Helicopter on the M25

Posted by Monty on March 18th, 2010

Well, no one seems to believe me, so here are the pics.

Slowness with Windows 7

Posted by Monty on February 16th, 2010

Well, recently I have been having trouble with my Win7 installation. I was getting very frequent slowdowns (every 2-3 seconds), but only if I used the hdd, if I was playing around with something in memory, then it was perfectly fine. Playing games could get rather frustrating because of the slowdowns, but once everything was loaded into memory, it was ok

After some research, and getting incredibly pissed off with my machine, to the point where I was convinced it was a hardware fault after disabling a bunch of services, updating all the drivers, antivirus, all the extra faff in windows, in one of my moments of desperation before I waved bye bye to my machine, I had a look in Resource Monitor, you know the little button located in the Task Manager’s Performance tab?

Well under there, I noticed that a certain process was hammering the hard disk, wmpnetwk, and whenever it seemed to hit the hard disk, I would get a slow down. After some research on the all mighty tinterweb, its the Windows Media Player Network Sharing Service, basically for streaming your stuff to other pc’s and/or Xbox etc, and from what I read online, that if it comes across a corrupted (or half downloaded .avi’s which I have loads of, after trying to convert a few vid’s for my friends), it tends to hammer the hard drive. Once I disabled this service, my PC was lightning fast!

Javascript – Encoding

Posted by Monty on December 15th, 2009

The escape() method does not encode the + character which is interpreted as a space on the server side as well as generated by forms with spaces in their fields. Due to this shortcoming and the fact that this function fails to handle non-ASCII characters correctly, you should avoid use of escape() whenever possible. The best alternative is usually encodeURIComponent().

escape() will not encode: @*/+

Use of the encodeURI() method is a bit more specialized than escape() in that it encodes for URIs [REF] as opposed to the querystring, which is part of a URL. Use this method when you need to encode a string to be used for any resource that uses URIs and needs certain characters to remain un-encoded. Note that this method does not encode the ' character, as it is a valid character within URIs.

encodeURI() will not encode: ~!@#$&*()=:/,;?+'

Lastly, the encodeURIComponent() method should be used in most cases when encoding a single component of a URI. This method will encode certain chars that would normally be recognized as special chars for URIs so that many components may be included. Note that this method does not encode the ' character, as it is a valid character within URIs.

encodeURIComponent() will not encode: ~!*()'

Shamelessly stolen from xkr.us – This can very well bite you on the ass.

Disable Warning As Error on WEBSITE project

Posted by Monty on December 8th, 2009

Well after spending half an hour looking on the net on how to disable WarningAsError on a WEBSITE project, everyone kept saying the same thing – edit the project settings – WELL A WEBSITE PROJECT DOSENT HAVE PROJECT SETTINGS!

Anyway, here is the solution, you need to edit your web.config :

<system.codedom>
 <compilers>
 <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="3" compilerOptions="/d:DEBUG;TRACE">
 </compiler>
 </compilers>
</system.codedom>

Should turn into the following:

<system.codedom>
 <compilers>
 <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="3" compilerOptions="/d:DEBUG;TRACE">
 <providerOption name="WarnAsError" value="false"/>
 </compiler>
 </compilers>
</system.codedom>

The line you want in question is:

<providerOption name="WarnAsError" value="false"/>

And this baby will make it work! Enjoy!

Clearing FK’s and tables from database

Posted by Monty on July 14th, 2009
SELECT 'ALTER TABLE ' +  OBJECT_NAME(f.parent_object_id) + ' DROP CONSTRAINT [' + f.name + ']' FROM sys.foreign_keys AS f INNER JOIN sys.foreign_key_columns AS fc ON f.OBJECT_ID = fc.constraint_object_id
union all
SELECT 'DROP TABLE '+ name FROM dbo.sysobjects WHERE (type = 'u') and name != 'sysdiagrams'

Curiosity

Posted by Monty on June 28th, 2009

Iv recently come across this rather … strange custom in the US navy, where an aircraft would land at the wrong aircraft carrier during a war – either because it got disoriented, or because it ran out of fuel (or, the pilot is a moron), with some hilarious affects:

