posts - 256, comments - 96, trackbacks - 129

My Links

News

My main blog url now is: weblogs.asp.net/meligy

Tag Cloud

Article Categories

Archives

Post Categories

BlogRoll

About Me:

Sunday, July 06, 2008

dotNETwork 5th Gathering – Really enjoyed that Silverlight & SOA Anti Patterns Mix (Part II / II)

I discovered just now that this blog post was not correctly cross posted from my new weblog to this one.

Trying to copy it manually also does not work (tried in Firefox 3 as well as IE 7). It looks like a timeout or something (warning: yes, it is a big post).

Anyway, if you are interested in my coverage of SOA Anti Patterns session in dotNETwork 5th gathering, you can find it here:

dotNETwork 5th Gathering – Really enjoyed that Silverlight & SOA Anti Patterns Mix (Part II / II)

posted @ Sunday, July 06, 2008 4:09 AM | Feedback (0) | Filed Under [ WS & Distributed Apps Local Events ]

[Off Topic] Displaying Desktop Alerts for Messages Moved from Inbox in Outlook 2007

In my company, we agree on certain subject macros for articles, news and similar non work related messages. Each of us creates his own Outlook 2007 Rules to move those to specialized folders.

The drawback of this is that new messages that get moved to other folders than Inbox do not have the desktop alert:

clip_image002

You do not know whether you got a new message or not.

This might be OK for messages flagged [fun], but as I have been in the company for long, I used to have folders for each of my complete projects messages in case I get a maintenance message or so. The project I work on right now has its own mailing list, so, I move its messages to a dedicated folder. I cannot afford missing instant note of an email in the project I work actively on right now!!

If you face a similar situation, it has an easy fix to get the desktop alerts for all the messages you need it for. Actually it’s no more than creating another Outlook folder :).

Let’s see how easy it can go:

Start by going to Tools-> Rules and Alerts …

clip_image004

Then click “New Rule…”

clip_image006

Make your selection as below and click “Next”

clip_image008

See if you need to apply this to only certain messages, typically just click “Next”

You may get a confirmation message. Just click “Yes”.

clip_image010

The last step is to select “Display Desktop Alert” and click “Finish” and "OK" to next messages.

clip_image012

 

Hope this helps anybody in similar situation.

 


Cross posted from weblogs.asp.net/meligy


posted @ Sunday, July 06, 2008 3:36 AM | Feedback (0) |

[Link List] Deep into ASP.NET Routing Assembly (Used in ASP.NET MVC Framework)

I’ve have just sent this email to the developers exchange group in my company:

I think you all know the routing engine that works with ASP.NET MVC framework to enable customizing URLs and mapping those to the corresponding controls, actions and their parameters.

Some of you may know too that the routing engine is not just for ASP.NET MVC, but ASP.NET in general. If you happened to download the source code of the ASP.NET MVC framework (any preview), you’d have noticed that the routing comes as DLL not in source code format like other parts of the ASP.NET MVC framework.

I have found an interesting series of articles going through the routing assembly that I thought you might be interested in:

I found them at: http://msmvps.com/blogs/luisabreu/archive/2008/07/04/the-routing-series.aspx

Regards,

Mohamed A. Meligy
SilverKey Technologies - Egypt

Senior Software Engineer

Hope that helps somebody.

I feel shamed for not writing genuine articles for long. This is to come soon (God Willing). Maybe in two weeks or hopefully less.


Cross posted from weblogs.asp.net/meligy


posted @ Sunday, July 06, 2008 2:37 AM | Feedback (0) |

Saturday, July 05, 2008

Foundations of Programming, AKA, the ALT.NET FREE Book!!

“Foundations of Programming, Building Better Software” is a new eBook by Karl Seguin. The book does not say in its introduction that it’s all ALT.NET-ish, it starts by introducing what ALT.NET is, it's goals etc, afterwards, all the topics the book covers are inspired by ALT>NET frequent topics. This includes Domain Driven Design (DDD), Dependency Injection (DI), Object Relational Mapping (ORMs), Mocking, etc…

Here’s what Channel9 had to say about it (which is how I originally found it too):

Karl Seguin recently released a great free 79 page eBook for .NET developers covering design patterns, unit testing, mock objects, memory management, object relational mapping, and more.  Get it while it's free!

Now, if I did my job well getting your interest, then you may want to get to the best part:

Foundations of Programming, Building Better Software – EBook Download

IF you’re not interested yet, I know this must get your most interest in the book, the table of contents (highlighting chapter titles in bold):

