Saturday, June 04, 2005

Elearning for developers

Check this out :

http://msdn.microsoft.com/elearning/


.Net | main
6/4/2005 3:23:41 PM UTC  #  Comments [3] 

  Friday, May 27, 2005

Neutrality in "religious" technology battles....

I have been googling myself today (I never said my ego was not super inflated), and stumbled upon an a blog entry talking about the presentation on .Net vs. J2EE I did in Riyadh last month (The entry is in Arabic). There are a few things I think I should correct, as I think the remarks were not ill intended:

  • The author claims that I said I would be perfectly neutral. I would have been foolish to claim perfectness in anything. I have only said that I would be as neutral as possible, and precised that I my own personnal choice was very clear, and that I prefered .Net
  • The author said that I didn't succeed in being neutral, and that I was too favorable to .Net. I have had many reactions from attendees that were favorable to .Net that said that I was giving J2EE much more credit than it deserves. I believe that when people are there to discuss, we can talk in a serene and calm technical atmosphere.

.Net | main | speaking
5/27/2005 1:42:23 PM UTC  #  Comments [4] 

  Monday, May 02, 2005

Microsoft Zirvesi Content

As I promised during my sessions at the Microsoft Zirvesi, here are my slide decks (I will be publishing the demos later).

Visual Studio 2005 : new features for the web services developer (926 KB)

DotNet vs j2ee (1.4 MB)

Developing Mobile Web Applications With ASP.NET (1.65 MB)

Compact Framework _ part 1 (3.78 MB)

Compact Framework _ part 2 (1.47 MB)


.Net | main | speaking
5/2/2005 8:20:15 AM UTC  #  Comments [0] 

  Tuesday, April 05, 2005

SQL Server 2005 Virtual Labs

   Are you interested in experimenting with SQL Server 2005 (formerly codenamed Yukon), but don't have the time, the bits or the resources to install it and test it yourself ? Maybe you have it intalled, but it is taking you to much time to figure out the features ? MSDN has just launched SQL Server 2005 virtual labs you can use as part of the Visual Studio hosted experience. On the menu is a great selection of labs you can choose from :

  • SQL Server 2005 Integration Services  
  • SQL Server 2005 Introduction to SQL Server Management Studio  
  • SQL Server 2005 Reporting Services  
  • SQL Server 2005 Server Management Objects  
  • SQL Server 2005 SQL CLR Integration  
  • SQL Server 2005 SQL Query Tuning  
  • SQL Server 2005 SQL Server and ADO.NET (Lab A)  
  • SQL Server 2005 SQL Server and ADO.NET (Lab B)  
  • SQL Server 2005 T-SQL Enhancements  
  • SQL Server 2005 Web Services  
  • SQL Server 2005 XML Capabilites 

Have fun!


.Net | main
4/5/2005 7:05:42 PM UTC  #  Comments [0] 

  Friday, March 18, 2005

SSW code auditor -- make your code healthier

 

   SSW (australian company, lead by my good friend Adam Cogan) has a great product for code audit.

The concept is quite simple : define rules using regular expressions (it has a builtin RegEx editor) to be checked against source code, file path, file names, HTML code ...etc, and define wether that is a desirable (should exist) or undesirable (should not exist) pattern (there is a lot of flexibility built in, as setting exceptions, notes, or statistics about the rules and the time they take). You choose the files you want to apply the rules to, and you run a scan. At the end you get a detailed report.

   The tool allows you to schedule automatic execution, and email the reports to any email address.

   It has many qualities I love in products: useful, productive, simple... Great job, Adam.


.Net | main
3/18/2005 4:17:16 AM UTC  #  Comments [0] 

  Thursday, March 03, 2005

You won't believe it until you see it...

What's the next step for .Net ? this might just be it ...

AspSoft  is preparing a big surprise for TechEd 2005. be there!


.Net | main
3/3/2005 11:18:46 AM UTC  #  Comments [0] 

  Sunday, January 23, 2005

