Sunday, 27 January 2013

Bad week for learning

The post title more or less says it all.

I have made absolutely no progress with the Database course I am signed up for this week. I only have two quizzes and some practical work to complete for tomorrow.

If they weren't all online, I'd log off the net to avoid distractions - like email, facebook and twitter.

A cuppa, a bacon sarnie then time to do the work.

Sunday, 20 January 2013

A nice treat

I was taken out last night for an early birthday meal, always a very nice treat.

We went to Thai Central on Ocean Road in South Shields.

The only regret I have about the meal is that I didn't take a picture of the food before we piled in and demolished it.

The food was extremely well presented, and very, very tasty.  We'll definitely be coming back for another visit.


Friday, 11 January 2013

Busy night

For some time Heron and Hymn have been saying we should have a night a week to practice something.

The main problem is my lack of guitar skills (we're not going to comment on my singing tonight).

On my other blog I have started commenting on my progress with the Guitar Smith game. Lynn was singing along to the track I'm trying to earn enough points to qualify (and although there is an option to reduce the qualification barrier, I'm refusing to use it).

As well as singing, Lynn has been quite productive and has written a short story based on an earlier discussion, and is well underway with a second one.

I was going to head to bed (it's just passed midnight here in the UK), but don't want to disturb the creative juices.

I've just realised I haven't finished my glass of wine either. So no driving for me before 9am then. Not that I was even planning on getting out of bed before then.

Sunday, 6 January 2013

23 Things in 2013


I've just been reading John Anealio's blog entry 'Will you take the “23 in '13”Challange?'.

I have decided to give it a go, but instead of 23 items in a single theme, I am going to do a bit of a mix and match on the challenge.

I do have some specific things in mind, though.
  • Spend more time learning the guitar (sorry neighbours!) and get to the point where I can reliably play a number of songs
  • To do a public performance of my guitar work as part of Heron Hymn (with North East Live first, because I promised Angie she'd get our first public performance)
  • To record and publish on Soundcloud some of the songs I have learned
  • To plan and write at least the outline of a novel (and I have started on this, but only just)
  • To complete my laser fence prototype, and create a custom PCB and have a permanent version of the game
  • To get at least three dynamic SaaS style websites to an operational level
  • To blog at least once a month for the year (but this will only count as one of the 23 items)
I was tempted to have read more, but as I have already finished half a dozen books this year already and finishing 23 books this year would not be a significant challenge!

Sunday, 2 December 2012

Test Driven Design and C++

One of my long term projects is to build a simulator for a 6502 custom hardware device that will run on OSX, Windows and Linux.

I have been using Codeblocks and wxWidgets, and was wanting to have the same project be able to compile for all three platforms, ideally on the same machine.

It should be possible, I have successfully compiled under linux for both Windows and Linux on my (sadly departed) Linux laptop (and on a VM on the mac), but needed to compile the OSX version separately on my macBook.  At the moment I'm happy enough with that, but intend to spend a little time seeing if I can get the Windows and Linux versions compiling under OSX too. But not in the immediate future, I currently have too many part finished projects under way.

My aim is to have the cpu libraries working with the tdd structures, so that I know when I manage to break some essential functionality. I am trying to make the difficult decision to either rewrite from scratch, applying some of the design patterns that I've been reading about this summer, or to hack the tdd into the existing design.

I could do with a couple of months somewhere with no distractions to get some of these projects a little closer to completion.

The projects include:

  • The 6502 simulator
    • Comprising a library for a virtual 6502 cpu
    • The controlling general purpose simulator
    • A hardware specific simulator (although the urgency for that has disappeared, the hardware developer I was working with is no longer interested in the project)
  • Learning C# (a little difficult, my VM's run way too slow to be effective on the macBook)
  • Learning Android - and getting to grips with Java
    • I have two or three little apps I will be building
  • Working on my Ruby on Rails skills
    • And building an api for Android to access the app
  • Working on Python
  • Working on PHP
  • Finishing the hardware for my laser fence


Monday, 21 May 2012

Configuring CakePHP for an OSX local install


I am currently learning some of the technologies involved in building web based applications, following ideas from the Software as a Service course.

Currently I'm looking at PHP and the CakePHP frameworks.

Obtain the source

Download and unzip the package from the CakePHP website
Rename to a suitable folder, I have put mine in Sites/ScoutCamp.

Set up Apache

Edit your sites file sudo nano /etc/apache2/users/username.conf
   Options FollowSymlinks
   AllowOverride All
   Order allow,deny
   Allow from all

Restart apache sudo httpd -k restart and open a browser to your shared pages.

Lots of errors and messages

First time I fired up the browser I thought “Oh dear me” or at least something along those lines.
Unlike my trial of Ruby on Rails, there were loads of errors and configuration changes that were required.

I have solved most of the problems, but still have one left to suss out.

Timezone settings

In app/Config/core.php there is a line (it was 232 on my build)

   //date_default_timezone_set('UTC');

Uncomment and set to your timezone - Newcastle is in the same timezone as London.


   date_default_timezone_set('Europe/London');

Unable to write 'cake_dev_en-us' to File cache

The app/tmp folder needs to be writable by the web user.
To find out who this is, add the following bit of code to app/View/Pages/home.ctp


   


On my system, the web user is _www, so change the owner:
   sudo chown -R _www app/tmp/

This cleared up all the errors above the title.

Please change the value of “Security.salt” and “Security.cipherSeed”

In app/Config/core.php find the lines and change to a more suitable value. I used sha1sum to generate the salt, and pasted for the salt. The Seed I just typed a few numbers at random.


   df  | shasum

Setting the database connection

You need to create your database using mysql (there are other options, but that's the one I went with).

Copy database.php.default to database.php and add your user and database details. Note that for some reason, OSX will not work user localhost (and that took a day to track down).

   public $default = array(
      'datasource' => 'Database/Mysql',
      'persistent' => false,
      'host' => '127.0.0.1', // Note change from localhost
      'login' => 'ScoutCamp',
      'password' => 'yourPassword',
      'database' => 'ScoutCamp',
      'prefix' => '',
      'encoding' => 'utf8',
   );

URL Rewriting

This is the only bit I haven't worked out yet, but I want to make a start developing my site and will come back to this.



Saturday, 19 May 2012

Administrating a mySQL database with phpMyAdmin

Just a quick gotcha for OSX, mySQL and phpMyAdmin.

I had successfully set up mySQL and secured the default accounts with passwords. Although shipping a product without passwords may be thought of as a security hole, it is just as bad as shipping with a default password.

Downloaded and installed phpMyAdmin onto the macbook and configured according to instructions. 

Did it work? Did it heck! 

After a while googling for answers, I read through another install guide (although for Lion not Snow Leopard) and found this gem: 

Edit config.inc.php using your favorite editor (I prefer vi) and change$cfg['Servers'][$i]['host'] = ‘localhost’; to $cfg['Servers'][$i]['host'] = ’127.0.0.1′;*Well it sounds stupid because localhost and 127.0.0.1 are same in networking world but phpMyAdmin won’t let you (At least me) log in without this change and keeps throwing error “#2002 Cannot log in to the MySQL server”
This is one of the classic IT gotcha's: two things that are supposed to give the same result don't. I'm almost tempted to see if it is the same on a linux machine, but don't want to get diverted.

Next steps will be to start reading up seriously on PHP MVC frameworks - I'm currently looking at cakePHP.

I really can't remember how we did this stuff before the internet was available, and many of the younger developers probably can't imagine the idea. Perhaps that is why I have a largish collection of computing books going back to VB5 and Access 2 in my bookshelves. Although that could just be because I hate to get rid of books.