New Car! Wedding Dress Deposit Paid! Adulthood Beckons!

Simon - I know you’re scared because I’m your friend and I’m getting married…. but think about me!

Shelley put down a deposit on her dress, so thats the two big things done - the venue and the dress, whilst the flowers and (we think) the cars are sorted. We’ve seen the rings we like, the cake we like, the suits we like - and our invitations are complete and (in some cases) on their way… We still have 11 and a half months left to navigate through any minefields as well. FTW!

Anyway, what with the house and marriage we thought we’d really embrace adulthood - we bought a Champagne coloured car! Oh but its a beauty. 140 horses, and potential 50mpg - brawny and efficient to!

General real world fuel economy appears to run at an average of over 40mpg according to most peoples onboard computers, alongside a top speed of 130mph (for a non tuned hatch!) and 140 horsepower… The 1.8 engine is something of a mini marvel, perhaps only bettered by the very latest BMW engines…

The only bad news is that my beloved Fiesta has been written off due to a run in with a 18 year old fresh driver who decided that 60 mph at stationary traffic was a great idea. In a Nissan Micra. Massive twat!

SimpleLife 1.3 Release

Eventually….. I managed to fix the cache issues. Turns out 90% of them were caused by people who didn’t have a cache folder. Tsk. I spent 6 months trying to fix a problem that wasn’t there. :|

Anyway, started coding up relative dates and a date cut off today so that shouldn’t take long.

These aren’t features that I am that bothered about by the way, but they seem popular and I have been doing loads of PHP coding at work recently and am now looking at “problems” and seeing “solutions” without have to think, so its good practice.

PHP: Calculate Difference Between Dates As Strings

There are plenty of well documented methods to calculate the difference between two dates. However its not so easy when you don’t have a date type, but a string which represents a date. You could turn the string into a date, then do some math and come up with a difference but thats long winded!

The easiest method when you have a string such as “21/06/08″ is to work out what day of the year that is (between 0 and 365) and subtract one from the other.

This function uses the explode function to seperate the string into parts (you’ll see the first variable is ‘/’ which happens to be my delimiter in this case, you could use ‘-’ or something similar) and gregoriantojd which takes the month, day and year in that order to return the day number in that year.

$day1 = explode('/', $day1);
$day2 = explode('/', $day2);
$start_date=gregoriantojd($day1[1], $day1[0], $day1[2]);
$end_date=gregoriantojd($day2[1], $day2[0], $day2[2]);
$days = $end_date - $start_date;

So American formatted dates would need a switch in the variables of the gregoriantojd function to 0, 1 ,2 or M, D, Y as they usually show their months first.

The Seven Days Of Peter Crumb

Image of The Seven Days of Peter CrumbStarted On: - 15th May 2008
Finished On: - 25th May 2008

Peter Crumb is not a good man. The 7 days of Peter Crumb is not a good book. I am unimpressed. The whole book, its like written, of course it is, in this faux conversation (you know what i mean right?) loose memoir note taking style, that just seems to go on and on. There is no plot. But then I knew that. So did he. Its funny how you do things. Without meaning to.

Anyway, you’ll probably get the idea from the above paragraph just how frustrating a read this book is - I laboured with it mistakenly thinking there was going to be a massive twist or payoff at the end to make it all worthwhile. After all Arena magazine decided this was “the debut novel of 2007″ (presumably in the sub category “about a man called Peter Crumb written by a gobshite”). There isn’t. Miso Soup, American Psycho etc all portray the descent into mindless violence without being vulgar and attention seeking - Mr Brooks expertly dissects the relationships between people inside one head. Simply, the content covered here is presented with more style and finesse elsewhere.

At times the author uses words and violence just to provoke a reaction - the reaction it got was one of tiresome boredom.

Both of me thought this was shit, although the line about the queen gets it an extra star.

Daily Mail Outdoes Itself With Fear Factor Overload

Check this photo - looks pretty horrific really:

And as this article states:

Washington is laid to waste. The Capitol is a blackened, smoking ruin. The White House has been razed. Countless thousands are dead. This is the apocalyptic scene terrorists hope to create if they ever get their hands on a nuclear bomb. This computer generated image posted on terror forums depict what would happen if a nuclear attack took place in Washington D.C. It appeared as rumours swept the Internet that the FBI was warning that an Al Qaeda video was about to be released urging militants to use weapons of mass destruction to attack the West. The information was said to be coming from ‘groups that monitor Islamic militant websites’.

Now surely you’d label this as fear mongering? With a title like “Al-Qaeda’s terrifying vision of a devastated America in the wake of a nuclear attack” you’d struggle not to.

