Thursday, 16 October 2008

Guest Lecture: Emerging Technologies covering database

I had done a guest lecture for INFOSYS330 in University of Auckland this afternoon. It was good... I think? Usually in the second last week of the semester there are not many students attending class, but this lecture marks attendance, so nearly everyone come to lecture, ha-ha. That made me feel better. :D

Anyway, just want to put up some slides and code. 

Here: slides and codes

 

P.S. I have polygon data for NZ map - and yes, I traced it. :P

Tuesday, 7 October 2008

Facebook speaks Pirate!

Tim from the Auckland University told me about this today! Wow! Didn't know that Facebook can speak Pirate English!

image

image

Friday, 3 October 2008

Imagine Cup 2009

clip_image002

http://www.microsoft.com/nz/imaginecup09/

Yes! Imagine Cup – “The world’s premier student technology competition” – is here again! This year we are going to mentor a team. Which one? I have no idea yet, haha. I am very excited about this event and mentoring. :)

If your company wants to mentor a team as well, please email icnz@microsoft.com. Look forward to have our team competing with yours! :P

Friday, 26 September 2008

Annoying VS2008 System.Runtime.InteropServices.COMException

I was a bit annoyed, and whatever people say in here didn’t solve my problem. >_<

If you got this when you open a Web services project:

image

Run your Visual Studio as an administrator (in Vista, in order to access IIS metabase)!

Friday, 19 September 2008

XAML: Diff between Rectangle and Border?

image

So here we are, a rectangle and a border with curved corners. Hmmm, what are the differences between them? Why different property names and API? Maybe I am too dumb to discover. Can someone please let me know?

XAML: Curved Corner Rectangle *Update

Simple. <Rectangle /> cannot have curved corner.* If you want a curved corner filled rectangle, use <Border />.

* Ivan told me that, actually you can! Check out the RadiusX and RadiusY properties!

Example:

<Border x:Name="ShapeBorder" Height="25" Background="Aqua" CornerRadius="3"
BorderThickness="1" BorderBrush="Black" />

The key attribute is CornerRadius! :)


image

Thursday, 11 September 2008

Demonstrate Drag and Drop from ListBox to ListBox in WPF

Still haven't be able to created the memory leak problem.

I have implemented simple drag and drop from one ListBox to another ListBox onto my memory leak test project. The power of WPF, all I did was create an adorner for visualising drag and drop, and remove/add object from/to the data binding sources.

By the way, no guarantee to be bug-free because implementing drag and drop logic was not my intention. I am trying to find out the memory leak problem!

Download

Anyway, let me note some key points:

1. A Canvas encapsulating the ListBoxes (in ShapeListCollectionControl.xaml)

<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="TestCanvas"
DragOver="TestCanvas_DragOver">
    <ListBox Width="300" Margin="0,0,0,0" Name="TestListBox"
PreviewMouseLeftButtonDown="TestListBox_PreviewMouseLeftButtonDown"
AllowDrop="True" Drop="TestListBox_Drop"
GiveFeedback="TestListBox_GiveFeedback">
<ListBox.ItemTemplate>
<DataTemplate>
<main:ShapeListControl ListID="{Binding Path=ListID}"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Canvas>

Don't worry about the event handlers yet. Having a canvas as a wrapper allow you to add adorner to the canvas when you start dragging.

2. Start dragging - TestListBox_PreviewMouseLeftButtonDown (in ShapeListCollectionControl.xaml.cs)
Note that I didn't write the GetObjectDataFromPoint method, I didn't even find it. All I have done was made it into an extension method.

Anyway. So the PreviewMouseLeftButtonDown event handler does the following:

i. Find out what has been dragged
ii. Find out the object list
iii. Set the selected shape
iv. Create Adorner and add to the canvas
v. Remember the offset positions
vi. Start dragging

3. Dragging - TestCanvas_DragOver
Note that here I am dragging the adorner, NOT the actual control. And it is in the canvas, not the ListBox!

4. Dropping - TestCanvas_Drop
To drop the selected shape, find the ShapeList by drop position. In the data model, remove the shape from the list we drag from and add to the list we drop to. After that remove adorner and reset selection.

object data = TestListBox.GetObjectDataFromPoint(position);

if (!(data is ShapeList))
{
RemoveAdorner();
return;
}

ShapeList list = data as ShapeList;

// Change Data
if (Manager.FromList != null)
{
Shape s = Manager.SelectedShapeControl.Shape;
Manager.FromList.Remove(s);
list.Add(s);
}

