Tuesday, 11 February 2014

Microfabricator.com - The internets end stop

Microfabricator.com

Been building content/community sites again and my latest site is

Microfabricator.com

Microfabricator.com is a new news, forum, and social content site for the 3D Printing community. We will also be hosting the design and build of the the "Photon" 3D printer on this site.

The "Photon" is a new 3D printer design, designed to be built in countries which may not have access to sophisticated components, most of the design can be built from components available in a DIY Hardware store.

more than 70% of the structure is it self printed, so its ideal for bootstrapping.

Saturday, 20 April 2013

phpugph 2013 developer sumit


Im speaking at the PHPUGPH 2013 conference here in Manila

This post is really just a placeholder so that I can attach the PDF of the conference slides, the talk I'm giving is an introduction to MongoDB for PHP programmers.



Monday, 3 December 2012

Bare arduino board works

Finally got my bare Arduino board up and running, Its was supposed to have a ZIF socket on it as its primary purpose is as an ATMEGA328P programmer, but I screwed up and accidentally bought a 24pin socket instead of a 28pin socket.

But it works, and I can upload sketches via the FTDI socket.


Im working on a Function generator using a DDS chipset, learning how to drive a 1602 LCD and a keypad using a  74HC595 shift register, and a hacked version of the "new LiquidCrystal" and the "Keypad" libs, Im trying to use the same 74HC595 to provide not only a 3wire interface to the LCD panel, but to provide the column strobes for the keypad, hopefully I will be able to get the whole UI interface to work using 6 i/O pins, leaving 7 left over to manage the DDS chip, and provide output for a programmable output stage and variable gain control. 

Im also looking at using the setup to provide a "wobbulator" capability, but Im not certain if I can sweep the DDS through its frequency range fast enough to make that useful enough for anything more than audio work. It will also need to provide a very stable linear DC coupled output to provide the Y sweep voltage output for the oscilloscope. 

But anyway it will make a nice compliment to my shiny new RIGOL DS1102E Scope, which is fantastic. and makes building stuff like this a doddle, you cant underestimate the value of being able to directly visualize what is going on inside your circuitry. 

Saturday, 5 March 2011

Installing ElasticSearch on mac os x or linux

These instructions are specifically for Mac Os X , but they should work fine on linux too.

Download the latest version of Elastic search from here: http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.5.tar.gz The current version is 0.18.5 but a later version should be ok

Unpack the tar file in the download directory (doubleclick on the tar file) this should create the directory ~/Downloads/elasticsearch-0.18.5

open a console in the download directory and pull down the elastic search service wrapper from github.


$cd ~/Downloads
$git clone https://github.com/elasticsearch/elasticsearch-servicewrapper.git elasticsearch-servicewrapper


Now we will move the service into place


$cd ~/Downloads
$sudo mv elasticsearch-0.18.5 /usr/local/share
$cd elasticsearch-servicewrapper
$sudo mv service /usr/local/share/elasticsearch-0.18.5/bin
$cd /usr/local/share
$sudo ln -s elasticsearch-0.18.5 elasticsearch
$sudo chown -R root:wheel elasticsearch


Now we can start up the service

 
$cd /usr/local/share/elasticsearch
$sudo bin/service/elasticsearch start


You should see the following output


$ sudo bin/service/elasticsearch start
Starting ElasticSearch. Detected Mac OSX and installed launchd daemon.
Waiting for ElasticSearch...
.
.
.
.
.
.
running: PID:57767
$


Note: The pid number will be different on your system

Check the service is ok by opening up a browser on http://localhost:9200, you should see the following output


{
"ok" : true,
"name" : "Bova",
"version" : {
"number" : "0.18.5",
"date" : "2011-03-01T19:07:42",
"snapshot_build" : false
},
"tagline" : "You Know, for Search",
"cover" : "DON'T PANIC",
"quote" : {
"book" : "The Hitchhiker's Guide to the Galaxy",
"chapter" : "Chapter 30",
"text1" : "\"The chances of finding out what's really going on in the universe are so remote, the only thing to do is hang the sense of it and keep yourself occupied. Look at me, I design fjords. I'd far rather be happy than right any day.\"",
"text2" : "\"And are you?\"",
"text3" : "\"No, that's where it all falls apart I'm afraid.\"",
"text4" : "\"Pity, it sounded like quite a nice lifestyle otherwise.\""
}
}