(Click for larger images)

^ is rather … worrying, im not sure what other ships will think if they see the Russian hammer and sickle on the tail?

The sheer amount of effort and work that went on this plane is just hilarious – “Must be airforce”, I wonder what would happened when this pilot got back to his own ship ?

Politics and expenses

Posted by Monty on June 18th, 2009

I don’t normally write about politics, because its usually such a controversial topic, and I tend to piss people off easily enough anyway, but the whole current expenses row really gets my goat.

They are elected by the public, to serve the public, but unfortunately, they do not see it this way. They see them selves as the elite, they see them selves above us “dirty commoners”, they are better than us. They believe there is one law for them, and another law for us. The whole expenses row has proved this to be correct.

Take the last Home Secretary, someone who was in charge of Anti terror legislation. She admitted to smoking cannabis in the 80′s, and warns people that they shouldn’t smoke cannabis because it will lead to mental health issues, this the day after she was appointed  as the head of the govt review of the UK Drugs strategy.

Smoking cannabis is a CRIME in the UK, so our (former) beloved Home Secretary is a *CRIMINAL*. She has committed a  CRIMINAL OFFENCE (And no, the Misuse of Drugs Act has no statute of limitations)

One of the anti terror strategies was to link, basically everything to terrorism. They have linked photographers to terrorists, something that would be done under the Home Secretary. Another thing that they have linked to terrorism was the fact that drugs will fund terrorists. So, Jacqui Smith has supported terrorism, and should be arrested under her very own Anti Terrorism Act, and held for 42 days without -food-charge.

She has stated :

“If you can’t live by the rules that we live by, the standards and the values that we live by, we should exclude you from this country and, what’s more, now we will make public those people that we have excluded”

Well, CLEARLY, by smoking a Class B drug, you have committed an offence under the Misuse of Drugs Act,  which the penalties lie from 3 months to 5 years in prison – why has she not been prosecuted, or arrested for this offence? I say prosecute her, throw her in jail, then deport her. Good luck finding a country to take the old hag though.

Then there’s the whole fiasco with the ID cards, no one wants them, it WILL NOT PREVENT TERRORIST ACTS (Madrid bombings – they had ID cards then) – and the govt make ridiculous claims such as “Its a SECURE form of identity” – Oh really? Like the countless MOD laptops “forgotten” on trains or left in pub car parks, details for 25 MILLION child benefit claimants’, 3 million learner driver’s details also “misplaced”, on top of that, 45,000 peoples names, dates of birth, and national insurance numbers of people claiming benefits in York, which also has been “misappropriated”.

And lately, the whole expenses row’s – our beloved Jacqui Spliff was caught watching pornography, not once, but twice, and tried to claim it on our expenses, which come out of my and your taxes. That’s great, does that mean I too can watch pornography, and it come out of tax payer expenses? No? That’s not fair!

And lets not forget the DNA debacle – 17 senior judges across Europe have ruled that keeping DNA after not being charged is ILLEGAL, and HAS TO STOP, and the -Nazi Government-British Government has agreed to keep DNA and fingerprints for 6 years.

Do you really trust this government, who have, repeatedly, over and over again, shown disregard for the law, and everyone’s rights, and only look out for themselves, and try to screw everyone over?

Evolution of communications

Posted by Monty on June 2nd, 2009

Iv been asked this question a few times when being interviewed about what I like about the internet – and one of the main things I respond with is the evolution of communications. Long gone are the days where you have to wait weeks to hear back from a friend on the other side of the world, where you have to carefully plan the time zone differences and risk calling someone on another continent when they might be asleep / waking up / not at home.

Nowerdays with RSS Feeds, twitter, Facebook, Myspace etc, you can keep up to date with all the latest goings on, while your at work, while you walk down to the shops, while you travel across the country on a train. Online communications has revolutionised the way news is broadcast across the world – no longer do certain news publishers say they have “exclusive” information – like the Mumbai terrorist attacks – updates were sent, on average, every 5 seconds regarding the attacks.

