Sunday 20 October 2013

9 ways to stay focused.... one you probably never knew existed.

I guess we all suffer from lack of focus, enthusiasm which spawns the evil that is... procrastination. So let's have a brief look at what you can do to stay focused and the holy grail of the focused mind... the smart tablet. Yes it does exist, keep reading.

There are a lot of things to help you with this from meditation, correct diet, plenty of sleep, even down to breaking work down into manageable chunks. Here's a few things I am mindful of on a daily basis.


  1. Drink plenty of water, your mind needs hydration to function. Personally I keep a litre bottle of water by my side all day and drink from that at work.
  2. Personally I avoid caffeine because it raises my blood pressure and i feel faint.
  3. Eat the right foods, don't eat stodgy foods that you know will make you feel meh. Long lasting protein like porridge in a morning is a good start to the day.
  4. Music to help you focus. I use Alpha Binaural* beats to give me the edge when I need it but in the main I avoid music with speech** in as that only distracts me or creates too many images and I end up distracted.
  5. Meditation, aye it's not everyone's cup of tea but I do find that a certain meditation technique does actually clear my mind a great deal and promotes some inner calm.
  6. Exercise... Yes I still get some exercise, I have two slightly insane springer spaniels which need walking and training every day so I do get out. Although if it's a really insane shift and they are being looked after then I do a half arsed attempt at the 7 min workout*** a few times during a session.
  7. Remove distractions, this isn't always easy. I work for myself and I have software that clients use to report issues to and post messages on which allows me to switch emails and phones off for long periods. There's nothing wrong sticking a note on your office door telling people you are busy creating some epic code. 
  8. Sleep, we need it to operate effectively. Catching up on it isn't a bad thing either, sunny lunchtime breaks for me are a chance to get the beanbags out in the garden and snooze for a while after a big session. 
  9. Smart pills.....


But what happens when you do all that but you still feel you need some real laser focus? I had a friend that asked me how I manage to work for 36 hours straight with the only breaks being to walk the dogs every 8 hours. They had to write a business plan on the weekend and a large one at that, with a big family weekend ahead all they had was the evenings, and after a day of playing with the kids, walking the dog and the pressure of the impending deadline they were reaching out for some pointers. So I went about explaining my epic find a few years ago.

To cut a long story short, they took my advice and at 3am in the morning I got a text telling me how focused they were. They had nearly written the entire business plan in one evening and was now wide awake. They carried on texting but fortunately I slept through the entire thing to wake up and find that they had finished everything that evening and felt fresh as a daisy the following day, happy in the knowledge that they had hit deadlines.

So what is it? .... Modafinil. It is used around the world in certain organisations such as the US military where they are used to keep troops alert and by-eck it works. It's not classed as a controlled substance here in the UK and therefore legal to use. It works by stimulating your central nervous system (brain and spine) to give you a wakeful alert state. You will have heard of other stimulants used in the 1940's called amphetamines which are now illegal and addictive. Modafinil works in a different way to these and has no addictive qualities. Personally and with the other three people that I know who have taken it there are no side effects as yet and I have taken it for a few years now when I need it, although interestingly enough there are reports that it stifles creativity, such as graphic designers would be adversely affected. Not something that ever affects me as I spend all my time with my head inside windows full of code and chatting on IRC, I haven't a graphically creative bone in my body, my previous attempts at anything graphical in the past remind me of what I think a dancing colourblind meerkat on a merry-go-round would paint.

My experience with it is that it provides me with a laser focus and vision into what I am doing that does not drop off. The feeling of needing to do something else for a break is gone and all that remains is clear thought and a wakeful state. It does allow you to work for longer periods of time than normal, but let's not forget that lack of sleep is cumulative and all those hours do add up. I tried 36 hours on, 8 hours sleep, 36 hours on, 8 hours sleep, 36 hours on and then slept for 12 hours. The following day (Saturday) I was a little hazy and pretty tired. The rest of the weekend was spent walking the dogs and vegging out on the sofa watching TV and cat napping, but... I had just worked over 100 hours in a week.

There's my thoughts on it all, you need to make sure you keep your engine fulled and in top condition before you start to build on that foundation.

Eat well, sleep well and be productive people.
Peace.

Here's some links to ponder over
*Binaural beats
What are they
http://en.wikipedia.org/wiki/Binaural_beats
My Favourite
http://www.youtube.com/watch?v=4rm-lubtdhw&list=PLVEuMHxpbIAv64R7OYKKwS3LVeEzVj7dD

**Speechless Music
http://www.youtube.com/watch?v=16kRVoSyO_w&list=TLNul3eIarTFReVmjm4ibDEqy7_V99l908
http://www.youtube.com/watch?v=hvXL-YLRq60

***7 min Scientific workout
With a good diet and only these to keep me company i've managed to loose 4 stone this year which is a whole other story.
http://journals.lww.com/acsm-healthfitness/Fulltext/2013/05000/HIGH_INTENSITY_CIRCUIT_TRAINING_USING_BODY_WEIGHT_.5.aspx


Wednesday 17 July 2013