.Net Celebrity charity auction starts today (9am Esatern US)

     The initiative lead by Julia Lerman and Stephen Forte, the .Net "Celebrity" Auction for the benefit of Tsunami victims of Banda Aceh will start this afternoon (2pm GMT time) on e-bay . Your bid will buy you an hour of consulting from one of the top experts, and all the money will go to the tsunami victims.

    Stephen Forte has the complete list with bios on his blog.

    Thanks to Thinktecture (and fellow .Net celebrities Christian Nagel, Christian Weyers, Ingo Rammer and Ralf Westphal from Thinktecture) who, being unable to get on board because they did not get the info on time (Travel and busy schedules play tricks on all of us sometimes) they have decided to help by picking up all the e-bay fees.

   You can click on the above link to the e-bay auction or go here : http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5552696499

   Some people seem to dislike the term "Celebrity" that Julia used to discribe us. I don't usually like to be discribed with such words, and I'm sure many on the list have the same feelings. but I have a few remarks on the subject : If not every single person on the list is a worldwide celebrity (I definitely don't think I am one), these are definitely people that would be seen as celebrities at least in their respective geographies. Also, the term celebrity only means that they are known and liked by a big number of people, which doesn't say the same as "top notch experts", which does apply to most people on the list (I would qualify as such everyone escept myself, and I know some would disagree with the exclusion)... Anyway, even if the celebrity status was not appropriate in other circumstances (and I know many of us have been called things that go beyond the term "celebrity" in the past, like "Software Legends", "Rock Stars", "Over Achievers", and many other things), it is completely appropriate as marketing for such a noble cause.

    Celebrity or not, these are people that will gie you more than your money's worth in consulting and advice.

    For my part, I intend to give a rather "long hour", and to deliver without much delay (notwithstanding my busy agenda).


.Net | main
1/23/2005 1:06:57 PM UTC  #  Comments [10] 
.Net Celebrity charity auction starts today (9am Esatern US)

     The .Net "Celebrity" Auction for the benefit of Tsunami victims of Banda Aceh will start this afternoon (GMT time) at e-bay . Your bid will buy you an hour of consulting from one of the top experts, and all the money will go to the tsunami victims.

    Stephen Forte has the complete list with bios on his blog.

    Thanks to Thinktecture (and fellow .Net celebrities Christian Nagel, Christian Weyers, Ingo Rammer and Ralf Westphal from Thinktecture) who, being unable to get on board because they did not get the info on time (Travel and busy schedules play tricks on all of us sometimes) they have decided to help by picking up all the e-bay fees.

   You can click on the above link to the e-bay auction or go here : http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5552696499

   For my part, I intend to give a rather "long hour", and to deliver without much delay (notwithstanding my busy agenda).


.Net | main
1/23/2005 12:28:42 PM UTC  #  Comments [10] 

  Saturday, January 22, 2005

Sony chooses Microsoft for a Web Services based Web Presence solution

Sony, although almost all their exisisting systems are J2EE based, has choosen .NET Framework and .NET Framework built Web Services for their new Professional Services web presence. Check it out at eweek...

 


.Net | main
1/22/2005 6:36:22 PM UTC  #  Comments [16] 

  Monday, December 13, 2004

SOA stuff coming up

I haven't been blogging for a while, and that is simply because I am too deeply immersed into a project. I can"t tell too much yet, but basically I am building a good size SOA implementation. Off course, it is not the size of proseware, nor as fancily crafted (I don't have the skill of Sir Clemens to do that), but it is still a nice example (with a few thousands of lines of code). It will be another two weeks before I can discuss it more openly here...


.Net | main | SOA
12/13/2004 11:29:34 AM UTC  #  Comments [0] 

  Tuesday, September 07, 2004

Working with a framework vs. code generation...

    It sounds like I will be crabby on my posts this week. Although I am not seeing axis or IBM Web Services for the first time, I cannot stop myself from being horribly surprised by the programming model. I will not compain about all the times the environment (Web Sphere Studio 5.1 or test integration server crashes for unknown reasons). I simply cannot understand how they expect a developper to be working with tons of generated code, which has even a few bugs... like this line :

mc.setProperty(com.ibm.ws.webservices.engine.MessageContext.PARAM_MAXOCCURS_NOT1, _set2)

   It gets generated in the SOAPBindingStub when working with unbounded arrays as return type, but it seems that MessageContext has no such field...

   Not too long ago, I was looking at some interop problems one of my customers had, and we found ourselves forced to deal with a huge amount of generated client side generated source code to be able to pass a username and password for authentication (the version of the tools we were using simply dropped authentication by username and password when they added support for oasis...)