Wednesday, 10 September 2008

Quick WPF Data Binding Illustration

I have to admit that what I said in the title was not what I intended to do.

Tonight I was writing some stuff up trying to recreate the suspicious ObservableCollection<T> memory leak issue that I mentioned to Jonas, so he can have a look and maybe tell me what the problem was. Strange that this simplified version seems to work fine. I am not sure it's the power of SP1, or it's just because I left something out. Anyway, I am going to test that again in the office tomorrow, or next Monday after the ski trip.

Anyway, since I have created this simplified version already, why not upload it. Due to the fact that this is something I mock up very quickly, it does illustrate some general concept/code usage in a plain way. Let me talk about the following:

  1. Border
  2. Namespace
  3. Data Template
  4. Style Setter
  5. Set ListItem positions inside a ListBox
  6. ObservableCollection<T> and INotifyPropertyChanged
  7. ...

Not now. It's 10:30pm already. I will first upload this, and talk about the stuff tomorrow. :)

Download

XAML: Import namespace for controls

image

To use your own user control, remember to import namespace:

    xmlns:main="clr-namespace:TestMemoryLeak"

Then you can use your control:

<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ListBox Width="300" Margin="0,0,0,0" Name="TestListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<main:ShapeListControl ListID="{Binding Path=ListID}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Canvas>

XAML: Curved Corner Rectangle *Update

Simple. <Rectangle /> cannot have curved corner.* If you want a curved corner filled rectangle, use <Border />.

Example:

<Border x:Name="ShapeBorder" Height="25" Background="Aqua" CornerRadius="3"
BorderThickness="1" BorderBrush="Black" />





The key attributes is CornerRadius! :)






image



* Ivan told me that, actually you can! Check out the RadiusX and RadiusY properties!

Thursday, 28 August 2008

After Girl Geek Dinner #5

Finally, I have done my Girl Power talk in the Girl Geek Dinner. Yes, my usual way of presentation, i.e. all I have prepared were my slides. No notes, no plan, cannot remember what slides I have, and no idea what I am going to speak next. All I had was the power point presentation I created in an hour or two. I always think this is the best way for presentation, hope people think it did go okay.

Not that I didn't want to spend more time on the presentation though, it's just because I was so busy these two weeks. Well, although I am saying that I was busy, however I am still working 40 hours week, which comparing to Amanda's 70-80 hours week I should have no complain. The problem about me is I have to sleep a lot. Saying "A lot", I do means "A LOT", usually 8.5 - 10 hours a night. Hubby said I sleep more than a pig.

Look forward to the GGD on Tech Ed's Monday night!

Monday, 11 August 2008

Auckland Girl Geek Dinner 28th August 2008

image

