My musings on .Net Technology

Oredev 2013 videos are up

leave a comment »

Written by rohits79

November 12, 2013 at 2:25 am

Posted in Uncategorized

Look out for OS X Mavericks

with 5 comments

I am a PC user for last 18 years or so, but this year I bought my first Mac OS i.e. Mac Book Air 2013 model (Yeah I stepped on to the dark side), and since last one month or so I am using it as my main .net development machine.

To run Win8 on OS X, I use Parallels VM (got it for 90% discount through stacksocial.com), performance wise I do not have any issue, in fact performance is far superior to my last year’s Core i7 Dell XPS (8 gigs with hard disk) and battery life is phenomenal, around 10-11 hours.

I can simply drag and drop files in between OS X and Win 8 VM, Win8 boots up in no time, Visual Studio/Compile Time is not any different from what I seen before. Hardware wise it is by far the best device I have used (albeit screen ppi), around 11 hours of battery, buttery smooth performance (both windows 8 on VM and OS X), it is been a month and no matter how much I push the MBA, I have not heard the fan yet, not to mention that all of this is little over 1 Kilogram (~2 pounds).

Thanks to the haswell processor the MBP 13″ can run on battery for 12 hours, but with next OS X i.e. Mavericks, apple is making a few changes that will push the battery to probably more than 12 hours. As part of the massive changes they are making to the OS, what caught my eyes was the “App Nap” feature, this in my opinion is a dream come true. The “app nap” feature basically throttle down the apps that are not in the view.

I wish we had this feature out of the box in Windows OS as well, so many times there are widgets/tabs/screen that are not in the view but still compete for resources at equal priority.

Image

Over all I am darn impressed with MacBook Air and looking forward to OS X Maverick.

Lastly, I have used Surface Pro and Macbook Air beats it pants down, the keyboard and trackpad on MBA is outstanding. I am loving my new .net development machine.

Written by rohits79

September 4, 2013 at 10:54 pm

Posted in Uncategorized

Principles of Reactive Programming

with one comment

If you are remotely interested in Reactive Programming (Rx, Functional Programming etc), don’t miss this coursera class (starring Erik Meijer with his funky hippy tees).

Written by rohits79

August 28, 2013 at 9:43 pm

Posted in Uncategorized

Healthy Programmer

leave a comment »

This is not a .net/development post so feel free to skip.

I have recently been diagnosed with cervical facet joint dysfunction and thought it may be useful to remind that no matter how much we exercise, if we sit in one stance for too long, the issues such as above might creep up sooner or later. I play basketball, badminton and squash on a regular basis, but I also work for 4 hours in the morning at a stretch and then maybe 4-5 hrs in the later half of the day.

At my work place I know at least 3 people who either have had or are soon going for a cervical surgery. Sitting in the wrong posture, or bending your neck too much has detrimental effect on your spine and nerves. So if you are careless like me then please stop and give yourself a break.

One alternate is to get a standing desk but then those i know who have used it, also cribs about pain in legs etc. Maybe we need to balance our sitting and standing times. Some even say that sitting for long may even cause the dreaded “c” word.

I am now reading the following book which i found to be very good. Have chalked up a plan to give my self a break every 25-30 minutes and stretch. Further I am a tummy sleeper, which is known to cause all back/neck issues.

Written by rohits79

August 28, 2013 at 9:40 pm

Posted in Uncategorized

Incremental Loading with GridView in Windows 8

with 2 comments

GridView and ListView are the two essential controls and forms the very foundation for most W8 apps, these controls not only support virtualization out of the box but also supports lazy loading i.e. the content in the grid view is dynamically fetched and loaded as you scroll through the control.

Following is an example of incremental loading from my Reddit-Pictures app, initially when the app is loaded only a handful of images are pre-fetched, and as you scroll, the next set of images are loaded (you can see the scroll bar size changing as well because of the asynchronous loading of images). The entire incrmental loading infrastructure is based on asynchronous mechanism (using async-await).

