webdev

Bootstrap File Example For Zend Framework

Here is some good starting file I’ve been using.
Please let me know if you think it’s good/bad/ugly/great:

<?php
/**
* Bootstrap file for zend framework
* @category zend framework tutorials
* @author Ido Green
* @see http://framework.zend.com
*/
error_reporting(E_ALL|E_STRICT);
ini_set(“display_errors”, “on”);

set_include_path(get_include_path(). PATH_SEPARATOR . ‘../library/’. PATH_SEPARATOR . ‘../application/models/’);
require_once “Zend/Loader.php”;

/**
* Required classes – if you use autoLoader you don’t need it… but it’s good to see what you might want to use.
*/
Zend_Loader::loadClass(‘Zend_Controller_Front’);
Zend_Loader::loadClass(‘Zend_Config_Ini’);
Zend_Loader::loadClass(‘Zend_View’);
Zend_Loader::loadClass(‘Zend_Session’);
Zend_Loader::loadClass(‘Zend_Log’);
Zend_Loader::loadClass(‘Zend_Controller_Request_Http’);
Zend_Loader::loadClass(‘Zend_Debug’);
Zend_Loader::loadClass(‘Zend_Auth’);
Zend_Loader::loadClass(‘Zend_Db’);
Zend_Loader::loadClass(‘Zend_Db_Table’);
Zend_Loader::loadClass(‘Zend_Registry’);

Zend_Session::start();

require_once “Zend/Session/Namespace.php”;
$consumer = new Zend_Session_Namespace(“consumer”);
Zend_Registry::set(‘consumer’, $consumer);

$config = new Zend_Config_Ini(“../application/config.ini”, “dev”); // have dev,qa,staging and prod for your own… life.

// setup database
$db = Zend_Db::factory($config->db->adapter, $config->db->config->toArray());
Zend_Registry::set(‘config’, $config);

Zend_Db_Table::setDefaultAdapter($db);
Zend_Registry::set(‘db’, $db);

require_once “Zend/Log/Writer/Stream.php”;
$writer = new Zend_Log_Writer_Stream(‘/tmp/our-project.log’);
$logger = new Zend_Log($writer);
Zend_Registry::set(‘logger’, $logger);

$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(‘../application/controllers’);
$front->setParam(‘noViewRenderer’, true);

if($config->staging) {
$front->throwExceptions(true);
}
else {
$front->throwExceptions(false);
}

$front->dispatch();
?>

Standard
Business, JavaScript, webdev

Chrome Extentions – IMHO, Very Cool Technology

Last week we had our 2nd FedEx day here at High Gear Media HQ (yes – we like to think big like Google, Yahoo and Atlassian). So we gave our developers lots of good pitza (tradition is tradition!) and some choose to hack on a new iPad application that we are going to ship soon. Some others, choose to check out the new Chrome App Store (or in its current status – chrome extension).

It was an excellent 24h and I hope we will have the video soon on youTube.

Here is the first chrome extension that took me less then one hour! It’s very cool that Google choose to take all the skills that any web developer will have (HTML, CSS, JS) and build their concept around it. When you take the new goodies that HTML5 is giving you (check this html5rocks for all the amazing capabilities) and you think that this new app store will be the way to users to install applications on their chrome OS ‘iPads’ – you start to see the huge potential.

Here is the 2nd extension that let you set your own car and get news/recall alerts on it. Cool, no?

We have some more ideas and with local storage, Geo location and other great HTML5 features we will ship some more extensions to the table. Our new APIs let us build these applications very quickly. I hope that we will be able to open most of them to the public so others could build on top of them. For now, if you feel like hacking on the best automitive API that is out there… try:

Something like: http://feeds.highgearmedia.com/?tags=sport – to get all the ‘sport’ information that we produce. Or http://feeds.highgearmedia.com/?tags=prius if you own one.
Of course you can change the ‘prius’ with any make-model that you own and still get all the content for that. If you are into ‘Green’ and want to check what is the new progress with specific model you can use: http://feeds.highgearmedia.com/?tags=camry,green

All these will bring you feeds (ATOM) that you can consume easily. Enjoy.

What is FedEx day?

This is our version of Google 20% time to work on ‘cool/new’ stuff.

The Goal
We are coming to the office early on FedEx day and ship something over one day of work, hence Fedex Day – “We deliver”.

The Rules

  • From 8.30 to 9 we brainstorm everyone’s ideas of what could be done, and developers sign up for tasks.
    This can be around a ‘theme’ or a bigger idea/project we want to push.
  • Developers can either work alone or in pairs.
  • The development task must be something “out of the ordinary”. This is hard to define – but basically the spirit is that you can’t do something you would normally do. It’s a chance to attack all those “I wonder if XYZ would work… “, “It would be nice if we could… ” small development tasks that always get pushed off in the heat of battle.
  • The development task must be deliverable in one day. This doesn’t mean it has to be finished, polished and shipped (although it’s awesome if we can get there), but it can’t be an “open engine”. It must do something and work to some extent. It must show enough promise that we should continue working on it, or can it.
  • Pizzas/Drinks are ordered in, support is handled in advance and all other assigned tasks are obviated for the day so that developers have nothing to do but code.
  • At about 5.30, we’ll meet up for a “show off” meeting where developers get to show off what they’ve done, combined with chocolate cake and beer.
