vote up
0
vote down

PHP: What is More Powerful Than list()

First of all list() is not an unknown method in the PHP community, where almost every PHP developer knows what it does. The pity is that it has, perhaps, remained useless, although there is hidden power in it! What is list()? Let’s assume
 
Stoimen
Aug 28 2010 04:19 AM
vote up
0
vote down

Andrew Stellman’s C# “Inner Circle” Discussion, Game Challenge and C# Video Q&A

The Week-Long Discussion Andrew Stellman, co-author of O’Reilly’s excellent and easy-to-read C# intro, Head First C#, is holding a week-long “Inner Circle” discussion on C# and .NET 4.0 in the forums for O’Reilly’s “Head First” book series. In this
 
Joey deVilla
Aug 20 2010 04:11 AM
vote up
0
vote down

“C# in Depth” and “Azure in Action” for the Price of One Book–Today Only (August 15th)!

For today only (that’s Sunday, August 15th), Manning is offering the pair of their books, C# in Depth, Second Edition and Azure in Action for the price of one! Just use the discount code dotd0815 in the Promotional Code box when you check out. You can
 
Joey deVilla
Aug 16 2010 07:14 AM
vote up
0
vote down

Discuss C# with the “Head First C#” Author, Save Big Bucks on “Head First C#” Too!

Want to learn C# or brush up on it? From Wednesday, August 18th through Tuesday, August 24th, you can join Head First C# co-author Andrew Stellman and other techies in a week-long exchange about C# in an O’Reilly “Inner Circle” discussion, where he’ll
 
Joey deVilla
Aug 13 2010 04:56 AM
vote up
0
vote down

Four Things to Know when Writing Comments

Every developer has been learned from his teachers how important is to comment his source code. You should comment the classes, the methods, the logic, etc. However nobody explained how exactly to code with comments between the lines. Have you ever seen
 
Stoimen
Jun 27 2010 12:42 PM
vote up
0
vote down

JSON and Zend Framework? – Zend_Json

That’s really a good Zend Framework’s class that help you do the encode/decode job very easily. First of all it escapes everything for you and second it prints a correct/valid code. Note that sometimes if you have a trailing whitespace after
 
Stoimen
Jun 10 2010 06:40 PM
vote up
0
vote down

PHP: Conditionals Coding Style

Just to continue with PHP coding style, let me suggest a conditional statement coding standard. Just don’t use large three operands conditions like that: condition ? if_true : if_false If it’s too long it will be difficult to read and
 
Stoimen
May 26 2010 11:40 AM
vote up
0
vote down

PHP Associative Arrays Coding Style

No PHP programmer writes code without arrays. Sound strange, but as many programmers there are, as many ways to format the array notation there are. My advice is to rely on a defined standard. I personally use the Zend Framework’s coding style. So
 
Stoimen
May 19 2010 04:44 PM
vote up
0
vote down

MRI Memory Allocation, A Primer For Developers

Memory allocation in the MRI 1.8.x series of Ruby is seen by many developers to be a black box. A developer writes code and the interpreter just does some magic to make sure that the memory for the code is allocated, and more importantly, eventually
 
Kirk Haines
May 04 2010 10:30 AM
vote up
0
vote down

Playing with winforms textbox border color.

This is a small hack class that adds a set color for input area borders (textbox, richtextbox, combos, etc.) Here is the result: Screenshot It all holds up in a single file: using System; using System.Collections.Generic; using System.Linq; using
Apr 22 2010 10:51 PM
vote up
0
vote down

Winforms flicker-free forms.

Ever had those flickers in your 50+ component forms? Trying to play with SuspendLayout / ResumeLayout didn’t help? That’s because it only suspends the automatic layout, triggered by the Anchor and Dock properties. Setting double-buffering to
Apr 02 2010 09:42 AM
vote up
0
vote down

Why can you write arr[n] == n[arr] in C ?

Try the following program in C : #include <stdio.h> int main () { int arr[] = {42}; printf("%d", arr[0] == 0[arr]); return 0; } The above program prints out 1...ie, true. But why...?Well the reason the above works is because of how arrays are
tags: c
Feb 27 2010 06:11 AM
vote up
0
vote down

Compiler code generation: just flatten the tree