Living with the Kinesis Advantage Keyboard

It's been a couple of months now since the Kinesis arrived and it's been pretty solid although a bit slow, however things are picking up and I am getting used to it every day. The ache in my wrist is completely gone, although it was only slight anyhow.

I stuck to what I had read in reviews and did not use a standard keyboard for the first month and it slowed me down to a dead crawl. The first few nights I attempted to do some online touch tying lessons and then carried on using it in my daily work. I can see now why isolation is a good thing, even now when i type on my laptop I find it strange. Not strange in a bad way though, I still don't truly touch type on a standard keyboard, only on the Kinesis because I find standard keyboards so damn cramped.

The best part I found was the ability to create macros to save you time and also to re-map keys so you don't have to stretch all over the place to get to the keys you commonly use.

Macros
There are a couple of awesome features, the first of them is the macros which is the ability to enter strings of characters and recall these with a series of key presses. You can't use a modifier key to trigger a macro i.e. Shift but you can use Ctrl. However do not make the mistake I did and map a macro directly to a single key! Which meant to trigger the email macro key I would have to press the function key + enable/disable macro key, then press the letter e and then press function and disable again. Otherwise just pressing E would reel off my email address mid sentence. A real DOH moment right there.

Here's the thing, I use a lot of Ctrl + key shortcuts within programs such as vim, terminator, awesomewm, midnight commander, so my thought of using Ctrl + key for a macro has got to be something that I don't use day to day. To avoid any complication I have mapped the numerics as macros and made them easier to remember by using the alpha key underneath the numeric to remind me of what it is. Here's what is stored for me

Ctrl + 6 (over the letter u)
My username for sites

Ctrl + 3 (over the letter e)
My email address "chris@digitalunity.co.uk"

Ctrl + 1 (over the letter q)
Query "$str_sql = '"

Ctrl + 4 (over the letter r)
Resultset "$result = $this->db->query($str_sql);"

I'm sure there are more useful macros to create although I haven't thought of any as yet.

You could even do a full irssi connect, login and join i.e.
>irssi
>/connect -ssl freenode.net
>/nick digitalunity_uk
>/msg nickserv indentify mypassword
>/join #channel

although with the last example you would need the Professional keyboard as you can only record 56 keystrokes per macro on the Advantage and classic.


Re-mapping Keys
The second was the ability to swap the keys around physically and re-map them within the keyboard memory.

The first thing I noticed was how strange some of the key placements were, especially being a PHP dev we all use the minus sign a lot such as $object->method(); and I also use the underscore a lot in variable names such as $str_company_name = ''; Now the > sign is easy to get to and remember but I found that the standard layout places the minus sign and underscore on my little finger which after a short while began to ache. So I moved the minus sign to the place of the numeric six and moved all the characters one along to the right.

Then there are the up and down cursor keys, I swapped these around so that they matched the same fingers as up and down within vim which is j and k.

Then the escape key is also on a pinkey key, it's awkward to reach all the way to the rubber keys. As I don't have much use of the Caps Lock key so I removed the caps lock key function and replaced it with Left Shift, bear with me on this one... Then Swapped Left shift with Caps Lock. Yes you are right in thinking I now do not have a Caps Lock key but using a keylogger over the period of a few days I realised that I don't actually use the key anyhow. So now my hands don't need to move to get to escape.

The only outstanding issue is the strange placement of the brackets which when pressing, mean that you have to curl your fingers under on the right hand. After a few months this became second nature and I would suggest that given a couple of months, even if you remapped every key, you would soon be back to touch typing again.

All-in-all the Kinesis is a heck of a lot comfier than a standard keyboard and well work the money in my opinion. The keypresses require much less movement and therefore gives a more comfortable experience and although the ten key number pad is embedded, the reduction on space between mouse and keyboard is far better. Having said that, I have just purchased a touchpad which sits in the middle so my hands no longer need to leave the keyboard!

Sunday 2 June 2013

The hunt for an ergonomic keyboard

This post is a collection of notes and links on my journey to find my personal holy grail of keyboards. Rather than write yet another review I have posted a link back to the best review of the board I ended up getting.

In an eBay cleansing session I stumbled across a slightly faulty maltron keyboard for sale and thought it looked pretty awesome and started to ponder on changing my keyboard, a microsoft 4000 which after two years of use has half the letters rubbed off. Having said that, it is the best keyboard I have owned. The fact that it is raised and slightly split has certainly helped with any wrist pain that I had in the past, albeit slight.

My reasons for changing are that I would prefer a tenkeyless board, get the mouse a bit closer and also have a more comfortable posture. Years of night time coding after work hunched up on the sofa on the laptop ended in a hefty chiropractor bill so anything to prevent more of that is a bonus while using the office pc.

