code
Python vs. PHP
0Lets quickly compare the two without wasting too much time:
#1 – Syntax
Python is it’s own funny thing, PHP resembles C/C++ very nicely. PHP wins
#2 – Speed (Time to echo “Hello World”) – 3 Runs to avoid the disk I/O.
Python:
real 0m0.027s
user 0m0.010s
sys 0m0.010s
PHP:
real 0m0.024s
user 0m0.020s
sys 0m0.000s
PHP Wins.
#3 – Looping 50000 times and printing the results.
for i in range(1, 50000):
print i
^^ is printing a newline. I googled and got this: http://stackoverflow.com/questions/4499073/printing-without-newline-print-a-prints-a-space-how-to-remove
Python is disqualified and no further tests are needed.
PHP Wins.
The reason for this post is that every single Python or Ruby on Rails developer will say with complete conviction that PHP is less than superior based on their own little understanding of programming languages as a whole and with out providing any valid arguments to justify their stance on the issue. So their informed input is nothing more than “Durrr, its too hard for me”.
The Worlds Best PDF Viewer
0While looking over some typical engrish product documentation from a manhole in China (yes, a manhole) I tried to copy and paste from the constantly deteriorating Foxit Reader. Let me first say, foxit, your software is good. I was an avid fan before you started whacking a whole bunch of features in, now you are Adobe Reader 2.0.
The first thing I noticed while trying to copy something was, that functionality was disabled, I also noticed a share this on Facebook button which is why I un-installed foxit faster than you can say: “Beardless dial-up” – don’t ask, but it’s now possible to browse the net with out a beard! RMS, you can shave it now.
So on to the copy thing. Roelf pointed out a nifty little reader called Sumatrapdf (http://code.google.com/p/sumatrapdf/), it’s open source so it’s perfect. Try the copy thing again and ”Copying text was denied (copying as image only)”, I can’t paste images into Skype chats very easily, no non-bearded internet for me
But wait, let’s look at the source:
pdf_has_permission(pdf_xref *xref, int p)
{
if (!xref->crypt)
return 1;
return xref->crypt->p & p;
}
That’s the stupid bastard that is ruining the fun. So I got to installing VC++ to hack away the annoyance, in the meantime Roelf fired up IDA and edited the DLL, with “big having success” as they would say in China. A few thousand seconds later VC++ was installed so I decided to correct the “broken code” and fix the other glaring issue the Sumatra team seems to have missed, WHICH IS THE BRIGHT YELLOW.
So here is a non yellow, PDF stupidity free version of Sumatra (2.0) for your consumption.
Sumatra Installer – 4.5mb – SumatraSane_Installer_2.0.exe
Sumatra Standalone Zip – 2.4mb – SumatraSane-2.0.zip
I have not gone ahead and uploaded the code or sent it to the developers as it is a small change and I think if they wanted it to work this way, it would.

Recent Comments