Tag | C# Posts

Windows CE: C# Application to Format TFAT In Windows CE: Formatting TFAT I show how to format a disk with TFAT using C/C++ code. The customer that I wrote that for develops using C#, so I wrote a C# application to test the formatting code. To me, most formatting tools are just too difficult for the average user. In this case, the user will be someone working in the factory or field service. They just need to select a disk and request that it be formatted. The application dialog look like: It has ...
Update 1 (Sept. 17, 2010): While the part below about using SLSvcUtil.exe to generate the service reference undoubtedly still works, it is no longer necessary. The RTM version of the Windows Phone Developer Tools now properly supports right-clicking on your game project's "References" item in the Solution Explorer and adding a Service Reference that way. ChannelFactory and related methods remain unsupported. For more details see http://msdn.microsoft.com/e... (Networking ...
A customer came to me for assistance in formatting an SD card with TFAT. I did a quick look in the control panel code to find how it formats disks as TFAT and told the customer to use FormatVolume() and set the FORMAT_OPTIONS dwFlags FATUTIL_FORMAT_TFAT flag. I assumed that it was that easy and left the customer to write the code. A few weeks later the customer came back to me and said that they just couldn’t get FormatVolume() to work, let alone format the disk as TFAT. So this time I dug deeper ...
My own very recent personal experience mirrors this blog post: Silicon Valley’s Dark Secret: It’s All About Age So what do I do to deal with that? Looking at Vivek’s advice, item number 1 is to move into management … yikes… I firmly believe that if someone thought I had the chops to be a manager it would have happened 20 years ago… nobody wants to make me a boss, trust me :) besides which, I like coding! Item 2 sucks… and goes totally against the American Dream of continually moving up… expect to ...
If anyone has been following my blogs lately, they would have noticed that they just had random rumblings of book summaries for my CS degree. This is actually the first semester where I am battling to keep up with the level of work – possibly because up to now the courses have been rather easy to complete the class work (multiple choice), and possibly because work work has gotten extremely busy which has left me with only one day a week (Saturday) to dedicate to learning and doing my assignments. ...
Okay, this is one I’ve been meaning to write for far too long. (So long, in fact, that NDepend 3 is released already, and has been for some time now.) One of the indispensable tools I use is NDepend. This is a great code analysis tool, providing not only valuable insight into our code base, but also visualization tools that let me easily convey a sense of architectural issues to management. Whenever I need to understand why something isn’t working the way I think it should, or I get the dreaded “cannot ...
WORK IN PROGRESS - I WILL UPDATE WITH DETAILED STEPS SOON IF YOU HAVE SPECIFIC QUESTIONS PLEASE COMMENT AND I WILL RESPOND ASAP I have just completed the arduous process of integrating ClickOnce deployment (with the ability to have multiple versions installed side-by-side EX: DEV,QA,UAT) into my TFS 2010 build script. This took me about a week due to lack of materials on the web. So for everyone else out there attempting this here is what I did to make it work. In order for this to work you must ...
In this Issue: Phil Middlemiss Justin Angel, Kunal Chowdhury, Emiel Jongerius, Microsoft, Channel 9, András Velvárt, Timmy Kokke, Microsoft Expression Blog, Jesse Liberty, and Jeremy Likness. Shoutouts: Jeff Weber announced Farseer Physics Engine 3.0 RELEASED, has a link to it and information about it. Jesse Liberty has posted The Great Silverlight Competency Test – Part 1 Chris Koenig announced Sharing the Light – Silverlight Development with Expression Blend... DFW Silverlight training with Victor ...
Over the past few months I had the great opportunity to tackle the challenge of learning both the iPhone and Android mobile platforms for the first time as a developer. I had used both previously as a consumer, so it was interesting to finally get a chance to jump in with both feet for a work project. I have been focused on .NET development in C# for the past 8 years, but originally cut my teeth on unmanaged C & C++ during the 90's, along with a smattering of Java development for college courses ...
this year I had the pleasure of cramming the following information into my lobes: Book: Schuams Graph Theory - http://www.amazon.com/Schau... - a subset of combinatorics. From my perspective, just use linear algebra - you can bash anything into vectors. some interesting stuff on platonic solids and the 3 color world map. SD - shortest distance SP - shortest path bipartite graph - 2 disjoint sets ...
How I wish I could find work in Israel that payed me to code in F#. If I didnt have 4 other mouths to feed, I would do it for free! I read the F# survival guide - CTO Corner, The F# Survival Guide it really blew my mind Anyway, heres my 2 cents as to why F# is more advanced than C#: much more concise. Functions are first class objects, and can be applied directly to collections to perform transformations/filtering much more efficiently. Immutably is encouraged -makes multi-threaded code much more ...
Well, the 2010 St. Louis Day of .Net is over. It was a great conference with over 680 attendees. I presented two topics this year and have made the presentations and source code available. Thing Every C# Developer Should Understand (presentation) Building Loosely Coupled and Extensible Applications (presentation) (MEF calculator source) Thanks to the organizers and to everyone who came out. - Eric ...
I recently worked with a friend on a small C# teaching project. We started with the premise of writing a String Truncate function for .NET 3.5 SP 1. At its simplest, this is trivial to create. public String Truncate(String input, int length) { return input.Substring(0, length); } After a review of the weaknesses of this implementation, we went in search of a more meaningful challenge. We expanded on this first effort with a few additional requirements: Input validation Do not truncate in the middle ...
This summer Inmeta ASA, a leading Norwegian IT company, bought Osiris Data. It means we’re now more than 150 consultants, up from 30 as we were. It means a lot for us, as we now can take on larger projects, more projects and with even more colleagues we will have better competency on more areas. It is also very exciting to be in a larger company, be “exposed” to more projects and more opportunities. Osiris Data was founded late autumn 1996, and started operation in January 1997, with 3 people. The ...
While Microsoft continues to add features to WCF with each version, they are also adding features that simplify working with WCF services as well. Historically WCF has been somewhat intimidating to the uninitiated because of the non-trivial configuration for endpoints including behaviors, bindings, and much more. For this reason, a lot of people stayed with “old school” asmx web services. With the new features of WCF 4, you can build powerful web services with *no* svc file and *no* endpoint configuration. ...
Well... I should have known better than to try to interview for a new job, but it was a Windows Phone gig... and could have been a career-extender. Not to even think about the crap that's going on at work right now, this would be a sweet deal. But... I don't interview well. I've proved that to myself and others multiple times. I work on .NET 2.0 web database software connected to Oracle, Oracle Stored Procs, and Microsoft Access 8 or 9 hours a day. The stuff's not tricky by any means, it's mostly ...
Some time ago I wrote about FEZ Mini and FEZ Domino – first affordable development boards for .NET Micro Framework. Today I’m excited to tell you about another device called Netduino. Similar to FEZ Domino this board is pin compatible with Arduino, and therefore most of Arduino shields should work fine on Netduino. This makes transitioning your project quite easy. Only care should be taken to ensure that shield can run at 3.3V logic levels (because Arduino runs at 5V). Of course Netduino is much ...
One of the major peeves that Silverlight developers had in its earlier versions was the lack of printing support. Printing is an essential feature of many applications and more so in the case of LOB applications. Hence, when Silverlight 4 was released with a full featured Printing API, developers welcomed it with open arms. What’s included in the printing API: The System.Windows.Printing namespace This namespace provides printing services for a Silverlight application through its various classes. ...
On Tuesday August 18th, the first publicly available beta for the Microsoft Lightswitch development tool was posted on MSDN. For more information about this Silverlight application generator addition to Visual Studio 2010 visit: http://msdn.microsoft.com/e... Because it is still a beta I installed the 500mb ISO on a Windows 7 virtual pc VM which already had Visual Studio 2010. I had not spun up this VM for over 4 months so there were LOTS of updates to apply first. Although ...
A few days (maybe even a week ago now) I had an email in my inbox asking me if I’d like to have a copy of NDepend so I could maybe write something about it on my blog. I went through 3 stages – 1st – free software?! Hell yes, I’ll have that… 2nd, actually, I have Visual Studio 2010, I have code metrics already, do I need more? 3rd – presumably there is a reason that NDepend exists, maybe I should take this opportunity to get to know why and what it’s for. So I said ‘yes’ and the next day I had NDepend ...
I monitor some Windows Compact (the new name for Windows CE) Forums for a few reasons: I learn a lot from others working on Windows CE, so many of you are running into the same issues that I run into. Sometimes you run into them before I do, other times I have already run into the issue. I learn a lot from answering questions. You might be surprised to find that sometimes I don't already know the answer, so I do some investigation to get the answer. Sometimes I am wrong, or there is a better way, ...
I found a greate tutorial about implementing a typical Master-Detail iPad application with orientation management in C# based on the MonoTouch framework. Thanks to Mike for this great work, it helped me so much to get my work done. http://mikebluestein.wordpr... ...
I recently read the book “C# 4.0” How-To by Ben Watson, published by SAMS, ISBN-13: 978-0-672-33063-6. I’m a primarily VB.net developer (hey I”m a VB MVP) but these days I find myself using C# more and more. This is a practical book; seeing exactly how to code various patterns in C# was very useful. The usefulness was three fold. First, as C# is not my 1st language, sometimes I stumble a bit when trying to express some code in C#. There are many many examples of using a very wide range of classes ...
When Commerce Server 2009 was released, it introduced a new API (commonly known as Multi Channel Commerce Foundation) based on the latest technology stack at the time. One of the biggest changes was the basis of an n-tier architect, based on WCF, which for the first time removed the Commerce Server dependencies from the web/presentation tier, and allowed all of the logic to be encapsulated on a separate application layer. In modern day architecture this becomes important when the presentation tier ...
Ive been having some problems with versioning for BizTalk recently and in particular it was centred around one map. Initially the problems were related to the configuration manager but then when this was resolved there was another little gotcha which is probably worth bearing in mind. So on the development machine everything versions as 999.999.999.999 and this is usually pretty pain free. On the build server though a version number is applied from cruise control and replaces anything with 999.999.999.999 ...
Technorati Tags: .NET,C#,Jon Skeet I'm really looking forward to the second edition of Jon Skeet's C# in Depth book, which should be printed in September. I took advantage of this "SkeetTweet" from yesterday: 45% off C# in Depth 2nd edition (http://manning.com/skeet2) - use coupon msa1145 at checkout. Valid until August 17th. …to pre-order the printed book, plus "Manning Early Access Program" access to PDFs of chapters from the work-in-progress, plus a PDF copy of the complete first edition, all ...
When I was in school my instructor introduced me to relational databases. I mostly programmed in Oracle learning different types of JOINS and T-SQL statements. It was forbidden to talk about any other type database. Now, fast forward few years and everyone is talking about Document Databases. The NOSQL movement is all about non-relational databases. The word NOSQL might seems a little harsh if you are a DBA but the reality it just means that there are options other than relational databases. Think ...
Over the past several years social media has grown from just a few sites to a booming industry. With the wealth of information and entertainment available on sites like YouTube, Facebook and Twitter, it is easy to see where it has come from and why it has stuck. Little wonder why people, developers and companies have sought to leverage the connections found on social media outlets to further careers, sell products or just plain connect to the rest of the world. Recently, I had been asked to develop ...

