Matt Daubneys Blog

learning

Day 3: Printers and Development

by on Jul.03, 2011, under learning, programming, ubuntu, windows

This is where I’ll slightly move away from “the average persons” tasks. Day to day I write or manage software projects, and for this experiment to continue I need to be able to do that on my laptop. Generally I work day to day using python in Eclipse with the pydev extension. This is relativley easy to get going on Windows, download a JDK, install eclipse, download/install python, install pydev. Job done. However I wanted to play with the Microsoft blessed languages, so I downloaded and installed Visual C# express as well. C# is a language I’ve had to use before, so I’m a bit rusty, but should be able to pick it up relativley quickly, and a big kudos to MS as the Visual Studio envornment is still probably the best IDE on the planet (I’m open to suggestions of others which do the job as well, but I’ve yet to play with one that does).

c# uses the .net framework to do all the heavy lifting. It’s a bit like Java in that it’s compiled into byte code and then interpreted so isn’t as fast as something like C++ but makes up for that by being easy and fast to develop in. Some of the widgets that come with the new .net framework (such as the graphing widget) are pretty fantastic and really do make life easy. In a couple of hours I’d refamiliarised myself with the language and written a short program that took in a CSV export from my Current Cost recording box and turned it into a nice graph. Doing the same using the GTK toolkit would probably take a bit longer with a little hacking around as there’s no dedicated graphing widget (that I’m aware of), so you’d have to generate the graph either on the fly by drawing it at a lower level or by creating a jpg and then displaying that in an image box.

One minor issue with the Visual Studio express suite is that there is no built in in subversioning system. At work, and most of the time at home, I tend to use the bzr suite of tools. A quick look on the bzr website and that’s also available for Windows. Download, install and it integrates very nicely into the My Computer interface, and can be called from the command prompt. Easy.

A lot of my dev work is for server stuff, so putty and winscp were downloaded and installed successfully on top of that as well.

Printers are another problem and a bit of a nightmare. I have an HP Photosmart C4180 All-in-One that I bought some time ago while I was at university. Having long since lost the driver disk for this, I nievley just plugged it in and hoped Windows would just find it as Ubuntu does. No such luck. It goes away and gives me a list of printers which mine isn’t in and then offers me the option to go to the Windows update site to find even more. I click that button and wait 5 minutes… then another 5 minutes… then it gives me a bigger list of printers. My printer is in this list (why it couldn’t just have said “We found your printer! Here is the driver.” rather than me spending 5 minutes scrolling through a badly sorted list I don’t know) and then installed it. The scanner wouldn’t work without the software from HP, but otherwise the thing worked as expected.

I have to admit, the boot time for Windows is now slowing down considerably. But my games work and it’s not overly getting in my way yet. So we’ll see.

1 Comment :, , more...

Day 2: Music and pictures

by on Jun.11, 2011, under learning, life, ubuntu, windows

All of my music and my images are backed up onto a small NAS I have at home. Simple! I thought daftly. Mount the NAS, copy the files into My Music and carry on. Again, so very wrong. Copying a single folder works, trying to copy all of them at the same time doesn’t! This is very annoying! How would I go about mending this in Linux? 3 lines of bash, or… rsync!

Googling around, I found that windows has a command in the command prompt called robocopy (I’m on windows and forced onto a command prompt, go figure) The command seems to be “robocopy z:\ c:\Users\Matt\Music /MIR”, and this seems to be working!

Windows Media Player seemed to pick up all of my MP3 files relativley quickly, and found/retrieved the album art where it was missing as well. However, all of my Ogg files where not found and not playable. A quick google around for an ogg codec for windows finds vorbis.com and a codec for “DirectShow based players”. It seems to imply WMP is one of these, so I grab it, install it, and can play my Ogg files! Although it doesn’t show the total running time in the playlist like it does MP3s for some reason. Never mind!

The only other music I tend to listen too is from Spotify. A quick trip to their website to grab the Windows client, and that wors straight away. Nice and easy :)

