Monday, August 30, 2010

Java plugin not working ?

hi i came across this problem that while trying to launch any applet or run a .jnpl file it failed to load. I checked my system and found that java was installed but not sun java ,it was icedtea . So i found a solution to it in ubuntu.
Go to System->Administration->Software Resources->Other Resources and enable to canonical repos.
Next just install sun-javaX-plugin. (where X is the latest version).
Hope it solves your problem.
Let the source be open :)

Monday, August 16, 2010

Adding libgraph, an alternative to graphics.h in ubuntu

hi all, recently we were asked to write graphics programmes in C and we were 'suggested' to use Windows as Linux doesn't support the graphics.h library . This really felt awkward and i knew there must be some way out. By some googling, i found that libgraph was the alternative.
Here's how to install it in ubuntu:
1. Install the libgraph tar.gz file from here.
2. Next you need to install some dependencies , i.e packages:
libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev (For fedora it's SDL-image and SDL-imagedev and the rest two are same)
3. After that you need to extract the downloaded tar and cd to it.
4. Next perform these:
(i). ./configure
(ii) make
(iii) make install
5. Next you need to copy all the libgraph shared files from /usr/local/lib to /usr/lib ,i.e
sudo cp /usr/local/lib/libgraph.* /usr/lib
That's it! now you may run any programme using graphics.h library and see the resutls. ;)

Here's a sample programme to draw a rectangle :


#include stdio.h // please put in angle brackets, there was some problem while posting
#include graphics.h // --do--

int main(void)
{
int gd=DETECT, gm=VGAMAX; // gd is the device driver , gm is the graphics mode
initgraph(&gd,&gm,NULL); // to initialize the graph
moveto(0, 0);
rectangle(50,50,500,200);
while (!kbhit());
closegraph();
return 0;
}


Note:For running the programme you must use the lgraph flag with gcc i.e if the programme is test.c then use gcc test.c -lgraph




For more details you may check out : this
Let the source be open :)

Saturday, August 7, 2010

Google fails but makes merry!

Here's something interesting. Google recently closed down Wave and they are celebrating about it. Yes, it's a trend they follow, that when they close any service they enjoy as it reflects some more work and more innovation is required by them . Here's the link with full details. Wonder! Let's Celebrate