Maybe a little bit too brave, but I am going to speak for 30 mins in the upcoming Auckland Girl Geek Dinner (see http://girlgeekdinners.co.nz/, although what am I going to speak is not up there yet). As you may already discovered, I like listening to other people techie talks, but myself don't like to do techie talk. Therefore, I am not doing one of those about REST, Silverlights, WPF, SQL Server 2008, AJAX, LINQ, Flash (oops, not MS!), Visual Studio 2008, TFS... etc hardcore stuff. Instead, I am going to do some relaxing thing, and my topic is "Girl Power! Why the world need us".

Well, this industry is for sure a male-dominant one, see last week in the .NET User Group for evidence. Yes we had 72 people, but in these 72, we have 3 girls from Olympic Software (my company), 2 from Kiwiplan (both are java developers, one was the speaker's wife and one was the girlfriend of a guy from Olympic), and 1 from the Software Engineering department of the University of Auckland. 6 girls among 72 people, that's 8.33333333333333%. Therefore, I am going to talk about why we need more girls in this industry, and as so-called* girl geeks, how can we make the difference in our work environment as well as the community.

Many people may probably think this is not important at all, but I tell you, Na! Come along and you will know. If you are a guy and would like to come, same old rule, you need to be invited by a girl! :D

Auckland Code Camp 2008

Hello guys and girls, yes! Code Camp is here again! If you came last year you'd know how good it is, and I have to tell you that this year it is even better! This year code camp is going to be more relaxed, which suits my personality very well, ha ha. Anyway. you can register at http://codecamp.net.nz and you have to be quick because we have over 200 registration already!

Date: 31st August 2008

Time: 9:00am - 6:00pm

Venue: Crown Plaza Hotel in Auckland (just next door to Tech Ed)

Cost: Free! Lunch will be provided by our sponsors. The after-match function is an optional dinner to be held at a restaurant within walking distance of the Crowne Plaza. Cost of the dinner will be less than $30.

Agenda:

We are close to finalising the sessions. Speaker details and a full agenda will be available shortly.

Sessions for the day will be:

  • Thinking in WPF
  • Silverlight for developers
  • WCF
  • ASP.NET MVC
  • Real world TDD: Building Dependable Code with Dependency Injection
  • As well as a bunch of Lightning Talks showcasing projects, products, companies and people in New Zealand

The day will run from 9am till 6pm, with a lunch and afternoon tea provided by the generous support of our sponsors (Datacom, Olympic Software, Intergen, Microsoft MVP).

Plan to stay until 6pm, as we're gathering up prizes to give away at the end of the day.

In fact, plan to stay the night, as we'll be going out for dinner afterwards.

So Register Here: HTTP://CODECAMP.NET.NZ

Post - .NET User Group 9 - Building line of business applications with Silverlight

n732077412_1100526_4189 Last Thursday we had our 9th .NET User Group meeting. Guess what, we got 72 people in total! It's very impressive. Darryl thought it is the biggest single user group he ever heard of in New Zealand .NET community. I think it's probably the case. Honestly we cannot fit anymore people in the room so in the future if we have a bigger number, we will have to do it in our warehouse. Good to see this number of people turned up. :)

Rob has put up the slides and the source code on his blog. Take them and play around with it!

Friday, 25 July 2008

.NET User Group 9 - Building line of business applications with Silverlight

Presented by Rob Fonseca-Ensor from Datacom

Date: Thursday 7 August 2008
Gather at 5:45pm, starting at 6:00pm
Catering: Pizza & Drinks (we will have chicken pizzas this time!)
Door Charge: Free!
Venue: Olympic Software, 10 Cawley Street, Ellerslie, Auckland (find a map here)

Parking: Free, just park in Olympic Software’s car park
Register here: Ellerslie DNUG or Dot Net NZ (please register)

 

Business value with Silverlight: Reading, Writing, Binding, Validating and Visualising your Data. Rob Fonseca-Ensor from Datacom will walk you through the steps to building useful, real world silverlight applications. Learn how easy it is to build a .net rich internet application with Silverlight & REST (via ADO.Net Data Services)

Friday, 18 July 2008

Software Development Meme

Alex has tagged me for this one. I haven't thought of who to tag yet at this moment. Let me see at the end of this.

How old were you when you first started programming?

18. First year of my university, COMPSCI101. It's an introduction to java programming paper. Of course I didn't start programming earlier than that! I am not a geek, I told you guys. :P

Oh wait, does LOGO count? If LOGO does count as programming, then I "started" programming at 14 in St. Stephen's Girls' College.

How did you get started in programming?

If LOGO doesn't count, then it's university. One day I had to decide what are we going to do for my bachelor degree, and I found out that Software Engineering is the only thing I could possibly do. I dislike commerce stuff, not good at nor interested in language, good in science but didn't want to go any further than differentiation and integration. So, I started my SE degree.

What was your first language?

LOGO! Can you believe that I do LOGO before html? Well, if both of these don't count, then it's java, and I touched assembly language before C#.

What was the first real program you wrote?

Pac-man game I wrote in COMPSCI101 is the earliest "real" program I can remember. If you are talking about commercial program, then it's something I better not talk about here in my blog. You can come ask me about that.

What languages have you used since you started programming?

Java, C#, C++, VB6, VB.NET, T-SQL, Action Script (flash), java script, PHP, NAnt script, Mozart Oz, assembly languages, alloy, JSP, pls, 4gl, HTML.

What was your first professional programming gig?

That's the "better not put it here" part. You can ask me.

What's the most fun you've ever had... programming?

I enjoy programming most of the time, but honestly programming is not the bit I enjoy most. I like meeting people, share their ideas, their difficulties or fun part in programming or anything related to their life of programming.

If you ask me what is the most fun part... I think it's when you design and build a thingy to solve other people's problem. Maybe they are your clients, maybe they are your colleagues. Problem solving with programming, is the most fun part, all time.

Who's next?

  1. Andre Meurer
  2. Rodney Lake
  3. Darryl Burling

Wanted to tag Alex James and JD as well, but they are tagged already. :P

Thursday, 10 July 2008

Post - .NET User Group 8 - A Tester’s Perspective

It was a great night and we had around 30 people for the meeting. It's a good mixture between developers and testers. Yes, we are trying to break the walls between these two groups, who as Hafiz said, always like having a war between them. Fortunately it's never a big problem in Olympic as we all have fun together and sit around each other. Have to admit that "Strange - it works on my machine!" is one of everyone's favourite lines here. Haha.

By the way, you can download Hafiz's presentation slides here. Oh yeah, sorry that we have removed some animation and it is in pdf format anyway. So less fun for people who didn't come! :D

Tuesday, 8 July 2008

.NET User Group 8 - A Tester’s Perspective

Presented by Hafiz Vegdani

Date: Wednesday 9th July 2008
Gather at 5:45pm, starting at 6:00pmCatering: Pizza & DrinksDoor Charge: Free!Venue: Olympic Software, 10 Cawley Street, Ellerslie, Auckland (find a map here)
Parking: Free, just park in Olympic Software’s car parkRegister here: Ellerslie DNUG or Dot Net NZ (please register)

HELLO... HELLO... Testing 1, 2, 3... Testing 1, 2, 3...

Did you ever see software testing as part and parcel of the Software Development Life Cycle? Are you aware of the challenges of Software Testers?

Come to our next Ellerslie .NET User Group meeting and find out about:
· QA functions
· UI standards
· Visual Studio Testers Edition at a glance
· How to write and maintain test scripts
· Types of testing
· Test process definitions
· Testing principals
· Attitudes of people

Hafiz Vegdani is a Lead Test Analyst at Olympic Software. He has 8 years experience in software testing.

Tuesday, 17 June 2008

Using Windows Form Control in WPF

Interesting enough that WPF does not have DateTimePicker (or Calendar). So we have decided to use the Windows Form DateTimePicker for now (just for now). Using a Windows Form control in WPF is not hard at all. :)