But it becomes ultimately very funny when you realise that this isn’t the product of some brain twisted man mental hellbent on the destuction of Capitol Hill, but actually promotional imagery from a computer game, made by americans.

http://www.shacknews.com/onearticle.x/52920

Unsurprisingly the Daily Mail have yet to remove their “media coup”. Good work!

Lost: Interest.

The entire internet is awash with theories, ideas and speculations about Lost and its great big dissapointing season 4 finale.

Here’s what I think happened:

Lost was a really good idea for a tv show. Really mundane crash land on an island and survive type show. Then some cocky young shit of a writer waltzed in and said “i know lets go paranormal and weird yeah, people lapped up twin peaks and the x-files!”. And so it was done.

Look how pissed of Sayid is!

Remember when we found out the others were actually quite civilised and they just pretended to have big beards? That was intrigue! That was a twist!

Since then they’ve ploughed on relentlessly with no real purpose or direction and periodically tie up some kind of loose end with a really shit stupid “twist”. Oh yeah claire just walked off into the jungle that’s why she never made it off the island!

So…. how do they escape from the big scary men? You know the army guys sent by Widmore (whats his deal? I know its you Jom Robinson). Lets move the whole island. Riiiigghhht. Which bit of the video Locke watched specifically mentioned the turny wheel? Or the conveinent ladder access? The video said to not put metal in the container. It didn’t say “put metal in to blow a hole in the wall to access a conveniant ladder system which will take you to a sub-zero(!) underground chamber with a turny wheel to move the whole island.”

Don’t get me wrong, anybody who wanted to access the pocket would probably do the opposite of instruction and put metal into the container and hope it did something explosive. But you’d have to be pretty fucking special to guess there was a ladder system to the wheel, and even if your luck got you that far you might be mistaken for thinking that the wheel did nothing more than grind arctic flour.

Not to mention that it doesn’t ever approach permafrost in the crust of the earth in the fucking tropics.

They’ll have to work hard to explain all this. Really Hard.

I’ll probably watch this until it eventually dies on its big fat flabby arse and turns most of the cast into b-movie “stars”, but I’m not impressed.

Plugins/Getting Married - An Update

Ok, so the plugins have hit the ground for like 5 months. Fear not - they are back on track as of now. I’m looking for someone with subversion experience to keep the official repository up to date with latest releases. If you’re interested let me know.

Anyway the reason its all gone quiet is its all been less than quiet in the real world. Not only did I start a new job (very well thankyou) but I got engaged.

We’ve now booked the venue (Smugglers Wheel), found the dress (I think?!) and set the date (June 14th 2009). And thats the three biggest things done. Obviously as a male, and a pragmatist, I’m twitchy until the deposit for the dress is laid down because anything could change but theres a mental commitment in place I suspect.

Now all we need to do is settle on a song for Shelley to walk down to the aisle to, which isn’t easy considering our taste in music (I’m still pushing for Get Mad You Son Of A Bitch by A Wilhelm Scream ;)

Broken Angels

Image of Broken AngelsStarted On: - 15th May 2008
Finished On: - 25th May 2008

There’s two things wrong with Sci Fi. Ridiculous oneupmanship permeates the genre, with each new author and each new book daring to create bigger better universes with more aliens and more technology and more fear and more intrigue and more confusion. And thats the other thing - confusion reigns when the author fails to employ subtlety.

Altered Carbon suffered from neither of these and as such it was perfect. This follow up, Broken Angels isn’t quite as succsseful. For a start it tries too hard. As a sequel it just isn’t as effortless as its predecessor, the technology gets in the way, the characters are too brash and the story is too convoluted.

And that ties up into quite a confusing little package - in a valient attempt at keeping the reader guessing Morgan has chucked more twists in than a bucket of twisty twister twists. And its just hoplessly confusing. At one point I was flicking back by 100 pages trying to work out what I’d read the day before and if that guy with the thing was actually that guy who did the thing with the other thing, but its not its ok its a different guy but they might be the same guy, and it might actually be a man and for fucks sake its all irrelevent.

What the novel does deliver in large doses is a downbeat look at corporate society (however unsubtle) and some fantastic action.

A case of trying too hard, this isn’t a bad novel but its not any better than the sum of its parts which is a shame because Takeshi Kovacs is an excellent character who deserves more.

The Zombie Survival Guide

Image of The Zombie Survival GuideStarted On: - 26th April 2008
Finished On: - 7th May 2008

This book should be amazing. Its about Zombies. Its a survival guide for the end of the world. Surely, it shouldn’t fail?!

Unfortunately it just doesn’t hit the spot. Its not funny. Its not clever. Its not even that accurate when regarding actual facts (like desert survival and plastic guns!).

