Sunday, September 30, 2007

Disabled-look ImageButton in ASP.NET

Coding Environment.
ASP.NET 2.0, C#, Visual Studio 2005

Stumbling Block.
Disabled look for ImageButton in ASP.NET, just like there is a different look for ASP.NET's Button control's Enabled = false property.

Solution / Work around.
a.
Fire-up VS 2005 and create a new 'Web Control Library' [File->New->Project->Windows]. Name it. ['DualImageButton']
b. Delete the class that's auto-created [e.g. WebCustomControl1.cs]
c. Add new class [DualImageButton.cs]
d. This would inherit from 'ImageButton'
public class DualImageButton : ImageButton

e. Primarily, we would add a new (string) Property (to specify 'Disabled' image [some grayed out image of the Enabled image] url) and override the ImageUrl property that'd return the (original) ImageUrl if the DualImageButton is enabled (Enabled = true) and ImageUrlDisabled if the DualImageButton is disabled (Enabled = false)
private string _disableImageUrl;

public string ImageUrlDisabled
{
get { return _disableImageUrl; }
set { _disableImageUrl = value; }
}

public override string ImageUrl
{
get
{
return base.Enabled ? base.ImageUrl : this.ImageUrlDisabled;
}
set
{
base.ImageUrl = value;
}
}

f. Build and include the dll (DualImageButton) in your ASP.NET projects. Set ImageUrl and ImageUrlDisabled properties to separate images to get the desired effect.

Additional Tip.
One could also override other properties like CSSClass to get more control over the disabled look and other aspects of any ASP.NET server control, in general, without building a new control from scratch.


Read more...



Post to del.icio.us

Friday, August 10, 2007

Build a Quick 'Google Maps' Mashup with Google Mashup Editor

Google Mashup Editor (GME) is an online 'mashup' building tool by Google, just like Yahoo! Pipes & Microsoft Popfly, but quite different per se. Right now, it's use is only on an invitational basis so those reading this but do not have an account can register at GME's site for an invitation.

This is a quick walkthrough of my first mashup using GME - BlogUSphere Moods! GME mainly works on the premise that user has access to an RSS feed of the data he wants to do a mashup of - and it's premise is not far-fetched if you know about Yahoo! Pipes and services like dapper. Even the GME FAQ claims Pipes and GME are friends not foe. So, let's explore it, but before that I must add, GME is best suited for Google Maps Mashups [just because it makes them so ridiculously easy to build].

OK, heard of 'We Feel Fine'? These guys search the blogosphere for posts containing 'feelings' [keywords like: happy, sad, fine etc.] and index them [with hordes of information]. They have made this information available freely through an API. I decided to make a quick mashup based on it - to show recent moods of bloggers on google maps. Earlier my plan was to include blogger emotions from around the world but for some cryptic reason [& I being very impatient to sort that out] I wasn't able to obtain entries from other countries on my first try but only the US. Thus, my mashup name has - blogUSphere - in it. Actually, it was a problem with the URL but yawwwnnn...

Moving on. It's a REST API [Go here for the docs]. So obtaining results was easy, through Pipes. See my pipes code. For first time users, I can only say that explore it, it's too easy - just take a look at some Perl's RegEx tutorial. It'd come handy. Also, note how I 'renamed' the tags to title, link, description [standard RSS] & geo:lat, geo:long [needed to enable Google Maps to fetch lat-long data in GME]. Now, save your pipes app, and obtain RSS feed of it.