My main problem is not why there are a few bugs (even if they are at a very basic level and should definitely not be there if anyone is going to be using the tools in the real world), but that the bugs are in generated code, which will be regenerated when one makes changes to the source of the bean the service is built from. This means that the bug will have to be fixed manually zillions of times during the development process !!! and I have not even started to talk about maintaining the service after it is deployed... and it is not something that happens on 1 generated file, but a big number (serialization/deserialization classes, binding stub, proxy, service interface, helper classes, meta data, and other bizarre things) 

   XML Web Services are built on protocols and interoperability specifications, and the mapping between an object model and a service model should be built as a framework that encapsulates the generic way of mapping the two worlds, or on a new programming model totally built for services (message contract, service contract, channels, ports...etc.).

   That is the way Microsoft is dealing with the problem, and I think they are right in doing so. the asmx model offers an extensible easy way to map the object world to the message world, and takes care of mapping the whole thing into xsd and wsdl. This model is still OO, but it works for the OO developer. with Visual Studio 2005, and later with Indigo, the service programming model gets its implementation as a framework.

   Between the two programming models, my choice is definitely made.


.Net | main | Views
9/7/2004 1:16:55 AM UTC  #  Comments [0] 

  Tuesday, August 31, 2004

Longhorn announcement was great news!!!

   Although many might be reporting Microsoft's Friday announcement as bad or mitigated news, I only see in it great news. Here is my tqke qt the issues :

  1. It is reassuring to know that what matters most to me as a developer and architect, i.e. Avalon and Indigo, are on track and going to be released in 2006 as previously announced. As for WinFS, and away from the hype, even if I did consider it interesting to deal with the amount of data that we will be faced with whithin the Longhorn timeframe, it is not as important to me as the other two tenets, especially if search is, as promissed, enhanced to a level where it becomes really efficient. here is how I view the three technologies :
    • Indigo : if there is something that will change the world of computing and make the vision that Rafal Lukawiecki calls "pervasive integration" happen, it is the "Service Orientation". Off course Microsoft has been leading in the world of Web Services (asmx and WSE), but not until "Indigo" will we have the tools that allow us to start fullfilling that vision. It is the first framework that allows us to thing, design and implements in terms of SOA concepts (Data Contract, Service Contract, abstracting the services from the channels and transports). If there is any technology I am eager to see released as soon as possible, it is Indigo. This technology is really what will make development much better, and allow for the richest feature model through a coherent, mangeable model based on SOA.
    • Avalon : Even though the most talked about features of Avalon are not necessarily very important to me, I am very happy they are included in the Longhorn release : media and UI unification, vector based graphics, higher shell integration, unification between thin client and rich client, ...etc. These will make applications look and feel different, but will take time before becoming mainstream, and thus are not as time sensitive.  However, what I would rather see happening as soon as possible, is a model where design is truely separate from code. that will save me and the developers I work with an incredible amount of time.
    • WinFS : Although I am probably not the best person to discuss the importance of rows and columns, I see WinFS as being a very interesting way to unify various Data Formats, but I remain convinced that with or without WinFS, our documents will still live in folders for quite some some time, which means that I don't see it as a time sensitive issue. at the same time, and with Yukons support for managed types and XML types, I don't see what would stop our applications that use or can make use of large quantities of document to store those in the database. We are not yet at the phase where developers are doing it and in bad need for a better framework. I even see the delay as beneficial, because it may well trigger more custom developped solutions, and thus real world experience that will guide the final format of WinFS. I will not discuss Object Spaces here, because I truely don't see that technology to be either important or even beneficial, simply because I don't like mapping messages and objects (although I do use such an approach sometimes, I prefer not to have it formalized as if it was a best practice). The only valid reason I can think of that would make WinFS an urgently needed technology is the need for quickly finding information that resides in documents in the huge number and size we probably will have on our hard disks (or for that matter, in remote storage as well) by 2006. That is why I was very relieved to hear that the new search functionality is going to be part of Longhorn.
  2. If the annoucement was marked by the decision to keep the schedule, and to cut WinFS, it did confirm a very happy rumor : Avalon and Indigo will be released for XP and 2003. I have explained above why I need and want those technologies, and being able to use them on a broad deployment base is very good news indeed. I hope they will also be generalized to the various Windows mobile products as well.
  3. I have seen some criticism about these news marking a move from being "technology oriented" back to the old "product oriented" days. actually, the announcement that the core technologies are being developed independently from product release constraints, then making it into a product release or not based on their own maturity and quality conveys a quite different message. Off course Microsoft makes its money out of products, and even its customers want it to be giving them the latest technologies as they go, according to manageable cycles. I think many customers would have been unhappy to be using the same technology for 7 years. that would have forced another major service pack / second edition, which would have been much less interesting than the new technologies that will be ready in 2006. I believe the message this annoucement conveys is that Microsoft remains a technology company, and that it does deal with market constraints and needs without compromising quality of the features and technologies.

