These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but still super useful.
rawdogReady made Python RSS aggregator
MySQL max index length prefixindex length prefixes can be up to 1000 bytes long (767 bytes for InnoDB tables) for indexes with blob or text fields.
Clone Digger | Overview |Clone Digger aimed to detect similar code in Python and Java programs. The synonyms for the term "similar code" are "clone" and "duplicate code".
Tags: Ajax, Clone, Coverage, Forum_I_Posted_To, Gigbayes, Grocist, Javascript, Jquery, Mysql, Pfam, Py2Exe, Python, Refactoring, Rss
Posted by Greg Pinero (Primary Searcher) as Uncategorized at 5:00 AM UTC
No Comments »
These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but still super useful.
strerror(errno) : strerror « string.h « C / ANSI-CHow to debug a file not opening in C.
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main ()
{
FILE * pFile;
pFile = fopen ("unexist.ent","r");
if (pFile == NULL)
printf ("Error opening file unexist.ent: %s\n",strerror(errno));
return 0;
}
epubtools - Epub Toolsepub.py : a simple python script that will take a TXT file and convert it into an .epub file for using on an iPhone ebook reader.
Tags: Backup, C, Comments, Debug, Disqus, Ebook, Epub, Firebug, Firefox, Forum_I_Posted_To, Gnome, Iphone, Javascript, Mplayer, Python, Ubuntu, Utilitymill, Win32
Posted by Greg Pinero (Primary Searcher) as Uncategorized at 4:59 AM UTC
No Comments »
I was using some code like this to open a 2.4GB file in my 32 bit Ubuntu installation:
#include <stdio.h>
#include <string.h>
int main ()
{
FILE * pFile;
pFile = fopen ("unexist.ent","r");
if (pFile == NULL)
printf ("Error opening file unexist.ent\n";
return 0;
}
But I kept getting a null pointer back.
The first step I did was try to get a more detailed error message. It turns out there’s an errno standard lib that gives you error messages about files. I implemented the changes recommended by this page:
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main ()
{
FILE * pFile;
pFile = fopen ("unexist.ent","r");
if (pFile == NULL)
printf ("Error opening file unexist.ent: %s\n",strerror(errno));
return 0;
}
And I got this message:
Value too large for defined data type
So thanks to advice from the C irc chat room, I switched to using fopen64, and everything worked!
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main ()
{
FILE * pFile;
pFile =fopen64("unexist.ent","r");
if (pFile == NULL)
printf ("Error opening file unexist.ent: %s\n",strerror(errno));
return 0;
}
Posted by Greg Pinero (Primary Searcher) as Other at 4:54 PM UTC
No Comments »