About the Author ...............................................................................................................................6
ALT.NET ............................................................................................................................................7
Goals .............................................................................................................................................8
Simplicity .......................................................................................................................................8 YAGNI............................................................................................................................................8
Last Responsible Moment................................................................................................................9
DRY ...............................................................................................................................................9
Explicitness and Cohesion ................................................................................................................9
Coupling ........................................................................................................................................9
Unit Tests and Continuous Integration .............................................................................................9
In This Chapter.............................................................................................................................10
Domain Driven Design.......................................................................................................................11
Domain/Data Driven Design...........................................................................................................11
Users, Clients and Stakeholders .....................................................................................................12
The Domain Object .......................................................................................................................13
UI ................................................................................................................................................15
Tricks and Tips ..............................................................................................................................16
Factory Pattern .........................................................................................................................16
Access Modifiers .......................................................................................................................17
Interfaces ................................................................................................................................17
Information Hiding and Encapsulation ........................................................................................18
In This Chapter.............................................................................................................................19
Persistence......................................................................................................................................20
The Gap .......................................................................................................................................20
DataMapper ................................................................................................................................20
We have a problem ...................................................................................................................23
Limitations...............................................................................................................................24
In This Chapter.............................................................................................................................25
Dependency Injection .......................................................................................................................26
Sneak Peak at Unit Testing.............................................................................................................27
Don’t avoid Coupling like the Plague ..............................................................................................28
Dependency Injection....................................................................................................................28
Constructor Injection.................................................................................................................28
Frameworks.............................................................................................................................30
A Final Improvement .................................................................................................................32
In This Chapter.............................................................................................................................33
Unit Testing.....................................................................................................................................34
Why Wasn't I Unit Testing 3 Years Ago?..........................................................................................35
The Tools .....................................................................................................................................36
nUnit .......................................................................................................................................36
What is a Unit Test ........................................................................................................................38
Mocking ......................................................................................................................................38
More on nUnit and RhinoMocks.....................................................................................................41
UI and Database Testing ................................................................................................................42
In This Chapter.............................................................................................................................42
Object Relational Mappers ................................................................................................................43
Infamous Inline SQL vs. Stored Procedure Debate ...........................................................................43
NHibernate ..................................................................................................................................46
Configuration...........................................................................................................................46
Relationships ............................................................................................................................49
Querying .................................................................................................................................50
Lazy Loading .............................................................................................................................51
Download ....................................................................................................................................52
In This Chapter.............................................................................................................................52
Back to Basics: Memory ....................................................................................................................53
Memory Allocation.......................................................................................................................53
The Stack .................................................................................................................................53
The Heap .................................................................................................................................54
Pointers ...................................................................................................................................55
Memory Model in Practice.............................................................................................................57
Boxing .....................................................................................................................................57
ByRef.......................................................................................................................................58
Managed Memory Leaks ...........................................................................................................61
Fragmentation ..........................................................................................................................61
Pinning ....................................................................................................................................62
Setting things to null .................................................................................................................63
Deterministic Finalization ..............................................................................................................63
In This Chapter.............................................................................................................................63
Back to Basics: Exceptions .................................................................................................................64
Handling Exceptions ......................................................................................................................64
Logging....................................................................................................................................65
Cleaning Up ..............................................................................................................................65
Throwing Exceptions .....................................................................................................................67
Throwing Mechanics .................................................................................................................67
When To Throw Exceptions .......................................................................................................68
Creating Custom Exceptions ..........................................................................................................69
In This Chapter.............................................................................................................................72
Back to Basics: Proxy This and Proxy That...........................................................................................73
Proxy Domain Pattern ...................................................................................................................74
Interception.................................................................................................................................75
In This Chapter.............................................................................................................................77
Wrapping It Up ................................................................................................................................78

The book cover has the www.codebetter.com URL, the community blogs whose owners originally started ht ALT.NET movement (I wrote about it very early back). I suspected it even before reading the table of contents!

Oh my. This is the book I always wanted to either read or write. Now I only have one option!!!


Cross posted from weblogs.asp.net/meligy


posted @ Saturday, July 05, 2008 6:04 AM | Feedback (0) | Filed Under [ ALT.NET ]

Monday, June 30, 2008

dotNETwork 5th Gathering – Really enjoyed that Silverlight & SOA Anti Patterns Mix (Part I / II)

This Sunday, I went to dotNETwork 5th gathering to see how interesting it would be to have some Silverlight fun followed by SOA and Patterns and Anti-Patterns goodness. It was a really fun day, and here comes its writing as I saw it.

Starting Out (No tech – you can skip)

The day started by meeting Mohamed Samy (the SOA guy, and my friend!) at 10 AM, getting some sandwiches (and coffee for me as I didn’t have sleep the night before), then, going to the buses place in El-Sekka club (as neither of us figured out how to go to the Canadian University). We tried to follow the first bus by his car (so that I could hopefully get a front row seat as for my eye sight issues), but we moved too late, got stuck at some traffic signal, and we simply lost the bus after we were already far from the original bus stop.

We tried to continue the way on our own using guidance from dotNETwork guys on the phone and trying to track the university signals. That was around 11 AM. Long story short, we arrived at the university around 12:45 PM, after going to so many places that look very different from each other, and false tries to meet with other guys from dotNETwork in any known place in this area (if “known place” can ever exist in it).

