Reverberations

News, Views, Rants and Raves About Technology and More

Archive for the ‘trick’ Category

Persistent “Bad Request – Error 400” when using Google Apps Mail

with 13 comments

Gmail for Google Apps sometimes throws “Bad Request – Error 400” after you have persistent session (chose to “Stay signed in” while logging in). I have 4-5 Gmail accounts which I’m usually logged in at the same time, and I get this “Bad Request – Error 400” error on one of the accounts. I use Firefox as my main browser (because apparently Google Chrome cannot support even the latest CentOS 5.x with official repo and Chromium build is stuck at version 13 for CentOS 5)

Google suggests – “Clear your browser’s cache and cookies” which means I need to kill all my active sessions and sign in all 5 gmail accounts again, which is pretty unproductive.

By trial and error, I found the following solution for Firefox-

  1. Install an extension which allows you to view cookie information of a browser tab and selectively delete cookies (I use Web Developer)
  2. List all the cookies on “Bad Request – Error 400” page (“View Cookie Information” on Web-developer extension)
  3. Delete the cookies which have long string values GMAIL_IMP. If you delete all the cookies, you may have to sign in to that account again, but usually deleting only some cookies works for me without needing to sign in again
  4. Refresh the browser tab which was showing  “Bad Request – Error 400” and done.

[update: Rob identified the cookie to be deleted]

Advertisements

Written by Brajesh

July 17, 2012 at 6:14 am

Posted in Google, trick

Internet Explorer’s Trailing Comma Woes

with 8 comments

Internet Explorer is notorious for breaking on trailing commas in JavaScript array declaration. e.g.

var obj = {
     a: 1,
      b: 2,
};

fails on IE, while all other browsers just ignore the innocuous trailing comma after second element.

Weeding out these commas from JavaScript code is absolute PITA. However, here is a regular expression search string I wrote to search such instances in the code.

,\s*\n+\s*[\}\)\]]

Even better,
,\s*\n+(\s*\/\/.*\n)*\s*[\}\)\]]
matches multiple new lines and comments.

Written by Brajesh

March 18, 2008 at 10:31 pm

Google Chart API: Simple and Awesome

with 2 comments

The Google Chart API looks to be the simplest way of generating high quality dynamic chart images for Line chart, Bar chart, Pie chart, Venn diagram and Scatter Plots. You just have to pass the chart data as URL parameters e.g.


http://chart.apis.google.com/chart?
cht=lc&
chs=200x100&
chd=s:ThisIsReallyReallyCool&
chxt=x,y&
chxl=0:|Apr|May|June|1:||666+KB

would produce this chart –

ThisIsReallyReallyCool

Written by Brajesh

December 7, 2007 at 10:31 am

Posted in Coding, Google, trick

Compiling Greasemonkey Scripts to xpi (Firefox Extension)

leave a comment »

Written by Brajesh

November 28, 2007 at 4:36 am

Direct Link to IMDb Movie Quotes

leave a comment »

A small greasemonkey script to get direct link to a quote on IMDb’s “memorable quotes” page. This script creates a “#” with a link to corresponding quote.

Written by Brajesh

October 20, 2007 at 10:09 am

Saving Streaming Windows Media

leave a comment »

Many times (or always?) the videos (especially wmv) streaming over internet are not downloadable as Windows Media Player disables the save menu. Windows Media files are usually served through an .asx metafile. ASX is a simple XML format which stores the path to media file(s) to play. e.g.

<ASX version="3.0">
     <Entry>
        <ref href="mms://rx-lvl3-wa37.rbn.com/farm/*/ibmpdc/pdc/open
                   /wmdemand/mar06/rtoranzo/anthem-v125.wmv"/>
     </Entry>
</ASX>

Now, the media files are served over mms protocol, which cannot be saved directly. Here comes the saviour FlashGet. Just put this mms url in FlashGet’s ‘URL’ field and save the file. Done!

Written by Brajesh

August 29, 2006 at 2:37 am

Posted in Media, Microsoft, trick, Windows