I am a new Silverlight MVP!

mvp_horizontal_fullcolor

 

I’m happy and proud to announce that I’ve been awarded Silverlight MVP status yesterday. The nomination process was quite challenging and before anything else I want to thank everybody who helped me in any way, including nomination, evaluation, recommendation and support of any kind, including moral.

For those of you who don’t know, MVP award is given to “exceptional technical community leaders who actively share their high quality, real world expertise with others”. Since I don’t have time right now to copy-paste more details (must go celebrate :-)), you can read more about it on the official MVP Award Program site. There are around 60 Silverlight MVPs in the world and exactly 19 MVPs in Croatia (in various areas).

I would like to congratulate my fellow countrymen Tomica Kaniški (@tkaniski) and Toni Frankola (@tonifrankola) for becoming MVPs yesterday as well in their respective fields. I know both of them personally and they are truly great experts and (maybe even more important) good people.

Another pack of congratulations goes to seven other new Silverlight MVPs from all around the world. I don’t know you guys (yet), but knowing how hard is to get an Silverlight MVP status, I’m sure you’ve earned it (list “borrowed” from Tim Heuer and John Papa blogs).

Since yesterday, there are also twelve new MVPs in the region: read all about it. Congrats to you too!

And last, but not least, I’ve just created Croatian MVPs Twitter list. There are few MVPs that don’t have Twitter account, but that will probably change in the future.
There is also Silverlight MVPs Twitter list maintained by John Papa.

0  

Physics in Silverlight

slphysicsFew days ago I’ve stumbled upon a Farseer physics engine for Silverlight and XNA. It looks very promising, but I didn’t get time to play with it (yet). The library itself deserves a post (I’ll probably write one in the future), but this time I want to write about another library, helper library based on the same physics engine. It enables us to do games and stuff without using a single line of code! All made with Blend behaviors!

I’ve played with it for a while and it’s really fun – you can preview the first test project I’ve built and download source code (actually, there is no “real” source code, only behaviors). But the real fun is to make it by yourself, from scratch. To do that, take a look at this short video (download) and you’ll be doing games in no time. Okay, the library is in beta and make sure you set up a Silverlight 3 (not 4) project. (Hint: there is a Silverlight 4 and even WP7 version, but you must download it manually from Source Code repository.)

If you want just take a look how it works for an end user, you can try my simple experiment (drag eggs with a mouse, use mouse wheel over an egg to make an explosion) or much more advanced official demos. Have fun – I did! Thank you Andy Beaulieu for this great library!

0  

Mobility Day drawing apps – Silverlight to WP7

image Last week I attended a (great) conference Mobility Day and organizers asked me to build a small Silverlight application for prize giveaway at the end of the day. Every participant had a number at the back of their ID card and if the wheel stopped at your number, the prize was yours. Application itself is very simple and it took me maybe an hour to build it from scratch. The important thing is that it can be run from any computer from the web, and the total number of participants can be set via URL, like this: http://demo.dizzy.hr/mobilitydaydrawing/?max=333. To use the app, first focus it and then expand to full screen with F11 key. Wheel can be started and stopped by mouse click or space key. Not really a smart application, but useful and attractive.

The main topic of the conference was Windows Phone 7. The day before the conference, I got an e-mail – can you port this app to Windows Phone 7? So I did – it took me five minutes and the only thing I had to do is remove part of user interface, because the phone’s screen is smaller. Everything else was just pure copy & paste. It worked great in emulator and I’ve sent it to organizers to try it on the real device. It worked fine, although the phone CPU/GPU is a bit slower than a computer, so animation is not so smooth. But it can be tweaked (I will when I get my hands on an actual device). If you have a developer device or want to try it in the emulator, download it here.

[BTW, during the conference there was a millenium photo taken, you can check it out here using Deep Zoom. I wish it was not only 12 megapixels.]

0  

My new project – TwBirthday.com

image After successful Bing-Vs-Google.com that compares search results from Bing and Google side by side, and very popular WallOfSilver.net, a Twitter wall used on many conferences and events around the world, few day ago I’ve launched another project called TwBirthday. The basic idea is very simple – if you enter your Twitter username, you’ll find out when have you started using Twitter (that’s your TwBirthday), your age index (your Twitter age compared to Twitter’s first tweet – March 21, 2006) and your Twitter godfather, a person you have followed the first. TwBirthday doesn’t require authentication nor it will send any tweets on your behalf, but it will remind you of your twbirthday when that day comes – it will post a tweet starting with your username, so you can see it in your mentions feed. Furthermore, if you follow @TwBirthday on Twitter (please do :-)), you will see when your friends celebrate their birthdays in your timeline.