Open GME - goto Feed browser - select 'Remote Feed' - paste your feed URL and see the results. This was just to ensure that every tag is in place. Now, if you are not a stickler for looks 'n all then all you need to do is: open Sample projects in the editor, browse to the Maps mashup sample app and replace the feed url written in it's code [look closely, it's written somewhere] with your pipes RSS feed url. Run it in Sandbox. It'll work! [adjust pagesize]. Howzzaat?

It took me 73 minutes - and you being a smart-ass would't take more than 7+3=10 mins. Go build your own mashAPP!

P.S. You can add JS code in GME - so the first things that came into my mind was 'Adsense' ;) ...and it works in it! [For some reason [given in gme groups] it wouldn't work inside tables]
P.S. 2: Also, the RSS feed is cached in GME and the crawler goes out to 'crawl' in a 30-60 mins. interval time - so, don't panic if you don't see your feeds updating - it's a limitation with GME right now.


Read more...



Post to del.icio.us

Monday, August 06, 2007

Next Generation iPod

The next generation Apple's iPod might resemble this. Drool!



The specs may include:
- Auto Landscape view
- No Keys or Clickwheel, Touch Sensitive
- Bluetooth


Read more...



Post to del.icio.us

Technorati API Wiki spammed beyond recognition, help to rebuild!

The Tehcnorati API wiki has been spammed badly and I think, needs the help of the active developer community to put it back into shape.

This page [link] shows all kinds of spam keywords. The wiki says it was last editted on 3rd August. Also, the link to technorati api from programmable web [link] takes to a page spammed with this note:

"Please Spam this page
Something not useful should be here

Ciaran"

Not a pretty sign for a popular site's wiki. Let's put it back into action.



Read more...



Post to del.icio.us

Sunday, August 05, 2007

diggTraitor - Identify Fans NOT Digging You!

Based on the Digg API, diggTraitor is windows-based desktop tool to 'Identify the unDiggly Fans'. It's a fun tool developed by me, to just explore the digg API and look at a funny side of it. Sort out fans who do not Digg your 'most vaunted' stories! It's version is 0.5. I am planning for version 1.0 to have some 'Traitor Ping' functionality to directly let them know that the user isn't happy about not digging a 'diggable' story.

Talking more about diggTraitor [sounds like 'dictator'] - I have developed it in C# on .NET framework 2.0 so, one would need .NET framework 2.0 to run this application.

Write in for comments, bugs or help. If someone needs to take a look at the source-code, feel free to drop a comment or an e-mail [my e-mail address: pag.floyd@gmail.com]

You can download diggTraitor from: [mihd link] [rapidshare link] 24.5 KB
If you are not able to download, please inform me.
Some screenshots of diggTraitor v0.5:



Happy Digging!


Read more...



Post to del.icio.us

Friday, August 03, 2007

.NET Library for Digg API - Making it work!

While looking for a .NET library for Digg API, I found two (the reader may suggest more, if any, in the comments). One goes by the name 'Baileysoft.Rss.DiggAPI' which has recently been added at codeproject by thund3rstruck and comes with a good tutorial and the api code - all of it to be found here. Nothing much to say about it as the tutorial is well-written and the author promises to add more functionality soon [not all Digg API calls have been implemented].

The other that I found is here which is fairly old and in all probability, it's development has been discontinued. It goes by the name 'DiggTools'. It's development was part of 'Google Code' and the web-page hasn't been updated since quite a while both at the original site and the Google page of the project. The download page [for an Aug. 9th 2006 release] says, "This version implements roughly 90% of the known Digg.com API. It is considered beta quality with newer versions expected shortly."

Since it's old, 'DiggTools' doesn't use an appkey that's required now. That wouldn't have been a problem if the download had the source code, but there was only a DiggTools.dll at the download location. Since, it implements quite a few API calls, I decided to bring it into running condition again. There is an API's google group which proved to be of some help and also, thund3rstruck's DiggAPI. In addition, DiggTools library is licensed under LGPL, so I am not making available the modified code - instead, here are the instructions to make it run for those who want to use it.


  • First, we only have the dll file so, download Reflector to decompile DiggApi.dll to C# code. It does it fairly efficiently and we get all the code files.

  • Now, open DiggTools solution in VS (assuming), open StoryFactor.cs - right click on references & add System.dll in it.

  • Add, using System.Net; at the top.

  • Add "+ &appkey=http%3A%2F%2Fwww.unique.com&type=xml" to end of following four lines:

    • string str = "http://services.digg.com/stories" + filter + this.parseSearchOptions(theOptions);

    • string filename = "http://services.digg.com/story/" + Convert.ToString(storyID) + "/activity?period=" + time;

    • string filename = "http://services.digg.com/stories/" + Convert.ToString(storyID);

    • string filename = "http://services.digg.com/stories?count=1";

  • As you know you can add any unique app key. Also, one may define a global variable for the appkey to avoid this tedious task.

  • Now, find this method: GetStories(string filter, SearchOptions theOptions) and inside the body of the first try{} statement inside the method, replace everything with the following code:

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(str);
webRequest.UserAgent = ".NET Framework digg Test Client";
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Accept = "text/xml"; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
System.IO.Stream responseStream = webResponse.GetResponseStream();
this.theXmlDocument.Load(responseStream);

  • Also, search for "min_date" & "max_date" and replace it with "min_submit_date" & "max_submit_date" in the same file.

  • Now, you are good to go. Build -> Goto 'bin' folder -> Fetch 'DiggTools.dll' -> Use it in your app!
Happy Coding!

P.S. Write in for comments, suggestions, brickbats!


Read more...



Post to del.icio.us

Thursday, August 02, 2007

Suggest a site name, Win an iPod!

Ed Lau and Michael Kwan need your help in naming their new hockey blog! You might know Michael from his freelance writing and Ed from his personal blog. If you come up with the best name, you could win an 8GB iPod Nano totally free!


There is a second prize too, a blue 4GB iPod Nano whose winner will be decided on the basis of a lucky draw. Tune in.

More details are available here...


Read more...



Post to del.icio.us

Did YOU contract HIV during your last ***? Odds are greater than YOU reading this Post!

Looking at a news article on the odds of something good, bad or surprising happening to someone, I wondered what are the odds that a particular but random blog post would be read today by you or me i.e. someone in particular.

Delving deeper into the matter, I thought I should make certain assumptions about this problem before it starts to get beyond my mathematical/analytical abilities. So, the problem ended-up being a simple one to analyze, owing to the assumptions! Although, I would love to see comments deriding my analysis. And yeah, the HIV part comes in the end ;)

