Thursday, May 06, 2010

Ugly web pages

I don't really think this warrants more than a few words...but the question to pose is where does Google come up with such ugliness ?

Shiney buttons and window borders make our geeky eyes glaze over. However I've been in the utilitarian camp. I like things simple and functional (form follows function). I also like to give credit where credit's due.

Take the iPhone interface for example, or the Bing maps, or the ExtJS user interface, or any well designed Flex application. Shiny objects galore...

... but come on ...this is ugly.



[edit]
I am specifically and exclusively talking about the CSS applied to the textbox and buttons. They could have not applied that CSS at all; which causes the textbox to look raised, or the buttons to look rounded.

Don’t get me wrong; Form follows function; I love the utilitarian/spartan look, I understand that the speed is of paramount concern.
[edit]

Wednesday, April 21, 2010

Linux Stuff

Pasting some common things that I need when setting up my Linux environment (Ubuntu 9.04/10.04).

a. Setting up fstab to auto-mount at startup

   1: # mount partitions 
   2: /dev/sda1 /media/windows        ntfs-3g    defaults 0 0 
   3: /dev/sdb1 /media/common-ntfs    ntfs-3g    defaults 0 0 
   4: /dev/sdb2 /media/common-ext     ext3       defaults 0 0 
   5: /dev/sdc1 /media/multimedia     ntfs-3g    defaults 0 0 

b. Setting up samba shares



   1: sudo apt-get install system-config-samba 

This is by far the easiest way to setup a samba share.



c. Setting up the nfs share



   1: sudo apt-get install nfs-kernel-server 

... and on the client



   1: sudo apt-get install nfs-common

Tuesday, March 30, 2010

New Web Stack (STAR)

Trying to start a new web stack

[edit]follow link http://aphatak.blogspot.com/2010/08/star-stack.html to read and download the stack [edit]


S = SQLite (embed db and jdbc driver)
T = Tomcat (as dedicated Railo Container with SQLite JDBC driver)
A = Apache (for serving static stuff. Will try to sever this from WAMP stack, maybe)
R = Railo (cfml engine)


Off these, I have been able to take Tomcat and integrate it with Railo (this is also documented on Jamie Krugg's blog)

Remember...you saw it here first !!

Thursday, March 11, 2010

Simple things that we forget

Create a few simple classes (one extends the other)
   1: class A {
   2:     public String prop_a1 = "property a1";
   3:  
   4:     public String method_a2() {
   5:         return "return from method_a2";
   6:     }
   7: }


   1: class B extends A {
   2:     public String prop_b1 = "property b1";
   3:     public String method_b2() {
   4:         return "return from method_b2";
   5:     }
   6: }

Now test the methods from inheritance chain...


   1: class C {
   2:     public static void main(String [] args) {
   3:         A a = new B(); // this is upcasting
   4:  
   5: System.out.println(a.prop_a1);
   6:         System.out.println(a.method_a2());
   7:  
   8:  
   9:         /**
  10:         ** The following code is compile-time error
  11:         ** System.out.println(a.prop_b1);
  12:         ** System.out.println(a.method_b2());
  13: 
  14:                 C:\Java\test4>javac A.java
  15:                 A.java:24: cannot find symbol
  16:                 symbol : variable prop_b1
  17:                 location: class A
  18:                 System.out.println(a.prop_b1);
  19:                                    ^
  20:                 A.java:25: cannot find symbol
  21:                 symbol : method method_b2()
  22:                 location: class A
  23:                 System.out.println(a.method_b2());
  24:                                    ^
  25:                 2 errors
  26:             **/
  27:  
  28:  
  29:  
  30:  
  31:         B b = new A();
  32:         /**
  33:          ** B b = new A();
  34:          ** The above code is "downcasting" [I stand corrected]
  35:          * C:\Java\test4>javac A.java
  36:                 A.java:45: incompatible types
  37:                 found : A
  38:                 required: B
  39:                 B b = new A();
  40:                 ^
  41:                 1 error
  42:             **/
  43:  
  44:             B b = (B)new A();
  45:                 /**
  46:                   * Casting will compile
  47:                   * But causes a runtime error
  48:                  **/
  49:  
  50:         }
  51: }





 





[Edit]


Looking at the comments below, I feel compelled to write the reason for these snippets of code. In ActionScript 3.0, the following works in standard mode (deferred type checking)



   1: class ClassBase
   2: {
   3: }

You can subsequently create a subclass of ClassBase named ClassExtender, which has one property named someString, as follows:



   1: class ClassExtender extends ClassBase
   2: {
   3:     var someString:String;
   4: }

and finally:



   1: var myClass:ClassBase = new ClassExtender();
   2: myClass.someString = 
   3: "hello";
   4: // no error in ActionScript 3.0 standard mode

 


[Edit]

Few more: public static void main(String[] args) { int i = 10; Integer I = new Integer(10); System.out.println("I == i : "+ (I == i)); // true System.out.println("I.equals(i) : "+ I.equals(i)); // true long l = 10L; System.out.println("I == l : " + (I == l)); // true Long L = new Long((long)10); System.out.println("I == L : Compiler Error...Incompatible datatypes"); System.out.println("I.equals(L) : " + I.equals(L)); // false }

Saturday, December 12, 2009

X Over SSH - Simple, Straightforwad way to access remote Ubuntu desktop from local Ubuntu machine

I keep hunting for this command so I decided to document my process.

Ctrl+Alt+F2  

Use {F2,F3,F4...F6}

Start x display
with a simple command in Ubuntu
                
xinit -- :1 vt8 
                

Use {vt8,vt9,...,vt12}

then log in to far away machine
                         
ssh user@ip_address -X -C


-X for X Forwarding
-C for compression (don't remember the case)

once logged in use command

               
gnome-session  

this is my window manager of choice albeit heavy. You can use others from so many available!