About Author: mike

Website
http://www.mkingscott.co.uk
Description
A nice guy, web developer using ASP.Net, martial arts fan and practitioner (when not crippled), film buff, husband and father :-)

Posts by mike

0

A Year Of Self-Sufficiency – ta, Meryl Streep

So, last night Jacky and I watched Julie and Julia, a film about a modern-day lady (Julie Powell) attempting to cook all of Julia Child’s recipes in Mastering The Art Of French cooking. No mean feat, as Julie has 524 recipes to complete in 365 days. The film was highly entertaining, with great perfomances from Amy Adams, Meryl Streep and a favourite of mine, Stanley Tucci (a young Artie Buco?).

Anyhoo, Julie Powell blogged her progress – this was back in 2002 when all the cool kids were doing blogs, before everyone jumped on the blogging bandwagon (myself included) in order to write about what they love, as opposed to me who just needs to vent occasionally.

I’m glad to say my wife Jacky falls into the former category and, inspired by the film, has started blog with a year-long timeframe. As she is a keen gardener and wannabe smallholder, Jacky will be blogging about her attempt to become even more self-sufficient (we already grow and use quite a bit), but there’s still some lawn that hasn’t been dug up yet ;)

The blog can be found at A Year Of Self-Sufficiency, and I’ve dutifully included it in my blog roll. Her first post has been made this evening, stay tuned for more :)

0

Useful .Net LINQ, part 387 ;-)

Here’s another post to help me keep track of .Net stuff I find useful :)

This time, it’s how to get a string array of selected values (or text strings back from a ListBox via LINQ:

public string[] GetSelectedSearchFields() {
return uxFieldList.Items.Cast().Where(li => li.Selected).Select(li => li.Value).ToArray();
}

Obviously, uxFieldList is my ListBox, but it could be any List-supporting control, e.g. CheckBoxList, etc. If you want the text of the item instead of the value, simply change li => li.Value to li => li.Text. And I’m sure you can make more of the method than me, but I subscribe to the KISS approach ;)

0

Office-style buttons (accompanying images) with CSS

Image of what the rest of the post is about:

CSS Buttons

(Excuse the rest of the site / styling, it’s the ASP.Net default one)

Well, I’ve been meaning to write this post for a while, it’s another one of my “if I don’t write this down somewhere I’ll forget it” entries, of which I need to write a couple more, but they can wait.

Please note that this is for ASP.Net web development and CSS (Cascading Style Sheets), so if you’re expecting some funny clips, film trailers, a sad litany of my latest injuries, or Hungarian donkey porn, you’ll have to wait ;)

As part of a project I’m working on, a requirement was to have buttons with small images next to them, similar to the MS Office buttons, or like the links in IE’s Favorites bar that have the favicon next to them. I seem to recall that you couldn’t (easily) add an image to a button, so I kinda cheated and used an ASP.Net LinkButtons. These are hyperlinks that can also have server-side events. The styling of the button was what I was after, not the plain text, so I set the LinkButton to render as a button, and added the following style declaration (via the LinkButton’s CssClass property).

<asp:LinkButton runat="server" ID="uxPrevL" CausesValidation="false" CssClass="button back" Text="Prev" OnClick="uxPrevB_Click" Visible="false" Width="75px">

As you can see, I’m adding two style classes, button and back. Note that I’m also setting the width of the button, this can also be done via CSS, or with ASP.Net theming.

Here’s another button:

<asp:LinkButton runat="server" ID="uxNextL" CssClass="button next" Text="Next" OnClick="uxNextB_Click">

As you can see, the style classes for this button are button and next. Here’s the style definition for button

.button
{
background-color: #ddd;
background-position: 5% 50%;
background-repeat: no-repeat;
border: 2px outset #ddd;
cursor: pointer;
display: inline-block;
margin: 5px;
padding: 5px 5px 5px 25px;
text-align: center;
text-decoration: none;
}

As you can see, we’re setting a few background properties, a border, a handy (ha ha) cursor to illustrate the button is clickable, making the element display as inline-block, setting margins and border and padding, and some text alignment gubbins.

The important part here is the background-position property. Whatever background we place on the button will be position 5% of the width in from the left and 50% vertically, or, technically speaking, nudged in a bit and slapped in the middle. I was slapped in my middle one, I didn’t like it…

Ok, let’s get those images declared – remember we’ve got two style classes being applied, so here’s the necessary declarations:

.back
{
background-image: url('../Images/back.png');
}
.next
{
background-image: url('../Images/next.png');
}

And that’s basically it – you just declare the (appropriately sized) images you want to appear on the button and through the CSS magic of “applying several styles”, it works – honest ;)

I also changed the color of the button text when the mouse hovers over the button, and gave a faux “pressed in” appearance when they button was clicked via the following:

.button:hover
{
color: #000;
}
.button:active
{
border-style: inset;
}

The button was tested in IE7+ (forget you, IE6!) and FF3+, which were our target browsers, and should be ok on Mac browsers as well.

Let me know what you think, if you like :)

Tags: ,
0

Two videos for your enjoyment

Well, it beats doing a real, researched blog post at 11:36pm ;)

First off, as I’m a fan of pratfalls and slapstick, a chap call Larry Griswold (Clark’s dad?) on The Frank Sinatra show. Now, I do a lot of falling over, but this guy does a lot more and walks away unscathed, quite a talent. It’s basically a high dive routine, but the guy’s a bit drunk and unsteady:

That was courtesy of Boing Boing

Next, a trailer for a new film called Battle For Los Angeles – it looks like Independence Day + War Of The Worlds + Skyline, but, you know, better:

Warning: the trailer allegedly contains the Brown Note, but no effects were observed :)

That was courtesy of First Showing, where you really should go to read more about the film and just in general, as it’s a great site for films :)

0

Happy New Year, 2011 edition ;-)

A Happy New Year to you! I’m currently sat in the cold study, while my wife and son are reading and playing in the slightly-warmer study. I had tapped this post out on my phone, but the upload failed so now I’m forced into the cold study to do it, grrrr!

We had a very enjoyable Christmas spent with my mum, my sister and her daughter (my niece). My aunt and uncle were not able to make it down due to the snow, so it was a bit quieter than usual but still a great Christmas Day. We had planned to go on a walk on Boxing Day but that was slightly ruined by me falling down the stairs and gashing my foot open. We left a bit earlier than intended, but it was a still a very pleasant stay,

We spent the next couple of days at the in-laws, which was also great if not a bit crazy on the second day with more small children added to the mix. Again, a great couple of days.

What has been very nice is the amount of hoiday we’ve had, and we’ve been very lazy during it, which is great. We’re usually quite busy most of the time, so it was great just to stop and put our feet up for a bit, apart from when we had to get the house ship-shape for the in-laws coming around on New Year’s Day for lunch and tea, to repay them for their hospitality over Christmas.

Our New Year’s Eve was quiet; we all stayed up to watch Big Ben’s bongs and the fireworks and passed our time by watching The Sorceror’s Apprentice and Jools Holland’s Hootenanny :)

As for New Year’s Resolutions, I have only one: get down to 12 stone. Whilst I was on the steroids for Bell’s Palsy, I put on half a stone (in four days!) and in the run-up to Christmas, I’ve put on a bit more, so it’s time for less food and more exercise. I’ve got down to 12 stone before for both Dan gradings, so it’s definitely achievable. I will be using this blog and my Twitter to keep myself motivated.

I also resolve to blog a bit more (although Twitter seems to satisfy that need), and regain some of my flexibility in kickboxing.

Anyway, Happy New Year to you, I hear Black Ops (Christmas present) calling…

0

Irish bail-out – shenanigans?

Just a thought: I’ve read that Ireland, if they “dip into” the EU bail-out, may lose their economic and political independence as a consequence. Given all the talk about the possibility of Ireland needing the bail-out is leading to other countries to withdraw money, is it possible that the talk is being engineered by the Franco-German facet?

0

Lead leg jump back kick

Before I became old and crippled, I used to have a fairly mean jump back kick. To be fair, I still have one, it’s just lacking in height. An alternative to the “standard” jump back kick (from left stance, you’d be kicking with your right leg), is the lead leg jump back kick. With this, from right stance, you fake a rear kick with the left leg, take off and kick with the right.

I was doing a couple of these last traning session, and they were going ok, just a little low. Clearly, as seen in the below video (at 3.30), I should stand on a table:

The chap throwing the kick is martial arts legend Benny “The Jet” Urquidez, and the poor chap being booted in the neck is Yuen Biao – or rather his stunt double ;)

Anyway, it’s inspiring :)

0

A follow up to Where Should I Be?

Reading back on my Where Should I Be post, there was a underlying current to that post. The simple answer to the Where Should I Be question was this:

In another company.

It wasn’t about the development choices (I’m still doing ASP.Net development and loving it), or learning a few new things (I’m currently getting to grips with the Telerik ASP.Net AJAX control suite), and working with a great bunch of people. In fact, the development team actually got applauded a last week for a demo; I don’t think that would have happened at the old place.

Anyway, time for bed, but I really must blog some more as there’s lots happening in the world that requires my oh-so-important view on it ;)

0

New job = blogging on the bus

I started my new job for a larger-than-normal start-up on Monday, and it seems to be going well. I’m working with a very pleasant and like-minded group of people, which is always a plus :-)

The only downside is travelling by bus as it takes so long, but it gives me the opportunity to read, check news and Google reader, and blog, as I’m doing now.