Thankfully, that was the only inconvenience of the day, yet, the only adventure as well.

Silverlight 2.0 – Yasser Makram

Yasser is really deeply technical guy, especially when it comes to Silverlight. He works for a company that does Arabization for Silverlight, so, you can imagine how deep he needs to be to get into that.

Clearly I reached his session 15 minutes late at least (given the session started later than it should). I found him discussing Silverlight competition with Flash, mentioning earlier acquisition Microsoft has made that did not help the competition, and why he thinks Silverlight will make it. He said there're other things

The reasons he believes Silverlight is going make it is that Microsoft is playing well on many roads. For developer reach, it’s very clear having thousands of threads in Silverlight forums while still in BETA. For partners and component developers, there're many controls, some are free, like Devexpress AgDataGrid, a very advanced grid control. In terms of showcase applications, there're cool goodies like  Popfly and Silverlight Streaming service (which hosts any Silverlight application not just streaming media with up to 10 GB and streaming is free up to 5 TB of aggregated bandwidth). For public websites (which Microsoft relays on to spread installation of Silverlight). there`re many, like the upcoming Olympics in August 2008. I asked Yasser though whether there`re even rough numbers of how much of a percentage Microsoft expects for Silverlight market share, but he said there’s none.

XAML

Afterwards, Yasser moved from his exploratory Silverlight and PowerPoint slides to the XAML of a basic Silverlight demo, which remained until the end of the session. He briefly introduced XAML, and how every XAML tag is used to instantiate an object of a corresponding class. Also syntax for mapping CLR namespaces and assemblies to XAML namespaces for use with custom namespaces, and said some of them are in AssemblyInfo.

Then he talked about object properties. Those are expressed in XAML as attributes or sub elements for properties of complex (or custom) types. The element name is in format “ComplexTypeClassName.PropertyName”. Silverlight uses “Type Converters” to map the XAML element names (which are strings) to types of objects to instantiate them.

He also showed how VS has the ability to generate event handler method stubs for the events when you type the event name in XAML markup. Small thing we web developers miss with ASP.NET markup :D.

Controls: Data Binding & Layout

The next point was Markup Extensions, which syntax-wise are just other attributes that start with curly brackets “{}”, usage-wise similar to both “$” and “#” i build extensions and data binding in ASP.NET. They are used in builtin implementation for getting data from static resources, but you can use them for any data manipulation, even better (more extensible as per Yasser( than type converters. Talking about data binding, he stated how Silverlight 1.0 didn’t have any input controls or data binding. Silverlight 2.0 has bunch of those.

Silverlight in general has two types of controls, ‘simple control” and “content control”. Actually, most of built in Silverlight controls are content controls. A content control is a template based control, so, you can embed any other control in it even when you think you normally can just add plain text or nothing at all. an example is a tool-tip or a button, in Silverlight, you can for example put an entire grid inside the tool-tip!!

Data binding also works in fashionable way. You basically map the namespaces you need, create a “resource” (which is something like data source in ASP.NET as per my understanding), give it a key, and use that with the control you want to bind to. The last step is to fill the source with any enumerable (list of values). I asked Yasser how the data binding work, whether you have to call “DataBind” manually as in ASP.NET or it works automatically and bi-directionally as in win-forms, which Yasser said it does. Talking about data binding made him mention Devexpress grid as well which has more features than the basic built-in one like built-in sorting, paging, and inline-editing.

The next topic was Silverlight “Layout”. This is determined via a layout manager which as I understand defines how controls are sized (called “Measure”) and located/aligned together(called “arrange”). Three main layouts in Silverlight are the Canvas (sounded like absolute layout to me) the Grid layout (just a table layout), and the Stack Panel (where elements are stacked next to each other). He explained that you can always create your own layout manager by implementing “measure” and “arrange”.

Programmability

Silverlight has support for LINQ-To-Objects. Yasser presented how to use it to apply certain change to all controls of certain type contained in another parent control. I asked him about other 2 LINQ providers, he said LINQ-To-SQL is not supported, but LINQ-To-XML is. I asked him about creating customer providers, he said it is supported given the created provider is built to target CoreCLR (Silverlight CLR) of course.

Yasser also mentioned Isolated Storage (like temporary folder for caching or whatever), which he said we should only use as advanced alternative to cookies. For example in last MIX conference, there was a demo of an email application that used Isolated Storage for keeping a local cache of the email inbox. Note that the quota (max size) for the Silverlight application storage is 1 MB. The user can configure the quota size still of course.

Design

Of course talking about Silverlight wouldn’t be complete without mentioning developer/designer separation having developer using VS and designer using Expression Blend. He mentioned two design terms, styles, which are like property setters that are saved in application level file (while the developer works on the content file), and control templates, that have template contracts (the parts to inject controls in the template), states (like enable, disable, hover, …). He used Blend (in the designer, with no manual markup) to show how you can change completely what a control looks like or hat nested controls it contains.