First of all, add a Grid to wherever you want your control to be:

    <Grid Height="28" Margin="116,0,0,49"
Name="DateGrid" VerticalAlignment="Bottom"
HorizontalAlignment="Left" Width="195">
</Grid>

Then add References to System.Windows.Forms and WindowsFormsIntegration and using:

using System.Windows.Forms.Integration;
using System.Windows.Forms;

Now, in your Window/UserControl Loaded event handler, create the Windows Forms Control and add it to the grid - by first adding it to WindowsFormsHost.

private void Window_Loaded(object sender, RoutedEventArgs e)
{
WindowsFormsHost host = new WindowsFormsHost();
DateTimePicker dateTimePicker = new DateTimePicker();
dateTimePicker.Width = (int)this.DateGrid.Width;
host.Width = (int)this.DateGrid.Width;
host.Child = dateTimePicker;
this.DateGrid.Children.Add(host);
}

That's it!

Friday, 6 June 2008

Refactoring: LINQ and Lambda Examples

I had migrated a project from .NET 2.0 to .NET 3.5. Guess it's also a good time to test some simple LINQ and Lambda. :)

Example 1: Simple List<A> to List<B>

List<ItBase> items = new List<ItBase>();

List<DBEntityBase> entities = GetDBEntities(typeof(ItBase), ids);

foreach (DBEntityBase entity in entities)
items.Add((ItBase)entity);

becomes

List<ItBase> items = new List<ItBase>();

List<DBEntityBase> entities = GetDBEntities(typeof(ItBase), ids);

items = entities.ConvertAll<ItBase>(e => (ItBase)e);

Example 2: Return members of List<A> with conditions


List<Attachment> attachments = new List<Attachment>();
foreach (Attachment attachment in this)

{
if (attachment.AttachmentType == attachmentType)
attachments.Add(attachment);
}

return attachments;
becomes

List<Attachment> attachments = new List<Attachment>();

return attachments.FindAll(a => a.AttachmentType == attachmentType);

Example 3: from array of int (index) returns List<Y> objects
List<ItBase> items = new List<ItBase>();

foreach (int id in ids)

{
items.Add(this[id]);
}

return items;
becomes

List<ItBase> items = new List<ItBase>();

items.AddRange(from i in ids select this[i]);
return items;

Example 4: From List<A> to List<B> but A and B are not inherited classes

List<User> users = new List<User>();

foreach (UserData userData in result)
{
User user = new User();
user.Email = userData.Email;
user.ID = userData.ID;
user.Name = userData.Name;
users.Add(user);
}
becomes

