lunes, junio 29, 2009

Silverlight Designer and Developer Network Sydney - July Meeting

This month Ali Shafai will talk on Silverlight, Prism and Unity and Miguel Madero will do a mini presentation on a less attractive, but important topic, Security in Silverlight at the Crown Hotel. Here are all the details:

Crown Hotel
162 Elizabeth St
Sydney
July 7th. 6:00 pm
Use the registration tool on the top of the SDDN Site.


View Larger Map
Silverlight, Prism and Unity
The holy trinity
by Ali Shafai

Ali will be building a LOB application with Silverlight 3 using prism (with MVVM) and will be showing how to use Unity to inject the dependencies into your classes. The application will have the skeleton of a minimal prism application.

I will also share some of my findings on more advanced topics such as:

  • dynamically creating views
  • region managers and how to use them
  • best practices on wiring events
  • loading essential data before application loads
  • showing a splash screen while the essential data is being loaded
  • tricks on styling your controls beyond what you thought possible
  • How to break the application into smaller assemblies

Ali Shafai started programming a few months before he could touch a computer, during this time, he was the programmer, the program and the computer. Then he got his hands to real computers and learned COBOL, PL/I, BASIC, C, Prolog, X86 Assembly, C++, Object Pascal, C# and Python in that exact order. He can still remember the first program he wrote and the joy he felt writing it. He moved to Sydney in 2001, was introduced to XP, TDD, CI and some other acronyms. In 2004 the company he was working for (EDI) won the 2004 Consensus Software Award and Microsoft Realizing Potential Award, he then joined forces with Chris Anderson and Mark Wallis and formed Peer Placements, a software talent management company. He is still enjoying programming and does freelance software development. His latest joy is Silverlight/Prism/Unity.

Security in Silverlight
by Miguel Madero

Miguel will show in several demos different Application Security concerns specific to Silverlight Applications commonly overlooked. He will teach us how to avoid being hacked and protect our data with some basic tips. These are some of the topics covered in this lightning talk:

  • Common Hacking Techniques
  • Security as an Aspect
  • End to end data protection
  • UI Level Security
  • Authentication Mechanisms
  • Authorization and User Context
  • Service Level Security

Miguel has been programming for fun for the last 15 years when he realized that it was better to play with QBasic and Pascal than Prince of Persia. He found out that he could actually get some money out of this hobby so he started a couple of web companies 5 years later and then a Development Shop before moving to Australia to work for Readify where he’s now having fun coding some of the coolest projects in Australia. He discovered Silverlight two years ago and it’s still keeping him busy and entertained.

martes, mayo 26, 2009

Silverlight Designer and Developer Network – June Meeting

 

Next Tuesday, June 2 at 6:30 at Microsoft in Sydney (1 Epping Road, North Ryde NSW) we will have the SSDN Sydney’s June Meeting. This time Tatham Oddie will be talking about the new Out of Browser features in Silverlight 3 and Sergey Klementiev will presenting “LOB applications in Silverlight Lap around middle tier”. You will also have the opportunity to win a copy full of Expression 2 Suite and the best of all network amongst your Silverlight peers. So don’t miss it.

miércoles, mayo 13, 2009

First Virtual Silverlight Designer and Developer Network Meeting

UPDATE 18/05/09: this is the link for the event, please register before the meeting and be sure you have Live Meeting installed on your computer. Some people have asked me about the place and how is this a Virtual Event. We’ll be using this tool called Live Meeting that allow us to interact with audio, video and share the desktop, polls, Q&A, etc, but rather than trying to explain what Live Meeting is, you can just try it tonight. Just register and follow the instructions.

SDDN it’s doing great after several meetings and trainings in Melbourne, Adelaide, Perth and Sydney we decided to try something a bit different that will give the opportunity to everyone to participate. Including designers and developers from Canberra and other cities, where we have not done any events yet.

When and Where?

May 18, 2009 at 9:00 pm Sydney Time. This will give enough time to everyone in the West Coast to get home, have dinner and be ready for the meeting. We’ll do it through Live Meeting. I’ll update this post with the link ASAP.

Format

Instead of the typical presentation, we decided to have an open discussion around different topics. Each topic will have a different moderator who will do a brief introduction and open the floor for discussion. The moderator won’t be answering all the questions, he’s just a facilitator for the group, but also another participant with experience in the discussed topic. We’ll have three different topics during the meeting.

Who will participate?

Everybody that has an interest in Silverlight can attend. This is a space for Designers and Developers. In the last meetings we had a bigger presence of developers, but we’re really targeting both audiences, so you can expect topics of mutual interest.