Next topic was Animations. He said they can be specified in code (called “procedural”). It can be also defined in markup, he showed how those can be created in Blend with the story board designer (similar to time line in Flash I guess). Then mentioed a not about Flash procedural animation libraries being ported from Flash to Silverlight.

He also mentioned DeepZoom. This enables you to make as big picture as you want (he mentioned an example of 6 million pixels), and not download them at once, but zoom and download zoomed part only as needed.

Arabic Support

Silverlight has no support for Arabic right now. This is funny thinking that Silverlight has general good localization support. Yasser showed how you can put Silverlight in a page by JavaScript or an EMBED html tag, and how to pass “culture to it”. It recognizes Arabic and shows the Arabic characters but in reverse order and separated from each others.and from right to left just as if they were English (Yasser showed that via applying the culture on an application with a Calendar control – he mentioned it’s not extensible BTW).

Santeon, the company Yasser works for, has provided free Arabic support for Silverlight.Yasser explained why Arabic is hard to get. You could just reverse the order of all characters but how about numbers and mixed English and Arabic content ? There’s also the issue that the character looks different based on its place in the word, and in some fonts based on what character comes after it. Also word wrapping. Someone hold a side discussion why Microsoft although is known excellence in this in Windows didn’t just use that, and Yasser said any application that supports Arabic well is mainly using system service built into the operating system itself, while Silverlight implementation tries to be not use an OS specific services.

The Arabic support for Silverlight from Santeon is done by creating alternative controls to the ones built into Silverlight. A way I personally don’t like but understand it might be the only way to go. They give out their Arabic support at: http://silverlight.santeon.com.

Conclusion

Yasser is a very knowledgeable guy. He knows much about Silverlight coding and it makes sense as per his work in its Arabization. I think he could make the session last longer though and had much more to tell than he did :). Most of the guys felt he could have improved the way he gave the sessio, but in general it was a good session with a certain depth that I was not expecting to reach in a Silverlight session.

P.S.

I had a discussion with Yasser about Silverlight and DLR (Dynamic Language Runtime), and why there’s a CodePlex project called DynamicSilverlight if it’s included in Silverlight already. He said he didn’t know. We did not agree on him to send me further information or such, but he later found my blog and usedmy contact page to send me the following:

Hi Mohamed,
I have checked the Dynamic Languages SDK project on CodeProject, and I found out that this projects is used to host the following:
IronRuby Silverlight libraries
IronPython SIlverlight libraries
Chiron tool, which is a commandline tool used to package Dynamic Languages applications in XAP files (ZIP file with a manifest which is used to redistribute Silverlight 2 applications)
Source code for IronRuby, IronPython for Silverlight
Dynamic Languages Samples
The tools (Chiron), and the libraries are included in the distribution of Silverlight SDK (by default located at C:\program files\Microsoft SDKs\Silverlight). So there is no need for confusion, the CodePlex project is not a separate project, as the libraries coming with Silverlight SDK is actually compiled from this CodePlex project.

He sent me his contact info, but I’m not putting them here without asking him of course! Thank you, Yasser.

He also sent me the following information about himself when he knew I was going to blog the event. It’s very interesting info, so, I’m sharing it here:

Hi Mohamed,
I have seen your blog and noticed that you will be blogging about yesterday's session, and also noticed that in a previous post that you don't know about me. So I though to briefly introduce myself to you, and specifically regarding Silverlight. I have been active in the Silverlight community since the beginning. I have been camping daily on the Silverlight official forums, reading threads and answering questions till I became the first to post over 1000 posts and have been ranked as the top contributor. In the last few months I have not been as active, but I still ranked as one of the top 5 contributors in SIlverlight community hall of fame
http://silverlight.net/community/recognition/hall-of-fame/ . I have worked on some Silverlight projects, including http://www.ddjsilverlight.com and http://www.nba.com . I am very glad to see bright developers like you in Egypt, after reading through your blog. Good luck and wishing you more success in the future.

Heading to SOA Patterns, OOPS, AntiPatterns (Coming in Part II)

The next session was very enjoying one as well as informative. I have had the honor to see Mohamed Samy putting the following touches on it before it happens, but seeing it in action was completely different. In order to not make you all wait until I finish that other long part, I’m publishing this part right now and will be sending about all the fun great SOA story in a separate part/post. I hope it’ll be as fun and informative to you as the session was to me.

Sorry for taking long to write. I’m already overwhelmed with investigating some other SOA related stuff :D :D :D, and some other less fancy stuff of course.

Stay Tuned !!


Cross posted from weblogs.asp.net/meligy


posted @ Monday, June 30, 2008 5:55 PM | Feedback (0) | Filed Under [ Local Events ]

Sunday, June 29, 2008

Blogging dotNETwork 5th Gathering Today, Silverlight and SOA

Hey all, I’m still blogging about my very interesting trip to dotNETwork 5th gathering, what Yasser said about Silverlight 2.0 and Mohamed Samy said about SOA Anti-Patterns.