Photo’s are a completley different kettle of fish. I have a total of 56.7GB of photos on my network storage. When I’m in Ubuntu I tend to only keep a smallish selection of these on the laptop. So for the purposes of this experiment, I’ll just import the ones from this year. At a mere 6.67GB, this should take about an hour off the slow network storage. I left this to copy, came back and tried to find some photo management software. Windows 7 seems to come with the “Windows Live Photo Gallery”, so trying to use the default software I fired this up. It asked me to sign in with my Windows Live ID (which I have courtesy of my XBox 360) and the quite quickly shows me all the photos I’ve just imported.Helpfully it also throws me a message saying it can’t open some file types (namely my Canon RAW files) and I need something called a “codec” to view them. It then takes me staright to the Canon download site for the raw codec. Quite handy. A 28MB download later and a reboot, all my pictures are now visable and viewable.

This seems to be just as usable as Shotwell, I can tag pictures, browse by dates, see the various metadata for each image, there is a small amount of editing possible. It feels a bit clunky though. Occasionally you can’t double click to preview a photo, you have to right click then go preview. Otherwise it seems more than capable for my mediocre photo managing tasks.

Tomorrow, I’ll attempt something a bit more taxing. I’ll try and get the printer working and have a look into application development in Windows.

1 Comment :, , , , , more...

From Linux to Windows for 30 days

by on Jun.09, 2011, under learning, ubuntu, windows

Having recently read this article about a journalist trying to use Ubuntu for 30 days, and having seen similar articles in the past, I’ve decided on an experiment.

For the past …… many years I’ve used Linux (of various flavours) as my primary desktop OS. I’ve used Windows in the past for games and the like, but haven’t used it for anything else since Windows XP was new. Very ingrained in my mind these days is the “Linux way” of doing things. If something’s broken, try and fix it, help others fix issues they may not be able to resolve themselves and so on.

The experiment I propose is this, I intend to reverse the article quoted above. There are a few caveats on this however, I’m a slightly more advanced user than the chap writing that article, and have used Windows before (sometime in the past!). I’ll try and keep this more or less regularly updated with how things go with various productivity tasks and my day to day jobs. Hopefully the things I learn will be useful somewhere!

1 Comment :, , , more...

Banishing the Demons of Distraction Redux

by on May.20, 2011, under learning, life, linux, programming, python, ubuntu

My fight against distractions has carried on further. This brief episode is brought to you by the theory of “scratching your own itch”.

There are a lot of things that annoy me with various tasks I perform every day. This past week I’ve been taking note of each one, and I count 78 in total. Each one of those 78 things could probably be fixed very easily, but because I’m generally running around like a headless chicken trying to get things done, I don’t even think about fixing them, I just put up with them and carry on. A fair few of these are things that take a while to fix, like the office being short of physical space because of all the orders coming in/out at the moment. Other issues are easy to fix, like the fact that it takes me 30 minutes to an hour to do a quick analysis of some testing data. This is a problem I can solve easily with a smattering of python and a little concentration. In fact, I’m intending to tackle this on Sunday by going into the office when it’s quiet, and just making this problem vanish.

A few other problems on that list of 78 can also be solved with code, some easily, some not so. Some can be solved by a few simple changes in my work routine, like the fact I constantly go to do a task, get pulled away by something else, and then forget what I was going to do. Keeping a simple log book of what I’m doing during the day would solve this easily. It would be better if this was digitized in some form, but for now a simple notebook will probably make a huge difference. This distraction on its own has probably caused me to lose my train of thought more times this week than any other on the list.

So how id my fight going? I’m much more aware of what causes me to be distracted after the past week or so. It’s taking me time to come to terms with each of those distractions and to deal with them, but ultimately, I am becoming more productive in a given period of time. The next big thing I’m going to have to tackle is project methodology. Since I don’t even have a passing familiarity with any of the standard methodologies, this is going to take some research, some thought and  a lot of conversations in order to find the best one to suite the needs of my team at work. As always, any pertinant reading material suggestions are always welcome.

1 Comment :, , , , , more...

Banishing the demons of distraction

by on May.08, 2011, under Fun, learning, life, linux, ubuntu

For a little while now I’ve been getting quite annoyed with myself for being very easily distracted (be it with llamas, badgers, narwhals or whatever). This has meant that my general level of productivity has been somewhat…… low. I have a list of running projects as long as my arm, none of which get enough attention because I flit form one to the other almost hourly. The situation as is obviously needs addressing.

From what little intelligence I can bring to bear on the problem, this should be able to be broken down into a few different variables:

  1. Environmental
  2. Physical
  3. Grey-mushial (?)