.Net | main | Views
8/31/2004 9:47:50 PM UTC  #  Comments [10] 

  Friday, August 06, 2004

Can there be an exploitable buffer overrun in the CLR ?

   last June, at the Q&A session at the Pakistan Developer Conference in Karachi, an attendee asked : "Can there be an exploitable buffer overrun in the CLR?". My answer was that it is always possible in theory... I was really tired after five sessions back to back. I did not develop my answer enough. I am not an expert on the CLR, so I post this in hope to get some comments from more knowledgeable people on the subject.

    Here are my thoughts :

  1. The CLR is definitely unmanaged, and thus, in theory it can have a buffer overrun. No Developer is beyond making mistakes, and there certainly could be a buffer overrun. the problem is whether it can be exploited, and if so, how...
  2. One shouldn't confuse the CLR with the .Net Framework : we develop in managed code against the built-in classes of the .Net Framework. this means that any exploitable buffer overrun that would surface in our applications would have to be there on the classes we develop. This means that if a buffer overrun on CLR is to be exploited through managed code, it has not only to be there on the CLR, but also to re-surface through some of the .Net Framework classes (calls to managed heap allocation for example, without validating values before making the call to the CLR). then, our own code would have to have the same flaw again... that means that the same flaw, applying to the very same value, would have to exist in three separate layers. The probability is so low that, even if it is theoritically possible, it remains so improbable that one should dismiss its possibility. There is a higher chance of having a class in the .Net framework itself having a buffer overrun in a native call, than having a CLR buffer overrun re-surface.
  3. Can there be an unmanaged call to the CLR exploiting a possible buffer overrun ? I will address this in a coming post

    Anyway, I realize the question's main objective is to find out whether it is possible to defeat the managed code security messaging. No matter whether there is a possible theoritical buffer overrun exploit (which will be, in any case so improbable that it is virtually impossible), it is very clear that the managed code is hundreds of times more secure than unmanaged...


.Net | main
8/6/2004 3:15:22 PM UTC  #  Comments [8] 

  Monday, June 28, 2004

Mauritius DevDays was great...

     Friday, Lee Mungai and I had a great day speaking at DevDays Mauritius. here is the content I presented (sorry for the delay).

(0) Trends and Vision.ppt (1.54 MB)

(1) Threats and Defenses.ppt (1.72 MB)

(2) Rebuild the puzzle.ppt (1.69 MB)

DevDays_Demos.zip (257.15 KB)

Demos Tutorial.zip (387.06 KB)
.Net | main | speaking
6/28/2004 6:26:59 AM UTC  #  Comments [12] 

  Tuesday, June 15, 2004