This will be coming late tonight (God Willing).

I just had a sudden graduation project documentation help request to have to in its writing to start final printing. But I still have my OneNote pages and those are still going to be converted to blog post(s).

I write this to confirm the writing though latency. This post is likely to be updated or deleted when I post my take on the day.

Stay tuned1!!


Cross posted from weblogs.asp.net/meligy


posted @ Sunday, June 29, 2008 9:10 AM | Feedback (0) | Filed Under [ Local Events ]

Friday, June 27, 2008

Mobinil Paid WiFi for Cafes in Egypt – I want my FREE WiFi back, without bugging

Mobinil, one of the 3 mobile phone networks in Egypt, owned by the same owner of Link dot NET, one of the leading ISPs in Egypt as well have come with a WiFi service for cafes, just like other ISPs provide.

When I’m in a cafe, I just use the Internet connection that the cafe provides via their ISP WiFi, and that’s it. I do NOT have to pay extra money for the Internet service. I do NOT have to register my Email and mobile phone number anywhere. I do NOT have to buy scratchy charge/balance cards like those for mobile phone credit. This is how it has been for years.

Mobinil screwed that all.

To get to the Internet in cafe, you have to do this the first time you connect:

  • Register your Email and mobile phone number
    • Refresh the page (clearly hosted by Link dot NET) if you get this exception
      mobinil2
      I’ll not get into the details of how horrible  is getting much detail of an exception. It’s not the first time.
  • Wait for the activation code to come (As SMS to your mobile phone, because you have no email, as you have no Internet yet)
    • MY friend did not get his activation code, in this case you call the customer service land line number to get the code.
  • Activate the service using the code, and then sign in to the service page (although you have just activated your account, they don’t know who you are).
  • Use a promotional free 2-hours card to access the Internet (clearly for only 2 hours).

Every time you want to connect to the Internet from a cafe, you have to:

  • Buy a card similar to the ugly scratchy cards you buy for you mobile phone credit
    • The packages available are:
      • 2 hours for 10 EGP
      • 10 hours for 50 EGP
      • 130 hours for 150 EGP
  • Sign in to the service
  • Enter not only the PIN code hidden under the scratch here part, but also a card serial number that’s even very hard to see.
    • I could not see the serial number for how small it is. My friend read it for me.
    • Here’s how the card looks like. The blue rectangle is the PIN code and the green rectangle is the serial number.
      cardBack - Copy
  • Use the Internet finally with the amount of hours you paid for. In my experience, the speed looked like 256Kb or 384Kb max, but maybe this is different from cafe to another or whatever.

For everybody who reads this, is this normal ? Is it a very popular style in so many countries ? I used to go to a respectable cafe paying certain amount of money for my coffee to get extra customer services. Not only that they get me AC and will not kick me out as soon as I finish the coffee, but also that I can get my FREE Internet.

Clearly Mobinil is able to replace other ISPs for cafe Internet, and has already acquired the big name cafes that I know. This is too bad.

 

I want my FREE cafe Internet back!! It has been there for years, and there’s no reason I have to let it go now.

 

Hopefully the other Internet providers will recover this somehow, otherwise, there should be sort of strong petition or stopping going to cafes with this service or such.

 


Cross posted from weblogs.asp.net/meligy


posted @ Friday, June 27, 2008 5:42 PM | Feedback (0) | Filed Under [ Personal ]

Wednesday, June 25, 2008

Egyptian Developers Conference 2008 Videos Available

Emad Lotfy, a software engineer in test and fellow developer in my company, discovered yesterday that the EDC 2008 videos are now available on the EDC 2008 official website.

See the videos NOW.

 

Recommendations

If I happen to choose only one session of those I attended then it’ll be Andrew Pardoe’s CoreCLR session (part 1 end of this file, and part 2 beginning of this file).

Other than that,, there’s Also Ahmed Bahaa’s VSTS 2008 and beyond session (this file), Ahmed Farrag’s SAAS session (this file).

Those are the best of what sessions I attended though . I’ve gone through the videos quick and clearly the other Silverlight videos are good too.

Notes

The videos are released for the 2nd time in developer conferences arranged by Microsoft Egypt. The first time there were problems that made the videos unusable and actually made some of them unavailable at all!

This time, Microsoft Egypt, congratulations. You have done a very good job. My friend could download the complete videos and I can see almost all the videos I was looking for. GREAT!

However, there’re still some issues that I tell here for people to avoid:

  • The video files are not related to specific sessions. They’re just related to conference rooms and then conference days then just numbers. You’ll also find some sessions split into tow videos.  you need to watch for this (I don’t know how – in my case, my friend just downloaded al the videos for us).
  • When you go to a link of a conference room and you want to go to another room, SOMETIMES this will not work. Click the address bar of your browser and press ENTER again to re-navigate to the page (do not try to Refresh (F5)). I think there’s some problem with the conference rooms links being LinkButtons and tryign to AJAify them or.. I don’t know
  • Ahmed Nagy’s Session about VSTO has no links (Should be Khafraa A Room: Day 02: CD 02, because I see myself in beginning of CD 03 asking Ahmed Nagy about his session after it’s complete :D). I would recommend it if it was there. Not sure what other sessions I didn’t notice are not there.