Environmental

Fixing environmental problems is relativley easy. If I want to concentrate on a task now I use my Mac Mini. Not because OSX is any more productive than Ubuntu I hasn’t to add, but because it is in a room on a desk with a comfortable chair in a comfortable working position. There is no television, no games consoles or anything else around to take my attention away from what I’m attempting to do.

In the office at work, I try and keep my desk clear of clutter. When there is a lot going on, or a lot of noise around, the twin help of Spotify and a decent pair of headphones can help keep me inside my own head and in my comfortable work zone. Anything I would sit and watch constantly for updates or results is now being reworked to email me or notify my some other way so that I can carry on concentrating on the more important tasks rather than waiting for something else to finish.

Physical

With this I refer to my general physical fitness and general wellbeing. I am quite aware that I don’t get enough exercise, but have yet to generate a plan to resolve this. Until recently I had no idea how well I ate. Throwing together a nasty hackey database in Django (code), I actually discovered I don’t eat too badly… but can binge on chocolate when things get a bit stressful! This is quite easy to rectify by stopping buying lunch and making it in advance. I still crave the chocolate quite a lot during the day, but hopefully this will fade away given some time!

Grey-mushial

This is what’s going on in my head and possibly the hardest part of the whole cycle to change. When I get frustrated with something I lose the will to carry on with something. This is normally the major factor in why I jump from project to project, task to task without completing things. I get frustrated and annoyed that I can’t do something so move onto something else I can do. This has a lot of negative impact as it means that sometimes I struggleto learn something new and overcome certain issues. This is quite hard to change, but I’m attempting to bring some positive re-inforcement to bear on the problem. Craving chocolate when being frustrated isn’t helping things, however, if I now manage to solve a problem that’s frustrating me then I can have some chocolate. This helps me motivate myself to push through the problems that keep me stumped, frustrated and annoyed.

Actually keeping my mind on task is another seperate problem. This, at the moment, I have no idea how to solve. I’ve started reading around this and started reading up on Zen as a lot of Zen practice seems to be based on either keeping your mind on a single thing or emptying your mind of all things completley. This may help, this may not help! Anything I struggle to concentrate on I make a note of what it is, hopefully some kind of pattern will emerge from the mess over time. For some reason, one thing I really can concentrate on without being distracted is painting my 40k models. I have no idea at all why this specifically is so easy to concentrate on, but an interesting observation none the less.

Why bring all this up on here? Well, for a start this place is one of my projects that gets overlooked quite frequently, and secondly so that if anyone does have any dealings with myself where I start something and don’t necessarily stick to it for a period of time….. let me know in case I haven’t noticed. There is a lot of Ubuntu stuff I’d love to do if I could just get over these daft concentration issues!

 

Leave a Comment :, , , , more...

Training vs Teaching

by on Dec.11, 2010, under learning, life, programming, ubuntu

Today I’ve been mostly teaching myself the oddities of C++. Now C++ is an object orientated language that’s an extension of C. This has led me to a revalation.

Recently at work I’ve been doing masses of OO stuff (as a change from the previous stuff I was writing which was largely linear) and as a result of that I’ve started seeing the world in terms of objects. Now in order to achieve what I needed at work, I ended up reading up on the theory of objects and what they actually are. In times past when I’ve been “taught” how to program (rather than teaching myself) , the content of the classes where more designed for a specific language on how to solve a specific problem. I think I only once sat in a computing based lecture that talked about the more abstract issues in programming. Whenever I start designing a program I always go back to that single lecture, and a few books that have a higher level stance on problems (such as Design Patterns)  and then once I’m passed that do I go to the language specific things.

The reason I digress this far is that after learning all this meta-stuff, learning another language is actually relatively easy. Now everything is falling down to syntax rather than subject. Going back to the title, I think that those lectures that taught me to do this in this language because it does that has got things backwards. They were doing the training first in the hope it would teach you something. What they should be doing is teaching you the concepts (all the “meta”) and the train you in the language.

Teach and then train, not train and then teach. Something I shall have to try and follow more often in the future.

(Many thanks to Alan Bell for the inspiration in the title :) )

1 Comment :, , , more...

Arduino powered lights and heating!

by on Nov.07, 2010, under arduino, learning, ubuntu, Uncategorized

