RSS

Writing WinForms code that scales to High DPI

In this post, I will try to collate different guidelines and pointers to readings that can help in building/fixing High DPI (HDPI) issues in WinForms

1. Automatic Scaling in Windows Forms

2. Creating a DPI aware application (MSDN documentation)

3. This post on SO has a documentation of some of the design guidelines – How to write WinForms code that auto-scales to system font and dpi settings? and this Creating a DPI-Aware Application

4. Take care of properly scaling Images – Make use of DpiHelper Class. For example, make use of LogicalToDeviceUnits to scale images properly for different DPIs

5. Try avoiding using the Designer. Use the built-in layout controls – specifically, the FlowLaypoutPanel and TableLayoutPanel

Most of the above points were helpful to me and should cover the most important things to keep in mind while working on HDPI. If you are starting fresh, you have various option like using WPF and building new Modern style UI on Windows 8 machines for which the framework handles the major things for you. 

 
Leave a comment

Posted by on June 23, 2014 in Uncategorized

 

Tags: ,

Cloud load testing with Visual Studio Online

This post has been long delayed from me. I have been working on Cloud Load Testing (CLT) with Visual Studio Online (VSO) for close to an year and half and it has been a great learning curve. Got an opportunity to work on various areas like Scalability, building frameworks to understand the service usage, integrating with other VSO services, building service dashboard and making my hands dirty building UI. A fun ride. A really proud thing is that this product is completely built ground up in Microsoft IDC, Hyderabad.

Cloud Load Testing Service in short:

The service will greatly reduce the amount of work required in setting up the infra-structure for load testing an application, configuring it with right settings and maintaining the environment.With CLT in place, the service will take care of setting up the agents, deploying your tests, and running your tests automatically, so you can just focus on what matters the most – finding and fixing performance and scale related problems in your application.

I am going to point to a series of good links to explore about CLT

1. Super Simple Load Test Trial Experience announced by Brian Harry – With this announcement customers can do a Load Test from Visual Studio Online (visualstudio.com).This experience is visible as of today to only users with MSDN Ultimate License. In case you don’t have an Ultimate license you still get a view of the experience from this Channel 9 Video demo’d by Chuck – Load Testing Made Easier

2. Brian Harry announcing about CLT – We all watched this demo with lot of excitement 🙂

3. Load Test your App – MSDN Article

4. CLT General Availability note 🙂

– This link has various links to getting started docs

– With the release of GA, customers can monitoring metrics from their Applications under test using Application Insights and quickly troubleshoot any performance issues.

5. Link to a good video

You get 15000 VUser minutes if you have an account on VSO. Do try out and share your feedback.

Note: All the text in this blog is written by me and my employer holds no responsibility 😛

 
 

Tags: , ,

Getting started with WPF

I have started working on WPF (Windows Presentation Foundation) since a couple of weeks and been going through some learning. WPF has been around for a long time (probably since .NET 3.0 time frame). What I am trying to post in this blog post is a list of readings which are recommended by my colleagues and the one which I found through reading on-line.

Suggestions and on-line readings:

1. A good blog from John Smith about WPF and MVVM

2. Keep UI layer as thin as possible. No data manipulation in xaml.cs(as much as can be avoided). UI layer should be dumb. Move all complex data logic to view model.

