wanted: crackdown on shitty advertising

October 5th, 2008

I really hate these kinds of web sites. Advertisement meets desperation. You’ve seen them all over the place. This example is fairly ok, but you get my point. If you need f*kin ads, dont put them in your text. I understand webmasters (haven’t heard that word in a long time) want to recoup some of the costs of running a site. But that doesn’t mean you need to go total yes-master/no-master.

Will google give you more money if you do it this way?

About Time-2

Technorati Tags:

Posted in Uncategorized | No Comments »

css sprite menu

June 14th, 2008

Apple.com’s menu is slick.

Looking at it closer, I realized that the whole menu is one image with all four states on different y positions.

I decided to copy that, to learn how it works. Check out my results.
My menu-state-single-file looks stylesheet

I threw in some javascript to make the divs show and disappear as well

Posted in css | No Comments »

suckerfish drop down menus scriptaculous slider problem

May 27th, 2008

Have you tried using suckerfish menus and the scriptaculous slider. If you do, you might noticed that the menu doesn’t disappear after you mouseout in IE6/7 ?

Someone found a way around that.

Posted in css | No Comments »

testing apps on vmware using localhost

May 27th, 2008

Do you run an app server locally and test against it, using localhost?

Do you also run vmware fusion/parallels to test the same app in IE6/IE7 and other browsers you don’t care to run on a daily basis?

Do you wish you could type in localhost:3000 inside the vmware/parallel’s guest OS and it would just work. Instead you have to find the IP address of your host OS and possibly change some properties files as well?

I have that problem, my app has to redirect to another app and then come back to me, and those settings are kept in a properties file. So to test in vmware, i have to change properties files, lame. I’d like to be able to browse to localhost:3000 in IE6/7 in the guest OS

You can:

  • find your host OS’s ip address. On a mac (running wireless), it’ll something like
    ifconfig -a 
    
    lo0: flags=8049 mtu 16384
    	inet6 fe80::1%lo0 prefixlen 64 scopeid 0×1 
    	inet 127.0.0.1 netmask 0xff000000 
    …..
    en0: flags=8863 mtu 1500
    ….
    en1: flags=8863 mtu 1500
    	inet6 fe80::21e:c2ff:fec4:1946%en1 prefixlen 64 scopeid 0×6 
    	inet 10.0.1.200 netmask 0xffffff00 broadcast 10.0.1.255
    
    
    In my case 10.0.1.200
  • Download apache’s soap tunnel . This is an older one, but its better because the command line version doesn’t echo to system out.
  • Copy the tunnel.jar to the vmware guest OS
  • On the guest OS, open up a command/terminal window and run
    java -cp tunnel.jar TcpTunnel 3000 10.0.1.200 3000
    
    Change 10.0.1.200 to whatever your IP address is
  • In your vmware guest OS, browse localhost:3000

Note: your host IP address might change if you restart it or have DHCP’d IP addresses. If that happens you have to start the tunnel again with updated IP.

Posted in testing | 2 Comments »

find items not rated or created by user

May 27th, 2008

We’ve been using the acts_as_rateable plugin at a client project. On a page, we needed to show items that weren’t rated or created by the logged in user.

Here’s some test tables, “videos” and “video_ratings”. Note: I’m using natural keys to make it simpler to read.

Videos
+------+------------------+
| id   | uploaded_by_user |
+------+------------------+
|    1 | tom              |
|    2 | mark             |
|    3 | tom              |
|    4 | mark             |
|    5 | tom              |
|    6 | john             |
+------+------------------+

Video_ratings:
+----------+--------+---------------+
| video_id | rating | rated_by_user |
+----------+--------+---------------+
|        1 |      5 | tom           |
|        1 |      4 | mark          |
|        5 |      2 | mark          |
+----------+--------+---------------+

The simplest query we could come up with was:

select id from videos
where not exists
  (select video_id as id from video_ratings
   where videos.id=video_ratings.video_id
   and video_ratings.rated_by_user='mark'
  )
and uploaded_by_user != 'mark'

This yields videos 3 and 6 (because 1, 5 already rated and 2, 4 uploaded by mark)
Can you think of any better/smarter query?

Posted in ruby on rails | No Comments »

tooltips

May 10th, 2008

two tooltip techniques

Posted in Uncategorized | No Comments »

first heroku app

May 10th, 2008

testslider.heroku.com Yep, its rails (what else could run on heroku :)), but no database really, just a prototype-based slider idea we wanted to use at a project.

Posted in Uncategorized | No Comments »

xslt in 2008

March 21st, 2008

I read about XSLT in a book, a long time ago. :) Does anyone use it still?

Apparently, Blizzard does on the Warcraft armory site. and it’s a pretty spiffy one too.

Check out my character. Do view source and you’ll see what I mean.

Posted in Uncategorized | No Comments »

control surfaces

February 22nd, 2008

These control interfaces are awesome.

I putted an order in for a sixty four.

Posted in Uncategorized | No Comments »

this app blows

February 12th, 2008

…in a good way. :) Cloth physics

Long time ago, I used matlab in school, to calculate heat distribution in cubes, I wish I could’ve done this kind of animation instead.

Posted in Uncategorized | No Comments »