Skip to main content

Posts

Showing posts with the label webtech

Add jquery in Chrome console

Many a time, a page you are debugging doesnot have jquery. This simple js will add(or prompt you to overwrite) jquery to any page from chrome console. javascript:if(!window.jQuery||confirm('Overwrite\x20current\x20version?\x20v'+jQuery.fn.jquery))(function(d,s){s=d.createElement('script');s.src='https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js';(d.head||d.documentElement).appendChild(s)})(document);

Appcache manifest file issues/caveats

Application cache (appcache) is a powerful feature in HTML5. However, it does come with baggage. Many (see links below) advocated ferociously against it due to tricky issues it comes with. For someone who is just testing waters, these issues may throw them off grid. Knowing them before hand helps reduce some unpredictable effects.

3 reasons to migrate to Disqus commenting platform

Over the last weekend, I evaluated DisQus commenting platform. I saw compelling reasons why Blogger's default commenting is primitive in comparison. Today I am launching DisQus on this blog. Here are 3 most important reasons that made this decision easy.

Developing Userscripts for Chrome (caveats)

To develop Chrome extensions, crx is the best way. But the user scripts that are developed in general for Greasemonkey can also be delivered for Chrome, if a few easy rules are followed. 1. @required and @resource don't work. By default, atleast for now, These two Userscript metatags donot work on Chrome. If you need to load a js file, instead of using @required - try to use document.createElement. Similarly with @resource. 2. Some GreaseMonkey helper methods don't work or are restricted. Methods with GM_ prefix from userscript api may not work. Particularly, unsafeWindow, GM_registerMenuCommand, GM_setValue, or GM_getValue are not supported. GM_xmlhttpRequest will work but not only on the same domain. 3. @include s are not shown while installing. This may not be a deal breaker for developers, but sure is for users. The patterns used in @include is not shown while installing. Instead a generic message is shown as below. This message may scare the users away. ...

Installing Userscripts in Firefox, Opera, Chrome

Want to install a userscript on your browser. Go no further. Here are simple instructions and caveats for installing Userscripts in Firefox, Opera, Chrome. If you want to author your own scripts, here is a beginner's tutorial .

Looking for alternative to Google App Engine? Wait!

The recent news about Google App Engine has taken the developer community by a surprise. There is a lot of hue and cry. Some have claimed that they have been betrayed, lost trust. Some even thought the rug got pulled out from under them. Some have even warned this as Google's biggest mistake that could cost them dearly. But is it really that big of a deal? How much of this is a concern?

Tips for Chrome developer tools

They say if you don't have Firebug you are not a developer. But Chrome developer tools, is just as sweet developers in chrome. Firebug is a very powerful tool in itself. Chrome dev tools adds a few more features that make it a pleasure to develop on chrome. Here is a quick video that may have your head turn to Chrome.

7 errant UI features in IE9

IE9 has some really cool tech upgrades .Here are a few errant UI features that makes IE9 less than perfect. It almost gives the impression that the UI engineers did not do a stellar job. or IE9 UI is a half baked cake.

Starred in Priority Inbox.

The new priority Inbox in Gmail is awesome for a GTD-er. However there's a small feature that is a little confusing. Assuming the three sections, Important and unread, Important and Starred are enabled. When an important mail is received, it goes in two Important and Unread. Then let the case be that the mail in question (The Mail, from here on) is worth a Star. It gets Starred. In due course, more mail comes in - Important ones. *The Mail* is now buried under. This is where its confusing. One thought begs to assume that The Mail is now shown in Starred section. But no. It is down the pile of Important mail. And NOT shown in Starred. Is that desirable? Not really? or is it?

What is IaaS, PaaS, SaaS?

IaaS : Infrastructure as a Service eg: Amazon EC2, Rackspace, Verizon Private Cloud. PaaS : Platform as a Service eg: App Engine, Azure. SaaS : Software as a Service eg: Google Docs, Acrobat.com. Here is a collection of slideshows about IaaS, Paas and SaaS.

Google Wave: How to create a Live Page on your website using a Public Wave

Yesterday, I created a public live readonly wave and posted it on my blog. Here is how you get it. You need a Wave account. You log into your wave inbox. and start a wave.   Add participant "Public". Note that "Public" is not in your address book. But shows up when start typing public. Then make the "Public" participant's Access to this wave readonly. Then get the code to insert from the *Link to wave* menu. Copy paste it on your website and You get your self a live reporter.

AppEngine Cold Startups - Rendezvous with Google App Engine Team

I was at Google App Engine IRC Chat today. Following a lot of concerns of others and of my own , I wanted to put forth my ideas to them about cold startups. I tried to promote my ideas of different approach to classloading, osgi, profiling the runtime itself etc. But time was not enough. I will probably talk again next time. For the most part, It looks like Google is almost ready to come up with *reserved instances* approach. But here is what they have to say. (9:59:52 PM) sar4j: This is about cold startups for java. I run my website sarathonline.com on appegnine py. But I am a java developer. So I have to get reasonabl undersanding about how gae/j works. To simulate the same performance, I am adding a test.js script to exisitng website. So every time a visit comes to gae/py a hit happens to gae/j. I still see that gae/j is very aggressively spinned down. (given number of requests are the same) is there any algorithm on how and when spinning down happens? ..... (10:04:17 PM) api...