The thing is, I was expecting a humourous book about how to best despatch a zombie and how to live like a bear. Instead I got some half arsed attempt at cleverness (they are zombies because they have the zombie virus, its called sonamblahblahblahium because, get this, they look like they sleep walk hahahaha) and a load of stuff I already knew.

For example - did you know that buses are not that good at driving through muddy fields?! Did you know that guns fire bullets?!

Also, and perhaps I missed the point because the whole thing seems quite american, where the fuck am i to get AK47’s from at the end of the world? Essential kit apparently.

Poor.

Copying And Pasting Values Across Multiple Rows In A Filtered List In Microsoft Excel

That sounds like a complicated task in itself, without even considering how unhelpful MS Excel can be…. What exactly am I trying to achieve?! How frequently does this need occur?

I work with massive spreadhseets. Sure I should probably use a specific database application, but seeing as Access sucks balls and everybody in my company literally wants to marry Excel I have little choice in the matter… I run a couple of databases, the specifics of which are unimportant, which have around 30-40 thousand rows acting as records. I have the data set up with auto filters for the coloumn headers so that I can show data that matches specific criteria in each coloumn (show all rows where postcode starts “AB” for example) or order rows according to any specific coloumn (like sort rows in order of postcode).

The problem occurs when working on specific subsets of this data. Fow example, say I am working on all accounts within the AB postcodes, where there is no manager name. I can add a formula into the top cell, a vlookup for example, and autofill this formula to the bottom of the displayed rows. Excel intelligently only applies this formula to the visible cells which is great… the hidden rows between which have been excluded by the filter are unaffected, which makes sense.

Now, with 40,000 rows and 15 coloumns, my spreadsheet has 600,000 cells. Thats over half a million pieces of data to hold in relation to each other. Obviously Excel begins to labour - changing filter criteria can take a couple of seconds, even using the end key to navigate to the bottom of the data can take a couple of seconds where its normally instant.

This in itself is not an issue but the problem is compounded with formulas. Every time you change a filter, Excel works out which rows to show and then recalculates every formula in the sheet. The more formulae you have the longer it takes until eventually you’re waiting hours to show just one postcode.

Most people profficient or at least familiar with Excel formulas know copying and pasting the cells that contain formulas as values (eg Copy, Paste Special, Paste Values) cuts out this added complication.

But that isn’t that easy when working with filtered lists! Try and copy a selection of cells in a filtered list and then paste them back on top as values and you’ll more than likely get some errors. The problem stems from hidden rows between the rows you are copying/pasting. Excel fails miserably to ignore these hidden cells, and if it works at all it will almost certainly overwrite hidden data with the copied values, leave formulas in other rows and generally fuck about with your karma.

The obvious work around is to release all criteria on the filters (Data -> Filter -> Show All is the easiest method) and copy any coloumn affected by your newly added formulas and then immediately paste them as values. This effectively replaces all formulas in these ranges with their “answers” and leaves any formatting intact.

The problem is, when I’m repeating this process maybe 10 - 20 times a day it gets intensely frustrating. Once you’ve done this, you still need to reapply the criteria you had and in a big spreadsheet this whole workaround can take a couple of minutes as Auto Filter needs to recalculate its visible data and all the formulas you haven’t changed yet. These minutes soon add up!

So I’ve hit another solution - a very simple macro which I’ve currently got assigned to a toolbar button which gets more use than any other.

Public Sub Values()
Dim cell As Object

Selection.SpecialCells(xlCellTypeVisible).Select

For Each cell In Selection
cell.Value = cell.Value
Next cell

End Sub

Once I’ve copied the formula down (or across etc) I select the cells that contain formula in the usual way and then run the macro.

It first takes the selection and very quickly narrows the selection to only visible cells. This is the most important part because as discussed, any initial selection you make contains the hidden cells between the selected visible cells.

Lastly it cycles through each cell in this new narrowed selection and copies the value directly into the cell. So if the cell contained the formula =2+2, the macro will take the value 4 and reset the cell to that value. This works for any formula, however complex.

The result is the ability to copy formulas and paste their values into any selection of cells, whether the are filtered with Auto Filter or not. Its how Copy and Paste Values should work - in fact its how copy and paste should behave full stop, but thats a different less elegent problem.

Reading back through it all seems a bit over the top, but so far it saves me about half an hour a day which is about 120 hours a year (taking into account holidays!) - thats 3 and a half weeks of my working life I got back! If only I hadn’t just run out of things to do!!

Powered by WordPress with GimpStyle Theme heavily modified by Kieran Delaney.
Entries and comments feeds. Valid XHTML and CSS. 16,543 spam comments ignored.