Thursday, October 18, 2007

Using my IFRAME tooltip with ASP.NET

Just posted an article on using my IFRAME tooltip to show webforms. The article discusses how it can be used to show a 'details page' for every row of a datagrid/datagridview inside a tooltip.

http://ashishware.com/WebfrmTooltip.shtml

Sometimes it might just not be convenient to show dynamic content using 'innerHTML' property of a floating container. This may be useful in scenarios for incorporating tooltip feature for already designed grid/details pages.

Wednesday, October 17, 2007

My Photo in MS Originals Gallery !

I am famous ! Just found my photo in Microsoft's Originals Gallery.

Check out yourself !

I hope you are able to locate me in the gallery* .
[*Hint: Enter my yahoo email id in the search.]

Tuesday, October 16, 2007

Uploaded another tooltip script !


Last week, I uploaded yet another tooltip javascript. This time it was the ' IFRAME based Javascript Tooltip'. It can be very useful to show full webpages inside a tooltip. This also solves the problem of DIV hovering a SELECT(drop down) in older versions of Internet Explorer.

This tooltip support all features of my previous DIV based tooltip, with only exception that it accepts a URL instead of 'innerHTML' string for showing content.

Check out the script in action and notes on using it here:
http://ashishware.com/IfrmToolTip.shtml

Friday, October 05, 2007

Buy a gadget and do some charity !

XO Laptop (One laptop for a child project) would be sale for two weeks in US. It comes for around USD 400. The deal is when you buy one for USD 400 , you spend 200 on your laptop and another 200 for laptop which would be donated to a child in poor country.

These laptops have been specifically made for children and for extreme conditions in poor countries. Though they are not as powerful as the commercial once, still they do have some nice functionality like Wifi, mesh networking, Linux, 6 hour battery ..etc .

Here is a nice video review about the same .

Now think of this, you could at least use it as a e-book reader or a cool PDA. Considering cost of such devices is around USD 200-300 in market, it’s a nice thing to buy. Also you can claim a tax-deduction on USD 200 you spent for charity.

This is their website:
http://www.xogiving.org/
http://www.laptop.org/en/vision/index.shtml (Philosophy behind the project)

Ok, if you are thinking that this could help children in India, the answer unfortunately is 'no'. India has said 'NO' to such laptops (as it happens with many good things in India…no points for guessing 'why?' ). But still not a bad deal.

I am definitely curious to know how it fares as a PDA and/or ebook reader !

Sunday, September 23, 2007

Writing my first Rails Application

Started work on writing my first RoR (Ruby on Rails) application a week back. Its a simple multiuser bug logging system.

Rails as a framework looks great. It does save lot of development time, only if you know how exactly to do things. Scaffolding generated views are also very cool, but to me it doesn't look very useful in practical scenario, since you will invariably find yourself rearranging fields or design of the view. But I am definitely impressed with ORM feature included with Rails. This is the first time I am using ORM, and I think the time it saves can be invaluable for certain types of projects. There are also some goodies like AJAX, DojoToolkit can be combined with Rails.
It took me some time to figure out how things work in rails. Also since I am new to Ruby, I had to go online many a times to get help.

I am very excited with prospects of being able to create very useful and robust applications in no time once I master Ruby and Rails. Right now this little application that I am making is a great learning experience for me.


Screenshot of 'Create new bug' screen.

Friday, September 21, 2007

Google Gears ! ... Looks Interesting

Google Gears assists you to create web applications that can work in offline mode. Gears is one of the first such tool to make this happen. With amount of javascript code being written increasing every day, one day web apps will be made on top of web services with javascript front end. You need to be as good with javascript as you are with ASP.NET, PHP or Ruby ! One more language to learn.

Saturday, September 15, 2007

Cool ASP.NET Validators !

Uploaded an article on enhancing ASP.NET client side validators using AJAX Control Toolkit. The example discussed in the article shows how to add validation callouts to every control and show list of errors in a modal dialog box with translucent background.

Read the article here : http://ashishware.com/ASPValid.shtml

Tuesday, September 11, 2007

Dojo Book 0.9 Released

The Dojotoolkit is open source javascript toolkit for creating next generation web applications. As a part of documentation project for the upcoming version the Dojo Book 0.9 has been released.

