Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
DZone MVB

Links

Social

October 2012 - Posts

Travelling MVP #4: DevReach 2012

Our next stop after Varna was Sofia where DevReach happens. DevReach is one of my favorite conferences in Europe because of sensible prices and strong speakers line-up. Also they have VIP-party after conference and this is good event to meet people you don’t see every day, have some discussion with speakers and find new friends.

devreach-2012-large

Our trip from Varna to Sofia took about 6.5 hours on bus. As I was tired from last evening it wasn’t problem for me as I slept half the trip. After smoking pause in Velike Tarnovo I watched movies from bus TV. We had supper later in city center Happy’s – place with good meat dishes and nice service. And next day it begun…. :)

DevReach 2012

DevReach is held usually in Arena Mladost. It’s near airport and Telerik office. The event is organized by local MVP Martin Kulov together with Telerik. Two days of sessions with strong speakers is good reason enough for me to go to visit some event. Some topics covered by sessions:

  • Windows 8 development
  • web development
  • SharePoint
  • Windows Azure
  • Windows Phone
  • architecture
  • Visual Studio

178490_3872705302817_715153932_oPractically everybody can find some interesting session in every time slot. As the Arena is not huge it is very easy to go from one sessions to another if selected session for time slot is not what you expected.

On the second floor of Arena there are many places where you can eat. There are simple chunk-food places like Burger King and also some restaurants. If you are hungry you will find something for your taste for sure. Also you can buy beer if it is too hot outside :)

Weather was very good for October – practically Estonian summer – 25C and over.

Sessions I visited

Here is the list of sessions I visited at DevReach 2012:

  • DevReach 2012 Opening & Welcome Messsage with Martin Kulov and Stephen Forte
  • Principled N-Tier Solution Design with Steve Smith
  • Data Patterns for the Cloud with Brian Randell
  • .NET Garbage Collection Performance Tips with Sasha Goldshtein
  • Building Secured, Scalable, Low-latency Web Applications with the Windows Azure Platform with Ido Flatow
  • It’s a Knockout! MVVM Style Web Applications with Charles Nurse
  • Web Application Architecture – Lessons Learned from Adobe Brackets with Brian Rinaldi
  • Demystifying Visual Studio 2012 Performance Tools with Martin Kulov
  • SPvNext – A Look At All the Exciting And New Features In SharePoint with Sahil Malik
  • Portable Libraries – Why You Should Care with Lino Tadros

I missed some sessions because of some death march projects that are going and that I have to coordinate but it was not big loss as I had time to walk around in session venue neighborhood and see Sofia Business Park.

Next year again!

I will be there again next year and hopefully more guys from Estonia will join me. I think it’s good idea to take short vacation for DevReach time and do things like we did this time – Bucharest, Varna, Sofia. It’s only good idea to plan some more free time so we are not very much in hurry and also we have no work stuff to do on the trip. This far this trip has been one of best trips I have organized and I will go and meet all those guys in this region again! :)

Travelling MVP #3: Community event in Varna, Bulgaria

Second stop in my DevReach 2012 trip was at Varna. We had not much time to hang around there but this problem will get fixed next year if not before. But still we had sessions there with Dimitar Georgijev and I had also chance to meet local techies. Next time we will have more tech and beers for sure!

We started in the morning from Bucharest and travelled through Ruse, Razgrad and Shumen to Varna. It’s about 275km. We used cab, local bus and Dimitar father’s car. We had one food stop in Ruse and after that we went directly to Varna. Here is our route on map.

2012-bucharest-varna

Varna is Bulgarian city that locates on western coast of Black Sea. I have been there once before this trip and it’s good place to have vacation under sun. Also autumn is there milder than here in Estonia (third day of snow is going on). Bulgaria has some good beers, my favorite mankind killer called rakia and very good national cuisine. Food is made of fresh stuff and it is damn good experience. Here are some arbitrarily selected images (you can click on these to view at original size):