That’s basically it. The service is quite simple, but I must emphasize that development was not so easy as it may look. Let me share some facts and thoughts about that:

  • it took me four months from first lines of code until launch
  • one of major issues was Twitter API request limiting – it defaults to 150 or 350 requests per hour (depends if you’re authenticated or not) – I’ve applied for more (20,000 per hour) few months ago, I was rejected three times but when I’ve finally get in touch with Twitter support service (one of the best support services I’ve ever got in contact with!), I’ve explained my intentions in details and everything was fine
  • I’ve optimized the system to use only two or three API requests per search, and two-hours caching of all retrieved data – that was fun
  • posting tweets about one’s birthday is really challenging – the idea was to post it just after midnight, but people live in different time zones and you don’t want them to get a birthday reminder on a wrong day. Another problem is Twitter update limit – you can post a maximum of 1000 tweets per day and “the daily update limit is further broken down into smaller limits for semi-hourly intervals”. This means that I have to distribute posting during the day not to hit the limit, be aware of user’s time zone while doing it and when I (hopefully) reach 1000 users with twbirthday per day, the system will have to choose which users deserve the greeting tweet more than the others in their and several neighboring time zones (currently, I’ve implemented a simple formula that calculates user’s activity base on number of followers and last tweet date, but that is subject to change)
  • users can change their usernames, so I update their info few days before twbirthday, to have accurate data
  • during the peaks, a database is automatically turned off – the most important thing is to display a birth certificate to a user – if there are too many visitors and database underneath is dying in pain, logging will be disabled
  • “calculating” godfather can be a slow task (some people follow 000s of users), so it is displayed with a small delay, using AJAX (of course); API request for that is on background thread
  • all API requests must be from a specific IP address (not the default one on the server), because only that IP address has higher API limit; using ASP.NET’s simple WebRequest or XDocument.Load doesn’t work here

To sum it all up – it was really fun and challenging to work on this project. I’ve learned a lot so the main goal is reached. Hope you like the final result! Tweets, comments, mentions and bug reports are appreciated!

And the most important, a big thanks goes to a friend of mine – Emanuel Blagonić – for a great design. You don’t want to know how it looked in beta version. :-)

0  

O Silverlightu na Web User Group

[English summary: announcing my talk about Silverlight on Web User Group in Zagreb, Croatia]

Nakon cijele sezone Web UG  i sedam vrlo uspješnih sastanaka, vrijeme je bilo da se i ja pojavim u ulozi predavača. Nekako sam taj svoj nastup čuvao u nadi da će kad-tad trebati zakrpati kakvu rupu jer neće biti interesa, no početkom rujna sam shvatio da se to neće dogoditi tako skoro. Naime, tek što sam odaslao mejl s pozivom da se ljudi jave s novim temama, došli su brojni odgovori i svi termini do kraja godine su dogovoreni! Zakon – oduševljen sam ovim interesom i hvala svima na tako brzoj i spremnoj volji da sudjeluju u našoj korisničkoj grupi. Štoviše, imat ćemo povremeno ove (školske, Microsoftove fiskalne) godine i po dva predavanja na jednom sastanku – jedno manje od petnaest minuta i drugo klasično, od sat vremena. Pizza i pivo ostaju :-)

Sutra, dakle, pričam ja o Silverlightu. Ideja je napraviti pregled Silverlighta za one koji ga još nisu susreli – za takva predavanja uvijek ima jako puno interesa, pa je tako i ovaj puta. Dok ovo pišem, malo više od 24 sata prije samog događanja, ostalo je još sedam slobodnih mjesta (od ukupno 70). Nadam se da će se osim samog mog pričanja razviti i nekakva diskusija o svemu – inače to nije slučaj (većina ljudi vole pasivno sjediti i slušati), no s obzirom na praktički obiteljsku atmosferu koja vlada na našim sastancima, mislim da s pravom to očekujem. Dakle, koga zanima, ima još par mjesta pa se prijavite. Ne znam treba li naglašavati da je ulaz besplatan i slobodan za sve?