So I have spent an entire week (ten hours of my life i'll not get back!) hunting for a keyboard that will fit the bill so I thought what better to do than test out the new one and write the ones I came across with a brief overview of each. I will pop a list of all the url's I can find that are half decent in my history on the bottom of the blog as well as some of the ones that I saw but didn't consider for one reason or another. The Ergodox looks pretty awesome for a start but isn't in production yet.

Oh and before I start I guess it's best to describe my keyboard use. I'm not a true touch typist, I don't look at the keys and I do use all my fingers but its self taught, at 60WPM I was fine with it. I use a qwerty layout and spend most of my time in the console using vim, alpine, mc, cmus so I remapped the ctrl key to caps lock. I also use awesomewm on crunchbang so the mod key (or windows key for microsoft users) gets used quite a lot to move between screens, tabs and clients. With the mouse just used for internet browsing and triggering synergy to switch machines.

For those who just want to know what I bought in the scroll down to number seven. This is another post that I did a month later with my findings.

So in order of preference, first being the most unlikely.

1) Das Keyboard    Website    Youtube
Love the simplicity of the keyboard and it seems to get really good reviews especially because of the switches used but it's not tenkeyless and I don't want to go back to a standard layout. The main reasons for the inclusion are that the dev community rank it highly and also the YouTube video above has a decent explanation of mechanical keyboards.

2) Happy Hacking Professional   Website   Youtube
Nice looking bit of kit with good reviews and the right size but just not laid out right for me.





3) DataHand Pro    Website     Youtube
Looking like something from the movies the data hand sounds perfect, I'm just not sure that I am ready for such a big step in use, nor the price, at a touch under a thousand pounds it's not in my budget. Plus not being a true touch typist coupled with an unfamiliar interface didn't sound appealing for that money. Although the reviews look awesome and it looks the dogs danglys. Maybe next year.

4|) TypeMatrix    Website    Youtube
Fantastic layout, just  too flat :-(






5) TrulyErgonimoc    Website   Youtube
Of all the keyboards this is the closest to the one I use and the layout is awesome, even the ctrl is in the right place. The reason that I did not go for this one is the numerous conversations with people that have had little to no support from the manufacturer and also because it is still a flat keyboard. However I'm still tempted with it even as a portable keyboard for the laptop while I am away from home for long periods.

6) Maltron     Website     Youtube
This was a very close second and beaten because of price and the number pad in the middle. There seemed to be a lot of transcribers using these and not so many developers.




7) Kinesis   Website    Youtube
A big thanks to Chris over at KIZZX2.COM for his help over the past week. I stumbled across Chris's review and felt that his use pretty much matched mine and after exchanging some emails decided to purchase one. Please have a read of Chris's blog on his findings whilst using one, they mirror that of mine including the damn awful rubber F keys, although mine does not send two key presses to my one which I have seen reported a lot!

As a non-true touch typist the migration is not as bad as I had imagined, although my WPM is shocking at the moment, I'm down to around 15 WPM. All the keys are placed perfectly for me and as for comfort, heads above even the old faithful Microsoft 4000. The journey to the mouse is a lot better also.
Update: Oct 3rd 2013 WPM on 10fastfingers.com now stands at 62WPM with 2 out of 57 incorrect words.

The keys are cherry MX brown switches which are very smooth, not too sure I could cope with the linear feel switches as I guess I would bottom those out every keystroke.

After a days use I can tell the difference, usually my right hand aches and my left pinky is numb but today both are fine. Although, granted I have typed less characters!

Update: the macros are an awesome time saver too, from strings of text up to rows of commands with a pause in between, pretty awesome.

For a good deal if you are outside of the UK try this link. Alternatively for us British, try this one.

Onward for the hunt for a touchpad, if anyone has any suggestions for a linux friendly touchpad with just the basics and works well with multiple screens please drop me a comment. Ideally something that fits in the middle if the Kinesis.

Kinesis do a few different keyboards but I was after something that wasn't a keyboard separated by a wire or a keyboard with a hinge in the middle. For those still looking then take a look at the other models they do.

Some of the others that I found along the way are:
Ergodox
Humble Hacker
Gold Touch pro
Safe Type




Friday 8 March 2013

Kashflow API PHP example

Its been a while since my last post mainly due to the amount of work getting a new product ready for launch so thought I would share a bit of knowledge with the world in the way of a quick and dirty Kashflow API demo. Just recently I was asked by a client to provide a form for their website so a client could pop an invoice number into it, press a button and get the invoice details along with some payment links.

Looking on the forums there seems to be quite a few bemused newbie coders about that are either having trouble getting  native SOAP mod to work in PHP or just not being able to get their head around it full stop. So here's what I posted just recently which is the code in a basic but workable format that was used as a demo for the client.

Trying to keep it simple I have not put this into a class, nor have I included any of the callbacks from when the payments are made. I figure that anyone that can understand the concept could quite easily whip up the class and record the payments, plus for those out there that are just starting out, that's perhaps the next step. If anyone wants the full class when it handles the payments against the invoices please either:

Pop me a message below
Tweet @digitalunity
Email chris@digitalunity.co.uk
FB: https://www.facebook.com/digitalunity.co.uk

PS: bit of Friday fun for you thanks to +Ben Griffiths  for the link http://phpstyleguide.com/
 :o)

Hope everyone has an awesome weekend.