Hostess, the maker (baker) of Twinkies, has decided to wind up its business owing to a labor union related problems. Twinkies was a household name and the day of the announcement of bankruptcy saw panic-buying among consumers who cleared the store shelves shortly after the announcement. Some Twinkies even made their way onto eBay, selling for as much as $60 a pack.
N4 Express
Linux: Reading XPS files, XPS to PDF
November 20, 2012
I’m running Ubuntu 12.04 and I was hoping the Document Viewer (eVince) would be able to read XPS files. A double-click got the XPS file opened as a ZIP archive, so I opened up Document Reader and did a File-Open using the menu, changed the selection filter to All Files, and selected the XPS file. However, Document Viewer complained that it couldn’t open a ZIP file, leaving me back where I started.
At this point, I did consider getting the KDE-based Okular document viewer because it does support XPS files (at least it claims to on its website), but it would be a large download and a long wait because I would have to download all of the KDE packages as well, so I looked for an alternative solution.
What I did eventually find was not a reader, but the XPS utilities. I was under half a megabyte so that sweetened the deal quite a bit. I installed them using “sudo apt-get install libgxps-utils” and that gave me the command-line tools I needed to convert the XPS file to a PDF file. Using “xpstopdf <filename>”, I was able to get a PDF file and that worked perfectly well with the eVince Document Viewer included with Ubuntu 12.04.
Spirit Airlines to charge $100 for carry-on luggage
October 2, 2012
From November 6, 2012, Spirit Airlines would be charging $100 for carry-on luggage for each flight. That translates into a $200 charge for a two-way passenger. In addition, Spirit Airlines also charges for providing water (and TSA won’t let you take your own bottled water on-board). Flying a budget airline for some passenger may end up costing them more than flying a regular airline, but assuming you just want to get from point A to point B and have no luggage or carry-on (or can make do with jacket pockets and cargo pants), a budget airline would help you save on air fare.
(Source: USA Today)
Installing LibCurl (Curl.h) for C Development
October 2, 2012
A lot of folks have complained about not being able to install the curl libraries. Here’s the sequence of inputs and outputs that the developers have reported:
$ sudo apt-get install libcurl-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libcurl-dev is a virtual package provided by:
libcurl4-openssl-dev 7.22.0-3ubuntu4
libcurl4-nss-dev 7.22.0-3ubuntu4
libcurl4-gnutls-dev 7.22.0-3ubuntu4
You should explicitly select one to install.
E: Package ‘libcurl-dev’ has no installation candidate
As you can see from the messages above, the libcurl-dev virtual package is provided by three different packages, so you have to pick one of the three to install. You most likely want to have the OpenSSL libcurl package, so here’s the command you need to use:
sudo apt-get install libcurl4-openssl-dev
Ubuntu 12.04 does complain about some packages being installed without authentication but if you trust the software repositories that you are hooked up to, you can just answer “y” to the prompt and continue with the installation.
Gandhi Jayanti
October 2, 2012
Today, October 2, is Gandhi Jayanti. It’s a national holiday in India to celebrate the birthday of Mohandas Karamchand Gandhi, better known as Mahatma Gandhi. The United Nations celebrates today as the national day of non-violence.
Gandhi was born on October 2, 1869, in Gujarat and obtained a law degree from London. He became known for his role in fighting for civil rights in South Africa before his return to India. In India, Gandhi sought non-violent means of opposing the British colonists. He promoted self-sufficiency over industrialization and was normally seen dressed in a home-spun dhoti and shawl.
One of Gandhi’s popular quotes is, “An eye for an eye makes the whole world blind.”
When describing Gandhi’s satyagraha philosophy, he is often misquoted as saying, “First they ignore you. Then they laugh at you. Then they attack you. Then you win.” The quote actually comes from Nicholas Klein who said, “First they ignore you. Then they ridicule you. And then they attack you and want to burn you. And then they build monuments to you.”
Gandhi (sometimes spelled as “Ghandi”) is often talked about for his portrayal in Sid Meyer’s Civilization. Due to a bug in the artificial intelligence subsystem in Civilization, Gandhi was portrayed as a peaceful leader initially, but after the discovery of democracy, he turns into a “bloodthirsty maniac who always wants to build and use nukes.”
Otellini Says Windows 8 Not Production-ready
September 26, 2012
Paul Otellini, Intel’s CEO, informed staff in Taiwan that Windows 8 is not production-ready yet. Devices pre-installed with Windows 8 will, however, still be pushed through sales channels by both Intel and Microsoft despite Otellini’s opinion, and the short-comings of Windows 8 will be addressed through service packs and updates. With some consumers sticking to their Windows XP PCs till they die out, both Microsoft and PC manufacturers would be hoping that they take up what Windows 8 has to offer so they can generate some sales.
PhpMyAdmin with backdoor hosted on SourceForge Mirror
September 26, 2012
A modified version of PhpMyAdmin 3.5.2.2 was posted on a SourceForge mirror containing a backdoor to allow the remote execution of PHP code. The malicious code was caught less than 4 days after it was put up, during which it was downloaded roughly 400 times. The mirror has since been removed from server list.
Calling Conventions
September 26, 2012
If you have spent a couple of years of programming with C, you may have heard about function calling conventions.
cdecl
The most popular of the lot among C programmers is the cdecl calling convention, which passes parameters to a function from right-to-left using a stack and returns integers and addresses using the eax register. Float values are returned using the ST0 register. The values present in the eax, ecx, and edx registers are restored after the function call by the caller.
The cdecl is the default calling convention in C compilers, and can be specified by using __cdecl between the return type and function name for Borland and Microsoft compilers, and by using __attribute__ for GNU’s GCC compiler:
int __cdecl sum(int a, int b); //Borland, Microsoft compilers
int sum(int a, int b) __attribute__((cdecl)); //GCC compilers
Note: If you are wondering why the __attribute__ using double paranthese in GCC, it is for getting around the lack of variadic (varargs) pre-processor macros in version of C prior to C99.
syscall
The syscall convention passes values using a stack in right-to-left order, with the parameter list size passed in al, and does not preserve eax, ecx, and edx values. The syscall convention was used by OS/2.
optlink
The optlink callin convention passes the first three parameter values using the eax, edx, and ecx registers, four float values using the st0-st3 registers, and all the values using a stack in a right-to-left order. Return values are passed using eax or st0. The registers ebp, ebx, esi, and edi have their values preserved.
pascal
The pascal calling convention passes parameters using a stack in the left-to-right order. The called function unwinds the stack at the end of the function call.
Note: The ret x86 instruction can (optionally) accept a 16-bit parameter for the size in bytes to unwind the stack.
stdcall
The stdcall calling convention passes parameters using a stack in the right-to-left order. Return values are passed using the eax register. The called function unwinds the stack at the end of the function call.
fastcall
The fastcall calling convention is implemented differently by different compilers. The Microsoft (also has the __msfastcall alias) and GNU GCC compilers pass the first two parameters using the ecx and edx registers in a left-to-right order and the remaining parameters using a stack from right-to-left order. Borland compilers (also has the __register alias) use a left-to-right order to pass the first three parameters using the eax, edx, and ecx registers, and the remaining parameters are passed using a stack in left-to-right order.
Other calling conventions do exist, but these are the more common ones that you would encounter.
Toyota Avalon: 2nd Generation
September 25, 2012
The Toyota Avalon 2nd generation (2000-2004) is arguably the best looking Avalon so far. It was powered by a 3.0-litre 210hp V6 engine and had a 4-speed automatic. The Avalon was sold in Japan as the Pronard. The successor to the Toyota Avalon 2nd generation boasted of a bigger, more powerful engine and a newer transmission.
Compiling GTK code on Ubuntu [12.04]
September 25, 2012
To compile a GTK application, you have to first install the GTK development libraries. If you haven’t installed the GTK development libraries or if you are not compiling it the right way, you would most likely come across one of these errors:
$ gcc gtk-try1.c
gtk-try1.c:1:21: fatal error: gtk/gtk.h: No such file or directory
compilation terminated.
$ gcc gtk-try1.c `pkg-config –libs –cflags gtk+-2.0`
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘gtk+-2.0′ found
gtk-try1.c:1:21: fatal error: gtk/gtk.h: No such file or directory
compilation terminated.
To install the GTK development libraries, you can do a “sudo apt-get install lib-gtk2.0dev” and the required packages get fetched from the software repositories. Following this, the compilation should work normally.