List<User> users = new List<User>();

users = result.ConvertAll<User>(r =>
new User
{
Email = r.Email,
ID = r.ID,
Name = r.Name,
}
);


WPF Example: Create UserControl and binding properties in a ListBox

see http://decav.com/blogs/andre/archive/2007/05/27/wpf-binding-to-properties-in-your-usercontrol-or-window.aspx

In order to bind the property, it needs to be a DependencyProperty, but not just that! You also need a control in XAML binding to your property. For example the following Control1 has a Message property:

XAML:

<UserControl x:Class="JSpike.Control1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="Control1Name">

<Grid>
<TextBlock x:Name="textBlock" Text="{Binding ElementName=Control1Name, Path=Message}"
Width="100" Height="25" Background="Aquamarine"></TextBlock>
</Grid>
</UserControl>

CS:

namespace JSpike
{
/// <summary>
/// Interaction logic for Control1.xaml
/// </summary>
public partial class Control1 : UserControl
{
public Control1()
{
InitializeComponent();
}

public static DependencyProperty MessageProperty = DependencyProperty.Register(
"Message", typeof(string), typeof(Control1));


public string Message
{
get
{
return (string)GetValue(MessageProperty);
}
set
{
SetValue(MessageProperty, value);
}

}
}

Now I want to bind this in a ListBox on Window1.xaml:


XAML:

<Window x:Class="JSpike.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:myCtrl="clr-namespace:JSpike"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ObjectDataProvider x:Key="MyStringData"
ObjectType="{x:Type myCtrl:ListOfStuff}" MethodName="GetList" />

</Window.Resources>
<Grid>
<ListBox ItemsSource="{Binding Source={StaticResource MyStringData}}"
Margin="0,36,78,0">
<ListBox.ItemTemplate>
<DataTemplate>
<myCtrl:Control1 Message="{Binding Path=.}" Height="37"
HorizontalAlignment="Left" VerticalAlignment="Top" Width="105"></myCtrl:Control1>
</DataTemplate>
</ListBox.ItemTemplate>

</ListBox>
</Grid>
</Window>

Class ListOfStuff is the data provider:

namespace JSpike
{
class ListOfStuff
{
public List<string> GetList()
{
List<string> list = new List<string>();
list.Add("Hello");
list.Add("Goodbye");
list.Add("Heya");
list.Add("Cya");
return list;
}
}
}

Result:


image

Thursday, 8 May 2008

.NET User Group 7 - REST in .NET

Presented by Alex Henderson from Dev|Defined Limited

Date: Wednesday 28 May 2008
Gather at 5:45pm, starting at 6:00pm
Catering: Pizza & Drinks (we will have chicken pizzas this time!)
Door Charge: Free!
Venue: Olympic Software, 10 Cawley Street, Ellerslie, Auckland (find a map here)

Parking: Free, just park in Olympic Software’s car park
Register here: Ellerslie DNUG or Dot Net NZ (please register)

 

A quick tour through the concepts of REST, or REpresentational State Transfer, including why you would use REST over WS-* and how you can implement REST'ful API's with .Net using WCF, ADO.Net Data Services (Astoria) and Open source Frameworks, how to address security concerns, and what the future of REST may offer us.

Friday, 11 April 2008

Interesting Screenshot of VS2008 Beta2 Installer

interesting_screenshot_of_vs2008_beta2_installer

Visual Studio 2008 has been designed for unprecedented reliability.

It will never do any of the following:

  • Give you up
  • Let you down
  • Run around and desert you
  • make you cry
  • Say goodbye
  • Tell a lie and hurt you

Thursday, 10 April 2008

Hide Blogger's navbar (2)

http://dev-for-fun.blogspot.com/2007/08/hide-bloggers-navbar.html

Another simpler method, add CSS class!

#navbar-iframe {
height:0px;
visibility:hidden;
display:none;
}

Wednesday, 9 April 2008

Gotcha: Why position:fixed header scroll?

Look at http://mix08.com and you can see the header was not scrolling because it has position:fixed in its CSS class. We tried to do something similar but the header keep scrolling. The html is very simple, too simple to have anything wrong, so we couldn't tell what's the problem with it.

All we were missing, was this - the DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

After we discovered it of course I did say "Of course!" (not "Eureka!"). But when we were writing HTML in notepad, the simplest thing is always what we would have forgotten.


I tell you, life is full of small annoying stupid problems like this one.