Faster.. Faster.. Internet in India

Just less than 2 weeks from the news of venture with Google , Airtel and BSNL have released new Faster internet plans.

Google App Engine / Java / cold Starup benchmarks (issues).

This is connected to the post in Google App Engine Group .  Although Google Appengine gives out a java container, I had to roll back to the python code I used for version SarathOnline 3.1 – for a sole reason – perfromance. My (blog) site has a very low traffic (compared to what google thinks a regular traffic application). Averaging ~100 visits/day. All the css and js is dynamically generated. My current python code is doing pretty well servicing these requests @ a maximum of 2.something secs

Update multiple Dynamic DNS servers using ddclient

Running Linux, ddclient is highly suggested software for updating DynamicDNS servers. It supports updating a variety of servers. Some of them are dyndns.com opendns.com and no-ip.com. ddclient supplies documentation to update multiple hostnames (on the same server) but does not have an example with multiple servers. Here is an example that covers all those combinations. ## ddclient configuration file daemon=600 # check every 600 seconds syslog=yes # log update msgs to syslog mail-failure=your@emailaddress.com # Mail failed updates to user # requires sendmail installed. pid=/var/run/ddclient.pid # record PID in file. ssl=yes #use ssl ## Detect IP with our CheckIP server use=web, web=checkip.dyndns.com/, web-skip='IP Address' protocol=dyndns2, login=user1, password=YOURPASSWORD \ some.selfip.org protocol=dyndns2, login=user2, password=ANOTHERPASS\ someother.selfip.org protocol=dyndns2, server=updates.opendns.com, login=user3, password=psswd3 \ home

Google Maps of India

"Mapquesting" in India is uncommon, if ever used at all. Google India maps have been developing quiet fast in the past few years. The last time I went to India, I was able to spot my home. Then I was able to save it as a favorite location. But Yesterday, I used it for real. I had to locate US consulate in Hyderabad. I had a Consular Interview scheduled on 18th for My H1B visa Extension. I did not have time to go personally there a day before, which I would have done otherwise. I looked up the address from the Consulate website . And put that in maps.Google.co.in . This dint come up, but – I did a search for us consulate, Hyderabad , and voila, I got the exact address I was looking for! Cool isn't it? Then, I hit the directions link, and put my home address. Dint come up. Tried with the local area name instead of the exact address. And Swweet sugar, It was even able to get turn by turn directions for me. View Larger Map

Price comparison Internet in USA and India

While this trip to India did not provide me enough time to set up all the infrastructure, I was happy with the technological advancements India witnessed in the past four years.  As I left to USA, in November 2004, my house had only dialup connection. Today we have at least three service providers including one WiMax provider. We have a BSNL broadband connection, Tata Photon+ wireless Internet Service to complement each other.  Now I will compare the cost of these Internet Services with those in the USA.  I benchmark this with respect to General browsing, Downloading/Video, and VPN users. The main advantage in the USA is that the Internet is not limited.  And not capped in terms of bandwidth.  The average speed of an Internet connection(cable), in the USA tops about 15 Mbps. Considering the fact that this is unlimited, one in India would expect a high costs associated with that.  But Comcast provide such high speed Internet connection for about $20 a mo...

javascript maxlength for textarea with \r\n breaks in java (esp Firefox)

Textareas allow new lines to enter. These are represented by \n (1) or \r\n (2) characters. But when you save to DB you have a limit to certain length of chars. There is no maxlength attribute in HTML that will stop you from entering data. This is generally acomplished by Javascript. You do a onkeyup hook and stop event or trim after textarea.value.length > maxlength. There are many other solutions out there.. But.. Here is the problem that most of those solutions overlook, How do you deal with the count on \n and \r\n representations. Lets first see how it matters. If the text entered has new lines, the length is calculated differently in Firefox and IE. When you enter a Text like 01234 567890 You expect the textarea.value.length to be 11. (10 chars + new line).On the backend, however, java would recieve it as 12 chars (10 chars + \r\n) (this is irrespective of FF or IE). So you are effectively saving 12 chars to DB. Worse yet, IE seems to figure textarea.value.length as 12 (...

Faster webpages fewer Images with CSS Sprites

In a previous post , I have made a point how to improve performance by reduce HTTP connections by stitching together content of css and js fragments. At that time I also mentioned a way to do it further is to reduce the number of images on a page. Because images are also loaded on HTTP connections. Again the same Cache-Control headers on the client can be used to reduce much of this traffic. But to reduce the Number of HTTP connections, You can employ a technique called CSS Sprites. I have to confess, I don't know about this technique until I was researching on GWT's ImageBundle interface. Had I known this trick, my SarathOnline2.0 site would not have been lame - text only! Simply the technique is to stitch all images together into one big image. This big image is called a Sprite. The images used on my site are sprite-d as shown on the left. How do we display them seperately? Using css backgrounds. To achieve this We will send a blank 1px gif. Then insert an img tag with...