Monday, 29 September 2014

Split session

Bass

I played half of the songs yesterday, but got sidetracked into taking James into town to get his bus back to Cleckheaton.

I played 10 songs for 39 minutes. I have played for 15 hours 28 minutes in total with 9984 hours 31 minutes to go before I reach the point at which you are supposed to become an expert at an activity.

It has been 61 days since I have played all of the songs I have been practising. It will take 3 hours 28 minutes to play through them all in one session.

Improved Songs

Angela, Good Enough, I Got Mine, The Spider and the Fly, Rebel Rebel

Playlist

Angela by Jarvis Cocker: Beaten previous high score of 105637 with 105640.

Good Enough by Tom Petty and the Heartbreakers: Scored 83541. Beaten last streak with a streak of 46 notes.

High and Dry by Radiohead: Scored 67944.

Ricochet by Brian Adam McCune: Scored 30575.

I Got Mine by The Black Keys: Beaten previous high score of 53433 with 62841.

The Spider and the Fly by The Rolling Stones: Beaten previous high score of 61100 with 65734.

Sunshine of Your Love by Cream: Scored 41570.

Rebel Rebel by David Bowie: Beaten previous high score of 40240 with 41692.

(I Can't Get No) Satisfaction by The Rolling Stones: Scored 56213.

< br/>

Full song list


SongArtist(s)Latest ScoreLatest ScoreStreakPercentage
AngelaJarvis Cocker10564010564014699
Good EnoughTom Petty and the Heartbreakers97746835414681
High and DryRadiohead68257679444579
RicochetBrian Adam McCune34404305751466
I Got MineThe Black Keys62841628415183
The Spider and the FlyThe Rolling Stones65734657344580
Sunshine of Your LoveCream47630415703077
Rebel RebelDavid Bowie41692416924084
(I Can't Get No) SatisfactionThe Rolling Stones57563562136580
Are You Gonna Go My WayLenny Kravitz3952039520
Take Me OutFranz Ferdinand58204506463676
A More Perfect UnionTitus Andronicus66157661576986
Higher GroundRed Hot Chilli Peppers23787173781760
Step Out of the CarThe Boxer Rebellion46936306745384
Mean BitchTaddy Porter897338823311687
House of the Rising SunThe Animals97160971605788
Panic SwitchSilversun Pickups63089568138581
Between the LinesStone Temple Pilots45582421454782
Pour Some Sugar on MeDef Leppard4888
Number ThirteenRed Fang38664386645678
Song 2Blur53274532746189
We Share the Same SkiesThe Cribs42364423647286
Under Cover of DarknessThe Strokes52000520004681
I Want Some MoreDan Auerbach59872591612081
Surf HellLittle Barrie55450554502175
Use SomebodyKings of Leon65934659344888
SlitherVelvet Revolver547094877710587
BossChris Lee26880268803285
Unnatural SelectionMuse28930287854276
Plug In BabyMuse42036420364587
California BrainRapScallions559845598411989
Sweet Home AlabamaLynyrd Skynyrd58672586724574
OutshinedSoundgarden61332613324277
Slow HandsInterpol33467334673372
I Can't Hear YouThe Dead Weather1324421324422290
BurnishedWhite Denim25160251602874
Run Back to Your SideEric Clapton37568375685076
IslandsThe xx94407842848087
JulesSeth Chapla77159771597193
In BloomNirvana56211562115188
Me and the BeanSpoon71649716494385
VasolineStone Temple Pilots98894917868388
Do You RememberThe Horrors10901410767213296
Go With the FlowQueens of the Stone Age84741825119886
Boys Don't CryThe Cure35618356183377
Space OstrichDisonaur39637396372981
BreedNirvana63878638766186
Next GirlThe Black Keys11130210765317797
ChimneyThe Yellow Moon Band1014819901914897
Where is My Mind?Pixies10081310081311993
GobbledigookSigur Rós1096551096556391
Well OK HoneyJenny O69112691124887
I Miss YouIncubus1338241323572591

First practice for ages

Guitar

I played 11 songs for 38 minutes. I have played for 132 hours 17 minutes in total with 9867 hours 43 minutes to go before I reach the point at which you are supposed to become an expert at an activity.

It has been 63 days since I have played all of the songs I have been practising. It will take 3 hours 20 minutes to play through them all in one session.

Improved Songs

Boss, Take Me Out

Playlist

Higher Ground by Red Hot Chilli Peppers: Scored 81836.

I Want Some More by Dan Auerbach: Scored 65595.

Slow Hands by Interpol: Scored 92229.

Boys Don't Cry by The Cure: Scored 79573.

Boss by Chris Lee: Scored 8876. Beaten last streak with a streak of 23 notes.

Take Me Out by Franz Ferdinand: Beaten previous high score of 64621 with 67483. Beaten last streak with a streak of 105 notes.

Between the Lines by Stone Temple Pilots: Scored 41417.

Are You Gonna Go My Way by Lenny Kravitz: Scored 22315.

< br/>

Full song list


SongArtist(s)Latest ScoreLatest ScoreStreakPercentage
Higher GroundRed Hot Chilli Peppers886988183615592
I Want Some MoreDan Auerbach86629655955891
Slow HandsInterpol970949222923397
Boys Don't CryThe Cure94355795737991
BossChris Lee1089688762372
Take Me OutFranz Ferdinand674836748310582
Between the LinesStone Temple Pilots58501414177885
Are You Gonna Go My WayLenny Kravitz27378223154785
Number ThirteenRed Fang551664988712686
Surf HellLittle Barrie45568428406382
Song 2Blur817368039515497
Where is My Mind?Pixies76970769709590
Use SomebodyKings of Leon737456555610488
Unnatural SelectionMuse53483421359786
RicochetBrian Adam McCune30587305872980
JulesSeth Chapla30147291946375
Well OK HoneyJenny O48263285962272
Run Back to Your SideEric Clapton22763167792071
Do You RememberThe Horrors103326790522380
High and DryRadiohead73334593238190
We Share the Same SkiesThe Cribs18547168773279
Sweet Home AlabamaLynyrd Skynyrd15980148125182
A More Perfect UnionTitus Andronicus393003625910083
California BrainRapScallions24917249175481
OutshinedSoundgarden50996472655483
Icky ThumpThe White Stripes57364536437987
SlitherVelvet Revolver24683183162778
In BloomNirvana74179696794381
BreedNirvana72322720285687
Me and the BeanSpoon57060549236887
VasolineStone Temple Pilots922618501720597
Mean BitchTaddy Porter57779569778383
I Got MineThe Black Keys49686496865285
When I'm with YouBest Coast41949392157691
Plug In BabyMuse468214384611493
Panic SwitchSilversun Pickups640896408910684
I Can't Hear YouThe Dead Weather67594675946388
Play with FireThe Rolling Stones38127361693075
Next GirlThe Black Keys11357811267919199
Step Out of the CarThe Boxer Rebellion45842458423481
(I Can't Get No) SatisfactionThe Rolling Stones901677786410896
AngelaJarvis Cocker1068789580918695
GobbledigookSigur Rós439534888
I Miss YouIncubus29963215223979
Sunshine of Your LoveCream44550419746280
Rebel RebelDavid Bowie57428428788787
IslandsThe xx23519222544386
The Spider and the FlyThe Rolling Stones37943289764098
House of the Rising SunThe Animals473274367515293
Good EnoughTom Petty and the Heartbreakers41508415082672
BurnishedWhite Denim29444233357492
ChimneyThe Yellow Moon Band26664266644475
Go With the FlowQueens of the Stone Age1685159345954197

Monday, 8 September 2014

Getting a raspberry pi to show videos at start up.


A side project today at work was to get the Raspberry Pi to automatically display video files for our partner company.

The first part was getting the files to loop, I used the script from the learn adafruit site.

#!/bin/sh # get rid of the cursor so we don't see it when videos are running setterm -cursor off # set here the path to the directory containing your videos VIDEOPATH="/mnt/storage/videos" # you can normally leave this alone SERVICE="omxplayer" # now for our infinite loop! while true; do if ps ax | grep -v grep | grep $SERVICE > /dev/null then sleep 1; else for entry in $VIDEOPATH/* do clear omxplayer $entry > /dev/null done fi done

That was the easy bit.

The more challenging part was to autoplay the script on startup. After a number of fruitless trials, I discovered the raspberrypi.stackexchange font of wisdom.

Basically all you need to do is to add a line calling the script into the /etc/xdg/lxsession/LXDE/autostart file.

@/home/pi/bin/videoplayer.sh

Knowing the SSH address of the pi is helpful to safely shutdown - or just pull the power ;-)


Sunday, 27 July 2014

Adding Firstname, middle name and last names to a Ruby on Rails app

I was wanting to add first name, middle name and last name columns to a Ruby on Rails application (specifically the Rails-Devise tutorial from RailsApps).

After a couple of hours working through various sites I came up with three migrations:

timestamp_add_first_last_to_users.rb
class AddFirstLastToUsers < ActiveRecord::Migration
  
  def self.up
    change_table :users do |t|
      add_column :users, :first_name, :string
      add_column :users, :middle_name, :string
      add_column :users, :last_name, :string
    end
  end
  
  def self.down
    remove_column :users, :first_name
    remove_column :users, :middle_name
    remove_column :users, :last_name    
  end    
end

timestamp_update_names_to_users
class UpdateNamesToUsers < ActiveRecord::Migration
  def up
    User.all.each do |user|
      na=user.name.split(" ")
      nc=na.size
      user.first_name=na[0]
      user.last_name=na.last if na.size>1
      user.middle_name= na[1..na.size-1].join(" ") if na.size>2
      user.save!
    end
  end
  
  def down
    User.all.each do |user|
      user.name = [user.first_name, user.middle_name, user.last_name].compact.join(" ")
      user.save!
    end
  end
end

timestamp_remove_name_from_users.rb
class RemoveNameFromUsers < ActiveRecord::Migration
  def up
    remove_column :users, :name, :string
  end

  def down
    add_column :users, :name, :string
  end
end

This works, but is probably not the best solution.

If you have an easier way, please feel free to let me know.



Monday, 11 November 2013

Starting Week 2 of NaNoWriMo

I have done better this year at getting words put down than I did last year, and have managed to get around 1600 words added so far this month.

It's a big shame that the target is to have 50,000 words by the end of this November, and to achieve this I need to have written an average of 1667 words a day. My average so far is 146.

At this rate I will finish around 9th October 2014. Just in time to start next year's novel.

Not going to say much more at the moment, I'm going to have a go at putting some more ink on paper.

Sunday, 29 September 2013

Wine, coding, pizza and enumerize

Wine

Drunk Coding: Safer than
Drunk Driving, but only just.
For some reason, we didn't finish a bottle of wine last night, although to be fair we did have three glasses each, so I thought I'd better finish the bottle before it goes off.

Coding

I'm doing a little bit more coding on my game tracking application, and have found a link to a git branching model that appears useful, I'm going to have a good think about it and will try putting it in place.

I'm also looking into using the enumerize gem with the app to reduce the amount of database calls - I am only going to be tracking two versions of the game for the moment, so this sort of makes sense.

Pizza

In a random conversation about drunk coding, I jokingly mentioned a pizza. Then realised I really do fancy one. I'm trying to be good, so might make do with a bacon buttie instead. Although I'm still thinking about the pizza. I was thinking if I wait long enough, they'll all be shut and problem solved. Then I remembered that one chain is open until 5am.

I need to be in bed long before then though.

I must resist.


Saturday, 24 August 2013

lolcommits

Every now and again I look at the lolcommits gem, this allows a git user to take a snapshot each time that they commit code to their repository.

The only bit it took me a while to work out was the correct way to get the twitter option to post.

After some playing around I discovered the following sequence usually works:

lolcommits -p twitter --config

and type true when you get the prompt

enabled:

Once you have committed to your repo, then type

lolcommits -c

this will take a fresh screenshot from your latest commit and give you a url to authorise the tweet activity. Enter the url into a browser, then paste the code into the command prompt and all your future commits will be sent to annoy your followers.

Examples of this hideous idea are here (how many of these places do you recognise?):