My PDC 2004 sessions

    Tomorrow, I'll be doing 5 sessions back to back. 4 were planned, and one of Steven's sessions (he couldn't make it to Karachi). These sessions are :

  1. Mobile Web Development with Microsoft Visual Studio .NET
  2. Developing Compact Framework Applications for PocketPC and Smartphone
  3. Developing PocketPC Applications for a Semi-Connected Environment
  4. Introduction to ADO.Net
  5. Developing Performing Mobile Applications with the .Net Compact Framework

 


.Net | C# | speaking
6/15/2004 8:37:43 AM UTC  #  Comments [20] 

  Wednesday, June 02, 2004

Developing for the Smartphone is different...

   While I am convinced the smartphone has a role to play in business solutions, I don't think it should be looked at the same way we look at PocketPCs and other handheld devices.

   The PocketPC is essentially a small PC, and its logical role in the enterprise is to extend the information system to englobe the mobile forces in the field. This means that the applications we develop for the PocketPC are essentially extensions to LOB, CRM, billing and such usual applications needed in the business processes. The only difference between them and applications that reside on the server or the desktop is that the PocketPC has lower ressources, smaller form factor, powered by batterie (limited autonomy), ...etc. If the PocketPC was as powerful as desktops, the apps we develop for it would be just the same as those we develop for the desktop. The necessity of small footprint, along with the semi-connected nature of all mobile devices imposes a certain way of development (rich client, data persistence, and eventually some connected operations when needed, essentially through web services). Although not as efficient as typing on a keyboard, the stylus typing can be decently used for data input.

   The smartphone, however, is essentially a phone (even if it is the most advanced form of phones), whith a small potential of data persitence and assisted data input. In my view, it should not (yet) be viewed as an extension to the business solutions, as much as a simple bridge between the solution that resides on the servers and the telephony or location capabilities of a phone. typically, the smartphone would be used to get some data from the system, but only in as much as that data is related to or helping on decision for making phone calls, appointments, ...etc, or for callecting prédefined data. The one handed operation of the phone, and the hardly efficient typing makes any input that goes beyond a few letters or a few digits almost impossible. On type of aplications I have found very intersting is reporting. It is linked to appointments, possibly to making phone calls (to confirm appointments, to postpone or delay commitments - which usually would involve sending messages or making phone calls) and it has predifined input (customers, tasks, ...etc) and usually only require choosing the appropriate info, and adding dates and times to them. When comments are needed, they can be dictated or voice recorded. then, the info can be synchronized back to the server - either through GPRS, or some other synchronization mechanism that requires the phone to be docked or wired to the system (like activeSync, Irda, bluetooth, or any other technique). That type of application is a perfect example of how the smartphone can add productivity and simplify some of the most painful processes.

   That is why, even though I am absolutely not fond of P/Invoke, I think it is an essential part of developing for the smartphone.


.Net | mobility
6/2/2004 1:20:33 PM UTC  #  Comments [2] 

  Thursday, May 06, 2004

Imagine Cup Finals in Morocco

   The Imagine Cup is organized for the first time in Morocco this year, and the finals will be on Saturday May 8th.

   The event is taking place at the INPT in Rabat (Institut National des Postes et Télécommunications). I will do a keynote on future technologies...

   I think it will be fun being on the jury (if I make it, for I have a chance to spend some time with my daughter this week end)...


.Net | main | speaking
5/6/2004 3:38:06 PM UTC  #  Comments [11] 

  Monday, May 03, 2004

The Cabañas at TechED this year...

   This year at TechEd, there is an interesting new addition : The Cabañas at the Community Lounge. The idea is to cut the distance between attendees and speakers/experts. Here are a few intersting happenings :

  • Meet the Technologist sessions : These are pretty much breakout sessions, but they are more attendee friendly in that they are smaller, and allowing more interaction with the speakers. They range from Chalk Talks to fully preped presentations with demos, in small open Cabañas. Attendees (At most, 30 per session) will have the oportunity to ask questions as the speaker is covering his topic, which, I am sure, will give those sessions a much more intimate atmosphere.
  • There will be no speaker lounge at TechEd, and speakers are supposed to simply hung out at the Community Lounge. That will let the attendees find the speakers much more easily and interact much more easily
  • There will be a concierge to help attendees find experts that can answer their questions. Many experts both from Microsoft and from the industry will be present in the Community Lounge at specified times, so that attendees can find them easily and discuss their subjects of interest with them.

    If you attend TechEd, don't miss the Community Lounge, it will be a fun and informative experience.

    I will be giving a Meet the Technologist session on "Writing .Net Compact Framework application that use the Telephony and Messaging APIs". If you are interested in mobile device development, come to the session and I will be glad to discuss any questions you may have. I will also be present at the community Lounge pretty much every day.


.Net | main | speaking | TechEd
5/3/2004 4:35:08 PM UTC  #  Comments [2] 

  Tuesday, April 06, 2004

Séparation entre code et contenu : XAML ...

   Je me rappelle que, il y a quelques années, je me demandais pourquoi la plus grande partie des applications client riche avait un design très peu flatteur, alors qu'on retrouve du design bien plus poussé dans les applications Web. Cela ressemblait à une contradiction, puisque sur le client riche on dispose de beaucoup plus de moyen pour bien exploiter les capacités graphiques de la machine que dans un browser.

   J'avais à l'époque passé un peu de temps avant de me rendre compte (je suis peut être un peu stupide sur les bords?) que c'était parceque le modèle de développement n'était pas du tout le même. Sur les applications Web, les designers s'occupent de créer la charte graphique, et les développeurs s'attellent à ne créer que les fonctionnalités dynamiques (accès aux bases de données, traitement des interactions utilisateur, validation, ... etc). Ce qui m'avait pris un temps de réflexion était le pourquoi, avant de me rendre compte que c'était facile de créer des applications de design qui générent du code, mais qu'il faut encore que le code qui gère l'affichage soit séparé de celui qui gère les aspects dynamiques, et que HTML remplissait ce rôle. Je savait pertinament qu'il n'était pas facile de dépasser les fonctionnalités de HTML (temps pour normaliser, temps pour implémenter les nouvelles normes, puis temps pour que cette nouvelle norme soit supportée par la majorité des browser) et que cette opération prennait des années.

   Quand XML est arrivé, on pensait que c'était un bon moyen pour que, sur le Web au moins, on puisse créer du code qui exploiter facilement toutes fonctionnalités nouvelles des nouveaux browsers sans pour autant perdre la compatibilité avec les browsers ancien (différents XSLT en fonction du UserAgent). D'ailleur, on pouvait aussi imaginer que les applications client riche utilisent le même modèle en basant la génération dynamique de l'affichage sur du XML. Le problème restait que l'affichage était cintrolé par le XSLT, et donc que c'était aux développeurs de le traiter et non pas aux designers... et donc le modèle en entier cassait.

   Aujourd'hui, nous avons enfin un modèle qui permet de séparer réellement le code du contenu, que ce soit dans des applications client riche ou lèger, et ce modèle se base sur une forme de XML appellée XAML (Extended Application Markup Language). Ce modèle à été conçu par Microsoft dans le cadre de la refonte du sous système de présentation de Windows qui fera partie de Windows "Longhorn" (prévu pour 2006). Ce qui est intéressant dans ce modèle, c'est qu'il offre un modèle semblable à HTML, sauf qu'il est utilisable sur tout type de client, et que le code n'a pas a être mélangé dans le HTML (même plus que ce n'était le cas avec ASP.Net).

   Le principe est très simple :

  •  Le code déclaratif (XAML) permet  une utilisation très riche des possibilités graphgiques (contrôles, documents, médias, transparence, effets, animlations, transformations ..etc). il est donc possible de faire des designs impresionnant avec XAML (ce que Adobe a très vite compris et a commencé à préparer des applications de design basées sur XAML). Ce code sera utilisé par le compilateur comme une classe partielle complètée par le la classe qui est dans le code (sans avoir à ajouter des balises ou quoi que ce soit)
  • Le code fait en langage de développement qui constitue une classe partielle complétée par le XAML.

   Même si ce modèle fait partie de Windows Longhorn, on peut d'ors et déjà l'utiliser à travers les outils tels que Xamlon (interprétation du XAML en runtime, et code behind dans un code séparé) et les divers générateurs XAML qui permettent de transformer des documents Illustrator ou After Effect (ou autres) en XAML. Les résultats sont impéssioanants...