557751_4110071463669_1149193415_n 523164_4115203631970_1365621628_n 548617_4115067828575_389598513_n
Old bus “monument”
in Razgrad
Stuffed peppers, Bulgarian
national cuisine
Infra-red community having good time and beers

We made our sessions at one study class of Varna technical university. It’s a little bit old style university but everything we needed was there and we had no problems with machinery. Sessions were same as in Bucharest.

The user group in Varna is brand new and hopefully it will be something bigger one good day. At least I try to make my commits so they get on their feet quicker. As we had not much time to announce the event there was about 15 guys listening to us and I’m happy that it was not too much hyped event because still I was getting my first experiences with foreign audiences. After sessions we took our stuff to hotel and went to hang around with local techies. We had some good time there and made some new friends.

Next time when I go to Varna I go back as more experienced speaker and I plan to do there one tougher and highly challenging session. Maybe somebody from Estonian community will join me and then it will be well planned surprise-attack to Varna :)

Windows Azure development storage and StorageServerException (Error 500)

When preparing my Sinergija12 code examples I ran into interesting problem. Windows Azure local development storage hangs for about minute and gives StorageServerException stating that there was problem in web server. A little surf in search engines gave me solution.

For me this error happened with default settings of development storage. Everything started working normally when I created storage database to my local SQL Server. MSDN library has good article about steps to take: How to Configure SQL Server for the Storage Emulator:

  • Click Start, point to All Programs, and then click Windows Azure SDK.
  • Right-click Windows Azure SDK Command Prompt, and then click Run as administrator.
  • In the Windows Azure SDK Command Prompt window, type the following command:
        DSInit /sqlInstance:<SQLServerInstance>
    Where <SQLServerInstance> is the name of the SQL Server instance.

Before running these commands shut down Storage Emulator. You can run it when you are done on Azure command-line.

Posted: Oct 20 2012, 07:01 PM by DigiMortal | with no comments
Filed under:
List of Microsoft training kits (2012)

Some years ago I published list of Microsoft training kits for developers. Now it’s time to make a little refresh and list current training kits available. Feel free to refer additional training kits in comments.

Speaking at Sinergija12

Sinergija12Next week I will be speaker at Sinergija12, the biggest Microsoft conference held in Serbia. The first time I visited Sinergija it was clear to me that this is the event where I should go back. Why? Because technical level of sessions was very well in place and actually sessions I visited were pretty hardcore. Now, two years later, I will be back there but this time I’m there as speaker.

My session at Sinergija12

Here are my three almost finished sessions for Sinergija12.

  • ASP.NET MVC 4 Overview
    Session focuses on new features of ASP.NET MVC 4 and gives the audience good overview about what is coming. Demos cover all important new features - agent based output, new application templates, Web API and Single Page Applications. This session is for everybody who plans to move to ASP.NET MVC 4 or who plans to start building modern web sites.
     
  • Building SharePoint Online applications using Napa Office 365
    Next version of Office365 allows you to build SharePoint applications using browser based IDE hosted in cloud. This session introduces new tools and shows through practical examples how to build online applications for SharePoint 2013.
     
  • Cloud-enabling ASP.NET MVC applications
    Cloud era is here and over next years more and more web applications will be hosted on cloud environments. Also some of our current web applications will be moved to cloud. This session shows to audience how to change the architecture of ASP.NET web application so it runs on shared hosting and Windows Azure with same code base. Also the audience will see how to debug and deploy web applications to Windows Azure.

All developers who are coming to Sinergija12 are welcome to my sessions. See you there! :)

Generating radial indicator images using C#

Radial indicatorIn one of my projects I needed to draw radial indicators for processes measured in percent. Simple images like the one shown on right. I solved the problem by creating images in C# and saving them on server hard disc so if image is once generated then it is returned from disc next time. I am not master of graphics or geometrics but here is the code I wrote.

Drawing radial indicator

To get things done quick’n’easy way – later may some of younger developers be the one who may need to changes things – I divided my indicator drawing process to four steps shown below.

