Tuesday, July 06, 2010

CSS Layout design

I have been exploring best way to bring customizable CSS layout design that would fit wider variety of audience. CSS with countable properties is kind of huge thing for me. It carries so much important aspects ie layout and aesthetics (themes) of front end and also we can play with it with the change in line of code. As always, making it simple is tough.

1) How do I design a layout templates so that it caters wider variety of audience
2) How do I change certain curvatures like rounded corner
3) Fluid vs Fixed layout and option to have both
4) How about doing it with Javascript like jLayout or JQuery Masonry

JQuery is doing fairly great job of DOM scripting and UI is not so fair as it touches here and there and providing something not very much useful to enable templates but doing nice job of theming.
Blueprint has been one of my favorite CSS framework for sometimes but 960.gs is also similar but doing similar task of blueprint. Almost these two guys hates fluid based layout with good reasons.
I really agree that CSS is territory of designers but having that abstracted out would really makes life simple. I wanted to do templating based on CSS and html alone.

I am going to use 960.gs for fixed width and fuild grid based on 960.gs for liquid design. Using little server side program and dynamic configuration, trying to bring custom design (Layout and theming)

Tuesday, June 29, 2010

iPhone 4 Facetime issue

iPhone 4 Facetime disappears when it is restored from old iPhone using iTunes. I looked at the Google which point me to a blog where it asked me to enable under Settings->Phone. But unfortunately I did not get Facetime under Setting->Phone. So how do I resolve?
I called up 611 and couple of minutes warring with customer care i was able to talk to Apple rep who is not that much useful to resolve, he asked me to call 1-888-Facetime to resolve :) it was totally useless minutes with rep.

So I thought of resetting all the settings under Settings -> General -> Reset -> Reset All Settings.

After that iPhone started rebooting and viola.. Facetime worked.....

Saturday, June 19, 2010

Wesocket and where it stands now

Wesocket protocol was updated to version 76 and Google chrome 6 already implemented it. So the list of browsers which support websocket are

  1. Google Chrome 5 and 6 with v76
  2. Safari 5
  3. Firefox --- well finally the websocket bug got closed as fixed. It is created in Jan 2009 and almost 17 months after its got closed.
But having Firefox now makes the total market share for websocket is more than 40%.

Monday, June 07, 2010

SNI, TLS, UCC or SAN and https

I am mixing too many keywords in secure communication using https (TLS v2) per se. SSL is deprecated and TLS is going to overtake. Since https secure connection happen below https layer, so host information would not be passed to server while establishing connection and hence multiple host on single IP is practically not possible until TLS v2 which adds SNI. Single IP, Single Server, Single host and Single certificate is not the way to go for my requirement. Had been spending so many hours to figuring out …. Better 1) Understanding how it works 2) Planning how to deal with short comings 3) Choosing one over the other.
Wildcard Certificate –
*.somedomain.com would not be possible for Virtual hosting with vendor domain (naked domain) kind of scenario and may be useful to have it with more neutral domains. It is not possible to serve different domains with wildcard.

UCC or SAN --- Unified communication certificates Or subject alternative names
It can be used if the all domains owned by single entity or person --- hmm… practically not possible. Usually certificate will embed multiple domains in single cert in alternative name filed.

SNI – server name indication ---
web server can have multiple certificates --- well key/cert files would be different for different domains. So it is webserver which understands which request for which domain and send appropriate certificate. Nginx with openssl .98+ supports this but need to tell it so.
Other issues with SNI,
Restart needed for each new VHOST configuration
Operating System (OS) limitation:
1) Windows XP
a. IE 7 or 8 will not work
b. Google chrome will not work
c. Firefox actually works -- nice job Firefox (as it uses its own networking layer)
d. Safari will not work.

2) Vista
a. IE 7 +
b. Chrome
c. Safari
Due to built in TLS layer in Win XP browser which used them will not work but Firefox which uses iNSS API would be able to work on SNI Virtaul hosts.

Wednesday, May 12, 2010

Google NaCl and Possible SDK for Chrome OS?

