What's up!

Pyaarey Allah!

Friday, December 31, 2010

Parents and Children

0 comments

Old parents are happy to see the son that he is smart and the child is counting-on for parents death.

(Sheikh Saadi)

Why so successful

0 comments

They aren't the best, Its just that they have got some better tools.

Capability

0 comments

Better resources make you highlighted but they do not prove your capability.

Downtime; Fate; Success;

0 comments

I don't know when I'll be down because its about my fate. But the fear of being defeated, elimination of un-necessary things and working in a peaceful place is the sign of being successful and good-luck for sure.

Hidden Power

0 comments

A man with trustworthy relations is powerful and a man with disloyal relations will be down to knees. This applies in social and professional life very well and then on every part of life.

Tuesday, December 28, 2010

The task is getting complicated...

0 comments

It is difficult because you did not learn it properly.

Monday, December 27, 2010

Jquery Live Method And Event Bubbling

1 comments

Take a look at the following code


[script type="text/javascript"]
                //parent clicked, return false
                $('.level1').live('click', function () {
                                return false;
                });

                //child clicked, alert
                $('.level2').live('click', function () {
                                alert('level2 clicked');
                });
[/script]

[div class="level1"]
[div class="level2"]Clicking on my will not alert[/div]
[/div]

In Jquery Live-events-binding, the event from level2(child) element will be passed on to level1(parent), then to parent's parent and finally to the root of the DOM(document object). If on any level the event it being canceled/interrupted by a parent then the child element's event will not be triggered. For example in the given code when we will click on the level2 element, the alert box will not show because the level1 div is blocking it by returning a false. This is the way things work in Jquery Live-events-binding. So be careful while using Live Events which can behave unexpected due to a little logical mistake.

Getting Current Index In Foreach Loop

1 comments


foreach (var obj in this.Sizes.Select((sz, i) => new {Size =sz, Index = i }))
{
ViewSize sizeObject = obj.Size;
int currentIndex = obj.Index;
Response.Write("index=" + currentIndex + ": class=" + sizeObject.ClassName);
}

Best Open Source Javascript Editor

0 comments

I found Komodo Editor by a youtube video reference and it was a GREAT edition to my Javascript Editors :P Too many editors. Unlike Visual Web Developer you can

  •  Fold the code, not only function blocks but also every curly brace block which is extremely cool
  • Click beside the starting bracket it will select the ending one, bravo.
  • The Dark theme is cool, I have started liking working with black background.
  • You can open not only files but also projects.
  • You associate file extensions with appropriate programming language. By default aspx is not associated, I bound with HTML view. I could have used XML too. The code folding works on that file too. Even that is server side code. For that go to Edit > Preferences > File Associations.
  • You can customize the colorization experience by Edit > Preferences > Fonts and colors. 
  • On the top toolbox you can "Show/Hide left pane" etc so you can view project browser on demand.
  • The vertical lines to show matching braces is a cool feature.
  • Guess what ! GO TO DEFINITION in javascript? ;) 
  • Code intellisense is also there. Liked it. It remembers variable names, function names and shows common objects such as window and document and their functions like alert() and parseInt() etc. 
I din't expect this much of features from a non-MS editor specially this level of javascript support which is leaving Microsoft Visual Web Developer behind many years.
    Click here to vist Komodo's Official website

    Firebug - Check DOM Event Bindings

    0 comments

    Go to Firebug Console edito and run this command

    $('#mybutton').events('data')
    See in the console logger  It will show the events bound with the mybutton element just like
    object {click=}
    You can further click on that link to see the Handler Node, Note that hovering the mouse over the word function(written next to Handler) will show a tooltip telling file name and line number. Click the word function to go to the line of code in script tab.

    IE is still the most famous browser even it holds www back

    2 comments

    I hate IE because of the fact that Microsoft is holding a lots of web development back. It has bad HTML5 support and it doesn't support 25% of CSS3 features. I, amazingly, see that IE is still holding 60% of the market. According to a report; In last 3 months Google Chrome has taken its rise from 5.x% to 9.x% which is a huge jump. IE has loosed 4% which seems to go to Google Chrome. Firefox loosed 2% and other browsers seem to be on their old positions.Below is a screenshot from another report

    Click the Image

    Sunday, December 26, 2010

    Sql Server DB Diagram Permissions Workaround

    0 comments

    EXEC sp_dbcmptlevel 'YOURDBNAME', '90';
    go
    ALTER AUTHORIZATION ON DATABASE::YOURDBNAME TO "sa"
    go
    use [YOURDBNAME]
    go
    EXECUTE AS USER = N'dbo' REVERT
    go
    

    Saturday, December 25, 2010

    Alternate Images in 'img' tags in Html

    0 comments

    I found a cool solution:


    Click here... 

    Thursday, December 9, 2010

    Rock Library gone open source

    1 comments

    Rock Library is my own and my favorite library. People were after it for a long time. Finally gone open source.
    Hosted on the google code hosting Click here to get the source