Osim toga, sutra ćemo imati i mali launch bete IE9 (navodno je Microsoft napokon pošten preglednik :-)) – on inače izlazi službeno danas, tako da će to biti zaista u pravo vrijeme, a s obzirom na publiku – i na pravom mjestu. Osim toga, kao posebnu poslasticu, podijelit ćemo i tri besplatne kotizacije za Mobility Day, pa ako ništa drugo, vrijedi doći i zbog toga. Šansa za dobitak je cca 5% :-)

Vidimo se!

0  

Try Windows Phone 7 on your computer using an emulator – step-by-step

It is not like you have a real device in your hand, but you can get some look and feel of Windows Phone using an emulator. If you have touchscreen monitor, your experience will be much better, but that’s not a requirement. You don’t need anything else installed on your system, not even Visual Studio 2010 :-)

I have tried this steps on Windows 7 machine, it should work on Vista as well. I’ve read there are some issues on Windows XP, please let me know if you try it.

  1. If you don’t have Windows Phone 7 Developer Tools installed, please do the following:
  2. If you have Windows Phone 7 Developer Tools installed, please check version (you should have June/July 2010 version)
  3. Download unlocked Windows Phone 7 ROM (92 MB), remember the folder you’ve put it in (I’ll use “C:”)
  4. Run one of the following lines on your command prompt (save it to batch file for future use) – change the folder you’ve put you BIN file in!
    • “C:Program FilesMicrosoft XDE1.0XDE.exe” “C:WM70C1-6414-unlocked.bin” /VMID {E575DA31-FC47-4766-853F-018D823B9EE6}
      OR
    • “C:Program Files (x86)Microsoft XDE1.0XDE.exe” “C:WM70C1-6414-unlocked.bin” /VMID {E575DA31-FC47-4766-853F-018D823B9EE6}
  5. Have fun! :-)

This walkthrough is based on Windows Phone 7 Developer Tools beta published in July 2010.
Please let me know if any link stops working :-)

image image image image image

I didn’t invent this – thank goes to En1gma and RustyGrom at XDA-Developers (where else? :-)).

0  

How to open application (XAP) in Windows Phone 7 Emulator without Visual Studio running and/or source files?

image You’ve developed your first Windows Phone 7 application and you want to share it with your friends or colleagues? Just follow this simple steps:

  1. Copy all files from “BinRelease” folder of your project. Move it to target machine.
  2. Have the Windows Phone 7 SDK installed on target machine (comes with Developer Tools)
  3. Open “XapDeploy.exe” in “C:Program Files (x86)Microsoft SDKsWindows Phonev7.0ToolsXAP Deployment” (actual path may vary on your system, but you get the idea)
  4. Select “Windows Phone 7 Emulator” as Target
  5. Browse for XAP file on your disk (the one you’ve copied from “BinRelease” folder)
  6. Deploy

That’s it!

0  

Circular Progress Bar in Silverlight

In one project I’m working on for a few months now I got the request to show progress bar in the form of circle – empty circle would mean 0%, and filled circle stands for 100%. It seemed like and interesting challenge, so I think I’ve found the simplest solution to the problem.

Let’s build it together…

First of all, we need a Path element with one ArcSegment and one LineSegment:

image

It will draw something like this – StartPoint is on the right, (A), ArcSegment draws half a circle to get to the point B, LineSegments goes to circle center C and since we have set parameter IsClosed to true, it draws another LineSegment to close the drawing in the point A, even if we didn’t write it explicitly.

image

We will bind this circular progress bar to a slider, as this is the simplest way to show how it works. You can, obviously, bind this to something else – the important thing is to get a value between 0 and 1 (0% – 100%).

image

This is the base that we need to have defined in XAML – the rest of the work will be done from code behind. We have named ArcSegment to be able to change its properties, namely Point and IsLargeArc.

First of all, we need circle radius and an angle that will represent a part of circle we want to show. Radius is equal to ArcSegment size (width or height, doesn’t matter), and the angle is full circle (360 degress or  2*PI) * percentage. When we have this two variables, you can use the following formula to calculate the point on the circle that corresponds to our percentage.

image

If the angle is more than PI (more than 180 degrees), we should set IsLargeArc to true, otherwise we will end up with this:

image