.Net | main
4/6/2004 11:57:08 AM UTC  #  Comments [15] 

  Thursday, April 01, 2004

Globalization and getting the Months right (Arabic Morocco)

The follwing code is in C# (easy to convert to VB.Net)... Have fun :

 

using System;

 

namespace Malek.Globalization

{

   /// <summary>

   /// Summary description for CultureInfo.

   /// </summary>

   public class CultureInfo : System.Globalization.CultureInfo

   {

      public CultureInfo(int culture) : base(culture)

      {

         setValidDateTimeFormat();

      }

      public CultureInfo(int culture, bool userOverride) :    base(culture, userOverride)

      {

         setValidDateTimeFormat();

      }

      public CultureInfo(string culture) :    base(culture)

      {

         setValidDateTimeFormat();

      }

      public CultureInfo(string culture, bool userOverride) :    base(culture, userOverride)

      {

         setValidDateTimeFormat();

      }

 

      public static new CultureInfo CreateSpecificCulture(string culture)

      {

         return new CultureInfo(culture);

      }

//      private System.Globalization.DateTimeFormatInfo base.DateTimeFormat;

 

      private string[] MoroccoMonthNames= new string[]{"يناير", "فبراير","مارس","أبريل","ماي","يونيو","يوليوز","غشت","شتنبر","أكتوبر","نونبر","دجنبر",""};

 

      private void setValidDateTimeFormat(){

         if (Name.ToLower()=="ar-ma")

         {

               System.Globalization.DateTimeFormatInfo dtfi = (System.Globalization.DateTimeFormatInfo)base.DateTimeFormat.Clone();

               dtfi.MonthNames=MoroccoMonthNames;

               dtfi.AbbreviatedMonthNames=MoroccoMonthNames;

               dtfi.AbbreviatedDayNames=dtfi.DayNames;

               dtfi.ShortDatePattern="dd/MM/yy";

               dtfi.LongDatePattern="dddd dd MMMM yyyy";

               DateTimeFormat= dtfi;

         }

      }

   }

}

 

 

 