Standard
Sport

Mountain Bike and Flow and Rytem

Great ride in a wonderful place…

Standard
Business, life

Israel, R&D, Innovation and startup nation

Standard
life, Sport

Weekend Ride To Mount Hamilton

Yep – we climb this mountain from both sides…

It was hot day, so the second climb was much harder.
You can see more details and even see the ride in 3D (if you have Google earth).

Mt. Hamilton from both sides

Mt. Hamilton from both sides

Mt. Hamilton from both sides
Standard
Business, life

Do Bankers Cheat More Than Politicians? (yes! 2 to 1)

Dan Ariely research and books are excellent! I’ve just finishing his second book “The Upside of Irrationality”.
Here is a short example to the wonderful world he is clearing for us:

Standard
life

A Good Example to an Elevator Pitch

Very nice idea… As for this start up, I’m not sure what will be their revenue stream since this space is:

1. Crowded like crazy. The big guys are there (google, yahoo local, yelp etc’) and some cool start ups like Techcrunch 50 winner – RedBeacon. They are doing the same.

2. Local is very hard because it is a pure tail game. Even if they will try to focus on the 5 biggest cities in the USA first, it is still very hard to build an index and have a community to put comments/reviews/thumbs/scores on all these little business.

We will see…

Standard
Business, webdev

New Data Stack Workshop: Building A Scalable Internet Datacenter

Here are few notes I took during yesterday conference in Stanford. The organizer (=Accel) did a very good job in bring some of the leading minds in the new emerging field of ‘Scalable’ and ‘Cloud’. Right… all of the speakers were ‘Accel companies’ – but they are the one who pushing the technology forward – so we cool with that.

The first company was NorthScale (and their chief architect is the same guy that we helped a year ago – with some real world data from high gear media servers). They have a very impressive open source project – Membase What is Membase you ask? Well, “Membase is an open-source (distributed, key-value database management system optimized for storing data behind interactive web applications. These applications must service many concurrent users; creating, storing, retrieving, aggregating, manipulating and presenting data in real-time. Supporting these requirements, membase processes data operations with quasi-deterministic low latency and high sustained throughput.”

In a nutshell:

  • Membase it’s like memcached but better.
  • Simple – get/set works with memcache client.
  • Fast – ram, ssd and disk layer.
  • Predictable latency.
  • Availability – All nodes are created equal.
  • Replication between data centers.

The second company was Cloudera – The bring to the table a full stack of Analytical Data Platform (ADP).

  • It’s not only a map/reduce solution but the full stack of ‘watching the wheels moving’ and understanding where you want to steer them.
  • BI is science for profit.
  • View of the world / answer question to make money
  • Pose hypothesis and validate them.
  • A/b testing – feeding the business with real world hypothesis and their verifications.
  • HDFS and map/reduce
  • Jim gray – ‘fourth paradigm’
  • HBase – base on google bigTable.
  • Hive – SQL intercede for Hadoop.
    What is Hadoop? Hadoop is the popular open-source implementation of MapReduce, a powerful tool designed for deep analysis and transformation of very large data sets
  • A good paper from Google: “The unreasonable effectiveness of Data’
  • Beautiful data – buy the book.

Last (for me) was Facebook. Here the story is very simple… scaling from 4-5M in 2006 up to 400M now is putting some challenges on the development team.

  • Scaling to 400M (efficiency is taking a hit at the beginning)
  • Need all the data all the time.
  • You / 100 friends / 100 objects-friends = 10’s of possible objects.
  • Web Server / memcached / MySQL – and make sure you can replicate boxes in each layer without any changes to your code.
  • Testing – Testing and some more unit testing, A/B Testing, System testing… you got the point.
  • Push a new version every week. Don’t let your software ‘get old and stick’.
  • Monitor EVERYTHING and when there is a problem always do what every you can in order to understand the root cause. Yes – even after you fixed it and everything is working now.
  • No single point of failure (sometimes – your software will be the single point of failure).

Overall, it was very productive 3h that will make us try few new opensource projects. Good times.

Standard
JavaScript, webdev

jQuery 101 – Quick Good Presention with Examples

I saw this one few days ago… very cool pretension that will give you the power of jQuery in less then 5min.

Like the best things out there. Their power is lay in a simple philosophy they are based on. In jQuery case:

1. Find some DOM elements. For example: $(“p”)

2. Do something with them. For example: $(“#myDiv”).html(“<h2>Yo yo – this is very impressive bike</h2>”);

The power is the simplicity and the way you can chain functions. Example: $(“#myDiv”).html(“foo bar!”).fadeIn(slow); <– yes, this will make the addition fading into the screen in a nice slow animation. Try to think how many lines of JavaScript you need for that. There are lots of other goodies in the pretension – so give it a ride.

Last but not least (for every developer, designer and well… human) – coffee. I know some will say Starbucks is NOT coffee. But nevertheless, this ‘poem’ on the cup got my attention. As we know, it’s not about YOU…

You and starbucks

Standard
Business, life

How much are these Apples?


Great video that show you how to world has change and a lot of people are evaluating everything just by the ‘packaging’ and the ‘fancy’ descriptions.
What a real life examples? go to Draegers and then just go to Trader Joe’s – for the SAME cheese you will pay in Draegers… much much more.

Standard