Cross posted from weblogs.asp.net/meligy


posted @ Wednesday, June 25, 2008 4:37 AM | Feedback (0) | Filed Under [ Local Events ]

Thursday, June 19, 2008

dotNETwork 5th Gathering – Silverlight and what ? SOA Patterns, Yay!!

n587461065_1343848_971The 5th dotNETwork gathering will be: Saturday, June 28, 2008.

The agenda is as follows:

12:00 AM - 01:30: Delivering Rich User Experience Applications using Silverlight 2 by Yasser Makram

01:30 PM – 2:00 PM: Coffee Break

02:00 PM – 3:30 PM: Patterns and antipatterns of SOA by Mohamed Samy

03:30 PM – 4:00 PM: Lunch

It’ll be in: Canadian International College - Busses will be available at: Nady El-Sekka (11:00 AM - 11:30 AM).

The gathering being on Sunday not Saturday as usual makes it harder to attend it The gathering facebook event said by mistake it’ll be on Sunday, but it’ll be on Saturday normally like all other dotNETwork events.

Regarding the sessions

I do not know about Yasser, but Silverlight 2.0 is a fairly new topic and it’ll sure be interesting to come and see it. I think Yasser will bring us a lot of amazement!

For the SOA topic, I want you all to set high expectations starting now. Mohamed Samy is a Solution Architecture (VSTS) MVP who has worked in and talked about SOA patterns more than most people I have met in person as both a personal passion and a job responsibility as a Technical Architect in ITWorx. I know Mohamed in person and believe he’ll be delivering a rocking session. Do not miss that.

Related Resources

 


Cross posted from weblogs.asp.net/meligy


posted @ Thursday, June 19, 2008 2:13 PM | Feedback (0) | Filed Under [ Local Events ]

Tuesday, June 17, 2008

Link List 20080617

· Everything You Wanted To Know About MVC and MVP But Were Afraid To Ask

· Functional Programming in C# 3.0: How Map/Reduce/Filter can Rock your World

· MbUnit 2.4 - Avoiding Crappy Data Resulted From The Test

· Managed Extensibility Framework

· IronRuby at Tech Ed 2008

· Velocity: A Distributed In-Memory Cache from Microsoft

· Must See WF/WCF Influencer MSDN Webcasts

· WCF Webcast Series (Old but good)

· Using CSS to Fix Anything: 20+ Common Bugs and Fixes (Found by Mohamed Tayseer)

· A jQuery Client Status Bar

· jQuery for Asp.net MVC preview 3

· Hands on Labs for Web Client and Smart Client (Web Client Software Factory, Smart Client Software Factory)

· Code Style Review Using Microsoft Source Analysis

· Did you know… You can use Tracepoints to log “printf” or “console.writeline” info without editing your code? - #237

· SOA: Making The Paradigm Shift Part 9 of N

· Functional C# - Learn from F# and LINQ


Cross posted from weblogs.asp.net/meligy