1. Fill pie 2. Draw circles 3. Fill inner circle 4. Draw text

1. Fill pie

2. Draw circles

3. Fill inner circle

4. Draw text

Drawing image

Here is the code to draw indicators.


private static void SaveRadialIndicator(int percent, string filePath)

{

    using (Bitmap bitmap = new Bitmap(100, 100))

    using (Graphics objGraphics = Graphics.FromImage(bitmap))

    {

        // Initialize graphics

        objGraphics.Clear(Color.White);

        objGraphics.SmoothingMode = SmoothingMode.AntiAlias;

        objGraphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

 

        // Fill pie

        // Degrees are taken clockwise, 0 is parallel with x

        // For sweep angle we must convert percent to degrees (90/25 = 18/5)

        float startAngle = -90.0F;               

        float sweepAngle = (18.0F / 5) * percent;

 

        Rectangle rectangle = new Rectangle(5, 5, 90, 90);

        objGraphics.FillPie(Brushes.Orange, rectangle, startAngle, sweepAngle);

 

        // Draw circles

        rectangle = new Rectangle(5, 5, 90, 90);

        objGraphics.DrawEllipse(Pens.LightGray, rectangle);

        rectangle = new Rectangle(20, 20, 60, 60);

        objGraphics.DrawEllipse(Pens.LightGray, rectangle);

 

        // Fill inner circle with white

        rectangle = new Rectangle(21, 21, 58, 58);

        objGraphics.FillEllipse(Brushes.White, rectangle);

 

        // Draw text on image

        // Use rectangle for text and align text to center of rectangle

        var font = new Font("Arial", 13, FontStyle.Bold);

        StringFormat stringFormat = new StringFormat();

        stringFormat.Alignment = StringAlignment.Center;

        stringFormat.LineAlignment = StringAlignment.Center;

 

        rectangle = new Rectangle(20, 40, 62, 20);

        objGraphics.DrawString(percent + "%", font, Brushes.DarkGray, rectangle, stringFormat);

 

        // Save indicator to file

        objGraphics.Flush();

        if (File.Exists(filePath))

            File.Delete(filePath);

 

        bitmap.Save(filePath, ImageFormat.Png);

    }       

}


Using indicators on web page

To show indicators on your web page you can use the following code on page that outputs indicator images:


protected void Page_Load(object sender, EventArgs e)

{

    var percentString = Request.QueryString["percent"];

    var percent = 0;

    if(!int.TryParse(percentString, out percent))

        return;

    if(percent < 0 || percent > 100)

        return;

 

    var file = Server.MapPath("~/images/percent/" + percent + ".png");

    if(!File.Exists(file))

        SaveImage(percent, file);

 

    Response.Clear();

    Response.ContentType = "image/png";

    Response.WriteFile(file);

    Response.End();

}


Om your pages where you need indicator you can set image source to Indicator.aspx (if you named your indicator handling file like this) and add percent as query string:

    <img src="Indicator.aspx?percent=30" />

That’s it! If somebody knows simpler way how to generate indicators like this I am interested in your feedback.

Travelling MVP #2: Community event at Bucharest, Romania

My second trip was to DevReach with two stops. My first stop was at Bucharest where I met with my friend Dimitar Georgiev who is one of authors of Gym Realm service. Romanian MVP Andrei Ignat was our host there and organized meeting with local community guys. With me – it was first time in my life – was one more guy from Estonia visiting DevReach and he made the whole trip with me.

Bucharest

We arrived to Bucharest 29.09 at night. We stayed at Hotel Michelangelo. It’s small hotel with nice rooms, free WiFi and very good service. Although my room was on the first floor there was no street noise. We visited one restaurant that offers national cuisine and it was really great.

Next day we went out with local guys and had some beers in “old town”. Bucharest “old town” is nice and cozy. There are many bars open and I am sure everybody will find there some very okay place. After supper we visited one warm karaoke bar where we had beers with local guys.