Twitter seems to have attracted a bunch of celebrities, from Alan Carr (@AlanCarr), to BoJo (@MayorOfLondon) – which breaks down another barrier when following your favourite celebrity, which in my case is Lance Armstrong – I no longer have to scour the net, seeing if he has appeared anywhere, I no long have to stay up till 3am watching Eurosport 3 reruns of the Giro d’Italia to see if he won it and where he placed, I can simply read his Twitter stream, and watch a few of his pre race video’s. I can get (near to) live updates on what he’s upto, and a bunch of other people I follow.

The social media phenomenon also breaks down a few other barriers – I no longer look at Paramedics with fascination and wonder “What is their job REALLY like?” – I read a bunch of medical blogs, from Random Acts of Reality (Tom, if your reading this, you are my hero <3 ) to NeeNaw – and its such a great insight into something that everyone takes for granted. I have alot more admiration and respect for the public services, after reading the amount of crap they have to deal with, especially from drunk / drugged up members of the public.

There are down sides to this evolution of communications though – I am now less “pro active” when it comes to communicating with friends, to see what’s going on with their life. For the friends I have on Facebook, I just load up the Facebook homepage, and see what’s the latest goings on with them. I no longer need to write to my friends (who are on FB at least) and ask them how they are doing, and what iv been upto lately – its all on my stream, in pretty much as real time as I care to update it.

I still love this evolution of communications though. Everything is interlinked, everything is in the now.

My dev setup

Posted by Monty on May 21st, 2009

Well iv seen hundreds of posts such as “This is my Firefox setup” and “This is my Visual Studio Setup”, but not many that is, well basically, everything…

First off, this is my desk. Its a cheapo Ikea corner table, that fits. Iv got a bog standard mesh chair, from Ebuyer, for about 60 quid.

My hardware / desk setup:

  • Custom built Monster:
    • Quad Core Processors
    • 8gb of the fastest DDR2 ram that was out
    • Dual 500gb HDDs
    • Dual DVD writers
    • 2 monitors – one 20″ widescreen, one 19″ bog stanard, both Iiyama’s (I know i have 3 on my desk, the 3rd one is hooked up to a temp pc)
  • Sennheiser HD 465 Headphones – very comfortable, fairly cheap, I wear them for hours a day with no problems
  • A small “localised” lamp from Homebase, useful for looking at small things
  • MS Natural Keyboard
  • Microsoft Laser Gaming Mouse 6000 – Its a lightweight mouse, the last thing you want is a big heavy mouse to move around all day.
  • A speaker / subwoofer setup, from Ebuyer, for about 10 quid – for when headphones arnt good enough (probably not recommended for offices!)
  • At the bottom of the picture is a fan, for when I get hot, yeah baby! ;)
  • Im not sure why my laptop was sitting on my desk…ignore that.

My “misc” software setup:

  • Running Vista  SP1 – im tempted to run Windows 7, but not anytime soon, im just getting used to Vista!
    • UAC is disabled on Vista – its the FIRST thing i do when installing vista on a box!
    • IIS7 and management tools installed.
  • Hostsman – easy editing of your hosts file for testing
  • Winamp – for music! You cant code without music!
  • Windows Clippings – easier to use than other screen grabbing software, very lightweight, very very good, deffo worth the $18! Has useful features like timers and ability to send to clipboard etc…
  • MSN Messenger / Skype – I know some companies dont like it when their staff play around on IM, so dont abuse it – its saved my skin a few times when iv had trouble, and its less intrusive in the office than annoying someone
  • WinSCP – freeware FTP / SFTP/ FTP over SSH client – covers pretty much any server you need to connect to, its free, and it just beats all other FTP clients hands down.
  • Ultramon – you get a 2nd taskbar for your 2nd monitor, so basically only the stuff that is running on that monitor is on the taskbar.
  • Microsoft Outlook – I have outlook running for my email – its easy to use, very straight forward, and quite cool with exchange.
  • Daemon Tools Lite – when you have to mount ISOs without burning them, useful for .iso files downloaded from microsoft / off network shares.
  • Microsoft Virtual PC 2004 SP1 – free software from MS, basically allows you to run virtual pc’s – useful for running XP off a virtual machine (Crappy versions of IE, anyone?) – although I had problems installing debian on it, so im looking into running VirtualBox
  • Firefox – better than IE by MILES. Have loads of plugins, such as Web Dev toolbar, firebug, greasemonkey, firephp, Fission (cool loading bar thing), IE Tab, Its All Text (You get a cool little “Edit” button on text area’s that load it up in notepad), ShowIP (Shows ip address of server), AdBlock (blocks 99.99% of crappy ads), ColorZilla (picks colours out from page), Download Statusbar, Extended Statusbar (tells you pagesize, how long it took to load, etc).
  • Opera – because someone will complain that it dosent work in this browser
  • FeedDemon / Newsgator – Free software that sync’s with their free website, so you can still check your favourite feeds away from home. By far the cleanest, easiest to use, and best RSS reader there is.
  • Hamachi – Free VPN software that works behind firewalls, very very useful, esp when you have less tech savvy friends.