You will find my name displayed , as a contributor on the book's home page. I have written the section on Drag and Drop API. Once Dojo 0.9 is hosted for public, it will be possible to view live demos of my examples in the book! Try out Dojo and ask your friends to do so!

This is my first shot at working with the open source community. A bit of personal achievement for me.

Looking forward to make more contributions (and learning many new things!).

Thursday, August 16, 2007

My Dream Gadget !

I am thinking of buying a new gadget. Maybe you can help me. I am looking for below mentioned features. Do you know of any gadget (mobile/laptop/tablet/handheld) that is a close match for my needs?

If yes, do drop a comment.

  • Wifi : For wireless internet.
  • Size : at least half the size of laptop.
  • TV Out : This I think can be a great feature for viewing videos, surfing playing games.
  • Full HTML Browser : Yes, preferably some port of FireFox with javascript.
  • Operation System : Linux or any other. SDK should be available. Open source stuff preferred.
  • Games : It should be powerful enough to run some of older 3D games like Doom. Ability to run emulators like MAME would be awesome. Should allow connecting upto 2 wireless joysticks for multiplayer gaming.
  • Connectivity : Bluetooth would be required. There should be ways of attaching a pointing device (mouse) and QWERTY keyboard via some kind of interface. It should be able to turn into a small computer if required. It could even have a couple of USB ports for attaching joysticks or other hardware.
  • Screen : Should be wide enough for displaying descent length lines of text. Even if it can display 10 such lines, I think it can be used for reading ebooks.
  • Multimedia : Ability to play audio and video files of common formats. Flash player could also be a great addition.
  • Storage : Mini SD cards up to max limit (2 GB I think). Having a hard drive would be really cool.
  • Price : Okay, this one is important :. Should cost around $200 – 350 (Rs. 8000 – 15000)

Wednesday, August 15, 2007

Fun with Silverlight !

Have been working with Silverlight since last month. Its a really cool thing and has lot of potential. Posted an article on the 'CodeProject.com' on creating real time AJAX line graphs with silverlight.

You can read it here : http://www.codeproject.com/silverlight/Silverlight_AJAX_Graph.asp

It can have many applications in Web 2.0 applications. Planning to do more interesting things with Silverlight.

Monday, July 30, 2007

Life without Overloads

Commonly asked question at any job interview:

"What is method/function overloading?"

Method overloading is indeed one of the most commonly used and easy to get concept of languages like C\C++, Java and C#. But there are some very good programming languages, that don’t support method overloading. For a person like me who is trained only in C like languages this sounds absurd. How can a language be very good and NOT support method overloading. But as I am learning more about Ruby, my beliefs are fast changing.

Overloading is very useful when done for constructors of a class. In languages like Ruby there is no constructor as such. The 'initialize' method acts as constructor. All startup code goes into initalize method. Since method overloading is not allowed it is not possible to have overloaded constructors.

One soultion is, using array as parameter with '*' operator. This operator allows grouping all the parameters into an array. I personally find this solution inelegant, but it will work if number of desired overloads was small.

class Myclass
def initialize ( *args)
if args.size==1 then puts "function called"
end

if args.size==2 then puts "first overload called"
end

if args.size==3 then puts "second overload called"
end
end
end

a = Myclass.new(10)
b= Myclass.new(10,"abc")
c= Myclass.new("a",1,"b")

Output:
function called
first overload called
second overload called
In languages like Ruby, function parameters are 'typeless'. So instead of passing multiple parameters we could just pass a single object that contains required values. A hash (or associative array) is a good candidate for this work.
class Widget
def initialize ( *args)
@border = args[0]["border"]? args[0]["border"].to_s : "undefined"
@color = args[0]["color"]? args[0]["color"].to_s : "undefined"
@font = args[0]["font"]? args[0]["font"].to_s : "undefined"

puts "Border:#{@border}px"
puts "Color:#{@color}"
puts "Font:#{@font}\n\n"
end
end

h = {"border" => 5,"font" => "Times","color" => "RED"}
button = Widget.new(h)