Unfortunately, were not quite there yet – there is a problem (I would dare to call it a bug) with 100% status, when the second point of ArcSegment is the same as the first one. In that case, even if you set IsLargeArc to true, you will not get a full circle:

image

So, we must use a hack – when a percentage reaches 100%, that means that the angle is equal to 2*PI, we will decrease the Y coordinate of the point by some small number, like 1/1000. By doing this, the second point will not be equal to the first one, but since the difference is very, very small, we will not be able to see it on the screen.

image

One last thing before the end – it is more common to see the circle fill from the top point, probably because that’s the way analog clock works. So, you can use rotation transform to fix this:

image

Now we’re done. You can check the demo here, and download sample project here. In those samples I’ve added another white circle on the top, to achieve the “donut” effect.

1  

First season of Web User Group

P1210108 Web User Group is the youngest user group in Croatian MS Community. I’ve founded it in December 2009 with support of Microsoft Croatia. Meetings are scheduled on the third Thursday of each month (except during the summer, in July and August).

Web User Group covers wide range of topics in the web-development area, including design, slicing, server and client technologies, tools and server software, services and libraries. The main focus is on Microsoft ASP.NET and Silverlight, but many standard technologies supported by Microsoft tools and platform are covered as well, like HTML, JavaScript and jQuery. Our wide topic area allows us to be appealing for a wide range of people, including web-designers, front-end and back-end developers, system engineers as well as decision makers.

Online

Untitled The group’s official web site can be found on www.webug.com.hr (in Croatian). Users and visitors can subscribe to the mailing list. Via mailing list, we inform people about meetings, benefits for user group members and availability of post-meeting materials.

Every meeting is recorded both video and audio and the video and screencast are available on our web site about a week after the meeting. There is also a Silverlight application that plays two synchronized streams at the time (video and screencast) – application is called Dual Streaming and it is developed especially for Web User Group.

PowerPoint presentations and photos from each meeting are available on official web site as well.

During every meeting we provide free online participation using LiveMeeting for people outside Zagreb and neighboring countries.

Collaboration

We work closely with DPE department of Microsoft Croatia and they support our activities with logistics, funding (beer and pizzas) and ideas. LiveMeeting broadcast and meeting recording is powered by Microsoft Innovation Center in Varaždin, and we give away their vouchers and discounts as door prizes.

We are full member of INETA Europe and integral part of Croatian MS Community. We work closely with them on promotion (for example, activities during WinDays conference in April) and organize shared group meetings (with SharePoint group in March and SQL/DEV group in April), in order to promote each other.

We collaborate with many other organizations and companies, especially event organizers. We are trying to arrange benefits for our members, like discounts, free vouchers, books, subscriptions and other deals. In seven months, we had more than 20 arrangements of that kind.

Our work is supported by several IT media in Croatia and numerous bloggers.

Meetings and people

7 Meetings are held in Microsoft Croatia office in the biggest room called Dante, which can accommodate up to 50 people and it is usually full. Registration system allows registration for 70 people, since some of them cancels in the last minute or simply do not show up. Usually, the interest exceeds the capacity of the room (the record was 95 registrations in February 2010, unfortunately, 25 of them on the waiting list didn’t have an opportunity to come). Currently, this is the biggest user group in Croatia.

Our mailing list has more than 350 active and valid subscribers that regularly receive announcements (not more than three times a month, two times on average).

0  

WordPress on SQL Server and SQL Azure

WordPress on Microsoft_1276688038774 Although I don’t use WordPress on my blog, I find very interesting that now it can store data in SQL Server database, either free SQL Server Express or some advanced version. PHP is still a requirement (I’m pretty sure that this will not change), but now you don’t have to install MySQL database on Windows (although it’s quite straightforward, using Web Platform Installer). But, the key point here is a support for SQL Azure – scenario that can enable high-traffic sites to use WordPress with no performance issue (at least not from the database point of view).

Several months ago a few friends and I were thinking about providing SQL Server support by writing a driver based on PG2WP plug-in that enables WordPress with PostgreSQL database. Unfortunately, we didn’t find enough time to do it, so the project was abandoned. Lucky for us, because all the hard would be wasted now that we have this patch.

There are also quite a few interesting articles on this topic:

For more info, installation procedure and getting started articles, check out this site. Can’t wait to use it, here is the direct link to download section.

0