3. Try to use data binding in xaml file as much as possible. Avoid adding code in xaml.cs file(C# layer for the UI should be thin). Instead add those UI logic in xaml file itself.

4. Use data converters

5. Keep the styles and data templates separate from the layout as much as possible. Then use those as StaticResource / DynamicResource wherever applicable. This ensures better reusability.

6. Define custom controls whenever necessary. Default controls may not always be perf-efficient.

7. WPF can cause memory issues if we are not careful. Detach any event handlers that we may have attached during UI loading / initialization. Dispose any IDisposable objects. Ref1 Ref2

8. One can find good tutorials on PluralSight.com

9. WPF Interview Question – This has real good questions which gives you an overview of various high level topics in WPF

10. XAML Guidelines

11. XAML Guidelines and Best Practices – This link has points to channel9 videos on XAML Guidelines

Once you get a good hang of these concepts, you would have real fun working on some good UI.

As a request always. Please do share links to interesting WPF UI examples/samples/blogs/new-concepts etc which you came across.

Good luck

 
Leave a comment

Posted by on February 4, 2014 in Uncategorized

 

Getting started with Big Data

Recently I have developed a lot of interest in learning Big Data and started exploring different learnings. I will provide links to some of the good resources I came across here, so that this would be a good starting point. I would request readers to suggest any additional readings in the comments.

1. Getting Started with Microsoft Big Data – From Microsoft Virtual Academy. This training has good introduction to using Windows Azure HDInsight. The sessions walk you through running MapReduce Jobs, Hive etc. These sessions a little out dated but you will get an Idea

2. Getting started with Windows Azure HDInsight : This has the latest documentation with up to date information on HDInsight.

The above two links are from Microsoft Technologies.

3. Yahoo! Hadoop Tutorial : This has a very good description of Hadoop Architecture

4. Apart from these, there are good courses on Coursera (Data Science, this is a very good course to get an idea of various Big Data solutions), Cloudera Training

5. Introduction to Hadoop and MapReduce: This is a course on Udacity. Very quick to finish. Really nice one.

6. Map Reduce – A really simple Introduction – here

Please do suggest any good references that would help me and other readers.

 
2 Comments

Posted by on November 23, 2013 in BigData

 

Tags: , , , ,

Design Patterns and Advanced Design Principles

Last week, I have been through a training at Microsoft campus on Design Patterns and Advanced Design Principles. It was a four day session, where in we learnt some good design principles and practised few patterns. It was a very wonderful session, as the sessions were very interactive and the instructor was very good at the subject. The interesting learning from this session for me is that one should focus on Design principles and Design patterns follows by itself. And our session were also more focused on principles than patterns (though there were good numbers of patterns covered with real world applications)

I wouldn’t be talking about the complete sessions here but would summarize the learning into points. If you are interested in learning more, I encourage you to read more on the web for each topic.

Recommended readings:

1. Head First Design Patterns:

2. Gang of Four’s Design Patterns Book

Pointers for Good Design:

1. Define abstractions from a given requirement

2. Design from client code perspective. Validate your design by writing code.

3. Understanding of Is-A and Has-A relationships

4. Focus on Design Principles

5. Separation of concerns

6. OCP – Open Close Principle [A class should be open for extension, but closed for modification]

7. SRP – Single Responsibility Principle

8. ISP – Interface Segregation Principle

9. LSP – Liskov Substitution Principle

10. Program to an interface  and not to an implementation

11. Prefer Has-A over Is-A

12. High Cohesion and Loose coupling is desired

13. Avoid Conditional delegation

14. Avoid Redundancy in Design

15. Avoid class proliferation

16. Decouple an abstraction from Implementation

Keep these principles in mind while designing. Practise few Patterns.

 
Leave a comment

Posted by on November 23, 2013 in Design

 

Tags: ,

Static Typing Vs Dynamic Typing

Recently I have been reading an article published by partners of internet.org. In the article its been mentioned that using PHP (a dynamic typed language) was very productive for Facebook. I tried understanding why is using dynamic typed languages productive and went through some readings. I am sharing a few which were a good read.

1. http://programmers.stackexchange.com/questions/10032/dynamically-vs-statically-typed-languages-studies

2. http://programmers.stackexchange.com/questions/122205/what-is-the-supposed-productivity-gain-of-dynamic-typing

3. http://www.sitepoint.com/typing-versus-dynamic-typing/

You can find many other resources but the above ones should give a quick overview of typing. Wiki articles are also a good place to start learning.

PS : I would strongly recommend people to read the article that is published from internet.org.

 
Leave a comment

Posted by on September 22, 2013 in Uncategorized

 

Tags: , ,

Adobe Interview Questions

Its been a long time made any posts on this blog. Let me try to share a bunch of my interview experiences. Starting with the letter A 😉 – Adobe

I had an interview with Adobe in early 2009 in their Bangalore Office, when Trilogy was shutting down its Office. I had about 8 months work experience by then

It started with a written test for 2 hours. There were about 7 or 8 (out of 80+) folks short listed for further rounds.

First Round:
1. There was a discussion around Makefiles

2. I heard a new term in this question – Distributed compilations. The questions was – how would you design such a system. A basic introduction was given about the system.

3. Assume there is a “container” the container have some “components” and each component in turn contains “items”, the components have some “properties”, also the items have some properties and some components depend on the properties of some other components by which I mean if the property of one component changes then the components behaviour which is dependent on this should alter. What data structure would you use in order to maintain this information.

4. Given 2 linked lists how to find the intersection. Imagine a Y shaped linked list.

Second Round:
1. You know malloc and free() functions. malloc knows the number of bytes to allocate, where as free() just takes a pointer and frees the same amount of memory that has been allocated to this address. if I ask you to implement this malloc() and free(), what would be underlying Data Structure that you would use in order to maintain the information required. It was a good discussion on complexity various approaches etc.
2. Given a string find first non-repeating character.

3. And some good ones which I don’t remember

Third Round
1. Reverse a linked list recursively without using global variables

2. Finding anagrams of a given word from a dictionary

3. Forgot the rest 😦

Fourth Round:
1. Discussion about Yahoo! project,work in Trilogy, technologies known.

2. How to implement a generic stack in Java

 
Leave a comment

Posted by on July 28, 2013 in Algorithms

 

Tags: , , ,