Output:
Border:5px
Color:RED
Font:Times
Better still, we can use the following syntax:
button = Widget.new("border" => 5,"font" => "Times","color" => "RED")
Above syntax gives a clearer picture of how many and which values were passed. Javascript like Ruby, doesn’t allow method overloads. Similar solution works.
c1 = new dojo.dnd.Source("c1", {creator: node_creator,accept:
["red","blue"],horizontal: true});
Instead of passing an array, a JSON object can be passed. Below is code snipped using Dojo toolkit API.

The second parameter is a JSON object, which can be used to pass any number of values.Similar thing can be done in normal programming languages too !

So I am thinking.. is life impossible without overloading? ...

Tuesday, June 26, 2007

Silverlight based photo viewer

Uploaded Microsoft Silverlight based photo/slide show viewer. It is not very difficult to use it in your website. Check out yourself :

http://ashishware.com/Silverlight_example.shtml

You can download required files for hosting it from above website.

Sunday, June 10, 2007

My first attempt at game programing !

Completed working on my first game few weeks back. Its a very simple game written in Ruby. Its got 4 levels. I learned quite a bit about game programing from this game.

You can read my experiences here : http://ashishware.com/FirstGame.shtml

Below is a screenshot from my game :

Saturday, May 05, 2007

Different ways of doing AJAX

A new article on my website , discussing different javascript libraries available for adding AJAX support to your webpages. Discusses individual strength of six libraries which include:

1] Basic javascript and XMLHTTPRequest object.
2] Prototype.js
3] Dojo Toolkit
4] Yahoo UI Library
5] ASP.NET !
6] Ruby on Rails

Read the article here: http://ashishware.com/Ajax1.shtml

Sunday, April 15, 2007

Hindi/Marathi/Sanskrit Transliteration on Blogger.com !

So finally they did it. Now blogging in India's National language (Hindi), Marathi and Sanskrit has become even more easy. Great job guys !

Many may find a problem FireFox and Devanagari script. FireFox doesn't seem to render joined Devanagari letters correctly, at least on Windows. IE works just fine.

For example,

Entering 'kya kar rahe ho. ' in the blogger.com's post editor window in FireFox gives this:





Where as it should give this:




The correct output is from IE. Both browsers were set to UTF-8 Encoding. The above problem can be seen for words like 'hindi'. Here again FireFox fails to render the correct output.

I found a solution which I am yet to try out here:
http://marathiblogs.net/font_problem

Also one more piece of advice that I would like to give Google, is to make transliteration tools available on their website. Adding spell-check is also a great idea (am I asking for too much).

For more on Transliteration tools for Indian Languages:
http://ashishware.com/Transl.shtml

Wednesday, April 11, 2007

Code for JSON DataSet Deserialization in

My typed DataSet looks like this:









This method is in code behind

[WebMethod]
public static MyDS GetDataFromServer()
{
MyDS d = new MyDS();
d.MyTable.AddMyTableRow("1", "abc");
return d;

}



The following lines are from aspx page accessing the service:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods=true>
<Services>
<asp:ServiceReference Path="Common\TestService.asmx" />
</Services>
</asp:ScriptManager>



Given below is the javascript code:

<script type="text/javascript" language="javascript">

function OnLookupComplete(result, userContext)
{
//Accessing typed dataset using column names
alert(result.tables[0].rows[0].ID);
alert(result.tables[0].rows[0].Name);
}

function OnError(result)
{
alert("Error: " + result.get_message());
}
function init()
{
debugger; //start debugging
TestService.GetDataFromServer(OnLookupComplete,OnError);
}

</script>


It is called on body.onload

<body onload="init();">

Thursday, March 29, 2007

Dataset JSON Serialization

There definitely seems to be some problem serializing dataset in the latest 'RELEASE' version of ASP.NET

It keeps on giving some 'Circular Reference Error' while deserializing a ASP.NET dataset.

After lot of researching on the web , this is how I solved it

1. Downloaded ASP.NET ATLAS JAN CTP from here:

2. Added reference to Microsoft.Web.Preview.dll

3.Added following lines to web.config

<converters>
<add name="DataSetConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataSetConverter, Microsoft.Web.Preview"/>
<add name="DataRowConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataRowConverter, Microsoft.Web.Preview"/>
<add name="DataTableConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataTableConverter, Microsoft.Web.Preview"/>
</converters>