Tuesday, 8 April 2008

Feature Silverlight Example of the Day: Along the River During the Ch'ing-ming Festival

http://learnet.npm.gov.tw/silverlight/

This is really impressive, from both a Chinese and a Developer point of view. A Must-See.

.NET User Group 6 - MIX08: A Developer's Perspective

Presented by Nigel Parker from Microsoft

Date: Tuesday 15 April 2008
Gather at 5:45pm, starting at 6:00pm
Catering: Pizza & Drinks (we will have chicken pizzas this time!)
Door Charge: Free!
Venue: Olympic Software, 10 Cawley Street, Ellerslie, Auckland (find a map here)
Parking: Free, just park in Olympic Software’s car park
Register here: Ellerslie DNUG or Dot Net NZ (please register)

Now in its third year, MIX08 took place in Las Vegas from March 5-7 2008. MIX is an intimate opportunity for cutting-edge technical, creative and business strategists to engage Microsoft in a conversation about the future of the web.

Nigel travelled to MIX and brought back with him a wealth of information and resources. Join Nigel as he showcases technical aspects of Microsoft's latest web technologies including Silverlight 2, .NET 3.5 and Live Services.

Thursday, 20 March 2008

Post - .NET User Group 5 - Introduction to the ASP.NET MVC Framework

19032008042aWow! We got 50 people last night! See the crowd, it's really amazing.

This is the first time I met JD and he is a very nice guy. I was shocked that he's younger than me and started programming when he's about 8 (very geeky! :P). He gave us a very good introduction to the MVC Framework, which was not too overwhelming, just right, especially everyone in the room has just finished a whole day of work and looking forward to Easter weekend. JD has presented quite a number of demos and that helped me to absorb the ideas a lot easier (Here you can download the slides and demo). I have to admit that although the MVC concept born before my time, I only have a really high level understand of it. Now I know a bit more and ready to test this .NET MVC framework out.

19032008046a Overall it's a very good night. I saw many old faces and some new faces,  including some girls I've never met before (you know, there are really not many girls around). For some people this is the first time they come to our events, and they asked how often do we have such event and commented it is a very good one because it also allows people from the MS community to meet each other. I was happy to hear that. It's good that everyone's happy. I like to see people are happy.

19032008050bThis time we have vegetarian, chicken, seafood and normal pork pizzas, but I think we should have ordered 1 more vegetarian pizza. Interestingly no matter how many pizzas we order, there are always some leftover. André said people tend to not eat the last few pieces. I asked JD to bring some back to Wellington but he said his bag could not fit them. Ivy took away one, Pedro took some for breakfast (he likes cold pizzas), and we still have about two pizzas left. Oh well, better than not enough. :)  I wasn't very hungry, but still have eaten many pizzas. Dinuka captured a picture of me concentrating, "investigating" the seafood pizzas and try to "calculate" how much more I can eat.

As a conclusion, it's all good! ;)

Friday, 7 March 2008

No more "Click to activate and use this control" (2)

See: No more "Click to activate and use this control"

Actually, I have another approach to this problem.

First of all, create an external js file with the following code:

objects = document.getElementsByTagName("embed");
for (var i = 0; i < objects.length; i++)
{
objects[i].outerHTML = objects[i].outerHTML;
}

OR

objects = document.getElementsByTagName("object");
for (var i = 0; i < objects.length; i++)
{
objects[i].outerHTML = objects[i].outerHTML;
}

Depends on whether you use <OBJECT> tag or <EMBED> directly.

Then at the very bottom of your HTML page, add the script reference in:

<script type="text/javascript" src="objupdate.js"></script>

Remember you need open tag and close tag. Using <script /> sometimes would not work.

Tuesday, 4 March 2008

Starting New WPF App Error: Cannot convert string 'pack://application:,,,/

This error is quite interesting. It appears straight after you create a new WPF project, i.e. Windows1.xaml is empty.

 image

By changing the Device Profile in Color Management to System Default, this problem goes away

 image

image

It is even more interesting that if you have your project open and change the Device Profile back to something else, the error would not reappear. However If you close the project and open it again, it will.

So anyone knows what’s the difference between all these profiles?

image

2008 Summer Road Trip - Slides and Code!

Yes! We do have the code and slides for the summer road trip!

Code: RoadTripCode.zip (3.90MB)
Slides: SummerRoadTrip.pptx (1.35MB)

According to Jeremy,

