This guy seems to have the right idea on why people would ever choose open source.
posted by dharh 8:58 PM Jan 27th, 2008
Someone has already done the leg work for the question I know everyone had. How many fucks are in the code on the web? You can find out here.
posted by dharh 5:08 PM Oct 5th, 2006
Slashdot has the skinny on Google Code Search which Google just released. Here's a direct link to the cnet story.
posted by dharh 8:44 AM Oct 5th, 2006
Code examples of manipulating an array of pointers.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLIST 10
struct ipList
{
int id;
char *name;
char *ip;
};
struct ipList **getList( void );
void printList( struct ipList **list );
int main( void )
{
struct ipList **theList;
theList = getList( );
printList( theList );
return 0;
}
struct ipList **getList( void )
{
struct ipList **list;
int i;
list = malloc( MAXLIST * sizeof( struct ipList * ) );
i = 0;
while ( i < MAXLIST )
{
list[ i ] = malloc( sizeof( struct ipList ) );
list[ i ]->id = i;
list[ i ]->name = "citibank.co.cx";
list[ i ]->ip = "209.249.147.15";
i++;
}
return ( list );
}
void printList( struct ipList **list )
{
int i = 0;
while ( i < MAXLIST )
{
printf( "%s - %s", ( list[ i ]->name ), ( list[ i ]->ip ) );
i++;
}
}
we can change the function getList slightly:
struct ipList **getList( void )
{
static struct ipList *list[ MAXLIST ];
int i;
//list = malloc( MAXLIST * sizeof( struct ipList * ) );
i = 0;
while ( i < MAXLIST )
{
list[ i ] = malloc( sizeof( struct ipList ) );
list[ i ]->id = i;
list[ i ]->name = "citibank.co.cx";
list[ i ]->ip = "209.249.147.15";
i++;
}
return ( list );
}
or we could have the main array created in main like this:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLIST 10
struct ipList
{
int id;
char name[ 35 ];
char ip[ 15 ];
};
void getList( struct ipList *list[ ] );
struct ipList *makeIP( void );
void printList( struct ipList *list[ ] );
int main( void )
{
struct ipList *theList[ MAXLIST ];
getList( theList );
printList( theList );
return 0;
}
void getList( struct ipList *list[ ] )
{
int i = 0;
while ( i < MAXLIST )
{
list[ i ] = makeIP( );
list[ i ]->id = i;
strcpy( ( list[ i ]->name ), "citibank.co.cx" );
strcpy( ( list[ i ]->ip ), "209.249.147.15" );
i++;
}
}
struct ipList *makeIP( void )
{
struct ipList *temp;
temp = malloc( sizeof( struct ipList ) );
return ( temp );
}
void printList( struct ipList *list[ ] )
{
int i = 0;
while ( i < MAXLIST )
{
printf( "%s - %s", ( list[ i ]->name ), ( list[ i ]->ip ) );
i++;
}
}
posted by dharh 9:59 PM Oct 2nd, 2006
Here's a cool report from Gina Trapani over at lifehacker about Yahoo! Open Hack Day '06. It's pretty interesting. You could say Yahoo! Open Hack Day is like Google Code Jam.
posted by dharh 12:56 PM Oct 2nd, 2006
Part of the passion in my life, besides life itself, is programming and computers. I especially like the idea of smart computing through smart programs and smart OSes. Which is what I want to focus on in my career, creating intelligence to various degrees to help create better and more efficient user experiences using computers.
Bellow is a table of various code snippets and articles organized by language.
15 Exercises for Learning a new Programming LanguageThis is an exercise to both learn a language, but also to compare different languages. The original idea can be found here.
posted by dharh 2:06 PM Mar 15th, 2006
« Previous 1 2 3 4 5 Next » |
AI airships america batteries blogs books browser C# c++ chatGPT computers conversation copyright covid cpp cr-48 CSharp dharh disaster DIY DRM economy energy environment FCC gaming google government history HTML humor idt internet interview japan java javascript linkjack linux lrn2program MLP moving music nature nefeedeater neThing neTodo networking news opensource philosophy podcasts poverty programming projects python reading religion science sick simple software space sparce tagging technology twitter unbirthday video wiki
|