I spent some time tonight working on the compiler I am writing for my own education. I started this project while only understanding bits and pieces of what it takes to write a compiler, but I am quickly learning more. Various texts on compilers start
Feb 09 2010 03:41 PM
vote up
0
vote down

Genie: Write Python-like code that runs as fast as pure C

There is an article on the Postabon Blog titled “Make Lisp 15x faster than Python or 4x faster than Java.” In his benchmark, which is a tightly nested loop doing some trigonometric calculations, he achieves speed similar to Java with
Feb 03 2010 03:47 PM
vote up
0
vote down

Two postfix operations redux: sequence points

Describes sequence points and the postincrement operator in C, contrasts with the Java language, and notes the expressions in Python that unfortunately look like preincrement/predecrement.
 
cdleary
Jan 11 2010 11:58 AM
vote up
0
vote down

Two postfix operations redux: sequence points

Describes sequence points and the postincrement operator in C, contrasts with the Java language, and notes the expressions in Python that unfortunately look like preincrement/predecrement.
 
cdleary
Jan 11 2010 02:34 AM
vote up
0
vote down

Debugging in Linux with advanced IDE's

This took me a while to figure out. I have been trying out several different IDE's for Linux C development (KDevelop, Code::Blocks, NetBeans) and I only managed to get debugging work like I wanted (e.g. code stepping, local variables etc) in
 
Makis
tags: c
Dec 07 2009 06:39 PM
vote up
0
vote down

malloc vs calloc vs realloc

char* malloc(sizeOf)Returns a pointer in the heap with the specified size. One major difference is that it does not initialize the memory. char* calloc(numElements, sizeOfElement)Returns a pointer in the heap with the specified size for a number of
tags: c
Dec 01 2009 01:20 PM
vote up
0
vote down

StackOverflow Awesomness

Besides all the cool Genetic Algorithms and Optimization mumbo jumbo, the always ready to strike SIGSEGVs and always-a-pleasure Python scripting, this is the coolest thing I have come across in recent times. This is a image on the Page Not Found for
 
amit
tags: code c
Nov 27 2009 03:38 PM
vote up
0
vote down

Readable vs Elegant?

I've been thinking about this for some time but there seems to be a contradiction within the software development community, an internal struggle between being clever and superior and a wanting for things to be clear but succinct.At DevDays in London,
Nov 26 2009 04:43 AM
vote up
0
vote down

Passing a pointer by reference in C

Today I needed a way to pass a pointer to an int to a function, modify the location of that pointer (via malloc) in that function, and then access the modified pointer from outside the function (from the caller). I tried to code it like such
tags: c
Nov 17 2009 09:16 PM
vote up
0
vote down

Old School Programmers

I came across a blog post by Eric Sink. It started out great. It showed the similarities between an old school Ham Radio Operator, and a C programmer. Then he made this statement. “…The C programmers actually have a
 
Jeremy
tags: opinion c
Nov 17 2009 09:52 AM
vote up
0
vote down

Number of elements in an array in C

Take the following piece of code: int main() { int nums[] = {1,2,3,4,5}; printf("Outside: %d\n",sizeof(nums) / sizeof(*nums)); f(nums); return 0; } int f(int nums[]) { printf("Inside: %d\n",sizeof(nums) / sizeof(*nums)); } Here is the output of the above
tags: c
Nov 17 2009 02:21 AM
vote up
0
vote down

PIC – Up and Run!

After a weekend of intense reading on the PIC32 architecture I finally got some code working. The PIC32 Starter Kit only comes with 3 LEDs and 3 Switches but I have never felt so much reward in seeing LEDs flashing. I wrote the following code, which
 
arthurcanal
tags: c pic32
Nov 10 2009 03:24 PM
vote up
0
vote down

Processes do not share Global Variables

In the C code above, what are the values at line 13 and 18?At line 13, the value is 30.At line 18, the value is 10.Why is this you ask? It's because the fork system call produces a new child process which does not share global variables with its parent
Nov 03 2009 06:23 PM
vote up
0
vote down

Usages and Definitions of All Operators in C

There is a list of all operators in C. Assignment Operator Arithmetic Operators Cast Operator Increment and Decrement Operators Abbreviated Assignment Operators Relational Operators Logical Operators Precedence of Operators I. Assignment Operator Equal
 