.Net | Csharp | main
4/1/2004 9:58:37 PM UTC  #  Comments [0] 
Changes to C# announced

Dan Fernandez and Eric Gunnerson from the C# team have both disclosed today in their blogs some of the latest changes that will be made to the C# language in its next version (part of Visual Studio 2005). It seems those changes are made for legal reason, to comply with the FCLC commission rules.

While Dan speaks about some of the System.String changes, Eric writes about some of the keyword changes. While I love the new level of intimacy C# is getting into, I am afraid it will be quite difficult to migrate current code into the new version, and there will be no wizards nor clear migration path. Here are some examples of how current code translates to the new version :

  • string str = "my 69 year old grand father" --> [Decent, FCLCCompliant] string str = "my (d) 69 year old grand father"  //I used (d) instead the new decency symbol
  • the following code :

protected void Button1_Click(object sender, EventArgs e)

{

SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection);

if (cmd.ExecuteReader().HasRows) authenticated=true;

...

}

translates into something like :

stupid dangerous void Button1_Click(object sender, EventArgs e)

{

[PtentialObsenity()]SqlCommand cmd = new SqlCommand("Select * from Users Where userName='"+textBox1.Text"' AND password='"+textBox2.Text+"'", myConnection);

if (cmd.ExecuteReader().HasRows) authenticated=true;

...

MessageBox.Show("April Fools, thanks for reading this far");

}


.Net | C# | main
4/1/2004 9:15:45 PM UTC  #  Comments [14] 

  Friday, March 12, 2004

NorthAfrica Developer Conference ... soon!!!

 

The greatest yet... The North Africa Developer conference this year features the future Microsoft technologies : Longhorn, Whidbey and Yukon, alongside the deep inside .Net development sessions covering most areas of interest for the developer, the software architect and the solutions decision maker... In this second edition of the NDC, we expect 1500 attendees at the 3 keynotes and 45 breakout sessions. Among the speakers, a strong Regional Directors presence including :

 

 


.Net | main | NDC
3/12/2004 9:35:13 AM UTC  #  Comments [1] 

  Tuesday, March 09, 2004

Going to Kansas City after 13 years ...

   

    When my friend and rock star speaker John Alexander told me that there was a conference on .Net in Kansas City in june, I didn't take a second before I wanted to be there ... So I return to the midwest as a conference speaker, after I left it when I was still a student 13 years ago.

   As some may know, I have spent a few years in Wichita, Kansas during my university years, and driving the 3 hours I needed to get to KC was a weekend habit (Actualy, I used to drive to Lawrence, KS to visit some friends at Kansas University on saturdays, and usually party out there, before heading to KC in the morning to spend my day over at Worlds of Fun and Oceans of Fun). But since I left Wichita in 1991, I have never been to any part of the Great Plains (except for about a week in Chicago in the 1996 - or was it 97 ?) ...

   Last week, one of my greatest friends (I call her my sister) that I have lost contact with for the last 12 years found me through google ... Off course lots of things happen in such a long time, and I am very happy to be able to see her.

    So, somehow, the midwest is calling ...


.Net | main | speaking
3/9/2004 8:54:50 PM UTC  #  Comments [13] 

  Sunday, February 15, 2004

Mono is great!

I really like it, but I hate Red Hat...


.Net | Linux | main
2/15/2004 1:36:50 AM UTC  #  Comments [0] 

  Thursday, February 12, 2004

