So there is a concept car from http://www.imoconcept.com/ and the idea is basically copy a lot of apple current tech and past tech and combine them into one vehicular design. the name is funny even though its poking at the
“i” in apples “i” line an Mo short for motors. In Japanese imo means potato.here are some shots of what they have come up with as far as concepts. i’m thinking since its supposed to be out in 2024 its all electrical. They love apple so much their site design even mimics apples current site. funny indeed.
the apple iMo…
Tags: apple, apple cars, Apple iMo, apple motors, Art, Creative, Design, iMo, Seriously?, something like apple, strange, WTFfizz buzz test.
I ran across this post on reddit.com about some developers who have had some school learnins’and things, they couldn’t even do a fizz buzz question. Now I never heard of this so I decided that I write up some thing that did it. I wrote it up in php and javascript. the javascript portion wasn’t tested though. HA
here is the question they asked on http://www.codinghorror.com/
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
kinda simple I guess. all in the modulus i spose.
php:
echo "<pre>";
$i = 1;
while ($i < 101) {
if($i % 3 == 0 && $i % 5 == 0) {
echo '--FizzBuzz'."\n";
}
elseif($i % 3 == 0) {
echo 'Fizz'."\n";
}
elseif($i % 5 == 0) {
echo 'Buzz'."\n";
}
else {
echo $i."\n";
}
$i++;
}
echo "</pre>";
javascript:
for(i=1; i<101; i++) {
if (i % 3 == 0 && i % 5 == 0 ) {
document.write('FizzBuzz
');
}
else if (i % 3 == 0) {
document.write('Fizz
');
}
else if (i % 5 == 0) {
document.write('Buzz
');
}
else {
document.write(i + '
');
}
}
Zend Framework, Subforms and organization
Tags: group subforms together, multiple subforms, zend, zend frameworkRecently I have been tasked to organize some form fields into nice columns. Normally you would use display groups. Since you really can not nest display groups, subforms were the answer. I have split my elements into 2 different sections and w/in these sections are basic incarnations of forms at the basic level ( utilizing the init() and extending Zend_Form() ). w/in each form I have many elements and display groups.
so in a nut shell here’s what i have,
$left = new Zend_Form_SubForm();
then you add the subforms you want inside of this "subform"
$left->setSubForms(array(
‘sub1′ => $sub1,
‘sub2′ => $sub2
));
you do the same thing for the other subform you want to add decorators to.
$right = new Zend_Form_SubForm();
$right->setSubForms(array(
‘sub3′ => $sub3,
‘sub4′ => $sub4
));
then to your original form you add these new "$left" and "$right" subforms
$this->setSubForms(array(
‘left’ => $left,
‘right’ => $right
));
you can then apply decorators to the "$left" and "$right" subforms as you see fit.
since i want to drop the fieldsets that encapsulate the elements inside mine looks like this, you do the same to the other one.
$left->setDecorators(array(
‘FormElements’,
array(‘HtmlTag’, array(‘tag’ => ‘div’)),
));
If programming languages were written as essays
Tags: awesome, funny, programming
now here’s my take on the Zend_Navigation and routes. Normally you can set a resource class to do this, but I rather do it in the bootstrap. kinda the same thing in my opinion, i decided not to use a xml config but a ini config type, this way you don’t have to worry if your tags are closed properly. if it works for you awesome.
protected function _initNavigation() {
// set up navigation
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/navigation.ini','navi');
$navigation = new Zend_Navigation($config);
$view->navigation($navigation);
return $view;
}
protected function _initRoutes() {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/navigation.ini', 'routes');
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$router->addConfig($config,'routes');
$front->setRouter($router);
return $router;
}sample ini file
;put routes here.
[routes]
routes.dashboard.route = "/dashboard"
routes.dashboard.defaults.controller = index
routes.dashboard.defaults.action = dashboard
;navigation
[navi]
dashboard.route = "dashboard"
dashboard.controller = index
dashboard.action = dashboard
dashboard.label = dashboard
dashboard.class = dashboard