Mehmatrix
Oct 17 2009 03:07 AM
vote up
0
vote down

Unit Testing in C

I haven't written new C code since the turn of the millennium. Since then it's been almost all Java and Python. Along with Java and Python come JUnit and Python's unittest module.I've grown completely dependent on unit testing.I'm looking at some C code,
Oct 14 2009 09:02 PM
vote up
0
vote down

Quick Tip: Piping to gnuplot from C

Update, 21/10/09 :Thanks to A.K’s comment, Its “gnuplot” and not “GNU plot” Couple of things first up: gnuplot supports piping, So, echo "plot sin(x)" | gnuplot will plot the sin(x) function. However, the plot
 
amit
Oct 03 2009 06:35 PM
vote up
0
vote down
vote up
0
vote down

foreach en java.

Java 5 s’est rapproché de son jumeaux C# en rajoutant la possibilité d’attaquer les différentes entités d’une liste ou d’une collection à travers son propre “foreach” : C# : foreach(type var in arr){
Jul 16 2009 09:06 PM
vote up
0
vote down

Bit Operations

For CS351, Intro to Systems, we had to do several operations using bit operators only. These took awhile, but are pretty cool to show off. We were graded by how few operations we used to return the right values for the generated test cases, including
 
Chet
Jul 05 2009 12:01 AM
vote up
0
vote down

How Not To Use Goto In C Init Functions

There is the idea that Goto is useful in some complex init functions to make the code simpler. Such as:if (OK != doSomething()) goto cleanup;if (OK != doSomethingElse()) goto cleanup;There could dozens of functions that need to be called except if
 
Makis
tags: c
Jul 02 2009 05:22 PM
vote up
0
vote down

List.Find() : utilisation des delegates.

L’utilisation des delegates rend les recherches génériques beaucoup plus faciles: Considérons l’objet simple suivant : Public Class Person{   private string m_name;   private int m_age;     // .Net3.0 syntax only.
tags: c/c++ c
Jun 27 2009 01:32 AM
vote up
0
vote down

Sérialisation cryptée binaire en .net

Pour réutilisation : j’ai écrit une petite classe qui fait de l’encryption + sérialisation binaire. using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Runtime.Serialization.Formatters.Binary;
Jun 22 2009 03:48 AM
vote up
0
vote down

Hidden Features Of Perl, PHP, Javascript, C, C++, C#, Java, Ruby, Python, And Others [Collection Of Incredibly Useful Lists]

Introduction StackOverflow is an amazing site for coding questions. It was created by Joel Spolsky of joelonsoftware.com, Jeff Atwood of codinghorror.com, and some other incredibly smart guys who truly care about user experience. I have been a total fan
 
Artem Russakovskii
Jun 22 2009 01:08 AM
vote up
0
vote down

Pointers, arrays, and string literals

A recently posted question on Stack Overflow highlighted a common misconception about the role of pointers and arrays held by many programmers learning C.
 
Jeff
Jun 19 2009 06:22 PM
vote up
0
vote down

Language Advocacy

This article is nearly ten years old, but it still is relevant today. In a recent discussion, I mentioned to a beginning programmer that C wasn't the best language to learn the thought process behind programming. I justified this assertion by saying that
Jun 14 2009 05:50 AM
vote up
0
vote down

Tail Recursion Optimization, gcc, gdb

Debugging or even throwing optimized code in a debugger is a stupid idea, when you are trying to debug the code, that is. Not so lame, when you are trying to learn whether the optimization has actually taken place . I wanted to check whether Tail Call
 
amit
May 23 2009 11:47 AM
vote up
0
vote down

Eric Lippert on infoof()

I previously mentioned some hypothetical C# fieldof and methodof operators, which would obtain FieldInfo and MethodInfo objects, in the same way that typeof retrieves Type at runtime. Eric Lippert explains the pros and cons of a combined infoof operator,
 
Tim Robinson
tags: c
May 22 2009 11:20 PM
vote up
0
vote down

Eric Lippert on infoof()

I previously mentioned some hypothetical C# fieldof and methodof operators, which would obtain FieldInfo and MethodInfo objects, in the same way that typeof retrieves Type at runtime. Eric Lippert explains the pros and cons of a combined infoof operator,
 
Tim Robinson
tags: c
May 22 2009 11:20 PM