Currently I'm working on a cloud storage library in C# which is called SharpBox. Just in this second I got a big step done to become a working release. Now the library compiles also on all platforms which are supported by the mono framework. Feel free to check out the latest bits!

A few months ago I had a really frustrating debate with my younger brother. He had come up to JHB to come for a visit and we decided to talk about programming. Of course I thought I would put a good pitch in for F#, but just couldn’t seem to do it any justice. Eventually his point was as follows - “What really is the difference between declaring a functional solution vs an iterative solution. Sure, in F# you have something like the Seq.map function, but isn’t it just a shorthand for a for loop or ...
Time for the Monday Postback (08.09.2010), this is where I'll do a brief rundown of last weeks progress here at dotGeek. Kind of easy to report back with not a whole lot really in the beginning, having just started things off... but here goes nothing. So I've settled on the template "Dirtylicious" and kicked things off this past Friday with my first post. Took me just a bit to find the templates, they seemed to be wedged between things and not really obvious. I suppose I was just use to some of the ...
En el artículo anterior se definieron los conceptos de la Nube y Cloud Computing, y se repasó rápidamente la evolución de tecnologías que favorecieron el surgimiento de dicho paradigma. En el presente artículo se definirán los diferentes conceptos “*aaS” relacionados con el concepto de cloud computing (SaaS, PaaS, IaaS, etc.). SaaS digamos que ya es un término hasta cierto punto conocido, pero ¿y los demás? Eso es lo que se aclarará en este artículo. Los servicios de computación en la Nube, así como ...
So I am not a web developer! I have never been one but Silverlight keeps popping in my head as the next big thing on the Microsoft stack and I would hate to “miss the boat” (I am sure some C developer said that 10 years ago as well). Today I thought I would get a little wet with Silverlight & WCF. Up to now I have been working in WPF so I am not scared of XAML and am surprised to say that I actually enjoy it. I have however never worked with WCF so for me that will be the learning curve. My project ...
One of my colleagues pointed me at Howard Baines as a recent example of a web consultancy already using Visual Studio 2010 and Entity Framework 4.0 to build web applications. I managed to grab a little time with co-founder Clive Howard (on twitter) to talk through some of the decisions, especially as I was intrigued to learn that they started out on Open Source Software including Ruby on Rails before switching to the .NET Framework. We discuss: Why switch to the .NET Framework? Entity Framework 4.0 ...
AOP still is pretty much a pain when living according to “traditional” object orientation. You need fancy tools or you need to do some advanced code slinging. With Event-Based Components, though, introducing aspects is a piece of cake. Actual code is freed from tackling special concerns. Rather concerns become a matter of architecture. But see for yourself. The scenario for today is file processing. I want an application which indexes .TXT files. The program should crawl a directory hierarchy, extract ...
Microsoft Silverlight 4 Step by Step (click book logo to be taken to the Catalog Page) By: Laurence Moroney Publisher: Microsoft Press Pub. Date: June 30, 2010 Print ISBN-13: 978-0-7356-3887-7 Pages in Print Edition: 336 I decided to do my first review with the new Silverlight 4 Step by Step book from Microsoft Press. I have read the entire book and completed all of the exercises. I have found several errors in the book’s code, but they were not hard to figure out. Instead of writing a formal book ...
Today at VSLive! we announced Visual Studio LightSwitch (link not quite up yet). LightSwitch is intended to be the simplest way to build business applications for the desktop and cloud. It provides the tools to rapidly develop professional applications from pre-built templates in a simplified development experience. It is intended to be used by professional developers. Top level features: Applications are built in Silverlight Pre-built templates Support for SQL Server, Sharepoint and SQL Azure Applications ...
[Check out other guest posts if you like this one. They are often better than mine!] One thing I miss about being the Technical Editor of the UK MSDN Flash is interacting with smart individuals to get their technical article ready for inclusion. It occurs to me that I use GuestPosts on my blog to get a similar “fix” :-) It is time for another fix :-) In this case the author is Patrick Smacchia, a very smart developer who happens to be the the lead developer for the rather amazing tool NDepend (and ...
Download GPIO Example driver and appplication source code In my article on reading and writing GPIO pins from a driver (see Windows CE: Using a Driver to Read/Write Hardware Registers) I developed a driver that exposes GPIO pins through DeviceIoControl() calls to the driver’s XXX_IOControl() function. Using DeviceIoControl() can be messy, so developing wrapper functions helps clean that up, but if the driver developer also created the wrapper and provided it as an API that would help. An API is really ...
If you haven’t seen the video demo in my last post, I suggest you watch it first to get a better understanding. So in this post we are going to see how the WCF service, the .NET Compact Framework application running on HD2 and the Silverlight application running on the Windows Phone 7 emulator work together. The Objective We are going to write three applications, a simple WCF service hosted in a windows console application which implements two functions, one called UploadAccelData() and the other ...
“prefer active patterns over multiple when guards” In line with my previous posts on 5 best practices for F# from Daniel Mohl’s slideshow, over the last few days I have been learning about active patterns. The exact best practice is to prefer active patterns over multiple “when” guards during pattern matching and in this post I am going to try and compare the two techniques and then also explain some of the basics of active patterns and why it is called active. Now before I go any further, let me ...
Intro Often extensions for Expression Blend need to store some global variables. Why not use the mechanisms Blend itself offers? I’d like to show you how to add a custom options page to the options dialog. I’ve started the example project by creating a new C# WPF Custom Control Library project and naming it ExtendingBlendOptionsTutorial. The details on how to create a new Blend Extension can be found here. You need to make sure the Microsoft.Expression.Extens... and Microsoft.Expression.Framework ...
I believe that every developer that works for someone has at least thought of becoming an Independent Developer at some point in his/her career. If I had to sum up the reason why, I’d pick these: 1. The freedom to pick the projects that you work on. 2. The ability to avoid worthless meetings. 3. Saying goodbye to incompetent co-workers. 4. Being able to do the project the ‘right’ way. (Which is typically your way - hopefully) 5. Getting the full reward for the skills you possess. I’m talking money ...
Some of you may have come across this helpful blog post recently, discussing when the garbage collector (a/k/a the GC) runs on Windows Phone 7 devices. Anyone who has programmed in XNA for the Xbox 360 before knows the GC well. For those of you new to XNA, there are several tricks and tips for slaying the evil GC monster that eats frames. This applies to Silverlight apps too, though since Silverlight does quite a lot for you automatically, there’s only so much control you have. First, you must leave ...
If you are following Scott Gu’s Blog or simply the ASP.NET Community, you would have definitely heard about WebMatrix and the Razor view engine. More specifically you must have heard of something known as “ASP.NET WebPages” The ASP.NET WebPages, Razor Engine as well as WebMatrix can definitely be confusing for many who have been into ASP.NET Development for sometime now. Clearly, this is not for you, if you are hard core ASP.NET Web Developer and are happy with either Webforms or MVC based development. ...
Last night, I attended the local C# SIG. I make sure I attend this SIG on a monthly basis. The topic was on the new features C# 2010. Here are my notes. static dynamic type bypass type checking offload until runtime implicit conversion Examples dynamic d = 7; // implicit conversion int i = d; // Since d is int, we can assign it to an integer d = "Hello world" // Now, d is a string int i = d; // this will not work (cannot place a string in int) Can take on type of object, which means that d can call ...
The past few months I've been working in objective-C since I've been doing some contract iPhone development work. I actually really like the platform. iOS is pretty fun to code for. However, it can also be incredibly frustrating--especially coming from using Visual Studio and C#. One of the things that stopped me for a while was that I noticed that my views were not being properly unloaded in a UINavigationController setup. Whenever I popped the view, I noticed that the retain count on it stayed ...
Technorati Tags: .NET,INotifyPropertyChanged... In my last post, I talked about using a Visual Studio code snippet for properties in classes implementing INotifyPropertyChanged: The code snippet lets me create the properties faster, but it's still a lot of repetitive "setter" code for each. What if I moved the "has the value changed?" and backing field update logic out of the property setters and replace my NotifyPropertyChanged method with this CheckForPropertyChange method?: protected bool CheckForPropertyChange<T... ...
In my previous article I designed and implemented a small desktop calculator using Event-Based Components. That was fun and went smoothly – but in the end I was in a hurry and missed a bug and a feature. In the meantime I found some time to fix both. Final architecture Let me take the opportunity to show you the application architecture in its entirety. The missing feature – Clear calculation - has already been added: This is the high level view. All activities except one are so simple, no further ...
Shay Friedman, author of IronRuby Unleashed (check out my review) kindly agreed to do a guest post on my blog. He explores how IronRuby can be very useful to a .NET developer, even if that developer is a die hard C# or Visual Basic developer who has no plans (Surely not! ) to use IronRuby in finished products. The power of an Interactive Console should not be underestimated – it can give you tremendous productivity gains, which is why I also recommend http://linqpad.net/ to offer similar behaviour ...