bhat.log() > web

It’s simple, just a days work, it works

Archive for the ‘Programming’ Category

Linksys hacks

without comments

I own one of these babies :) Just a bookmark for me to investigate
Linksys hacks

Written by Satish Bhat

February 7th, 2006 at 6:13 pm

Posted in Personal,Programming

Overload == Polymorphism?

without comments

Just went through another interview process today (I am averaging 3-4 a day for past few weeks!).

After conducting so many interviews, especially past 6 months, I have kinda developed an interview model which works for me:
- Ask about the project they have worked in the past year (Kinda Ice breaker).
- Ask about the architecture of the application or what they found to be most interesting in that project.
- Move on to the platform specific questions, where the questions are more on the framework then any thing else.
- Maybe even drill down to certain important API’s.
- Give some problem for solving on an implementation level.
- A generic scenario from which a class diagram needs to be generated. I like this one as it tells me if the candidate has an innate knowledge of design or not. You will be surprised by how people think of a hierarchy. Seems to be a simple “as-is” relationship, but reasons for justifying a base class! Even what base classes people can come up with (Whew).

Anyways, everytime what gets my goat is when we discuss Polymorphic behavour, especially in C++ or C# or Java, I hear about overloading being polymorphic. I still haven’t figured our how this term has come into being: static polymorphism?

In math we define Morphism as something which can retain the same structure but the underlying mathematical structure (functions for e.g.) can change. This basically means in our modern OOPS language polymorphism is alwyas be the usage of virtual functions (overriding).