4. My web service returns a typed dataset with ID and Name columns.

Now these javascript lines work:

result.tables[0].rows[0].ID
result.tables[0].rows[0].Name

Monday, March 26, 2007

Planning to write a game!

Couldn’t think of better way of learning a new language. I am seriously thinking of writing a game using Ruby and SDL. I know ruby is not the best language to do this, but
I just want to get exposed to the field.

Here is the list of things I need to learn for making my first game:

1] SDL (Simple Device Layer)
2] Sprites (I find the concept very interesting)
3] Collision detection (I guess will be complex)
4] Free music and sounds (Yes! They are very important)
5] Game loop (Is that what is it called?)


Right now I am desperate to find more information on above stuff. My first game would be very simple, maybe car racing or shooting.

Hmmmm ....some real interesting time ahead.
My 'First Game'!!

Thursday, March 15, 2007

AJAX Bar Graph with ASP.NET



Just posted script, demos and article for creating AJAX Bar Graph with ASP.NET(2.0). Using my script you can create AJAX Bar Graphs using only HTML and ASP.NET. They can be used to show real time information like cricket scores, stock quotes, temperature or any numeric data streaming form a web server.

Download the code and run it from your local machine. Here is the link http://ashishware.com/AJAXGraph.shtml

I am also working on page that demonstrates how to use the script with any server side programing language. Once it is ready , you will find it on my website !


Technorati Profile

Saturday, March 03, 2007

Started Learning Ruby!

'But why?' Is the first question people ask.

I heard of Ruby long ago. That time I only knew that it was invented and pretty popular in Japan. But then came ‘Ruby On Rails’. Being a web developer, I couldn’t overlook its popularity.

So one fine day, I decided to try ‘Rails’ myself. But I soon realized, I needed to learn ‘Ruby’ first. Seemed logical. (You need to learn C++, before you can do anything with MFC).

So, I am learning Ruby. I would have preferred learning Python, but I found learning Ruby (and Ruby on Rails) could be more beneficial to my professional. That doesn’t mean I am giving up ASP.NET.

This is a common problem, which I see with people. When they see someone learning something not ‘directly’ related to his/her work, they think he/she is looking for a switch. Many of us (at least here in India) grow up learning ‘C’ like languages. Our (including myself) conception of a programming language is something very close to ‘C’. This is the reason I am very comfortable with languages like C\C++\Java\C#\Javascript etc. Anything different becomes hard to digest as a programming language. It is in no way a reason to worry because I can solve the problem which I am supposed to!

This is not a question of ‘my language is better than yours’. Learning new languages teaches valuable lessons on programming style, concepts and elegance. Performance and utility are entirely different topics. Every language has its strong points and ways of writing elegant code. There can be no single language that can have all the best features.

I am reading the book ‘Programming Ruby’ by Dave Thomas and Andy Hunt, and believe me just skimming thorough the book has exposed me to scores of different programming concepts, constructs and strategies. Imagine how much will I gain when I actually start working on Rails!!

So next time when I code at work, I’ll probably ask myself ‘why I can’t do something like that in this language’ and the answer will surely help me understand the language and programming better.

Wednesday, January 31, 2007

AJAX tooltip for ASP.NET

Recently uploaded an AJAX tooltip example for the ASP.NET DataGrid. The sample code demonstrates how to add a cool AJAX tooltip to an ASP.NET DataGrid (DataGridView to be specific).

It uses my javascript based tooltip script along with the prototype.js(for AJAX).With minor modifications, I am sure that the code can be made to work with ASP.Net 1.x.

Tuesday, January 16, 2007

Clipboard Image Archiver - Revisited !

Ever saved images and forgot where you saved them !
That happens with me quite often.

If you face same problem the 'Clipboard Image Archiver' is for you !

Uploaded binaries for my older program. It allows you to simply paste any image copied to clipboard to a single location.

The coolest thing about it is it helps you to store all such images in a single location. It stores them in a compressed format so it takes less space. The program has been written in C# and uses SharpZipLib for compression.

Great for:

1. Taking and saving screen shots.

2. Saving images while browsing.

3. Saving those cute images in emails.

Download the program here: http://ashishware.com/Clip.shtml

Site Meter