Today Google introduced Nacl SDK, Google's native client is baked into SDK. I think its going to serve as SDK for Chrome OS. In the surface it may sounds like another Flash or Silverlight like thingy but how can otherwise Google can empower Chrome OS? Important point is, it can run any languages -- it may be python, Lua or Google Go(There should be integration point - Ports). I am looking for Nacl SDK for Android and how it can be useful for web development. One point in future Native client app can be bundled with Google Chrome and can be run on any platform which eliminates the need for crapy browser dependency, so write html + CSS +JS and heavy lift using NaCl and bundle it with ChromeOS --- so cloud ready app is just click away.

Thursday, April 01, 2010

Riak, thoughts on Erlang based client

I compiled Riak and started it, couple of times I tried with documented hello world like example but this time I wanted to separate Riak DB server from Erlang client. Riak is notoriously bad for omitting how to guides -- this also helps early adapter to delve deeply to understand and hence good for devs at the end. I really need to thank Joe Armstrong for pointing to Riak as it is not visible few months back.

1. Riak's default cookie name is "riak" and it can be verified by "ps -ef | grep riak" or rel/etc/vm.args file has cookie properties, here it can be changed to match Erlang client
2. I copied few files from cp <>/riak/apps/riak or luke/ebin to my working directory to check dependent module to work with and found

    1. luke.beam
    2. luke_flow.beam
    3. luke_flow_sup.beam
    4. riak.beam
    5. riak_client.beam
    6. riak_core_util.beam
    7. riak_kv_map_phase.beam
    8. riak_kv_mapred_query.beam
    9. riak_kv_util.beam
    10. riak_object.beam
    11. vclock.beam
                        are necessary to talk to Riak using Erlang application
                        3. Once grap hold of those files and node at which Riak server is running with cookie which Riak uses -- Erlang can talk to Riak period.
                        4. Now the steps detailed in the README (Riak's) is working fine for me. Assuming you are the directory where the above 5 files are available (or include that dir in erl path (-pa))
                        I just copied sample code from README file below and io output is omitted for brevity.
                        prompt> erl -name riaktest@127.0.0.1 -setcookie riak
                        (riaktest@127.0.0.1)1> RiakNode = 'riak@127.0.0.1'.
                        (riaktest@127.0.0.1)1> net_adm:ping(RiakNode).
                        (riaktest@127.0.0.1)1> {ok, C} = riak:client_connect(RiakNode).
                        (riaktest@127.0.0.1)1> O0 = riak_object:new(<<"groceries">>, <<"mine">>, ["bread"]).
                        (riaktest@127.0.0.1)1> C:put(O0, 1).
                        (riaktest@127.0.0.1)1> {ok, O1} = C:get(<<"groceries">>, <<"mine">>, 1).
                        (riaktest@127.0.0.1)1> V = riak_object:get_value(O1).
                        (riaktest@127.0.0.1)1> O2 = riak_object:update_value(O1, ["milk" | V]).
                        (riaktest@127.0.0.1)1> C:put(O2, 1).

                        I am not sure only these files are enough, but probably not! there are modules for certain kind of map reduce available in Riak, so if you plan to use those builtins you may need to copy them as well.

                        Riak a super scale datastore

                        I started looking into Riak lately to see how it can fit into my application which is currently using CouchDb. I really like CouchDb for
                        1. Map Reduce view -- just throw some mr function you will find out the document which it preserved
                        2. Web UI (the futon) it alleviate lot of Admin pages along with lately added security is good enough to manage it
                        3. Hot data backup, it is an excellent feature and makes like easier

                        Cons:
                        1. Mindset of treating CouchDb as all in all self contained product and hence lacks native interface, (there are APIs but it is based on http -- even http world is moving to websocket due to its inherent limitation for certain usecases, having Database served by http to another middleware is costly and environmentally hazardous like gas guzzling trucks
                        2. lack of native search (full text) but there is a lucene based one but already couchdb is dependent on JS, Erlang, ICU and having Java into the fold is kind of nightmare to the mix but it works and also gives head ache when replicating and spinning multiple nodes
                        3. It is not truly distributed but it is kind of storage engine which can be equated to better dets storage engine or innostore but there is nothing similar in couch architecture to be comparable with Cassandra or Riak.


                        Wednesday, March 17, 2010

                        Thank you Google Chrome, IE9 is your gift to us....

                        IE9 with its preview release inching forward and compliance with standards like CSS 3.0, HTML5, new javascript engine. Microsoft realized that they can't stop web momentum by not improving the browser but making it better would definitely going to help them in long run. They jumped into the bandwagon of fast JS engine and more HTML5 feature including video/audio support is surely welcome factor for web. This is absolutely due to Google chrome and it is the finest example of turning badie into good one and how one's true potential make others to follow. Thanks Google. I hope same thing going to happen in internet pipeline too once Google rolls out 1Gbps fiber optic internet service.

                        Saturday, March 13, 2010

                        How eventual transparency triumphs

                        I, earlier, blogged about how technology going to bring transparency and I termed it as "Eventual Transparency". If you come from India, last week's news (March 2010) about one fraud Godsman would have been torned you apart. Though it is unforgivably bad... this kind of behavior never accepted in any society including open culture society. These guys fly high into "super stardom" by marketing gimmick (luring people and making people believe that they are capable of things which God only can do and hence people things that they are Godsmen), once they climb into high and they storm into human mind. Once people accepts this guys, they would gain "root" access (mind would start trusting them as God, please read more about root here) into believer's brain and brain as rooted system is taught to be trusted them. So once mind is defected, it goes into myopic view... this is where so called "Godsman" peaks and influence people to their advantages and collect as much money as possible and force people to do anything he wants and those defected people would think it is correct even if the
                        Godsmen do wrong. Ok it is better topic for phycologist than me, and this event has links to "Eventual transparency".

                        Eventual transparency
                        This is where Gadgets and devices equipped with "Camera" and voice recording would storm into and expose the truth. And events like this will open up myopic eyes of people and bring them back to reality. But what about effected users? It is definitely hard for them and events like this would at least stop new people tranced (hypnotized) by this kind of people.

                        Fun part...
                        Few days back, the same Godsman appeared on the video and stating that "the video is not true blah blah" and acting as if he is innocent as usual and unfortunately "Oscar" board didn't see the video otherwise he would have got immediately oscar for "best actor" category...

                        Friday, March 12, 2010

                        How GREEN my app is?

                        Green means spending less energy or doing more with less. If we apply this principle to software then following factors would affect the green thing. I am picking Web application development as an example
                        1. How many Developer/Tester/Manager etc etc needed to bring the application to completion -- it is one time cost
                        2. Maintenance --- recurring
                        3. Hardware requirement -- given the app deployed on the hardware, how many users it can serve? This is very important factor as some of the very famous language is really bad at serving more concurrent users and hence need more hardware to support peak numbers and fight between Amdahl's and Moore's law :)
                        4. Power consumption is very related to item 3 above
                        5. Architecture -- among others, choosing the right technique like partial page rendering and sending only the data need to render which eliminates network loads, serialization cost or construction and deconstruction costs
                        6. Right sizing and utilizing modern hardware
                        7. Location how near the server is located to user which avoids unnecessary trips
                        8. Infrastructure and real estate costs / wastes etc
                        These factors grossly affects the Green computing. At the end, burning less fossil fuel to run the application.

                        Thursday, February 04, 2010

                        CouchDb RPC vs HTTP client

                        I have been lately doing Erlang RPC client for couchdb and found following interesting facts.
                        Http is almost 3 times slower than RPC and 6-7 times slower than co-located client (client and couchdb running on same beam process).
                        Details
                        -------
                        RPC
                        runtime=20 wall_clock=280 microseconds
                        runtime=10 wall_clock=313 microseconds
                        runtime=20 wall_clock=368 microseconds
                        runtime=20 wall_clock=402 microseconds
                        runtime=20 wall_clock=445 microseconds

                        Http
                        runtime=80 wall_clock=781 microseconds
                        runtime=80 wall_clock=819 microseconds
                        runtime=80 wall_clock=804 microseconds
                        runtime=80 wall_clock=784 microseconds
                        runtime=80 wall_clock=798 microseconds

                        Tuesday, January 19, 2010

                        IS Google Chrome the Next Firefox

                        I am a fan of Firefox and I have been using since 2004 end, but I have little concern or thought on Firefox and its future.
                        Firefox is lacking behind Google Chrome in following area
                        1. Javascript speed
                        2. Implementation HMTL 5 web form (though opera leads)
                        3. HTML5 websocket
                        4. More HTML5 related...
                        Javascript Speed, this is well known fact that V8 javascript engine is leader in this space but actually Safari is king in javascript handling
                        HTML5 Webforms :
                        Actually HTML5 did bring new things in many areas but it is split into web forms, protocol etc what matter is "after effect" of html5. For example, in the text field "watermark" like implementation using most concise JQuery needs around 500 lines of JS code and few lines CSS. So what is the problem? My point may be sounds naive but still valid in the Internet scale application.
                        1. Bandwidth saving
                        2. Browser performance -- no need to download and it knows how to handle effectively since it is natively compiled into browser engine
                        3. Development effort --- it is somehow shifted to browser developer but it is one time cost
                        4. Webforms makes very semantic browser knows what type of input and for ex. iPhone like touch based device may throw relavant virtual keyboard etc
                        HTML5 Websocket:
                        Firefox has code in its trunk and waiting to be blessed by reviewer. It is more than an year (I guess) here is the bug ref. So what is happening?
                        Obviously firefox is lacking for the reason and it is clearly good thing for Google Chrome.
                        Hm... I started using Google chrome when google debuted its chrome browser. And firefox moved to my second most used browser list and conceding its pole post to Google chrome. But change is necessary to keep things evolve...


                        Sunday, December 20, 2009

                        Avatar the must watch movie of life

                        I have been tracking the Avatar's progress for one reason -- James Cameron, the director of Terminator and Titanic and he was telling that he has been waiting for 15 years for technology to mature. What else you want? This is must watch movie obviously. I wanted to watch in 3D and yes I did it and I just lost in Pandora -- the planet where human invaded and trying to get the precious element. Story, well, you never need one for such a visual treats. You need to watch, watch, watch so many times to enjoy the beautify of characters and places. Wow, its spellbound. I watched on normal 3D and planning for IMAX 3D. Thanks Cameron for such a wonderful movie.
                        These are the items I liked in the first time....
                        1. 9 feet tall humanoids which express emotions cleanly on screen
                        2. Beautiful forest
                        3. Floating mountain and mountain in general
                        4. Big huge tree
                        5. Glowing things in the nature which is brilliant
                        and technology which brings above all.

                        I some how felt the characters and nature in this movie draws me back to Indian epic Ramayana.

                        Tuesday, December 15, 2009

                        Websocket client

                        I am looking for Websocket client, these are my requirement.
                        1. Flash is painful it needs one more server running on port 883 and it will always first hit that port to get the policy file and it is not configurable however it will try to origin port next time to get policy file. What a mess!!! So I don't want Flash based solution.
                        2. Java applet --- may be ok and it is also one of the ubiquitous run time and most client machine should have Java installed.
                        3. I am targeting just 2 browsers (hmmm... not exactly) IE (7, 8 and 9 -- jus kidding) and Firefox. Is it possible to use proprietary browser API to work around? Safari and Chrome already supports websocket, Safari is expected to support websocket anytime soon.
                        Please post you comment, if you have any solution in your mind.

                        Saturday, December 12, 2009

                        Firefox leaning towards Microsoft

                        It is well known that Google is contributing 70-80% of the Firefox's revenue but after Chrome browser Firefox became restless. It talked inline with Microsoft about Google's Chrome Frame for IE here is more. Firefox also talked about Bing and telling it is better in terms of handling privacy. Firefox also started slowing down some of the new Html5 features like Websocket and other form elements. Websocket has been completed and lying at the whim of review board. It shows symptom of IE team and leaning towards MS side. Will Firefox be bought over by MS? May be atleast we can expect some movement from Firefox towards MS, smells like MS is enemy of Google and for Firefox?

                        Friday, December 11, 2009

                        Erlang Websocket on Mochiweb

                        After long sleepless night and past two days of continuous work, able to run Websocket on Mochiweb. This is going to be checked into Erlwebsockserver. I really welcome folks to try out on Google Chrome which is the only Browser, apart from Firefox --- which has Websocket in its trunk waiting for review borads blessing.

                        Thursday, December 03, 2009

                        Google and it's DNS

                        Google public DNS
                        Google is known for making things (read web) fast. It tried with Google Chrome and it worked well. It’s minimalistic design in it’s various application also helps its peculiar but good indent of making web fast. Today I came to know about its public DNS, it good idea. I configured my Macbook to Google public DNS (8.8.8.8 & 8.8.4.4) after that I try to ping google itself to seek out how quick their domain name service. Before the google DNS, my ping latency was 27-35 msec, after I changed to goole DNS it became 80-120 msec. There are other factors which influence the ping latency basically I can’t trust AT&T’s U-Verse connection. I had many a times issue with slow speed and latency in the past. These are the minor thing but my major point of this posting is “How Google is going to exploit its DNS service?”,
                        Here is what I think,
                        Google is going to track which site user is actually visiting by logging DNS resolution request
                        It was initially the search being tracked, I once talked about URL is dead, but people still used to go to site which they frequent every day like twitter/facebook/yahoo etc and it also gives google opportunity to track everything. Yes everything and it is “the” data which is precious element to target adds and augment their application
                        On the otherside,
                        Google can identify fishing site and warn user
                        Track the profile of the web site and rank it based on multiple factors
                        Track the information which user is hunting through visiting the website
                        Can provide tiny url kind of service easily
                        It can provide application developed on google cloud (google app engine) a public access through its DNS and make cost effective etc
                        So Google is everywhere.

                        Friday, November 06, 2009

                        Load testing using tsung

                        I am trying to use tsung as load testing tool. It is written in Erlang and got advantage of spawning concurrent process easily and so it is best fit for this kind of simulation.
                        1. I wanted to test CouchDB Multimaster setup and to know how replication can be used reliably in real world scenario.
                        2. I also want to test HA proxy's TCP based load balancing using CouchDB's native client

                        Saturday, October 31, 2009

                        running erlang emulator shell as root on mac

                        I wanted to run couchdb under emulator but the problem with erl emulator is, it is not inheriting or obeying sudo command. I didn't plan well before installing couchdb so that it could run as logged in user. So I tried something like below to make it work on my macbook OS X (10.5.8)
                        1. sudo bash
                        2. set ERL_LIBS
                        3. export it
                        4. erl
                        Actual steps are
                        1. sudo bash (OR) sudo su
                        2. ERL_LIBS=/usr/local/lib/couchdb/erlang/lib --- path where couchdb is installed
                        3. export ERL_LIBS
                        4. echo $ERL_LIBS --- to verify the var is set properly
                        5. erl It worked finally...

                        Saturday, October 24, 2009

                        Native Erlang Interface to CouchDB

                        Http Client
                        In my application I am using couchbeam as erlang client utility. It is under heavily developed and improved by benoitc. It is one of the excellent http based couchdb erlang client.

                        Native Client
                        There is an interface which sits along with couchdb binaries called hovercraft. It looks like not maintained by its developer and it was not working as it is not retrofitted to new couchdb changes. I fixed those things by forking it (http://github.com/sendtopms/hovercraft).

                        Performance difference
                        It is native erlang client. So compare to any other http based erlang couchdb client it has advantage of talking to couchdb using erlang terms. So erlang->json ->erlang serialization is avoided. In my ad-hoc testing, I just had a document in couchdb and created view and accessed it through above client.
                        Couchbeam took 6472microsec - 7331 microsec
                        Hovercraft took 994 microsec - 1057 microsec.
                        Will this # matter? It is not humanly noticeable to find the difference but when no of request increases throughput will increase with native view but need to deal with Erlang.

                        Http client has advantages over native as
                        1. Easy to loadbalance using HAProxy or nginx or Apache
                        2. it is dead easy to set up Master to Slave configuration as Load is balanced in the DB request layer so Create/Update/Delete (CUD) can easily be routed to master, in case of native client, LB can be done at front end or presentation layer, but routing to master for CUD is quite complicated if it has session association and state management, but if it is designed and architected from the start it is quite simple to model. After all, native client is 6-7 times more efficient to http based client.