The Code package contains a quick README on getting things set up, feel free to comment if you have more detail you want to add to this, however be warned you will want to put this in a PRE-PRODUCTION / TEST environment as it makes use of many beta bits such as SQL Server 2008 and the Entity Framework.
If you are looking to build such a VM up from scratch then these instructions may help you out in terms of what you need to install..
1. Windows Server 2008 Enterprise with No Hyper-V operating system installation
    - Roles: Web Server, File Services, Application Server: Enable TCP and Named Pipe Activation and Distributed Transactions  
    - Features: Windows Powershell, Telnet Client
2. Visual Studio 2008
3. SQL Server 2008 CTP 6
    - Install only Database Server, Books Online and Client Tools
    - Execute sp_filestream_configure @enable_level = 2 after server has installed
    - Create C:\FSData directory locally for storing filestream data for the Road Trip database
4. Entity Framework Beta 3
    - Also install Visual Studio hotfix for Entity Framework Beta 3
    - Also install Entity Framework Tools for Visual Studio

Have fun with the code and slides!

Thursday, 28 February 2008

First Silverlight Facebook App - My City

I have just added this First Silverlight Facebook application - My City. Unfortunately you can add only one citizen a day. So, yep, here is my city with one factory worker!

image

.NET User Group 5 - Introduction to the ASP.NET MVC (Model-View Controller) Framework

Presented by John-Daniel Trask from Mindscape

Date: 19/03/2008
Gather at 5:45pm, starting at 6:00pm
Catering: Pizza & Drinks (we will have non-pork but non-vege pizzas this time!)
Venue: Olympic Software, 10 Cawley Street, Ellerslie, Auckland
Register here: Ellerslie DNUG or Dot Net NZ

John-Daniel will be introducing the ASP.NET MVC framework from Microsoft which allows developers to create ASP.NET solutions without using standard web forms that they're used to.

This new framework empowers developers to more easily create robust solutions based on solid design patterns.

This talk will start by introducing the MVC pattern and then dive into the specifics of the framework so even if are new to using the MVC design pattern you will be able to understand what is being discussed. Finally, he will cover unit testing and mocking to validate your solutions.

See Scott Gutherie's blog for ASP .NET MVC Framework.

Friday, 22 February 2008

Thursday, 21 February 2008

Post-.NET User Group 4 - Introduction of .NET Framework Programming

 

DSC00677This is Rodney Lake, our speaker last night. We have 56 people with different level of expertise here last night and Rodney sure has done a very good job. I believe everyone (including myself) has got something out from the presentation.

 

 

DSC00650 The presentation was really good. I think it has given people a good introduction about .NET and what .NET Framework can do without overwhelming them with too much technical information. Quite a number of people come talk to me and ask some questions after the presentation, showing that people are inspired by all the information presented by Rodney! It's good to see people are happy about the meeting.

 

DSC00674 We have ordered 28 pizzas. Maybe not all the girls eat like me (who have ate 4 pieces, i.e. half of a pizza), we do have some pizzas left. Things I've learnt from this are: 1. We need chicken and beef pizzas, not just vegetarian! 2. We should count half for guys and a quarter for girls. 3. People are more into fizzy drinks and juice than beer (well myself don't drink beer too). Anyway, see me carrying these empty pizza boxes, that's still quite a lot!


P.S. I told my Java friends last night that once I have started developing in .NET framework, I think I can never go back to Java again. Of course Java people can disagree with me since I do not have industrial experience with Java (but 4 years University experience, developing Java everyday...).

Tuesday, 19 February 2008

Manually remove Trojan algssl.exe

Open your Task Manager, if you see a "Form 1" application running all the time, and it is algssl.exe process. Yes, it is a Trojan. Apparently it is a Chinese community thingy. I am not sure how did I get it, but apparently Norton and other anti-virus thing cannot remove it completely. So you have to do it manually.

Most of the online explanation is in Chinese, so I am writing an English one, for people who don't know Chinese but got this Chinese Trojan on their computer.

Step 1:
Kill the algssl.exe process

Step2:
Go to C:\Windows\System32\
Delete algssl.exe, msime80.exe, and msfir80.exe

Step 3:
Edit Registry (run regedit)
Go to:
HKEY_LOCAL_MACHINE\
SOFTWARE\
Microsoft\
Windows\
CurrentVersion\
Explorer\
Advanced\
Folder\
Hidden\
SHOWALL

Delete CheckedValue
Recreate a DWORD CheckedValue with Value = 1