Over the past few weeks as it gets colder, I’ve really started to notice the significant bite in heating costs from our flat being largely electrically heated. The main issue with this system is that none of the heaters have thermostats, they are either on, or off. As each heater is 2kW or greater, and there are 4 of them in the flat, that means at any one time we could be using 8kWh of electricity. Which is a lot of money during the day!

The solution? Build a thermostat for them (and replace 2 with a gas convection heater). The circuit for this is quite simple thanks to the fantastic home easy set of sockets. I bought a pack of three sockets (with a remote) and a light bulb holder (we’ll come back to that later). On top of this I needed a temperature sensor (tmp36), a 433MHz transmitter , a 433MHz reciever and an arduino uno.

Thanks to the lovely folks at the Home Easy Hacking Wiki getting this lot to work together with an arduino is easy as anything! Here is the basic circuit:

Home Easy Transmitter DiagramThis is only the transmitter/temperature sensor part. Initially you’ll need to build a receiver to get the ID of your remote. This can be found at this page in the arduino playground. Once you have your remotes ID, you just need a simple arduino sketch to turn the socket thats plugged into the heater on/off! Here it is….

HomeEasy homeEasy;
boolean isOn;
int incomingByte = 0;	// for incoming serial data
float timeOn=-900000;
int myCode = 1595082;  
 
void setup()
{
       Serial.begin(9600);
       homeEasy = HomeEasy();
       homeEasy.init();
       isOn = false; // 1 = On, 0 = Off
}
 
void loop()
{
  float temp = getTemp(0);
  Serial.println(temp);
  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();
    // say what you got:
    if (incomingByte == 111){
      //turn on the group
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true );
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, true );
    }
    else if (incomingByte == 102){
      // turn off the group
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true );
      homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, true );
    }
  }
  if (temp < 18.0 && isOn == false && millis()-timeOn > 300000 ) {
     //turn on the heaters
     homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false );
     homeEasy.sendAdvancedProtocolMessage(myCode, 0, true, false );
     isOn = true;
     timeOn = millis();
  }
  else if (temp > 18.0 && isOn == true && millis()-timeOn > 300000 ) {
    homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false );
    homeEasy.sendAdvancedProtocolMessage(myCode, 0, false, false );
    isOn = false;
    timeOn = millis();
  }
}
 
/*
* getVoltage() – returns the voltage on the analog input defined by
* pin
*/
float getTemp(int pin){
return (((analogRead(pin) * .004882814)-0.5)*100.0); //converting from a 0 to 1023 digital range
                                        // to 0 to 5 volts (each 1 reading equals ~ 5 millivolts
}

This code ensures that there is no change in status for at least 5 minutes, basically so the socket doesn’t go continuously on/off and damage something! There is also a hook for a serial input to turn on the “group” of the remote. This is to turn on the light in my bedroom. I’m in the process of writing two simple bits of python to turn a light on/of depending which is run. This means I can set up a cron to turn on a light at a given time! Simple alarm clock :)

To get this code to work you’ll need the homeeasy library from here. You may need to alter the pin allocation in homeeasy.cpp, but that shouldn’t be too hard to do!

Next thing to do on this project is to get my Revo setup as a little wireless server box to graph the temperature changes and run the alarm clock. Conveniently it’s being replaced with a mac mini this week so has become available to complete the project. This will be a simple ubuntu box, running ubuntu server and little else really. Thought it may gain an ldap database for another, slightly different project.

1 Comment :, , , , , more...

Chillis!

by on Jan.31, 2010, under Fun, learning, life, ubuntu

Having seen other peoples success of growing chillis from seed (specifically theopensourcerer) I thought this year I’d have a go. So in what could possibly be said to be a familiar style…..

Packets of Chilli Seeds

Packets of Chilli Seeds

I’m only attempting three types of chillis this year, cayenne long hot, navaho and scotch bonnet. In the interest of science I’m trying theopensourcers method of germinating the seeds, and tomorrow evening will be attempting some in plain pots with compost in a heated propagator. This may mean I end up with an absolutley enormous glut of chillis, but I’ll burn that bridge when I come to it.

Here are the seeds ready for the airing cupboard.

Seeds in trays

Seeds Ready for the airing cupboard

