Curious Rami

Entries categorized as ‘Blogging’

Fire At Park Victoria Building – 1333 South Park St - Halifax

September 3, 2007 · 3 Comments

At 4:20 AM this morning, I spent 5 minutes in my bed trying to figure out whether the annoying sound was my alarm clock or my cell phone. Eventually, I realized that it was the fire alarm! So what, the fire alarm goes off regularly in my building, however, the last time we had a fire was December 2006. So this time it is probably be a false alarm, right?

I took a quick peak outside my bedroom window. Well, well, well! There was a big scene down in front of my building. There were at least 6 fire trucks with their flashy red lights. Many people were already down with more coming out every few seconds. My building has about 400 apartments with an average of 2-3 people per apartment. I am guessing there are at least 1000 residents in my building.

I believe in the wisdom of the crowd, so I decided to head down immediately. I washed my face, put on my jeans and jacket and headed out. My building has 3 exits on each floor, one in the middle and one on each side. I tried the middle one, and it was full of smoke, it did not help that I took a deep breath as I opened the door to the stair way. Well, that sucks, this is the real deal!

I ran to one of the other exits, and it was clear. I got down fast. I survived!

The fire was on the fourth floor. I did not see an ambulance so I am hoping nobody got hurt.

The whole thing was over by 5:45 AM.

It is now 6:20 AM, so back to bed.

Categories: Blogging

Save the penny or leave the penny?

August 7, 2007 · 1 Comment

Today I was very disappointed to learn that my evil plan to get rid of over 1,000 pennies is going to fail miserably. Over the past few years, I collected over 1,000 pennies. My plan was to take all the pennies and buy something with them and enjoy the look on the cashier’s face while attempting to count the pennies. I thought that cashiers are obligated to take all the pennies. Well, I was wrong, according to a CBC article titled Save the penny or leave the penny?

In Canada, the Currency Act says, “A payment in coins … is a legal tender for no more than … twenty-five cents if the denomination is one cent.” No one is legally obligated to accept more than 25 pennies at a time.

Here you can find the Royal Canadian Mint Act and the Currency Act and the limits on all coins.

There goes my evil plan :(

I look forward to a Canada without the penny.

What do you think?

Categories: Blogging · Business

Voldemort killed Hermione and Snape killed Hagrid

June 22, 2007 · 2 Comments

I am not sure if this story is true or false, however it makes a point that everyone in your organization should be informed about the dangers of the internet and should be trained to spot and avoid hackers’ attacks.

The attack strategy was the easiest one.

The usual milw0rm downloaded exploit delivered by email/click-on-the-link/open-browser/click-on-this-animated-icon/back-connect to some employee of Bloomsbury Publishing, the company that’s behind the Harry crap.

It’s amazing to see how much people inside the company have copies and drafts of this book.

http://seclists.org/fulldisclosure/2007/Jun/0380.html

Categories: Blogging · Engineering · Project Management · Software · Work

Truemors Goes Public

May 13, 2007 · 3 Comments

Today http://www.truemors.com/ went public. Truemors is an interesting website where you can post rumors using SMS, email, or phone. You don’t need an account to post anything.
I gave it a try ( http://truemors.com/?p=563 ) and gave myself a score of 4 by deleting the Truemors cookie (I feel like a dirty spammer, just couldn’t resist to try, sorry Truemors.)
Here is a screenshot of my experiment (I am on top):
Truemors
Truemors already implemented the tough features (SMS and phone); the next step should be to add optional signup with the ability to monitor friends and groups. Truemors main man is Guy Kawasaki (http://blog.guykawasaki.com/ ; given Guy’s status in the web2 world, the expectations are super high. Good luck Guy.

Categories: Blogging · Startup · Web 2.0

In Memorial of the Tire in the Tree

May 2, 2007 · 8 Comments

On May 1st 2007, the infamous tire in the tree in Bedford, Nova Scotia, Canada (highway 102) disappeared. Please take a moment to remember the tire in the tree.

Bedford Tire in the Tree

 Update May 19 2007: The picture above is taken from: http://www.facebook.com/group.php?gid=2330994504

Categories: Blogging · Life

Learning CakePHP Step 1

April 22, 2007 · 13 Comments

This is a tutorial on how to design a website from scratch using CakePHP. To make the tutorial useful and challenging, I decided to clone an existing web application. One web app that I visit every day is http://news.ycombinator.com/. Y.News is a great resource for startups and it is based on Reddit.com.

To accelerate the development cycle, I copied Y.News’s .css file and HTML structure.

All that is left is the dynamic code (php) including database connection, user authentication, etc…

I first started by designing the database and followed CakePHP naming conventions. I have four tables: users, sites, comments and votes. ‘Users’ has many sites, comments, and votes; and ‘sites’ has many comments and votes.

Then I ran cakePHP’s bake.php to build the default models, controllers, and views.

Then I designed the website structure:
/sites/newest
/sites/best
/sites/submit
/sites/view
/users/add
/users/login
/users/view
/layouts/default
/errors/error404

To make the website more efficient, I added two fields, commentscount and votescount, to the sites table and updated those fields every time a new comment or a new vote is added. This saved me two additional JOIN queries.

Then I deleted all unnecessary model relationships, controller functions, and views. Most importantly, is deleting unnecessary model relationships, for example, the relationship between the votes table and the sites table is no longer needed after adding the votescount field to the sites table. Deleting relationships saves you a JOIN query.

Sometimes you will be forced to add a JOIN query. For example, /sites/view displays one site and all related comments, to show the username of the comment submitter, you will need to add a new query:

Sites.*, Comments.*, Users.username AS Auther FROM Comments INNER JOIN Users ON Users.id = Comments.user_id LEFT OUTER JOIN Sites ON Comments.site_id = Sites.id WHERE Sites.id = ‘. $id

This website was built in 4 hours; that is a lot given that this is a simple website. CakePHP is awesome if you are familiar with the API, if not it might be a bit frustrating to learn it all, but trust me it is all worth it. For example, to display the time elapsed since a site was added, you could use: $time->relativeTime($site['Site']['created']), now that is awesome!

Here are few screenshots and the source code:

reddit-1.gif

reddit-2.gif

reddit-3.gif

reddit-4.gif

Code:cakephp-tutorial-projectrar.pdf (right click, save as, rename extension to .rar)

SQL: cakephp-tutorial-projectsql.pdf (right click, save as, rename extension to .sql)

Categories: Blogging · CakePHP · Software · Startup · Web 2.0

Science Hack Making Science Cool… With Videos!

April 14, 2007 · No Comments


sciencehack.com

I’ve been collecting science videos since forever; any video that is physics, chemistry, space, biology, math… My “favorites” folder was getting pretty big, so I finally dedicated some time to put all those science videos in one accessible place; Science Hack. Science Hack is my new blog. I will use it to bookmark all the cool science videos that I find. Eventually, I want to go beyond videos, with some longer and more detailed posts. If you find a cool science video, leave a comment here or on Science Hack, and I will post it and link to your blog or website.
science hack

Visit Science Hack and let me know what you think, how can I improve it and make it more useful.

Categories: Blogging · Engineering · Science · ScienceHack

GOOD Magazine: Nuclear Weapons Transparency

March 17, 2007 · No Comments

Here is a scary thought:

Categories: Blogging · Science