That said, I’ll be taking the train as soon as I can, as it will afford me two brisk walks every day ;-)

0

Polo Sucker or Cruncher = inane

So, on the bottom of my MSN app, there’s the following ad:

“Are you a Polo (R) Sucker or Cruncher. Take the test to find out!”

Leaving aside the unforgivable exclusion of a question mark (yes, I’m a grammar nazi), I suggest that people who need to take a test to find out if they suck or crunch a Polo shouldn’t be out in public on their own ;)

0

The political situation, part 1

Not that my opinion counts for anything (apart from at the ballot box), but here’s how I see things at the moment:

I’m a bit dismayed that the coalition is acting like the last Government, but I believe this is down to the LibDem influence. Never mind, a quick email to my MP via WriteToThem may garner a response :)

0

Due Date trailer

Well, I best share this as it looks very funny. It’s got that chap out of The Hangover in it, and some guy called Robert Downey Jr. The latter has to get to the birth of his son by the due date, and the former is “helping” him get there.


Looks good, hopefully it’s more Hangover 2 than the official Hangover sequel, which I really don’t think is necessary.

H/T to FirstShowing.net

0

Bell’s Palsy sucks ass, day 26

Well, I had my final Prednisolone 5mg tablet yesterday, so that’s a milestone of sorts. I was decreasing my does by 5mg a day, and have really been enjoying the lack of feeling sick and I’m feeling less anxious. I’m seeing the doc again tomorrow, and we’ll take it from there.

I’m still feeling a bit shaky and anxious, but I guess that will take a while to wear off, and hopefully there’s no “coming off” (ooh-er) side-effects.

My face has definitely responded to the steroid treatment, but it’s not back to normal yet, something that could take another nine months or so, seeing as the facial nerve re-grows at about one millimetre a day. But at least it re-grows :) Apparently, the B range of vitamins helps, which I’m already taking.

Stay tuned for more updates ;)

0

The Other Guys review – 8/10

So, made good use of my time off today to recuperate in a cinema. I’ve been wanting to see The Other Guys since I saw a trailer, and it had a few good reviews, and the price was right – £4.90 for a digital projected film? Cheap at half the price ;)

To sum up the plot, the two “hero” cops of the NYPD (played briefly by Samuel L. Jackson and Dwayne Johnson) are, er, removed from service and the other guys, the guys who do their paperwork, need to step up and fill the missing places. Well, one of them does – Hoitz (played by Mark Wahlberg) is a very angry cop, desperate to prove himself and a bit of a mess. He drags his partner, Gamble (played by Will Ferrell) into an investigation sparked by Gamble’s boring investigation into scaffolding permits, and it escalates from there.

This is not a buddy-buddy movie – Hoitz hates Gamble (and most other guys), has no problem telling him to his face, but Gamble is able to respond in his own way. Obviously, the pair warm to each other a la Lethal Weapon but with more laughs.

The film takes a rapid-fire approach to the humour, and there are some great, great lines in there. A favourite is Hoitz’s disparaging remark about Gamble’s Prius: “I feel like I’m driving around in a vagina”. The poor Prius comes in for far worse though.

Mark Wahlberg, no stranger to gritty drama and hard-nosed characters, plays the comedic role well, and makes it work. His frustration at his partner, his job, his life easily comes out but never seems like exposition. Will Ferrell, who can be samey at times, is reined in here and is far more funny as a result. As someone else said, he plays Gamble as his usual man-child character with a few quirks – he’s a babe magnet, which confuses and consternates Hoitz, and provides a great scene when Hoitz meets Gamble’s wife, played by Eva Mendez. Speaking of whom, she’s really funny in her screen-time, but again, comes across as a real character and not just a comic foil. The same can be said for Michael Keaton, who is just excellent in his role as the police captain – again, lots of good, quick one-liners from him.

The comedy does slow a bit towards the end of the film, but it allows the characters the necessary time to establish the situation and Show Growth ™. The end of the film is suitably bombastic and a great ride. Speaking of the end of the film, stay for the credits, as it explains what a Ponzi scheme is (involved in the film), and details about US financial bail-outs, CEO remuneration, etc. – it’s quite educational.

Overall, I’ll give it 8 / 10, a very funny comedy :D

Coming Soon: I saw trailers for The Town, which looks excellent, and RED (Retired Extremely Dangerous) which looks like a lot of fun, so they’re on the “to watch” list.

0

Added tweets to sidebar

The right sidebar now displays my latest tweets, thanks to Rick’s Twitter for WordPress plugin. It was simple to install and configure, and you can use it in-page or as a widget.

I’ve also changed the colour of my links, which necessitated a big of jiggery-pokery with CSS, been a while since I’ve done that :)