Filed Under (Development) by Karun on 24-05-2009
With the release of the first beta of Visual Studio 2010 which includes support for F#, it was only a matter of time till I tried my hand at it.
I don’t go for Hello World programs. Apart from C, the first code I’ve written in every other language (since I heard this question) has been the same. Keeping up tradition, here’s the F# port.
let Check (x: int) = float(int(sqrt(float x))) = sqrt(float x)
for x = 32 to 99 do
let sqVal = pown x 2
if (Check(sqVal / 100) && Check(sqVal % 100)) then
System.Console.WriteLine(sqVal);
done
This code aims to find every 4 digit number that is a perfect square whose upper and lower two digits are both perfect squares. This question was part of my sem 1 C paper and got me a 0/10. Clearly the examiner didn’t understand my answer. :P In honor of the great act of stupidity on my side (of writing such a solution in an exam), I recreate this in every concievable language as my first code :)
This is my first piece of code in a functional language so if I could have done this better, please let me know. Now to try out Haskell :)
A note about the VS 2010 F# editor. I know its not meant for performance but compiling clearly takes a couple of seconds. The IDE also could do with a bit more work with its intellisense because it didn’t like remembering System.Console and instead searched for the string everytime meaning I would hit System.Configuration instead (I am used to hitting enter after ‘Con’ due to C# :))
Filed Under (Development) by Karun on 15-03-2009
My new laptop is a work box and doesn’t inherit the obsessive compulsiveness of File naming and sorting that my desktop hard disks have. I have, for this reason, dumped all wallpapers which are applicable to be used with my desktop (wallpapers with aspect ratio 16:9) into my “My Pictures” folder. Randomly, I have an urge to change the wallpaper and I really don’t want to go select one. So I thought I should have something that would change my wallpaper to a random image. I tried finding something but most such applications were installables and would change the wallpapers after periodic time intervals, something i didn’t want.
Thus was born the Random Selection Wallpaper Changer (RSWC). An extremely simplistic, single exe application that does what is required.
Default Values:
- RSWC takes images (bmp, jpg, png) from the user’s My Pictures folder.
- It sets this image as your desktop wallpaper using stretched mode.
Pre-Requisite: A pre-requisite is that you have .NET 2.0 installed on your machine.
Future Plans: The exe is 416kb, something I wish to reduce. I might rewrite the code in C++ to get rid of the .NET dependency (despite Microsoft claiming .NET is common enough to no longer be a “requirement” and even reduce the file size. Also, I might contemplate creating a light weight application to change wallpapers at regular time intervals as well. (People requesting for such things would certainly compel me. I’m not motivated to do this for personal usage :))
If someone requires it, I might work a way in to set the source folder and mode of setting the wallpaper and still keep it portable and single filed. I could write to registry but that isn’t really portable in my opinion. Ideas/Suggestions/Feedback/Advanced Critique is always welcome ;)
Known Limitation: Setting png wallpapers sets the desktop to a plain coloured background (your default background color) because Windows doesn’t support png wallpapers. It converts pngs into jpgs and then applies them and I shall do the same in the next update.
Download: Random Selection Wallpaper Changer (RSWC) v1.00 (416 KB)
Filed Under (Development) by Karun on 21-08-2008
Its been a long road going through the SDI National Finals where we came second, going to IIM-A where we got project incubation and then finally to the World Finals where we won the interoperability award. Along the way, we made lots of new friends and learned a whole lot more.
Here are a few related posts on my blog: Imagine Cup 2008 World Finals and Imagine Cup 2008 Gallery. Be sure to check out the latter post which has never before seen footage.
Another announcement to be made is that the development for my custom CMS j@x has been put to halt indefinitely due to shortage of time. As have a few other projects like Scribble Scrabble. Some of them, I’ve signed over control to other AXIS members while others (like PHPIRCBot) shall be released in their current state. This decision had to be made considering my schedule over the past year only keeps getting busier and busier.
Next month, I’ll make sure I tell the world about a few products I have under development and others I have ready in my garage ;) The releases include DarkLight, PHPIRCBot and a brand new CountPrime.
Filed Under (Development) by Karun on 02-02-2008
On 10th of December, 2008, 2 days before my Computer Networks paper I made a WhatPulse class in php to get data from the WhatPulse WebAPI for you to work with. With the information at your finger tips make a forum signature, why don’t you? ;)
I’ve added a few functions to the class and written a small example for people to use. Most people must have it already because the WebAPI came out around 2 years ago but in case there is someone who doesn’t have caching of the WhatPulse data then this is useful.
Caching of data means lesser resources used by your php script to
a) Read from the WhatPulse server.
b) Write to the server’s hard-disk.
c) Use the server’s tubes (even though the xml is less than a kilobyte).
So what are you waiting for? Go have a look ;)
WhatPulse.class.php on svn
WhatPulse_example.php on svn
My WhatPulse profile
PS: This whole thing started with me updating to WhatPulse 1.5b1 after noticing that the WhatPulse team wasn’t going to release any more betas any time soon and the fact that I am currently 18th in the world :-o! (in keystrokes)
More such releases to come soon. I’m planning to have a collection in the dev section. I make tons of useless scripts in php. Might as well put them up just in case someone finds them useful ;)
Everything written in this post except this line and the first line were written 2 months ago. I just didn’t put it up for so long :-(
Filed Under (Development) by Karun on 15-12-2006
There is a Plus! scripting competition going on that the entire community knows about. With t-shirts for all participants, there have been over 70 entries in 3 weeks. There are only 4 days to go so despite my exams, here is my shot at the competition.
I don’t want to give away much right now but all I can say is its a project that uses JavaScript, Delphi, PHP and mySQL. I don’t think any other script uses all 4 so far. Of course I have my favourite Boca Juniors fan doing the Delphi hax.
Soon you shall see the update on the dev page. But for now, its over and out.
Update: The script was uploaded just in time for the competition. Go check it out ;)
Filed Under (Development) by Karun on 26-11-2006
Here it is, the launch of my new site. What is to come, you shall see. I’ve been working on this despite my exams going on cause i wanted to complete this project. I’ve wanted to do this forever now.
Thanks to dt and segosa for their help over the past few days. I may add a new interface but I’d like to keep this one for now, its my first creation from scratch. It will stay at least till the end of exams.
This is going to be different from Jatonian Life How exactly, you ask? Wait and find out ;) I have great things planned for j@x.
Yeah I do need to add rss support. Apart from that and a few repeated calls, I’d say this blog is pretty streamlined. At 12.8 KB (13,151 bytes) including the installer, I’d say its pretty impressive for my first project. I think optimisation could bring it to around 11kb but lets leave that for a rainy day.