Stopping Elastic search


use a similar command to starting as shown above.
 
$cd /usr/local/share/elasticsearch
$sudo bin/service/elasticsearch stop

Tuesday, 21 September 2010

Zend Framework, Dojo and MVC layout

Recently I had a real nasty problem which had me scratching my head for several days, I have recently started using the Zend Framework and Dojo framework together to allow me to create forms which have rich controls in them, such as calendar controls etc.

Initially all worked well, setting up a simple ZF application, Using Zend_Dojo to "Dojo" enable my forms and views all went without a hitch. For each control i instantiated in my forms the Zend_Dojo_View_Container attached to the view would automatically create all the required script and library calls needed to make sure the right components where integrated with the page. Everything was fantastic. Then I tried to apply the same approach to my actual application.

The difference between my test rig and my Application is that in most of the views in my application we deliberately disable the MVC layout, and render the pages using the Zend_Controller_Action::renderScript() method. The reason for this is that our view scripts are pre-assembled with all components preprocessed into single files per page, including all the layout elements.

Typically we use the following in the Controller baseclass preDispatch method


$layout = Zend_Layout::getMvcInstance();
if($layout) {
$layout->disableLayout();
}
$this->_helper->viewRenderer->setNoRender();


Generally my Controller actions look like this.


public function registerAction() {
/*
* Register for new account
*/
$register = new Form_User_Registration();
if (Zend_Auth::getInstance()->hasIdentity()) {
$this->_redirect('/');
} else if ($this->getRequest()->isPost()) {
// do the registration action here
// redirect when done
}

$this->view->register = $register;

echo $this->renderScript('pages/user/register.phtml');
}


However doing things this way, I discovered that none of the form dijit specifications had been injected into the Zend_Dojo_View_Container, so none of my controls rendered as Dojo rich controls.

The reason why this was happening became clear after a lot of debugging. In the conventional MVC mode, the "contents" of the page are rendered before the layout scripts are run. The form is rendered into the page contents and then the layout script is executed to create the page around the contents. However in my case the contents where executing in the same script as the layout, so the Dojo container was being output at the top of the script before the contents where rendered, hence the missing specifications.

The solution was simple, but non-obvious. change the assignment of the form to the view from


$this->view->register = $register;


to:


$this->view->register = (string)$register;


Which forced the __ToString() method of the Zend_Dojo_Form class to be called before the Controller renderScript() function executed, causing the dijit specs to be registered first.

This fixed the problem, and finally all my forms where being rendered correctly with Dojo Rich controls..

Monday, 8 February 2010

Messing around with SEO engines

Checkout a new SEO engine at http://www.gold2cashxchange.co.uk . This is an automated portal system we are experimenting with.

Saturday, 11 April 2009

Java: Bad CPU id in executable

Here is a weird one:

Recently i have been doing a lot of java work, and many of the packages I use need to have Java_HOME set. So normally
i just add this line to my /etc/profile


JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home; export JAVA_HOME


Works just fine on my Macbook, and my recent 2009 Mac Mini. However i have an older 2006 Intel Mac Mini, the older Core Duo type, rather than the newer Core 2 Duo versions. Its been out of action for a few months due to a failed Hard Drive, but recently I revived it by buying a suitable hard drive from PCWorld and attacking the machine with a putty knife. (upgrading the ram whilst i was in there).

Everything seemed to be working fine, re-installed the OS, and I took the opportunity whilst i had a virgin system to document and automate the installation of my EC2 management scripts. Everything swam along fine until I actually tried to use the EC2 management scripts where upon I got the dreaded message "java: Bad CPU Id in executable" WTF....

Googling the error did not seem to help, so back to the drawing board, and take a microscope to the machine.

I checked the target directories, they are fine, in the "versions" directory under the java framework I can see 1.42, 1.50 and 1.60. so what is happening.

The first clue is that the java preferences applet does not list the 1.6.0 version as available.... Hmm why not????

The second clue is that switching to version 1.5.0 in the JAVA_HOME statement makes it all work.

The answer is that Apple never released a 32bit version of Java 1.6, but to rub salt into the wounds they load a perfectly non-functional 64bit version onto all 32bit only boxes. Ouch...

Come on Apple, there is no reason to limit java 1.6 to 64bit only, and even if there is, why on earth load a nonfunctional 64bit framework onto 32bit machines?

Shakes head in amazement.......