Step 4:
If you are using XP, you probably can turn on "show hidden files" and search for autorun.inf, tel.xls.exe (or sal.xls.exe). All located at the top level of the hard drive (i.e. C:\, D:\, E:\, F:\, G:\...so on) should be removed. Note that your external/pluggable hard drives maybe affected as well, so plug in and do the search and delete for them.

If you are using Vista, unfortunately "show hidden files" is not doing the trick. What I did was using command prompt. You can list hidden files with
C:\>dir /AH
and delete them with
C:\>del /AH autorun.inf
C:\>del /AH sal.xls.exe

*If any of your hard drive was not cleared with these files, when you double click the drive to explore it, the same Trojan would be installed again. So when you switch between drivers, do not double click to explore. You can type E: for example in your explorer bar.

Step 5:
Go back to regedit, go to:
HKEY_LOCAL_MACHINE\
SOFTWARE\
Microsoft\
Windows\
CurrentVersion\
Run

and

HKEY_CURRENT_USER\
Software\
Microsoft\
Windows\
CurrentVersion\
Run

to remove anything with msime80.exe or msfir80.exe.

Step 6:
I don't have to do this step but apparently some people do. Run msconfig, go to Start Up and remove anything with msime80.exe or msfir80.exe.

Restart your machine, everything should be OK now.

Alter Column to become Case Sensitive

SQL Server 2000 (or above) allows individual columns become case sensitive by identifying collation. For example:

ALTER TABLE TblName 
ALTER COLUMN ColName VARCHAR(100) COLLATE Latin1_General_CS_AS NULL

Where _CS_ indicates it is a Case Sensitive column.

Monday, 11 February 2008

New Olympic Software Website

http://www.olympic.co.nz/


We have redesigned the website. It's simple and clean. I helped Warner in the flash stuff! :)

Tuesday, 5 February 2008

Blah 4 - Girls

Right, it's good to see familiar and unfamiliar faces in the summer road trip event. Among all these faces, one obvious observation I made was the number of girls comparing to the number of guys is still low. Alex and I had been discussing why most of the girls go into industries like accounting and finance. Back in University, 25% of our software engineering class were girls. However it's much less than this percentage in yesterday event.

Last week I had been chatting with Amanda (who organises the Girl Geek Dinners in New Zealand over emails. I didn't go to these dinners before because there's no one (girl) from my company would like to go. Amanda told me that actually a lot of girls didn't come with friends. Umm... although i don't want to be named "geek", but I may consider going to the next one, just to see how many girls in the community, haha. :D

2008 Summer Road Trip - Auckland - Done (Yay yay!)

The weather wasn't so great yesterday, but the event made the day special. Yes, it's the first day of the 2008 Summer Road Trip and they were here in Auckland. It's a good experience for me as this is the first time (after at least 10 years) for me to MC in an event with about 200 people. I was quite nervous and actually I had left out something in the Intro and Outro but I think it wasn't too bad.

We had a very little unexpected problem about the venue (see Darryl's blog) but we sort ourselves out. We started the show at 1:30pm. Chris, Jeremy and Alex had given us very informative presentations. They have a very interesting showcase and everyone seems to be impressed. We have pretty good feedback (as far as I can see from the evaluation forms), except, ah, apparently everyone wants a toilet break like me.

It's good to see familiar and unfamiliar faces in the event. I really hope to see all these faces again in our Ellerslie User Group events and have a chance to talk to each. Yesterday was a bit rush and I didn't even have a chance to say hi and bye to my own colleagues (from Olympic Software and friends. So, look forward to meet and talk to everyone in the near future! :)

Friday, 25 January 2008

.NET User Group 4 - Introduction to .NET Programming

Presented by Rodney Lake (Spectra Data Solutions)

Date: 20/02/2008
Gather at 5:45, starting at 6:00
Catering: Pizza & Drinks
Venue: Olympic Software, 10 Cawley Street, Ellerslie, Auckland
Register here: Ellerslie DNUG or Dot Net NZ(we really want to have an idea of the number)

Are you curious about .Net programming? This presentation is a back-to-basics introduction to programming in the .Net Framework.

Topics will include:
• An brief introduction to Visual Studio
• The difference between VB.Net and C#
• The difference between ASP.Net and Windows Forms
• Introduction to the Base Class Library
• Introduction to the Common Language Runtime
• Emerging and future technologies
• Your questions, no matter how dumb… :)

Tuesday, 8 January 2008