I’m also in the process of building an automated watering system for these once they’re in the greenhouse using arduinos, and hopefully connecting to a server in the house using an easy radio link to report the conditions in the greenhouse :) Many thanks to theopensourcerer for the information he’s posted on his blog.

Leave a Comment :, , , , more...

On Life

by on Dec.07, 2009, under FOSS, learning, life, linux, programming, python, ubuntu

For the past few weeks life has been busy, and when I say busy I mean hectic beyond belief. In that time I’ve had a few OSS revelations I’d like to share.

As an experiment at work I thought I’d try using eclipse as an IDE instead of my normal vim+terminator job. Scary as it is, I find myself actually quite liking eclipse. It may be that my work machine has 4GB of RAM, and so copes better than the machines I’ve used in the past, or it may be that I’m starting to lose my qualms about what tools I use to do a job, as long as a job gets done. The PHP and Python tools inside eclipse have made my life a lot easier, and I really do find little things, like it reading out the docstring I’d put in a function when I hover over that function when it’s called, useful. Has eclipse evolved to where it’s useable or has affordable technology caught up with eclipse? A bit of a quandry for me that one.

The other small revelation I’ve had recently is that KDE4 is now inherently useable, and quite shiny to boot. when I’ve tried it in the past I quickly got fed up with things that didn’t quite fit or where missing completely, but now time has passed, and like KDE4 I believe I’ve changed a bit, and actually quite like it. I won’t be using it at home for a while, as the 7″ screen on this tiny little netbook certainly won’t make it very use-able compared to the  20″ odd monitor I have at work. The one big thing annoying me with it at the moment though is that konquerer doesn’t seem to fit with the default theme. Niggly annoyance I know, but surely that should be a papercut?

The last revelation I’ve had, though it’s not really a revelation, is a pang of guilt. I’m inherently a consumer in the whole Linux ecosphere. I consume by far more than I give back, and at the moment I simply don’t have the time to give back as much as I’d like. So this is my decree, and a proclamation that as of next year (with certain exceptions) I intend to deem one night a week free software night. On that night I will help to squish bugs, I’ll sit on IRC and be patient with people trying to help them through problems, I shall try and get involved in the various mailing list debates I sit and read, and I shall attempt to stop consuming quite so much and start giving back as much as I can.

In order to do this I will need a little help. The whole software workflow thing is a bit of a mystery to me. I’ve had little formal training in such things and as such tend to wing it more than I’d like. Can people point me in the direction of some good literature to help mend this? I’m quite willing to get my hands dirty if people are willing to be patient with me as I learn how the OSS developer crowd works so I can learn and adjust. In a way I’m hoping that this will flow back and help me at work as much as it’ll help me contribute back to the community in general.

If anyone also has a project they might want a hand with one evening a week from the of the month, feel free to drop me a line by your favourite communications method :)

1 Comment :, , , , , , , more...

The Code Book by Simon Singh

by on Sep.14, 2009, under Fun, learning, ubuntu

In a fit of overwhelming generosity, popey lent me a couple of books, The Code Book by Simon Singh and a python book, which is downstairs so I don’t have the title to hand. Ignoring the python book for the moment, I’ll concentrate on The Code Book.

The Code Book is an overview of the history of codes, ciphers and code cracking. Encryption in all its forms is incredibly interesting to me, simply because some of the methods involved are incredibly clever and very subtle. The book goes through the evolution of codemakers and codebreakers from it’s very beginnings  with Ceasers’ cipher through to some predictions on quantum computing and the effects of this.

The book starts with the story of Mary Queen of Scots. She was put on trial for Treason, but her cousin, Queen Elizabeth I, would only convict and execute her if it could be proven without doubt. This story of how code-breaking had been a life or death situation is continued through out the book. These stories in themselves are intriguing for the huge effect codes and code-breaking have had in our history. The constant creation of new codes and the subsequent breaking of them changed various events in our history.

The author leads us through history, story by story, cipher by cipher, talking about various famous cryptogrophers including Turing, Vignere, Zimmerman and many others.

The book is very easy to read and incredibly insightful. It’s certainly made me a bit more paranoid about security of my various machines!

Thanks again to Popey for lending me this book, and also allowing me to pass it on if anybody else would like to delve through it! Just drop me an email and let me know you’re interested :)

Leave a Comment :, , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...