Well, unfortunately all the new texts in India use this term liberally with overloading :( go figure.

Refrencing Links:
http://en.wikipedia.org/wiki/Morphism
http://en.wikipedia.org/wiki/Polymorphism

Written by Satish Bhat

January 17th, 2006 at 12:25 pm

Posted in Programming

Web Trawling or Deep web search

without comments

Web Trawling or Deep web search

A friend asked me how do I keep in touch with the latest and greatest? The answer was “/.”
But seriously if I am looking for something specific, the following bookmark is what I use for my searches, i.e. when I want more then then what google can give me(!).

PDF search
http://www.searchpdf.adobe.com The guys who made it possible
Articles and journals archive
http://www.askeric.org contains abstracts of journals and documents
http://www.findarticles.com an archive of 300+ magazines from 1998
http://www.lii.org The librarian’s starting point
http://www.lita.org/committe/toptech/toolkit.htm#invisible Lib and info tech associations tool kit for the expert web searcher
http://dir.lycos.com/Reference/Searchable_Databases/ Web catalog
Yet to be investigated
www.lexibot.com  
http://info.intelliseek.com/prod/bullseye.htm  
flipper.com an archive of 300+ magazines from 1998
Bookmarks
http://www.freepint.com/gary/direct.htm  
Formerly http://www.invisibleweb.com, a vertical search/catalog engine  
http://www.completeplanet.com  
Research area on CS
http://liinwww.ira.uka.de/bibliography/ A good CS bibliography query engine
http://citeseer.nj.nec.com/ Research Paper Index’s

Other links
Dictionary of Algorithms
An open directory

Written by Satish Bhat

February 1st, 2005 at 6:43 pm

Posted in Programming

Enabling compression in Web Servers

without comments

Enabling compression in Web Servers

On a site serving static content or content that are read only, generally does
not generate large data to be consumed by the client. Even in case of large
documents/articles/content most of the sites split the content across multiple
pages to ease the amount of data to be downloaded. In case of applications with
web interfaces this can be different. Generally the users of the system have
been used to a client-server based applications with UI interface with many
smart tricks on the client side. A typical user expects the same behaviour on
the web solution. A clever UI designer can design an interface which works well
even in the web based mode.

But there are many cases where a small thin interface is difficult to design.
Standard examples are dashboard, reporting page or cases where filters are
removed, etc …

For these cases it is a good idea to enable stream compression at the web server
level. This can drastically reduce the bandwidth requirement and hence download
speeds for a site.

Few gotchas:

  • Enabling compression will increase the server CPU load. But in a cluster
    enviroment, I definetly recommend this. As a general thumb rule if the server
    machine is running at the max load of 80% enable the compression, otherwise add
    another machine to your cluster environment before enabling them.

  • There are browser quirks where these can create problem. Most notable Netscape
    4.xx (these can be safely ignored) or IE 5.5 (yikes, baad browser. If your
    users have this browser, recommend IE 5.5 SP2) or IE 6.0 Japanese version (similar to IE
    5.5 in bugs!)

  • Compressing streams smaller then 1K will create unnecessary load on the server.
    If possible disable compression for streams smaller then ~500-1000 bytes.

There is a decent article covering the same here. I will not cover the same points already discussed out there, but these are my take:

  • Set compression for both static and dynamic files.

  • Disable compression for those aspx or server script files where we serve
    already compressed files. e.g. jpeg, mpeg, dwf, jpg, jpe, gif, zip, cab, mpg,
    mpe, mp3, png, amp, ptp, dwp, pnp, and zgl.

  • Understand the following variables of IIS:
    HcDoDynamicCompression
    ,
    HcNoCompressionForRange
    , In fact readup on
    IIsCompressionSchemes
    .

  • To disable compression for certain files or nodes, set the DoDynamicCompression
    to false.

e.g. scripts:
[code]
C:/Inetpub/AdminScripts/adsutil.vbs set w3svc/{siteID}/root/DoStaticCompression True

cscript C:/Inetpub/AdminScripts/adsutil.vbs set w3svc/{siteID}/root/DoDynamicCompression True

cscript C:/Inetpub/AdminScripts/adsutil.vbs set
W3SVC/{siteID}/root/{subfolder}/{page.aspx}/DoDynamicCompression False
[/code]

Otherwise you can use the Metabase Explorer to do this.

Apache web server

There are two modules available, namely “deflate” and “gzip”.

As the following thread explains if you have Apache 2, use mod_deflate otherwise depending upon your configuration requirements go for either.

The apache site contains information for deflate (http://httpd.apache.org/docs-2.0/mod/mod_deflate.html)
and mod_gzip is explained at http://www.schroepl.net/projekte/mod_gzip/config.htm

A sample configuration
[code]
mod_gzip_on Yes

mod_gzip_on Yes
#mod_gzip_send_vary Yes
mod_gzip_add_header_count Yes
mod_gzip_dechunk Yes

mod_gzip_can_negotiate Yes
mod_gzip_update_static No
mod_gzip_static_suffix .gz

mod_gzip_minimum_file_size 300
mod_gzip_maximum_inmem_size 60000
mod_gzip_maximum_file_size 2000000
mod_gzip_temp_dir /tmp
mod_gzip_keep_workfiles No

## minimal included set of items to compress to avoid sending Vary * header
## This is very conservative and cooperates superbly with mod_expires
## caching headers. (Netscape 4.0[678] will still have problems, but it
## only affects a fraction of a percent of hits (about 0.00015 == 0.015%)
## on our site with the settings below)
mod_gzip_item_include uri .s?html?$
mod_gzip_item_include mime ^text/
mod_gzip_item_include file .php$
mod_gzip_item_include file .js$
mod_gzip_item_include file .css$

mod_gzip_item_exclude mime ^image/

[/code]

Written by Satish Bhat

December 22nd, 2004 at 6:42 pm

Posted in Programming

Search for open source

without comments

Divya pointed out this one for me.
What I liked about the site is the way they have categorized and a simple way of browsing projects.

I guess a place I will haunt more :)

Check it out at http://www.koders.com/
As they say in windows world “ctrl-c ctrl-v” or if you prefer vim “esc” “y” “p” or for the emacs fanatics “alt-w ctrl-y”. What’s your poison?

Written by Satish Bhat

November 23rd, 2004 at 7:38 pm

Posted in Programming