I've recently been working on an MVC.NET project. Whats interesting is that most WebForms User controls don't work because there is no post back and code behind. (Don't quote me on this, I'm still very new to it).
So anyway, I needed a table that could Sort Columns, Search Filters, Paging... I conveniently found some JQuery Tables that work on HTML Tables. See http://www.datatables.net/.
My solution built in MVC is to have a model of the data, and have the view output the model using HTML tables. This is done in ASP.NET so you use angle brackets inside the asp code to loop through all the entries. Then you use the above jquery library, which is completely client side, no server side calls.
The downside is, you retrieve all your data the first go, and load the entire table, which is slower than real paging.
Thursday, January 28, 2010
Saturday, January 23, 2010
We didn't start the Fire
The We didn't start the Fire (Original)
The original "We didn't start the Fire" by Billy Joel. Plus a collection of the Parodies out there.
Slideshow Version
We Didn't Start the Flame War
We Live in Singapora
We Didn't start the Star Wars
Facebook Anthem - I'm getting bored on Facebook
We didn't start the Viral - Tribute to Popular Viral Videos
The original "We didn't start the Fire" by Billy Joel. Plus a collection of the Parodies out there.
Slideshow Version
We Didn't Start the Flame War
We Live in Singapora
We Didn't start the Star Wars
Facebook Anthem - I'm getting bored on Facebook
We didn't start the Viral - Tribute to Popular Viral Videos
Wednesday, January 20, 2010
Update on My Life so far
South Island DVD
Took me way too long, but managed to get there in the end. Sorted through hundreds of photos to turn them into slide show movie files, one file per day. Then add music and a DVD menu to turn it into a proper DVD. Looks very kiwi/amateurish but its pretty cool. I usedDVD-Styler and DVD slideshow GUI both open source apps to make the DVD.
Took me way too long, but managed to get there in the end. Sorted through hundreds of photos to turn them into slide show movie files, one file per day. Then add music and a DVD menu to turn it into a proper DVD. Looks very kiwi/amateurish but its pretty cool. I usedDVD-Styler and DVD slideshow GUI both open source apps to make the DVD.
Back to School - well work actually.
Getting back from a massive South Island
road trip has been hectic. At work, I'm straight into with a new project kicking
off. I'm organizing Round the Bays for the company, so that will be great
fun! Our first running-bunch session starts tomorrow.
Fire on Cawley St
Check it out... its down the road from where I work, and I saw it!! wowzers it was
big
Getting back from a massive South Island
road trip has been hectic. At work, I'm straight into with a new project kicking
off. I'm organizing Round the Bays for the company, so that will be great
fun! Our first running-bunch session starts tomorrow.
Fire on Cawley St
Check it out... its down the road from where I work, and I saw it!! wowzers it was
big
Church @ Salvation Army I've attended once this past month and a bit, as
I haven't been in Auckland on Sundays much. I did however visit their new
website... nice!
Decommissioning my beloved basketball hoop
Its lasted some 3-odd years, but the rust has made it dangerously unstable. Not too sure what i'm going
to do with it, whether I'll buy another one or make my own...
Braces: 12 months and counting
Its been 1 year since I first got my braces. It was thought that we could get them off in 9 months and then use the retainers. But its taking a bit longer than expected and I'm not enjoying it one bit.
Orlando is not doing as well as expected. The team is too muddled by new players and chemistry despite having one of the best teams on paper. Their last loss to the Lakers was particularly bad after falling behind in the 1st half, crushing the Lakers in the 3rd quarter and collapsing in the 4th. The Lakers are on a roll despite Kobe's injuries. LeBron has the Cavs right up there despite Shaq getting in the way.
Tags
current events,
me,
NBA,
Orlando Magic,
Salvation Army
Friday, January 15, 2010
C# Reading from a closed Stream
Basicaly, when you read from a Stream, you must close it after you are done. But what if at some point later you need to open it and read it again? Even after trying to reopen it, it seems like the pointer is at the end and it just finishes :S
We copy the stream we want to read first, then read that copied stream. I found this code on the net somewhere, can't remember now. Very handy, stored here for later reference :)
*edit* updated by adding one line to the CopyStream method
We copy the stream we want to read first, then read that copied stream. I found this code on the net somewhere, can't remember now. Very handy, stored here for later reference :)
*edit* updated by adding one line to the CopyStream method
...
//Copy the stream first so we can open it several times
Stream responseStream = CopyStream(attachment.ContentStream);
// convert stream to string
using (StreamReader reader = new StreamReader(responseStream))
{
string text = reader.ReadToEnd();
return text;
}
...
///
/// Copy the stream for reading and writing
///
///
///
private static Stream CopyStream(Stream inputStream)
{
const int readSize = 256;
byte[] buffer = new byte[readSize];
MemoryStream ms = new MemoryStream();
int count = inputStream.Read(buffer, 0, readSize);
while (count > 0)
{
ms.Write(buffer, 0, count);
count = inputStream.Read(buffer, 0, readSize);
}
ms.Seek(0, SeekOrigin.Begin);
inputStream.Seek(0, SeekOrigin.Begin);
return ms;
}
Thursday, January 14, 2010
Geeky email
Dear Tech Support,
This year I upgraded from Boyfriend 5.0 to Husband 1.0 and noticed a distinct slow down in overall system performance, particularly in the flower and jewellery applications, which operated flawlessly under Boyfriend 5.0.
In addition, Husband 1.0 uninstalled many other valuable programs, such as
· Romance 9.5 and
· Personal Attention 6.5, and then installed undesirable programs such as
· NBA 5.0,
· AFL 3.0 and
· Golf Clubs 4.1.
Conversation 8.0 no longer runs, and Housecleaning 2...6 simply crashes the system.
· Please note that I have tried running Nagging 5.3 to fix these problems, but to no avail.
What can I do?
Signed,
Desperate.
DEAR DESPERATE,
First, keep in mind,
· Boyfriend 5.0 is an Entertainment Package, while
· Husband 1...0 is an operating system.
Please enter command: ithoughtyoulovedme.html and try to download Tears 6.2 and do not forget to install the Guilt 3.0update.
· If that application works as designed, Husband1.0 should then automatically run the applications Jewelry 2.0 and Flowers 3.5.
However, remember, overuse of the above application can cause Husband 1.0 to default to Grumpy Silence 2.5, Happy Hour 7.0 or Beer 6.1.
Whatever you do, DO NOT under any circumstances install Mother-In-Law 1.0 (it runs a virus in the background that will eventually seize control of all your system resources.)
In addition, please do not attempt to reinstall the Boyfriend 5.0 program.These are unsupported applications and will crashHusband 1.0.
In summary, Husband 1.0 is a great program, but it does have limited memory and cannot learn new applications quickly. You might consider buying additional software to improve memory and performance... We recommend
· Cooking 3.0 and
· Hot Lingerie 7.7.
Good Luck Babe!
Tech Support
Epic South Island
Is it more kiwi-like to go to the South Island or to not? - or is it just an Aucklander thing? Well of all the places I have been to, which is not a lot, the South Island is by far the most amazing, the most epic, and the most beautiful. I have travelled the North Island extensively, Rotorua is fairly exciting, New Plymouth, Muriwai, Cathedral Cove, Goat Island are all very nice beaches but none as complete as places around the South Island.
All the scenery was unreal. Its the only place where I've seen pictures, and then see that the real thing is just as good. There were a few places where it was raining and misty, and we didn't have such a great view, but we caught a break in other places so that was good.
There are plenty of activities, plenty of tourists and an overall great place to spend your holiday. I wouldn't mind living there for a few months, working and traveling in the weekends. Would be a welcome change from borring old Auckland for a while. But I think it would get borring soon, as most of the townships were pretty small. Christchurch being the largest city, but Queenstown being the most interesting and happening. Oh and its home to the great Ferg's Burgers, the best burgers in New Zealand!
On our first day, we landed in Christchurch. After picking up our rental car, we went straight to Fox Glacier via Arthur's Pass stopping at Franz Joseph Glacier. The straight roads and massive planes immediatly struck me with awe. The mountains that loomed over us could only be descriped as EPIC - I don't know how many times I've mentioned that already, but I said it a lot more in the car!
All the scenery was unreal. Its the only place where I've seen pictures, and then see that the real thing is just as good. There were a few places where it was raining and misty, and we didn't have such a great view, but we caught a break in other places so that was good.
Another awesome thing about it was the heritage. There are plenty of history to see, lots of old buildings. Theres plenty of Gold mines, including the Chinese Settlement in Arrowtown, which was home to many of the first chinese to settle in NZ.
There are plenty of activities, plenty of tourists and an overall great place to spend your holiday. I wouldn't mind living there for a few months, working and traveling in the weekends. Would be a welcome change from borring old Auckland for a while. But I think it would get borring soon, as most of the townships were pretty small. Christchurch being the largest city, but Queenstown being the most interesting and happening. Oh and its home to the great Ferg's Burgers, the best burgers in New Zealand!
I'm already looking forward to going back. I would love to see it in the South Island when all the mountains become snow capped. Go on some other adventure activities, and just experience it all over again!
Wednesday, January 13, 2010
Subscribe to:
Posts (Atom)