posted @ Tuesday, June 17, 2008 6:21 PM | Feedback (0) | Filed Under [ C# ]

Monday, June 02, 2008

Prevent ASP.NET Validators from Massively Increasing Page Size

This is problematic with ASP.NET AJAX. The main Script Components are NOT sent to the client when in :Legacy” mode. This is “By design” in ASP.NET AJAX, although it is a clear limitation!!

I’m investigating the problem for other solutions and will be sending an update soon.

Thank you, Iman Halawany, for making me note this. I’ve been working on WCF services and ASP.NET MVC stuff lately than normal webforms, so, didn’t realize this obvious showstopper.

To all my readers, I owe you a BIG apology.

The Problem

ASP.NET validators and ValidationSummary controls are rendered as SPAN tags that are shown and hidden based on validation state. The properties of the validators are written normally via JavaScript calls similar to these:

<script type="text/javascript">

//<![CDATA[

var Page_ValidationSummaries =  new Array(document.getElementById("vdsSiteLogin"));

var Page_Validators =  new Array(document.getElementById("rfvEmail"), document.getElementById("revEmail"), document.getElementById("rfvName"));

//]]>

</script>

 

<script type="text/javascript">

//<![CDATA[

var rfvEmail = document.all ? document.all["rfvEmail"] : document.getElementById("rfvEmail");

rfvEmail.controltovalidate = "txtEmail";

rfvEmail.errormessage = "Email Missing";

rfvEmail.validationGroup = "SiteLogin";

rfvEmail.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";

rfvEmail.initialvalue = "";

var revEmail = document.all ? document.all["revEmail"] : document.getElementById("revEmail");

revEmail.controltovalidate = "txtEmail";

revEmail.errormessage = "Email is invalid";

revEmail.validationGroup = "SiteLogin";

revEmail.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";

revEmail.validationexpression = "\\w+([-+.\']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";

var rfvName = document.all ? document.all["rfvName"] : document.getElementById("rfvName");

rfvName.controltovalidate = "txtEmail";

rfvName.errormessage = "Password is missing";

rfvName.validationGroup = "SiteLogin";

rfvName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";

rfvName.initialvalue = "";

var vdsSiteLogin = document.all ? document.all["vdsSiteLogin"] : document.getElementById("vdsSiteLogin");

vdsSiteLogin.validationGroup = "SiteLogin";

//]]>

 

</script>

 

Note that this is for ONLY 3 validators, 1 validation summary and in directly a page that doesn't use a master page, not in nested user control or such!

How about a page with over 30+ validators (yeah, those forms!!), and each with ClientID like "ctl00_cphBody_ct00_fvUserLogin_rfvEmail_" and such?

If you have ever wondered why those pages take so much time loading, this code block (multiplied per number of validators you have and their properties set) is one reason.

You cannot even take the JavaScipt in separate file that can be cached, because this is dynamically created as per the visible validation controls.

The Solution (See Above Note)

The clear alternative to setting those properties via JavaScript long block with huge ClientIDs is to put the properties in the SPAN tags of the validation controls themselves.

The reason that AS.NET does not do this by default is that this is not XHTML 1.0 Transitional compliant, because the validator properties are not XHTML attributes of the SPAN tag.

ASP.NET tries to render XHTML 1.0 Transitional markup by default. But you can change that in your web.config file by adding one line under <system.web>:

<system.web>

        <xhtmlConformance mode="Legacy"/>

 

This will make the properties render in the SPAN tags themselves, saving so much code in real life scenarios.

Personally I'd recommend: DO THIS IN EVERY WEBSITE YOU HAVE (See above note)

 

Thanks to Paulo Morgado for mentioning this.


Cross posted from weblogs.asp.net/meligy


posted @ Monday, June 02, 2008 1:09 PM | Feedback (0) |

Saturday, May 31, 2008

ASP.NET Validators Client Side APIs: MSDN List Page

If you have ever thought that the famous if(Page_ClientValidate("validationGroup")) {/*JS Code*/}  and myValidator.ValidationGroup = "validationGroup"; are sure not enough client side capabilities in ASP.NET validators, you are right.

The list of client side API for ASP.NET Validators can be found on this MSDN page "ASP.NET Validation in Depth":

http://msdn.microsoft.com/en-us/library/aa479045.aspx#aspplusvalid_properties

Look for subtitle: "Client-Side APIs".

 

Thanks Simone Chiaretta for mentioning the topic, Mohamed Tayseer for sharing the topic on facebook, and Richard Cook for his comment on the post making me search for the complete list.


Cross posted from weblogs.asp.net/meligy


posted @ Saturday, May 31, 2008 5:58 PM | Feedback (0) |

Wednesday, May 28, 2008

[Non-Tech] Quotes

This is collected from some quotes sent in dotNETreporter.com's "Weekly Top Posts" newsletter messages in the past months, in no particular order:

  • "Solitude is painful when one is young, but delightful when one is more mature." (Albert Einstein)
  • "I can teach anybody how to get what they want out of life. The problem is that I can't find anybody who can tell me what they want." (Mark Twain)
  • "The person who goes farthest is generally the one who is willing to do and dare. The sure-thing boat never gets far from shore. (Dale Carnegie)
  • "The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance." (Confucious)
  • "The father who does not teach his son his duties is equally guilty with the son who neglects them." (Confucious)
  • "The royal road to a man's heart is to talk to him about the things he treasures most." (Dale Carnegie)
  • "Problems cannot be solved at the same level of awareness that created them." (Albert Einstein)
  • "History is strewn thick with evidence that a truth is not hard to kill, but a lie, well told, is immortal." (Mark Twain)
  • "Tell the audience what you're going to say, say it; then tell them what you've said." (Dale Carnegie)
  • "Study the past if you would divine the future." (Confucious)
  • "All you need in this life is ignorance and confidence, and then Success is sure." (Mark Twain)
  • "Politics is far more complicated than physics." (Albert Einstein)
  • "Everybody talks about the weather, but nobody does anything about it." (Mark Twain)
  • "Remember, today is the tomorrow you worried about yesterday." (Dale Carnegie)
  • "Our greatest glory is not in never falling, but in rising every time we fall."  (Confucious)
  • "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." (Albert Einstein)
  • "Remember, happiness doesn't depend upon who you are or what you have, it depends solely upon what you think." (Dale Carnegie)
  • "Only the wisest and the stupidest of men never change." (Confucious)
  • "It is a miracle that curiosity survives formal education." (Albert Einstein)
  • "If we knew what we were doing it wouldn't be research." (Albert Einstein)
  • "Education is the progressive realization of our ignorance." (Albert Einstein)
  • Accident is the name of the greatest of all inventors. (Mark Twain)
  • "Many of the things you can count, don't count. Many of the things you can't count, really count." (Albert Einstein)
  • "Courage is resistance to fear, mastery of fear -- not absence of fear." (Mark Twain)
  • "People rarely succeed unless they have fun in what they are doing." (Dale Carnegie)
  • "Always do right. This will gratify some people and astonish the rest." (Mark Twain
  • "You can make more friends in two months by becoming interested in other people than you can in two years by trying to get other people interested in you." (Dale Carnegie)
  • "Most of us have far more courage than we ever dreamed we possessed." (Dale Carnegie)
  • "I have found out that there ain't no surer way to find out whether you like people or hate them than to travel with them." (Mark Twain)
  • "Life is really simple, but men insist on making it complicated." (Confucious)
  • "Common sense is the collection of prejudices acquired by age eighteen." (Albert Einstein)
  • "Our fatigue is often caused not by work, but by worry, frustration and resentment." (Dale Carnegie)
  • "In the middle of difficulty lies opportunity." (Albert Einstein)
  • "Most of the important things in the world have been accomplished by people who have kept on trying when there seemed to be no help at all." (Dale Carnegie)
  • "To know what is right and not do it is the worst cowardice." (Confucious)
  • "He who conquers himself is the mightiest warrior." (Confucious)
  • "A man who has committed a mistake and doesn't correct it is committing another mistake." (Confucious)
  • "It's not the size of the dog in the fight, it's the size of the fight in the dog." (Mark Twain)
  • "If you want to be enthusiastic, act enthusiastic." (Dale Carnegie)
  • "A habit cannot be tossed out the window; it must be coaxed down the stairs a step at a time." (Mark Twain)
  • "The true sign of intelligence is not knowledge but imagination." (Albert Einstein)
  • "There is only one way... to get anybody to do anything. And that is by making the other person want to do it." (Dale Carnegie)
  • "To see and listen to the wicked is already the beginning of wickedness." (Confucious)
  • "It is easier to stay out than get out." (Mark Twain)
  • "You can conquer almost any fear if you will only make up your mind to do so. For remember, fear doesn't exist anywhere except in the mind." (Dale Carnegie)
  • "The secret to creativity is knowing how to hide your sources." (Albert Einstein)
  • "The only source of knowledge is experience." (Albert Einstein)
  • "It is better to deserve honors and not have them than to have them and not deserve them." (Mark Twain)
  • "If you have nothing to say, say nothing." (Mark Twain)

 

Note to not waste your time: The website no longer has new content.


Cross posted from weblogs.asp.net/meligy


posted @ Wednesday, May 28, 2008 9:21 PM | Feedback (0) | Filed Under [ Personal ]

Microsoft ASP.NET MVC Preview 3 Announced

Resources:


Cross posted from weblogs.asp.net/meligy


posted @ Wednesday, May 28, 2008 11:00 AM | Feedback (0) |

Friday, May 23, 2008

Resharper 4 BETA Released

Avoid Much Talk

I wrote about Resharper 4 performance improvements in an earlier blog post today showing my VS Color Scheme including use of R# nightly builds. My friend Mohamed Tayseer pointed me out that Resharper 4 BETA was released yesterday. If you already know Resharper, skip the blah blah blah talk and get to the download.

Resharper, AKA R#, Who ???

Resharper used to be a must-have add-in for Visual Studio. It completes the features existing in Visual Studio like intellisense (not just smarter intellisense, but also available everywhere, like those areas in ASP.NET markup when you start typing non-standard code to Visual Studio to hook some properties and you get lost alone usually).

Of course it makes the expected enhancements to standard VS editor like parentheses and semicolon completion and other similar features, although it takes you w while to get used to stopping writing those after R# writes them for you!

It also has interesting stuff like SPEED find options (instead of this "Compiling the Solution" messages whenever you want to "Find Reference") also extended for things like 2-way jump between the base classes / interfaces and their children classes/methods. ad also tons of "Guideline promoting" features like intellisense for  VARIABLE names (like when you type "MailMessage" for local variable type, it recommends names like "mailMessage", "message", etc...), and options to detect unused variables and "using" namespace directives, and many other features.

It also offers very handy icons that do interesting stuff like inverting "if" statements and reversing assignments (very handy in ASP.NET donkey code behind files, in an edit page, call on page load a method with all txtProductName.Text = currentProduct.ProductName;, copy that to the method that's called from the "Save" button click, select it and click "Reverse Assignment"), and many great other features appearing as very small icons to the left of the code to not interrupt your work.

It's also smart. It can realize that Console.WriteLine("{0}, {1}", object0); will fail because the string format method is a "string formatter method" and it expects two objects while I passed only one! It has tons of interesting warnings and recommendations like this. Leave apart small features like quick use of "var" instead of type and suggesting a