Ubuntu 10.10 has been released a few day…
Filed in link, 18/10/2010, 21:01Ubuntu 10.10 has been released a few days ago and I found a few nice things to do with it: http://www.omgubuntu.co.uk/2010/10/customizing-ubuntu-10-10-with-a-dock-new-icon-theme-effects-global-menu-and-more/
Yii framework relations between models and tables
Filed in post, , 20:57Now that my first application in Yii is completed, I’ve been studying up on the relations in the Yii framework to simplfy my application. These relations are the same as you find everywhere else but the things is that the tutorial, yet again, isn’t a beginner’s guide. It’s written by programmers, meaning everything the programmer already knows for himself or he thinks everybody knows is left out, which includes some essential things like primary key creation, index key creation and foreign keys.
Nothing above is easy nor hard to accomplish but I think that I wouldn’t have hurt to explain in depth what the system does and how it works instead of just making up an exemple with eveyrthing in it, so I hope I can soon entertain you with a little more text about this.
Profiling a php application
Filed in General,myself and me,Projects, 04/09/2010, 15:00Today I’ve been talking with a friend of mine, Pieter. We share a server together for our websites,programming adventures etc.
I’ve been talking about a project I’m writing and reminded me to go profile my application so the load of the application keeps low. So I’ve been searching the web for some easy profiling system, I came across Xdebug and others but the one that really struck my fancy was PHP quick profiler.
It might not have every single feature other applications have in their toolbox but it’s easy to install and easy to work with. The things I’m most concerned about are shown nicely so I don’t need more
C programming: dynamic keyboard allocation with pointer to pointer
Filed in source code, 16/04/2010, 23:41Something I’ve written for a project I have to do for school, it’s without bugs at least on visual studio 2008.
The little story about this code:
This is a dynamic memory allocation function for text entered by the user.
You give the addresses from pointers to memory placements to the function, it only return errors by value, everything else is returned by reference (pointer to pointer).
**string is the string pointer
**cntrChar is a counter for the number for characters
**cntrChar is used in another function to verify that the chain of characters entered, is longer then 1 because ‘\n’ is also seen as character so you need more then 1 to pass that test normally but it depends on the requirements of the program created.
int keyboardInputString(char **string, int **cntrChar){
char c, *iString;
int i=0;
iString = (char*)malloc(sizeof(char));
if(iString != NULL){
do{
c = getchar();
*(iString+i)=c;
i++;
iString = (char*) realloc (iString, (i+1) * sizeof(char));
if(iString == NULL)
return 1;
}while(c != '\n');
*(iString+i-1)='\0';
*string = iString;
*cntrChar = &i;
return 0;
}
else{
return 1;
}
}
exemple:
if(strcmp(**string, "exit") && **cntrChar >1)
//your code here
Windows ate my thumbdrive
Filed in General, 02/04/2010, 09:00Yesterday was disappointing and frustrating.
Visual studio freaked out which resulted in my project becoming inaccessible from my thumb drive and not long after that the partition table was destroyed, resulting in my thumb drive being of the RAW format.
I searched and found some recovery software but nothing that wanted to recover my partition table so I had to result to formatting and recovering data afterwords. Unfortunately I got to save every file that was on the drive except for my project which visual studio had obviously eaten up.
Thanks again Microsoft, nice tool, if only it wasn’t this hungry! Come to think of it almost everyone had problems with visual studio, maybe it wanted revenge for the bad code that we write.
Yii themes
Filed in General, 25/02/2010, 18:57This was actually fun, a first, i have to admit. Normally when i do convert a template to a theme, i is time consuming, in Yii after some rudamentry settings (2 actually), you’re on your way.
Annoyed…with coding
Filed in General,Projects,tutorials, 22/02/2010, 00:39I’ve been coding away all week, that is between my other jobs at home
In all my ‘wisdom’ and persistence i made a small app with Yii which stores data in an array and serializes it into a db, and a basic CRUD, a proof of concept to see if the framework was capable of doing this and in the fastest way possible.
No problem so far, getting it is simple, but apparently you Yii doesn’t permit everything. So you need a $temp variable to store the model data in, suffice to say that it isn’t really the shortest route to take nor in my opinion the fastest bus alas I have to do with it. This little app of not more then a 60 lines of code took me four days, four damn days to figure out the error, honestly if we have methods to ‘save space’ in your coding why not permit them?
I’m not going to bother everybody with my nagging so, I’ll stop here.
For those who want to see the topic on the yii forums.