To support incremental loading,  your underlying data collection (which is bounded to grid) needs to implement ISupportIncrementalLoading interface, that is all it takes to support asynchronous incremental loading.

Written by rohits79

July 14, 2013 at 7:51 pm

Posted in Uncategorized

Rendering multiple views for a single viewmodel with Caliburn Micro

leave a comment »

Caliburn Micro supports one to many relationship between a view-model and multiple views i.e. we can render the same view-model differently by using one of the many views. In this article we will see this aspect by rendering view-model (1) as a dialog window (2) as a sub-view.

I assume you know how to setup caliburn bootstrapper and use contentcontrol attribute, if not, please read my previous article or head to caliburnmicro.codeplex.com.

Recap: Caliburn Micro uses naming convention to do the essential binding between view and view-model. Example, we can render a view-model named “ContentViewModel”, as long as we have a view named “ContentView”. The default convention is <Entity>View for View, and <Entity>ViewModel for the view model (it is all in the suffix).

But what if we want to render the view-model using different view on a case by case basis? Let us see how Caliburn Micro can help us here with the two most common scenarios:

(1) Render view model differently when showing a popup-window/dialog 

We can render a view model as a popup, dialog or window by using Caliburn Micro’s Window Manager class (invoke ShowDialog, ShowPopup or ShowWindow methods on CM’s WindowManager to achieve the same).

Example: below is how we render a view model (ContentViewModel) as dialog; per convention, Caliburn Micro would use the default naming convention to look for corresponding view (in this case ContentView)

Render ContentViewModel

To render this view-model with a different view, all it takes is to pass the name of the context as second parameter to ShowDialog (in this example we pass “SecondView” as Context), now Caliburn Micro would instead use the convention “Content.<ContextName-ThatYouPassed>” to look for the respective view (in our example CM would use the view named “Content.SecondView”). See Caliburn Micro Naming Convention page for more details.

Render ContentViewModel.SecondView

Note: It is not mandatory to include the literal “View” in the context name.

(2) Render sub-view differently

In the second example we will use CM to dynamically switch and re-render a section of a window with a completely different view (keeping the underlying view-model same).

Example: In the below example we want to dynamically change how list of numbers are rendered.

Main View

MainView-Xaml

- ContentControl holds the numbers that needs to be rendered. In the above screenshot the contentcontrol is rendered using a view which uses listbox to render the underlying numbers, our goal is to switch to a different view that uses different control to render the numbers (again, if you are not familiar with how CM uses ContentControl, then please read my previous article mentioned above)

- ComboBox (named “RenderTypes”) lists the available views via which we could render the ContentControl differently

To keep the example simple: we’d render the numbers in one of the two ways i.e. as a list box and as a Carousel Control (using infragistics Carousel Control – see my previous article on how to setup infragistics control with caliburn micro), thus we’d show these two rendering types as combobox items (CarouselView/ListView)

As with the first example we’d use Context property as a hint to CM to find the required view, to do so we’d use the attached property to establish binding between ContextProperty and combo box

view.content

Now when we select the value of the combobox to “CarouselView”, CM would render ContentControl with a view ending with name “CarouselView”, and similarly with ListView

Main View 2

 

 

Written by rohits79

July 3, 2013 at 12:52 am

Posted in Uncategorized

.net 4.5.1. now supports On demand LOH compaction

with one comment

Besides various new features in the .net 4.5.1 preview (not to miss the edit and continue feature for 64 bit and asynchronous debugging), one of the most requested feature in .net from the beginning of time was on-demand LOH compaction, well behold, we now have the option to compact the LOH  available, as suggested use this sparingly only on a case by case basis as it may have detrimental effect.

Written by rohits79

June 30, 2013 at 8:11 pm

Posted in Uncategorized

Follow

Get every new post delivered to your Inbox.

Join 268 other followers