Andrei Ignat – karaoke star Agu Suur and Andrei Ion Rinea
Andrei Ignat – karaoke star Agu Suur and Andrei Ion Rinea enjoying
karaoke and tequila

Community event

Next day we had community event. I made my session about ASP.NET Web API and Dimitar told about how to port ASP.NET web applications to cloud environment. Sessions were held at study class of one local company.

Dimitar Georgiev speaking about porting web apps to Windows Azure
Dimitar Georgiev speaking about porting web apps to Windows Azure.

As it was usual community evening and not some bigger event there were about 12 guys attending from Bucharest. There were both IT-PROs and developers and one nice thing about Bucharest community is that they are listening to you very well and they ask questions if something is unclear or if you slide over from topic they are interested in. Okay, we tried to keep up good tempo so people stay awake and I think we succeeded.

After sessions we went all together to local Piranha pub that was near event venue. We had some beers with local guys and talked with them on different technology topics. It was another good and interesting evening at Bucharest.

I want to go back there for sure. As it was my first trip to Bucharest and mostly I gathered experiences I think my next community trip there will be way stronger. I take it as a challenge. Plus – I have there some new friends and I want to meet them too – be it community event or not. :)

Travelling MVP #1: Visit to SharePoint User Group Finland

My first self organized trip this autumn was visit to SharePoint User Group Finland community evening. As active community leaders who make things like these possible they are worth mentioning and on spug.fi side there was Jussi Roine the one who invited me. Here is my short review about my trip to Helsinki.

User group meeting

As Helsinki is near Tallinn I went there using ship. It was easy to get from sea port to venue and I had also some minutes of time to visit academic book store. Community evening was held on the ground floor of one city center hotel and room was conveniently located near hotel bar and restaurant.

Here is the meeting schedule:

  • Welcome (Jussi Roine)
  • OpenText application archiving and governance for SharePoint
    (Bernd Hennicke, OpenText)
  • Using advanced C# features in SharePoint development
    (Alexey Sadomov, NED Consulting)
  • Optimizing public-facing internet sites for SharePoint (Gunnar Peipman)

After meeting, of course, local dudes doesn’t walk away but continue with some beers and discussion.

Sessions

After welcome words by Jussi there was session by Bernd Hennicke who spoke about OpenText. His session covered OpenText history and current moment. After this introduction he spoke about OpenText products for SharePoint and gave the audience good overview about where their SharePoint extensions fit in big picture. I usually don’t like those vendors sessions but this one was good. I mean vendor dudes were not aggressively selling something. They were way different – kind people who introduced their stuff and later answered questions. They acted like good guests.

Second speaker was Alexey Sadomov who is working on SharePoint development projects. He introduced some ways how to get over some limitations of SharePoint. I don’t go here deeply with his session but it’s worth to mention that this session was strong one. It is not rear case when developers have to make nasty hacks to SharePoint. I mean really nasty hacks. Often these hacks are long blocks of code that uses terrible techniques to achieve the result. Alexey introduced some very much civilized ways about how to apply hacks.

Alex Sadomov
Alex Sadomov, SharePoint MVP, speaking about SharePoint
coding tips and tricks on C#

I spoke about how I optimized caching of Estonian Microsoft community portal that runs on SharePoint Server and that uses publishing infrastructure. I made no actual demos on SharePoint because I wanted to focus on optimizing process and share some experiences about how to get caches optimized and how to measure caches.

Networking

After official part there was time to talk and discuss with people. Finns are cool – they have beers and they are glad. It was not big community event but people were like one good family. Developers there work often for big companies and it was very interesting to me to hear about their experiences with SharePoint. One thing was a little bit surprising for me – SharePoint guys in Finland are talking actively also about Office 365 and online SharePoint. It doesn’t happen often here in Estonia.

I had to leave a little bit 21:00 to get to my ship back to Tallinn. I am sure spug.fi dudes continued nice evening and they had at least same good time as I did. Do I want to go back to Finland and meet these guys again? Yes, sure, let’s do it again! :)

More Posts