mono:: is alive and well...

    Although I had followed the mono project (Ximian's implementation of the CLI), and even talked about it in short words many times, I finally made my mind to really see it...

    Actually, I didn't just think I should do it, but it was in preparation for a talk that Youness Habibi will do for the Morocco .Net User Group, and I had promised to assist him (as if I had any idea about it)...

   It was quite an experience, and actually we were helped by Mr. Lebbadi of Atrait for compiling and configuring mono(A nice Linux guy, who didn't even say anything harsh to me - except mybe saying something in this line : are you as open to others as Microsoft). That help was crucial, for neither I nor Youness had ever really touched a Linux beyond the user interface and maybe some "vi"...

   Well, how happy we were when the hello world "mono style" worked and we had that "mono:: is alive and well..." on the screen. That was only few minutes after Morocco's victory in the mid-final African Soccer Cup, and Casablanca was going wild ... Still, we almost topped the cround's noise when we were rejoicing after we copied the .exe to windows and it worked...

   Tomorrow, we are going to start doing some serious tests on mono : (Data, Web Wervices, WebForms, WinForms...)... Long live the world of portable .Net IL ...


.Net | Ineta/MUGNET | main
2/12/2004 3:35:33 AM UTC  #  Comments [0] 

  Wednesday, February 04, 2004

Trivia Answer : Memory allocation management in VB.Net

Can memery allocation (non garbage collected) be done with VB .Net ?

Regular answer : No. C# can do unsafe (non garbage collected) code, and VB.Net cannot

Hideous Answer : Well, yes it is far from being Elegant, but as my good friend and impressively clever RD Clemens once told me in the middle of a discussion on .Net vs. COM : "There can be no purity in software development". So here it is :

    There is full set of Memory management APIs (http://msdn.microsoft.com/library/en-us/memory/base/memory_management_reference.asp) that can be used to do memory alocation (both on the heap and on the stack), copy memory, get a handle to allocated memory, ...etc.

    VB can do PInvoke ...

   PInvoking into Kernel32.dll (or Coredll.dll in Windows Mobile) makes VB capable of dealing with such issues... which is only usefull in very special cases (using other APIs accessible through PInvoke and making sure there is no garbage collection on the arguments passed to the native APIs is the only use I ever needed them for - and only because I had to show VB.Net code (besides C# code) in presentations ...).

   It is not very hard to wrap those calls into some Utility class, and then use it for allocating memory and geting the handles to the objects, which can easily make the code somewhat more elegant ...

   Example (MSDN Article by Derek Mitchell) :

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfphoneapi.asp

   Have Fun ...

 


.Net | main | Trivia
2/4/2004 1:39:07 PM UTC  #  Comments [0] 

  Saturday, January 31, 2004

Trivia Question : unsafe code in VB.Net ?

Can memery allocation (non garbage collected) be done with VB .Net ?

Use the comments to answer ...


.Net | main | Trivia
1/31/2004 3:00:54 PM UTC  #  Comments [16] 

  Tuesday, January 13, 2004

A great MDC this year

The MDC is a great information source for Developers. Started last year, the MDC is becoming "The" Microsoft conference in the middle east ...

For those who missed the PDC (Los Angeles, October 2003), this is a great opportunity to have a look at the future with Longhorn, Yukon and Whidbey ... The three products that will change Microsoft technology, and place managed code at the center of every Microsoft product ...

This year, the conference will be opened by Bill Gates himself (for the first time in Middle East).

There are a few of my friends and fellow RDs speaking :

Stephen Forte

Patrick Hynds

Goksin Bakir

Selçuk Uzun

Hossam Khalifa

For myself, I'll be giving 4 sessions. 3 sesions on Office System development (using XML in Word and Excel, InfoPath, and Visual Studio Tools for Office), and a mobility session on developing mobile applications with the compact framework (I will dwell quite a bit on smartphone development, on performance considerations and tips, and I will introduce the new mobility features of Visual Studio Whidbey).


.Net | main | speaking | Travel
1/13/2004 10:49:10 AM UTC  #  Comments [0] 

  Monday, January 12, 2004

streaming to an application from a web page ...

One intersting simple thing I have worked on today (to solve a problem encountered by a couple of friends), is streaming a dynamically generated pdf or other types of files to the user without storing it first in the file system.

Well, it is easy to change the header information (content-type essentially), remove all the unwanted headers and content (Response.Clear() ) so that the normally generated HTML does not corrupt the pdf file ... etc.

The problem is to deal with what will happen when the client doesn't have a pdf reader (acrobat reader) add-in installed in his browser. Then, the browser will simply propose to saven the file, and the filename will be that of an aspx file (or whatever server side page is used), since the client requested an Asp.Net page ...

To handle this situation, there is a simple (comment if you think it is complex) way :

  • Map the pdf extension to the ASP.Net engine : simply, in IIS, go to the application configuration and add the exension .pdf as needing  executable C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll, as shown in the following picture

This by itself can do the trick, but it will force a very inelegant (and having great error potential, ...etc.) solution ... this solution would be just renaming the .aspx page to a .pdf ... A more elegant solution is not to use an aspx file at all for this pdf generation and do the next two steps

  •  Create an HttpHandler, that deals with the pdf generation. it can get the request parameters (or form parameters), generate the pdf, and stream it right back to the client. The code to do That is illustrated in the following sample :

 

namespace Malek.Utils{