Podcast isn't the kind of media I would like to receive, since reading is much faster than listening.

The above image states the only reason I ever tried the PHP Abstract, Cal Evans is giving out free books to blog about it1! 
So I picked out 2 podcasts and listened to them...
Oh... cheesy opening... 
After hearing the Five Ways To Kill a Software Project. It's mostly about how to not do software project for clients. Some things I definitely want to remember. Not now though. the only client is myself....
The opinionated software one is one thing that's really struck me. I don't mean I'm a person creating millions of configurations for the users, I don't give the users options for configure them because everything I wrote is so delicate2. Sounds like PHP codes for embedded systems. I have the feelings I can never write something suitable for anyone else but me.
The podcast's opening + ending took 1 minute in total, that's quite long compare to the entire podcast. Come on, it's an abstract, extended brief news, cut to the point...
Oh, that reminds me another reason I like reading better. No one can jump though sections in podcast as easy as textbooks.
[Nothing against podcast, I'm just jealous about the people who have a iPod to listening to podcast on the go]
So, I recommend PHP Abstract to anyone who have interest in new(or interesting) stuff in PHP and can find 10 minute on a average week3 sitting in the bus with an ipod.
I wonder why it's not fusion and defusion...
Loop fusion should be a very common thing in PHP programming.
For example, 2 arrays;
for($i= 0;$i<30;++$i){ $a[$i]++; } for($i = 0;$i<30;++$i){ $b[$i]++; }
for($i = 0l $i<30; ++$i){ $a[$i]++; $b[$i]++; }
for($i=0;$i<101;++$i){ echo $i; }
for($i=0;$i<101;$i+=4){ echo $i; echo $i+1; echo $i+2; echo $i+3; }
Yesterday, the PHP programming test closed, it's time to open source my code!
The entry explained.
See the attachment.
The code and the UI is not user friendly, but it can handle huge dictionaries and it's very memory efficient.
I put an 470kb dictionary in the package for you to test it out.
Hope in the contest, the creators creates super huge dictionaries to test my code out.
Algorithm is my life!
And I know how to improve my algorithm so it's even faster(might be over 60% performance boost)
but, again, it's too complex and I'm too lazy.
I hope you have PHP5.
Yesterday someone in Qunu asked me is there a way to prepend a string in front of a file. I said the only way is to load the entire file into the memory, write the string into the file then append the file in the memory into the file.
I told him to check back my site later, I will come up with something better.
So I did, I would post this yesterday but for some real life reasons, it's postponed till today.
I'm a helpful person, you can Qunu me once in a while if you have PHP problem 
This function suppose the script can write to the same directory of the script and you are using PHP5.
function prepend($string, $filename){ $context = stream_context_create (); $fp = fopen($filename,'r',1,$context); $tmpname = md5($string); file_put_contents($tmpname,$string); file_put_contents($tmpname,$fp,FILE_APPEND); fclose($fp); unlink($filename); rename($tmpname,$filename); }
The function first create a stream, a resource. then convert $fp to a stream. The script puts the string into a temporary file, and append the stream to the end. After that, replace the original file with the temporary file.
Today, someone in asked me a question in Qunu asked me a question to loop though 2 associative array at the same time.
Suppose, 2 associative arrays, $a and $b. They have some information corresponding to each other according to their position, but they are not numeric arrays, and it is not possible to manipulate one array's value or key to get another array's key.
My suggestion is to loop though 2 arrays with foreach separately, build them as 2 numeric array and then we will have a numeric key to access them.
foreach($a as $key=>$var){ $num_a[] = array($key=>$var); } foreach($b as $key=>$var){ $num_b[] = array($key=>$var); }
The qunu user told me a better code, use each().
foreach($a as $akey=>$avar){ $tmpb = each($b); $bkey = $tmpb['key']; $bvar = $tmpb['value']; }
Recent comments
1 day 8 hours ago
5 days 18 hours ago
1 week 19 min ago
1 week 2 days ago
1 week 2 days ago
1 week 2 days ago
1 week 3 days ago
1 week 4 days ago
2 weeks 9 hours ago
2 weeks 10 hours ago