First, I would need a rough estimate of 'number of blog-posts made in a day' . It turned out to be easy. I found it in Technorati's quarterly State of the Blogosphere (April'07) report. In the article's summary it says, "...1.5 million posts per day."

Now, how many posts does 'that somebody, you or me' read in a day? The report says nothing about that. 5? 10? 20? Let me assume 21 posts, with no statistical backing.

So, is it 21/1.5 million? I'd not like to make matters complex but let's add another detail. If I start reading those 21 posts of mine - what 21 posts would I read? Most probably that link to each other. I assume probability of reaching a post randomly is 0. Thus, the 'Post in Question' that is to be read may or may not lie in my linked path or may lie too far ahead in my linked path and I may not reach that in those 21 posts I read.

I have 3 situations:
1. Post can not be reached as it is not in my path
2. Post can be reached as it is in my path but would not fall in 21 posts I read today
3. Post is reached

Matters can get more complicated, by taking into account that popular blogs are more linked and hence a post in them would be easier to stumble into. But, in all fairness to my intellectual abilities (excuse 1: c'mon man there is no statistical data?, excuse 2: the odds of this post being read are too low to take the pain :D), I assume that all 3 situations have equal chance of happening.

So, the proability is 1/3 * (21/1.5 million) or, 1/(1.5 million/7) .

Thus, the odds of 'You' reading 'This' post are 1 in 214,286. This link tells me that Odds of a person contracting HIV by having unprotected sex with someone who 'may or may not' have HIV are 1 in 200,000.

You have already read this post. Is it time for you to run to your doctor? Btw, you may like to take a look at coincidences when talking of large numbers here.

P.S. Please link back to the article if you want to reproduce it on your own site.

Disclaimer. The author is not claiming anything regarding process or probability of contraction of HIV/AIDS. Thus, reader is advised to take this article as a piece of humour and not medical advice.


Read more...



Post to del.icio.us

Wednesday, August 01, 2007

Microsoft's Signifi(g)ant Mistake in Silverlight with .NET Keynote!

While viewing the videos of Silverlight with .NET here, I came across a 'Signifi(g)ant' mistake in a slide of Jamie Cool's presentation on 'Building Silverlight Applications using .NET - a spelling mistake - Signifigant! See the screenshot.


Insignificant? Yeah, in all probability but with all kinds of new tools & technology coming out lately from M$'s stable including Silverlight, Expression Studio etc. based on their much hyped WPFE, one would expect their powerpoint's spelling checker to live upto the hype of it's fellow tools ;) Or, is it that Mr. Cool wasn't much cool about the outcome of the keynote and the new tools, and hence the mistake? Well, time will tell if it was a 'Significant' mistake!


Read more...



Post to del.icio.us

Monday, July 30, 2007

Vista Look on Windows XP - Vistamizer

People who do not bother about how vista works but only how it looks, but can not install it on their 'old' machine or don't want a hole burnt into their pocket - might want to look at Vistamizer (ver. 1.1.6) - it's tailor-made for guys who want to give their XP machines, the new Vista look!

Many would have used desktop replacement software, like Windows Blinds, Style XP etc. to make XP look like Vista - but nothing comes close to Vistamizer and added benefits are - it replaces the system files, so no heavy background processes have to be run while using the look; uninstallation is clean leaving the system perfectly in the state it was before installation; and it's a freeware!


All essential Vista looks are packaged, viz: startup, logon screens, sounds, taskbar, icons, applications' appearance and even, thumbnails of minimized windows while hovering over them. To view enlarged screenshots, click here...


Read more...



Post to del.icio.us

Sunday, July 29, 2007

A Googlewhack approach to be a Googlewhacker!

Googlewhack, for those who have been living in a dream world and do not know what 'the one' is, is a search query consisting of only two words entered into Google's search page that results in one & only one result - and then, there are rules [Follow this to read the rules].

Googlewhacking is the pastime of finding a Googlewhack.

Googlewhacker is a person Googlewhacking.

Now, after all these definitions to get the 'no idea' reader interested, let's get to the story. Let me be right to the point.

For the uninitiated, starting from random words would take ages - and one may still not become a Googlewhacker. There are small scripts floating around the net to get to such queries, but there is hardly one with 'something to write home about' success rate!

A GOOGLEWHACK APPROACH. [+/-]



Thanks to my friend, Prashant Gaharwar, for his help in Googlewhacking.

Happy Googlewhacking!

- Pag 'Googlewhacker' Floyd :D

P.S. The list of recent Googlewhacks is here...


Read more...



Post to del.icio.us

Friday, July 27, 2007

A-Z of the Harry Potter World!

With the release of Deathly Hollows, ahem Hallows, on popular demand, I almost wrote the A-Z list of the Harry Potter World - The most important terms, characters, places et. al. in James's (who? Harry James Potter ;)) world in an alphabetically ordered list.

But, while exploring around for references, I found an excellent A-Z list here. It's nearly the kind of list I'd have made except a few minor changes which are listed below, but it's a good read anyway.

Here are the minor changes/more suggestions:
A - Avada Kedavra
B - Bellatrix 'Bella' Lestrange
E - Expecto Patronum
F - Fudge
H - Hermione, Hogwarts School of Witchcraft and Wizardry, Hagrid too! {the list says 'Harry Potter'}
I - Imperio (Imperius Curse)
J - J. K. Rowling (well, one can't leave her out!)
K - Knight Bus
O - O.W.L.s
R - Ron Weasley (although the list mentions the Weasleys in W but Ron needs special mention)
T - Transfiguration
Z - Little to choose from but maybe, Mrs. Zabini for her 'alleged' supreme beauty ;)

You beg to differ? Write in!


Read more...



Post to del.icio.us

How to show Images uploaded on Blogger in a Modal Window using Lightwindow

If one has been following this post, he/she would be happy that 'phydeaux3' suggested the possible cause and a solution to the problem. phydeaux3's original comment in full body & soul can be viewed here.



Quoting phydeaux3's comment:

"Actually, the problem most likely resides in the peculiar way blogger image hosting works. By default, the large linked image is in a format (I'm using yours as the example and only showing the last relevant bits of the url)

/s1600-h/mpro.jpg

If you view that image directly, you'll find that Picasa Web Albums (which is the actual image host for blogger) makes this NOT an actual image file, but an html page, with an image embedded in it (view source). What that means is, the large image cannot be used as in in an image tag, but only viewed directly. But if you cut out the -h in the folder name
s1600/mpro.jpg
That gives an image that CAN be used in an image tag, and presumeable in your scripts as well (but cannot be viewed directly, as it will prompt for a file down load..yeah it's odd). So remove the -h from the last folder name and try it.

(there also may be referrer restrictions on images larger than 800px in size, but I haven't messed with it lately)."

Here, I put the above to the original test (without '-h' in the target url):
Without a doubt, it works! Hail phydeaux3 :)


Read more...



Post to del.icio.us

Thursday, July 26, 2007

Lightwindow fails to run with Images uploaded on Blogger

Modal Window (Box) utility, Lightwindow - based on Prototype & Script.aculo.us libraries - fails to pop-up on clicking the (image or text) link if used with an image uploaded on Blogger. At least, it does not in my case. It works in case of other links (e.g. click on Lightwindow, Prototype etc. links).


To illustrate the point, here is an image uploaded on Imageshack (Click on it : works clean as a whistle!)...








Read the full story...



Read more...



Post to del.icio.us

How to Widgetize your RSS feeds?

Here is a step-by-step guide to Widgetize (Desktop or Web) your (or any) RSS feed, just like the one on this blog on the right (Web-based), powered by MuseStorm.
  1. Go here, if you haven't already joined or else here to login.

  2. You will be taken to the 'Dashboard' after logging in.

  3. Click on the button 'Widgetize a Feed'

  4. Enter your feed URL (e.g. if you have a BLOGGER account, your feed would be 'http://www.[blog-name].blogspot.com/feeds/post/default') & Click on 'Add Feed'.

  5. In the Widgetize Feed form that pops up after step 4, enter mandatory (*) and optional fields - also 'check' on 'Web Widgets' + 'Desktop Widgets' (currently supports 'Yahoo Widgets' & 'Google Gadgets')

  6. If all goes well, you will see 'Your widgets are ready!'

  7. You can download the Desktop Widgets or click on 'view' for the Web Widget to configure it.

  8. When 'configured', click on 'widgetize' to get the code for 'Web-Widget' to be put on any website.

  9. In case of blogger, the instructions (directly copied from the source) are:

    1. Login to your Blogger account

    2. Select your blog from the dashboard

    3. Click the "Layout" link

    4. Select "Add a page element"

    5. Select a "HTML/JavaScript" element

    6. Give the element a title and paste the HTML snippet into the content field

    7. Hit "Save changes"

    8. OR, directly edit the template's HTML
Happy Widgetizing!


Read more...



Post to del.icio.us

Emotions against Google!

Are emotions running high against Google? All of a sudden, everything is going against the search giant, except of course, the big-moolah. Sample this:


  • Who's who of IT industry questioning Google's monopolistic move to buyout DoubleClick - the list is getting longer everyday.

  • $1 billion lawsuit from Viacom for YouTube's alleged copyright infringement.

  • Privacy International placing Google dead last in its evaluation of Internet service companies in terms of consumer data protection, labeling it hostile to privacy.

  • Came under the scanner for keeping a lifelong record of every search query of each of its users, along with the IP address the query was executed from and a cookie ID to link together queries from a user's computer even if the IP address changes - a direct link to the point preceding this.

  • Allegations that Google underestimates click fraud rates even after it paid a $90 million settlement in a click fraud case in March of last year.

  • Amazon deciding to use M$'s Live Search over Google's to provide search results on its site.

  • Today's news that prompted this article, Microsoft replaces Google as the exclusive provider of display and contextual advertising on Digg.


Read the full story...



Read more...



Post to del.icio.us

Tuesday, July 24, 2007

Adsense incompatible with Blogger?


When I tried to insert 'Google SiteSearch' code generated through Google Adsense into the template of my Blog on the recently revamped Google's Blogger - it gave the following error on saving:


Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: Attribute name "checked" associated with an element type "input" must be followed by the ' = ' character.

Since, the new Blogger had been in beta earlier - I suppose these quirks have already been discussed and thus, I got the solution i.e. to write: checked = "true" to get rid of the problem in the SiteSearch's auto-generated code. But, the bigger question is "Is the adsense generating non-standard code?"



Read more...



Post to del.icio.us

Harry Potter and the Autograph of the Batting Wizard!

No, it's not the title of the 8th installment of the HP series - but, a meeting of Harry Potter (Daniel Radcliffe) with the Batting Wizard of Cricket (Sachin Tendulkar).


Potter turned up at Lord's to witness England take on India in the first match of the three test-match series. The match ended in a rain-washed draw but Potter made the most of his first visit to any cricket match by getting an autograph of the Indian batting maestro and also, the englishman - Andrew Strauss. Amusing is the fact that both the cricketers didn't recognize Mr. Potter - as they were in a customary position while signing i.e. their heads down into the autograph books of their fans - an impossible position to have a look at the fans, one of whom happened to be Radcliffe himself!

Later, Strauss got an HP book signed by the On-Screen Potter for his son. Apparently, the news did finally get to the cricketer that one of the fans was not YAF (Yet Another Fan)!

Read the full story here...


Read more...



Post to del.icio.us

Monday, July 23, 2007

How to ace the NTSE interview?

This post is a direct result of a number of emails received by a friend of mine who is an NTSE scholar (Year 2000) on preparation for the NTSE interview.

NTSE is an acronym for: National Talent Search Examination - a prestigious scholarship exam in India for standard 10th passouts leading to a scholarship funding upto postdoc level.

Here is what my scholar friend has to say about the interview:

Read the full story...



Read more...



Post to del.icio.us

Saturday, July 21, 2007

Wrong Potter book and the Real Spoilers!

It seems my source wasn't authentic enough hence the earlier misleading spoilers...

here go the real spoilers:

Also have a look at why the 'leaker' is safe!


Read more...



Post to del.icio.us

Why the 'leaker' of Harry's last adventure is safe - the escape route!


As claimed here, "A few lines of 'digital DNA' could allow the publishers of Harry Potter to find and finger the person apparently responsible for leaking the final adventures of the boy wizard...", may not turn out to be entirely fool-proof.


Taken, the digital DNA (EXIF data) has revealed the camera model [Canon Rebel 350] and the serial number [560151117] and may eventually point out the owner of the camera, but is he/she the person they are really looking for? Noticeable is the fact that the camera has been out for 3 years - and assuming that the 'original owner' would still be the 'owner' of the camera is a bit far-fetched and even if true, provides an escape-route for the 'leaker'.


Read the full story...




Read more...



Post to del.icio.us

Friday, July 20, 2007

A-Z of Top Motion Pictures!

Note 1: Articles, Prepositions eg: a, an, the, to etc. ignored while determining alphabetical order!
Note 2: Movies mainly from English (Hollywood) & Hindi (Bollywood) Film Industries
Key: Movie Name: Language - Year of Release - IMDB Rating - Plot Synopsis - Strongest Point(s) - [Other Movies]

Anand: Hindi - 1970 - 8.9/10 - The classic story of a terminally ill man who wishes to live life to the full before the inevitable occurs, as told by his best friend - Story + Acting of Rajesh Khanna - [Apollo 13]




Beautiful Mind, A: English - 2001 - 7.8/10 - After a brilliant but asocial mathematician accepts secret work in cryptography, his life takes a turn to the nightmarish - Story + Acting of Russell Crowe - [Buono, il brutto, il cattivo, Il, Bawarchi]


Read the full story...



Read more...



Post to del.icio.us

Wednesday, July 18, 2007

Harry Potter and the Deathly Hollows spoilers!



Spoilers!


- Ron dies
- Lupin dies
- Percy dies
- Voldemort dies
- Snape dies
- Harry DOES NOT!

Read the full story...




Update: July 21, 2007 - The REAL Spoilers!

Checkout the 'A-Z' list of Harry Potter World!


Read more...



Post to del.icio.us

Friday, July 06, 2007

google.com is worth $0.00, MSN leads!

Yeah it's true, if 'how much is your blog worth?', a tool developed using Technorati's API, is to be believed!

Inspired by Tristan Louis's research into the value of each link to Weblogs Inc, this tool was created using Technorati's API which computes and displays your blog's worth using the same link to dollar ratio as the AOL-Weblogs Inc deal. Old news, huh!

But, writing www.google.com in the box to compute it's worth gives this startling result:
Read the full story...


Read more...



Post to del.icio.us