My dev setup:

  • Visual Studio 2008 Pro – Pro because you need at least that for integrated unit tests and Pex to run.
  • Codesmith Generator, with my own custom version of Nettiers code generator – WHY on earth would you want to write CRUD (Create, Read, Update, Delete) for your DB/objects over and over? Point this baby at it, and go baby go!
  • Resharper – Solution wide error highlighting BEFORE you hit the big compile button. Instant solution for alot of errors. Advanced intellisense. Advanced unit testing tools. Code clean up, inline code generation. Even does cool stuff like close your speach marks and brackets for you!
  • A White text on dark background colour theme like the image below – the last thing you want to do is look at retina scortching white screen for hours on end, it will do your eyes in, it really will.
    windowclipping-214
  • I tend to have Microsoft SQL Server installed on a virtual PC, so I can mimic the server environment – you can use the Microsoft Loopback Adapter to create your own private network – a hint, the 1.* ip address network (same for 2. all the way upto 9) is non routable, so feel free to use them for your virtual machines – i.e. my vps start off at 1.1.1.2 etc)
  • Not sure if this should go in Misc or not, but NotePad++ – iv replaced notepad.exe in window with this, and it works ACE!

Im sure I have forgotten something, so when I remember, ill add to this post. If you have any great ideas, lets hear them!

Missing page pointer: NOAVATAR

Posted by Monty on March 5th, 2009

If you get the following error with YAF:

YAF Error 1

While using a custom language pack, you probably have tried visiting the forum, and you probably have read this following, brilliant, useful post:

Very useful dev

And guess what happens when you click on that link?forum-error-google-chrome

HURRAH! Oh hangon, no thats not good. Anyway, the solution is to put this :

<page name=”CP_EDITAVATAR”>

<Resource tag=”TITLE”>Modify Avatar</Resource>
<Resource tag=”AVATAR”>Avatar</Resource>
<Resource tag=”AVATARCURRENT”>Current Avatar</Resource>
<Resource tag=”AVATARNEW”>Choose a New Avatar</Resource>
<Resource tag=”AVATARUPLOAD”>Upload Avatar from Your Computer:</Resource>
<Resource tag=”AVATARDELETE”>Clear Avatar</Resource>
<Resource tag=”AVATARREMOTE”>Enter URL of Avatar on Remote Server to Use:</Resource>
<Resource tag=”OURAVATAR”>Select your Avatar from our Collection:</Resource>
<Resource tag=”OURAVATAR_SELECT”>Click Here to Select an Avatar</Resource>
<Resource tag=”AVATARTEXT”>Avatar Explaination Text</Resource>
<Resource tag=”NOAVATAR”>[ No Avatar ]</Resource>
<Resource tag=”WARN_TOOBIG”>Image size can’t be larger than {0}x{1} pixels.</Resource>
<Resource tag=”WARN_SIZE”>The size of your image was {0}x{1} pixels.</Resource>
<Resource tag=”WARN_RESIZED”>The image was resized to fit.</Resource>
<Resource tag=”WARN_BIGFILE”>The size of your image can’t be more than {0} bytes.</Resource>
<Resource tag=”WARN_FILESIZE”>The size of your image was {0} bytes.</Resource>
</page>

Into your chosen language xml file, and it should work.


Copyright © 2007-2010 Muntedhar Alhakim. All rights reserved.