miércoles, abril 29, 2009

First Meeting of Silverlight Designer and Developer Network in Sydney

Our next meeting is on Tuesday the 5th of May in Sydney

What's on?

This meeting we will see Chris Anderson (blog), from Peer Placements will be discussing advanced styling in Silverlight for both developers and designers. Topics will cover styling strategies, tools, advanced xaml techniques, fashions, and a discussion on designing user experiences.  

Jordan Knight (Blog) from Readify will run through the exciting new features in Silverlight 3, and demonstrate how you might use them in a real working reference application. This in depth session will cover perspective 3D, pixel shaders, navigation features, out of browser and much more. Other concepts like Model-View-ViewModel, dependency injection, unit testing and designing template friendly (read designer friendly) applications will also be touched upon.

WIN!

Attendees will have the opportunity to win a copy of the full Expression 2 suite, worth $1000!

When and Where?

The date and time: Tuesday May 5 at 6:00 PM for a 6:30 PM start.

The venue is the Pyrmont Bridge Hotel, Level 2, Pyrmont, NSW. See map for details.

Attendance is FREE, but please RSVP by entering your details in the registration in the registration tool on the site (http://www.sddn.org.au) or send an email to info@sddn.org.au.

Who will this group interest?

The focus of the group is not just on developers. Traditionally developers have had great community support, whereas designers not so much… now that Silverlight 2 is out we plan to change this.

Silverlight is as interesting for developers as it is for designers. Due in part to Silverlight’s excellent separation of design and development concerns we have new problems to solve around finding the best ways to work together.

To this end the SDDN will facilitate an ongoing discussion and promote the development of ideas and best practices for anyone who works with Silverlight.

To register interest head over to http://www.sddn.org.au. Use the registration tool in the header of the site.

viernes, noviembre 28, 2008

Windows and TimeZones

People from IT and DB guys have told me they can't rely on Windows when it comes to TimeZones and when time zone adjustments are necessary. I've seen systems re-implementing this feature again just to have have more control. At first this seemed unnecessary for me, but I just noticed today, talking with my sister in law that I had the wrong time of Argentina.

image
The main clock is Sydney in the image is Sydney.

I thought the cause was that Argentina was an additional clock and not my "main clock", so I change that and noticed that according to windows Buenos Aires start's the Daylight Savings beings on December. How hard is for windows to get this right?

image

According to the first page I found in Google (http://www.timeanddate.com/worldclock/) Argentina moved to Daylight Saving and the time is 8:29 not 7:29.

image

How disappointed. Well, let's give it another try and manually update it.

image

Wait for a while

image

Doesn't work :(

 image

Let's try another server

image

Same with all their servers. Failed. Why do they need so many servers only for time? If there were a valid reason, why would the user have to select a different one? Is it like Microsoft saying, "probably we will get it wrong, so we will give you more options just in case (which by the way might also fail)" or "probably you need to create your own time server in case you want to run an anarchy and don't want to go to daylight saving periods". This Internet Server's won't fix our Daylight Saving, they care about time not time zones, so they actually have an other purpose and could bring new problems for systems where seconds or milliseconds are important.

I remember that Microsoft distributed a patch for Windows and Windows Mobile to be able to adjust properly for the Daylight Saving in Sydney. Probably I need a patch for my recently configured Time Zone that went to summer time two months ago. Windows Update? Nothing

Well this isn't not that bad, Microsoft, has this Server product that works fantastic. But they still got it wrong (also in windows seven).

image

Now a typical discussion would go like this:

Customer: We need to adjust the {Enter Feature Heare} based on the time zones of our new markets.  
NET Guy: Microsoft is super cool. We can just rely on them for this time zone thingy and we don't care about it. When we do datetime comparisons it takes into account the TimeZone and when saving it or sending it over the wire that information is also considered and we can easily adjust it to UTC, transport or Local time.
IT Guy 1: That doesn't work. (Because .NET relys on the OS info)
IT Guy 2: All we need to do is keep patching the system for all our servers and client machines on time for all our different markets
IT Guy 1: That's a pain.
IT Guy 3: We better move the time manually and disable the auto adjust for daylight saving.
IT Guy 1: That's a pain in the !@$%!@(~. 
IT Guy 4: .NET Guy, could you do it for us?
NET Guy: I can't it's too complex. If MS didn't got it right it's because it's super dupper complex and we better not code it ourselves, it's going to be more painful. It's better to install that patches, that's why MS provides it.
IT Guy 4 (taking advantage of the super hero pride of the dev): Com'on you're better than Microsoft, you can do everything (sarcastically smiling)
Customer: Uses the puppy face look
NET Guy (all full in drunk in pride and self-steem): I am going to do it.

This is a code that should work on DotNet, but it doesn't.

// Buenos Aires at 19:45 (UTC -3 +1 For Daylight Saving) == UTC 21:45
var argentinianDate = new DateTime(2008, 11, 29, 19, 45, 0, DateTimeKind.Local);
Console.WriteLine(argentinianDate.ToUniversalTime());

// UTC 21:45 == 19:45 Buenos Aires
var utcDate = new DateTime(2008,11,29,21,45,0,DateTimeKind.Utc);
Console.WriteLine(utcDate.ToLocalTime());

Console.ReadLine();


image 


So if the OS gets it wrong, you will get it wrong also in .NET.




  1. There're other options hacks.


    According to this blog post. You can use this tool called "tzedit" to create a custom time zone and decide when you want to start your Daylight Savings. That way you and your family can start saving at a different time of the year, you will be probably late for work, but saving light.


  2. A blog from Microsoft even mentions as Option 1 to move your TZ to GMT-2.


  3. There other option is to install a patch, that isn't supported on Windows Vista and Server 2008 systems and it's only targeted to enterprise suers. What? By the way, this post was published one day before the daylight saving started.

sábado, octubre 25, 2008

Reflector Add-In's Save the Day

Recently my brother had a problem with an old winforms application we developed to help him upload images and product information. The issue was really simple, once I had a chance to run and debug the application the issue was evident. The app was using FTP to upload pictures to the website and the credentials were invalid.

image

Easy I thought, go to the config file and change it, it'll probably be encrypted and might give me a hard time to hack. I opened it and didn't find anything. Let's open reflector and see what's happening I have a Stack Trace to start with, but that wasn't the best place. I remembered the name of the user, so the Reflector Add-in Code Search quickly pointed me to the right place:

image

From there a double click sent me to the method

image

Great. Someone thought it was safer to hard code it instead of using the web.config.

Then the question remains, how can we change it? The proper solution would be to open Visual Studio, connect to TFS, get the sources, edit recompile and sent back the new version. However I don't think the latest version is stable, so I would need to search for a label to get the latest deployed version. I'm running on a really slow connection now and that would probably take a while, beside it's sunday and I'm ready to go surfing (or at least try to).

Option 2. In that same screen just open Reflexil (another Reflector-Addin) locate the IL line that sets the password (this is not as hard as it sounds) and edit the string.

image

Then we simply save the assembly. This was probably the hardest part, this was the first time I used Reflexil and I was expecting the Save As option to be right next to the place where I do the edit, in the Tools menu or a toolbar, I finally found the option when clicking file in Reflector.

image

After that, just save the file e-mail it and ready to go, but then I had the brilliant idea of write this post and it took me more time than the fix.

You can find this an other reflector add-ins in http://www.codeplex.com/reflectoraddins

lunes, octubre 06, 2008

Learning with Tests (MessageBroker in NInject)

A great way to learn a few coding practices is to get an open source project (one good, don't get the first thing you see en codeplex) and trying to understand the code, how they apply patterns, use certain classes or reuse code through the project. The best way to start (with most of the good projects) is with the tests.

I have been playing lately with Ninject, a Dependency Injection Framework,  it's well designed, auto-documented and documented (probably too much documentation at the code level), the downside is that the wiki, the blog posts and tutorials barely cover the basics. However, the tests do a good job to describe the project at a higher level. As an example an example we can see one of the tests for the MessageBrokerModule.

        [Test]
public void OnePublisherOneSubscriber()
{
using (var kernel = new StandardKernel(new MessageBrokerModule()))
{
PublisherMock pub = kernel.Get<PublisherMock>();
Assert.That(pub, Is.Not.Null);

SubscriberMock sub = kernel.Get<SubscriberMock>();
Assert.That(sub, Is.Not.Null);

Assert.That(pub.HasListeners);
Assert.That(sub.LastMessage, Is.Null);

pub.SendMessage("Hello, world!");

Assert.That(sub.LastMessage, Is.EqualTo("Hello, world!"));
}
}


The code is really easy to follow, first he asserts that the kernel can create instances of the publisher and subscriber, then the publisher should have a listener, the subscriber doesn't have any message and finally he sends a message than the subscriber should receive. The other tests like OnePublisherTwoSubscribers and ManyPubsManySubscribiers are similar.