ERROR:href=”#” shifting the brower scroll on top…!

javascript No Comments »

 Have you people ever noticed that for a hyperlink of type

<a href=“#”>test</a>

after clicking causes the window scroll position to move upwards giving a weird sense of behaviour to the link.

I just managed to find out a workaround for this problem.What I did was I re-coded the hyperlink in the following manner

<a href=“javascript:void(0);” >test</a>

Here I am doing nothing but replacing the # with a null javascript, but here I have to assume that the javascript in your friendly browser is enabled.

Another work around is

<a href=“#” onclick=“javascript:alert(’test’);return false;”>test</a>

here the return false tell the browser to do nothing once the alert is displayed.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Book.mark.hu
  • co.mments
  • Technorati
  • YahooMyWeb
  • IndianPad
  • DZone

Threads and Synchronization in Ruby..!

Ruby No Comments »

I was just free this weekend,so just gotta a chance and dropped myself with a little program on threads and synchronization in ruby.This program  generates a secret number which is implemented as sync_server_thread on the server side and then assigns the same variable on the the client side.

In this program , I took care of things like mutual exclusion and deadlocks.In the very first line I am requiring thread class and creating a new object for Mutex(a class which handles stuff related to mutual exclusion of threads), a instance of condition variable (a condition variable is a semaphore which is mainly used in accordance with mutex class,its main purpose is to take of processes in the critical section which are stuck in themselves while waiting for some external resources like non ruby programs).The sync_var_1 and sync_var_2 are local variables which will contain the secret number that will be generated at the server side and will be assigned to the client side program.

The first thread is the server side which runs on the server side and is responsible for generating the secret number on the server side. In The server side thread we can see that the condition variable sync_prevention.wait, there is no such implication on the presence of this statement in the program,but I have actually kept it if in case we include any functionality in the program which generally calls some external program to run as a part of the thread for example if I use a third party secret number generator for generating a secure secret number which may take a ample of time to generate the secret number.The wait method of condition variable generally tends to release the current thread under mutex and  re invokes that process later when the external program has responded.

Similarly in the second thread, the signal method of the condition variable tends to wake up the first thread waiting for the external resource.By doing this, we can maintain a balance of load on the server where multiple requests for generating the secret number.

The join method is one of the coolest and a must use method in the Thread class,I call it a must use method because when a ruby program containing some code related to thread runs,All the threads creating during the course of execution of the program will and must be killed once the program exits out of its execution.So To make sure that these threads complete at their whole, we use the associate them the join method.And finally the sync_diff is make sure that the same values at the server as well as the client remain intact at any point of time and the difference between them should always be zero.

 There are some implcations in the existing program, that the client and server run on the same file. In my coming posts you will see that the

the server thread runs under the server enviornment like webbrick or mongrel or may be a backgroundDRB…!…and the client thread will be running as a controller process in case of our rails app and will be synchronized with the server’s secret value.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Book.mark.hu
  • co.mments
  • Technorati
  • YahooMyWeb
  • IndianPad
  • DZone

Climb And Hack The Firewall

Hacking 1 Comment »

Climb And Hack The Firewall 

Have You ever wondered about how to bypass firewall which blocks your favourites sites and presents before you some dummy page saying  “This Page Is Blocked under the category  “FUN/HUMOUR”. Then here I present before you a work around to climb over the firewall and access your favourite site. 

Just download the web browser called Operator which is nothing but a mixing of Opera (A Web Browser) and TOR(keeps to anonymous when online) 

http://archetwist.com/opera/operator 

A operator plug-in for Mozilla firefox is also available for download 

https://addons.mozilla.org/en-US/firefox/addon/4106 

You can just download the setup of operator from the below link 

The operator ships along with Privoxy and proxy based system which will trick your firewall in a very simple way. 

When you start the operator you will see a blue icon with a “P” alphabet in the group of tray icons in your taskbar. 

What operator actually does is it relays all the http traffic over port 8118 which is set to default rather then the standard port 8080, along with proxy url internally generated by privoxy and your dear admin tends to put the firewall rules on this port.So,this is how it goes and  how operator allows you to access your favourite sites and keeps you happy. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Book.mark.hu
  • co.mments
  • Technorati
  • YahooMyWeb
  • IndianPad
  • DZone

The Rails Song..!

Fun On Rails No Comments »

Presenting before you the “The Rails Song”…

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Book.mark.hu
  • co.mments
  • Technorati
  • YahooMyWeb
  • IndianPad
  • DZone

Rails KeyNotes By DHH

Rails Videos No Comments »

Poested below are a few keynotes On Rails by David Heinemer Hansson during RailsConf in Europe

 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Book.mark.hu
  • co.mments
  • Technorati
  • YahooMyWeb
  • IndianPad
  • DZone

WordPress Theme & Icons by N.Design Studio. Packaged by Edublogs - education blogs.
Entries RSS Comments RSS Login