HNotepad :: Haskell -> Gtk2Hs -> HNotepad ()

Hi !

this time went ahead with Gtk2 + Haskell [Gtk2Hs]. First GUI program… so.. thought to make simple Notepad ๐Ÿ˜›

wasn’t a waste anyway.. learned quite a few things.

code might not be pure Haskellish.. but I’m slowly getting used to use Haskell.. ๐Ÿ™‚

This is how it looks –

and you can download source [.hs + glade file] from my skydrive or have a quick look at source on hpaste

Download Link

Advertisements

Windows Search Index Reader

Hi !

Few days ago one of my good friends, Ishan lost alot of his data when his 1TB external hdd fell from desk. Sad ๐Ÿ˜ฆ

There are almost no chances of getting his data back. Today he found he had indexed his entire external hard disk on his computer….ย  fine, he can’t have his data back but there are some hopes to know what all he has lost !

I quickly derived a very simple app from Windows Search SDK code samples that lists all the entries in a DataGridView and gave him but it was pain to see whole file list in table. So made this thing.

It will also show indexed files in Explorer like view. Again, note that its just an index, not the true files. Its only to tell him what all was there so that he can try to get those things back from other sources ๐Ÿ™‚

Continue reading

My first Haskell Adventure !

Hi !

I’ve been trying to spend some time with Haskell for long but college.. assignments … etc..were keeping me away. Finally got time + kick + excitement last night and decided to code something meaningful.
Thought to solve this challenge one more time > http://punetech.com/apply

Its quite simple. Read from input.txt [which is actually a twitter feed] > remove duplicate id entries > sort in descending order of Timestamp and save to output.txt.

Took pretty long time though. I was also reading relevant pages from RWH. had to read some things like Monads twice/thrice to understand. Then talking to folks in IRC #Haskell.. Still have to go through alot.

but it was fun. yeah! my first Haskell program that works as expected ๐Ÿ˜€

here’s the code. It still requires alot of cleaning and will do that after posting this. but this is the final v1.0 that works. So wanted to share this one only ๐Ÿ˜€

Continue reading

Fetch twitter feed on your Form

Here’s a way to fetch twitter feed on form.

Twitter provides RSS feed of every account, provided account visibility is Public.

If you are using New twitter, you’ll have to find out your twitter feed link by

1] either leave new twitter preview and find RSS links on right sidebar, or
2] click on the RSS Feed icon in browser addressbar. It will probably show your favorites feed. Note the userid from URL.

Now, use that userid in this fashion :
http://twitter.com/statuses/user_timeline/userid.rss

Once you get your twitter feed rss url, its simple to fetch entries.

Sample code using my twitter feed :

You’ll need a RichTextBox and a Button on form. Keep default names.

	Dim items As Xml.XmlNodeList = FetchTwitterFeed("http://bit.ly/hbsM7i")
	'Iterate and print each title
	For Each item As System.Xml.XmlNode In items
		RichTextBox1.AppendText(item.ChildNodes(0).InnerText & vbCrLf)
		'childNodes(0) gives title
		'for rest node indices like link,time etc
		'check source string
	Next

Read more for FetchTwitterFeed() Function –

Continue reading