Dotmad.netDotmad.netMy thoughts on software developement using .Net. Articles
Is Hebrew blogging the new Zionism?
2008-02-17 07:20:00 Guy started the debate by calling Israely bloggers (and the blogs.microsoft.co.il platform) to write in Hebrew to encourage the creation of professional resources addressing the Hebrew reading crowd.I disagreed by stating the fact I like to share my knowledge with the entire world rather than just sharing it with Hebrew readers and Omer agrees with me.Tamir contributed to the discussion in his own unique way, demonstrating the frustration a non-English post can cause to English readers (and assuming I understood the translation he is basically saying "write in whatever language you feel comfortable with")I would like to address Guy's second claim, saying the blogs.microsoft.co.il site should be used to encourage Hebrew blogging (and that English bloggers have alternatives such as Blogger and Wordpress).Blogger and Wordpress are excellent platforms, but if I want a blogging site focused on IT blogs, they are wrong for me.The unique thing about the blogs.microsoft.co.il site is that ... More About: Blogging , Zionism
Design patterns: I wouldn't bother reading the GOF book
2008-02-16 11:17:00 I have to disagree with Gil's (welcome to the blogosphere) recommendation regarding the classic DP book:I found it very hard to read, focusing on theory (as opposed to practice), and laking use of .Net framework features (since it was not written for .Net users).If you are a .Net programmer and want to learn and use design patterns, I recommend going to dofactory.com - clear, real-world examples meant for C# developers. More About: Design , Reading , Book , Patterns , Design Patterns
Don't try this at work
2008-02-15 09:53:00 A friend sent me the following code, meant to do simple string comparison for a standard password changing dialog: char buf[256] test_pass = 0; for (i = 0; i < strlen(buf); ++i) { test_pass ^= (unsigned long)buf[i] << (i%4)*8; test_pass = test_pass << (i%4)*8 test_pass >> (32 - (i%4)*8); } sscanf(g_config.m_pPassword, "%08X", &old_pass); if (test_pass == old_pass) { // Get new password GetDlgItemText(IDC_EDIT_NEW_PASS, buf, 255); test_pass = 0; for (i = 0; i < strlen(buf); ++i) { test_pass ^= (unsigned long)buf[i] << (i%4)*8; test_pass = test_pass << (i%4)*8 test_pass >> (32 - (i%4)*8); } // Check configmation GetDlgItemText(IDC_EDIT_NEW_PASS2, buf, 255); ... More About: Work
Upgrading technologies in an existing project
2008-02-14 06:43:00 We all know about the "cool new kids in town", meaning new technologies all developers want to use. Offer a developer two positions:Programming with C# 1.1Programming with WPF and C# 3.5What do you think most developers will choose?However, there is the question of an existing project, written in an "uncool" technology.In my experience developers tend to push towards using newer technologies, but how do you convince the people in charge?Here are my thoughts on the subject:Framework 2.0 vs. 1.1Advantages: Performance boost if you are using ArrayLists with value types in them (when you switch to generic Lists)Disadvantages: Incompatibility issues requiring code changes (should be very minor)Framework 3.5 vs. 2.0Advantages: Using Linq for new complex data access and query modules, otherwise I'm unsureDisadvantages: Same as switching between 1.1 and 2.0WCF vs. Various communication technologiesAdvantages: Much easier to configure and deploy, can drastically change the communication met... More About: Project , Technologies
WCF Everywhere? Worth some consideration
2007-12-30 19:31:00 Sadly I missed Juval Lowy's WCF lecture last Thursday, but I read Udi Dahan's blog post regarding the lecture.It seems Juval is preaching the use of WCF for every inter-class operation, even on the same computer, as WCF is better designed than plain code, and Udi objects to the idea due to possible performance consequences.One of the main reasons for Udi's objection was a demo Juval ran in which the communication output was 200 calls per second - not very high.But as someone else already commented, this was done using security, encryption, exception handling and other "services" which are not necessarily present in day-to-day inner-process method calls.This also lead me to search for again benchmarks for WCF, and it turns out you can reach more than 5000 calls per second with it.So use WCF for every inter-class operation? I think not, since it basically break your entire code to services, and SOA requires careful planning.On the other hand, I would use WCF for every cross-process... More About: Worth
Facebook usage
2007-12-05 07:03:00 I took a look at the Facebook countries stats, and it got me curious about possible correlation between Internet users and Facebook users, so I collected Internet users stats and came up with this (absolute numbers are in Thousands): More About: Usage
Light reading at the traffic light
2007-11-30 06:59:00 In case you were wondering, the book in the picture is the bible. More About: Reading , Traffic , Light
Five steps for creating a transparent user control
2007-11-29 12:30:00 Guest post from Eyal Ron: After much testing this is the correct formula for a truly transparent user control: Derive from Panel rather then User Control . Override the OnPaintBackground function: protected override void OnPaintBackground(PaintEventArgs pevent) { //do nothing } Override the OnMove function: protected override void OnMove(EventArgs e) { More About: Creating , Transparent , Steps
Special consideration for the ThreadAbort exception
2007-11-22 07:07:00 As a rule, I never want to see an unhandled exception crashing my application with the .Net error dialog and without logging the error. Therefor I always hook both the AppDomain.UnhandledException and the Application.ThreadException events to catch those exceptions, log them, and close the application gracefully.Turns out I overlooked one small detail - the ThreadAbort exception, raised by a call More About: Special , Consider
Acer's localized international warranty
2007-11-22 06:46:00 I have been looking to buy a notebook computer for some time now. Someone told me about a friend of his who bought a new Acer notebook during a trip to the U.S. as a temporary replacement for his malfunctioning computer, and now he wants to sell this new notebook computer (as his old computer was fixed). It seems he got it in the U.S. with an international warranty. So I called Acer's locale More About: International , Warranty , Loca
Validation of a NumericUpDown control
2007-11-18 14:59:00 The NumericUpDown control has a built-in validation: Values smaller than the minimum are replaced by the minimumValues larger than the maximum are replaced by the maximumThis may lead to a situation in which the user entered an invalid value and pressed the form's "OK" button, leading to saving of a value completely different than the one entered with no notification. To prevent this, enter your More About: Validation , Control , Dati , Vali
From the people who brought you "Catastrophic Error"
2007-11-18 10:33:00 Now comes another great error dialog: "The Operation completed successfully" error dialog. More About: People , Error , The People
Create the ultimate business card
2007-11-17 20:03:00 During the David Platt's lecture I received a business card from him. The card's title is "Rolling Thunder computing" (his company), and his title is: "Supreme and Exalted, Dictator-for-life" I think that's the best job title I have ever seen on a business card, and even better - it makes people pause and remember him because it's unusual. Do you have special titles on your business cards? More About: Business , Card , Business Card , Ultimate , Create
David Platt on Why Software Sucks
2007-11-14 21:28:00 I went to a lecture by David Platt on the subject of "Why software sucks", which discusses what is wrong with software today (hint: it's mostly designed by programmers) and how we can improve it. From listening to a previous ARcast with him I already knew he is a very entertaining speaker, and he proved me right (in fact, I kept thinking I could bring my wife to one of his lectures and she would More About: Software , Sucks , David Platt
Three wrong assumptions
2007-11-11 19:52:00 Did some blog reading today, and found out several assumptions I had which were wrong: Assumption: "Protected Internal" means both protected and internal Wrong : It means Protected OR Internal. Assumption: 32bit Windows is limited to 2/4gb ram Wrong: It's limited to 2gb of ram per application. Assumption: OpenFileDialog is harmless Wrong: It loads a mini-explorer, including all the extensions you More About: Assumptions
Buy a shirt with this blog's tagline
2007-11-11 07:09:00 Just did some searching and found this site, which sells T-shirts with the tagline: "Programming is an art form that fights back" (which I "stole" from Chad Z. Hower, aka Kudzu) More About: Shirt
Microsoft Windows Live press conference
2007-11-08 20:20:00 I was lucky to be invited to the official press conference of announcement of the new Live service from Microsoft . It looks very promising, and would give Google (and Picasa) a tough competition. Here are some interesting points from the presentation: Microsoft global market status: According to the speaker there are 280 million MS Messenger users worldwide, and the number of Hotmail users is More About: Windows , Windows Live , Press , Press Conference
Heroes in Microsoft?
2007-11-03 22:18:00 I was just erasing promotion mail from my mailbox when I noticed the photo: I'm not 100% sure, but this looks a lot like James Kyson Lee ("Ando") from "Heroes ". More About: Microsoft
Drawing rounded rectangles
2007-10-31 22:19:00 I needed rounded-corners panels for the application I'm working on.Some search showed there is no built-in solution, and the way to go is using GDI+, and drawing the control's border manually, meaning you need to draw 4 arcs and 4 lines:GraphicsPath gp=new GraphicsPath(); gp.AddLine(X + radius, Y, X + width - (radius*2), Y); gp.AddArc(X + width - (radius*2), Y, radius*2, radius*2, 270, 90); More About: Drawing , Rounded , Angle , Rect
Setting image transparency
2007-10-26 20:36:00 There are many cases in which you need to embed an image in a winform control (such as a button), and usually you'll need the image to have a transparent background. Someone showed me recently an easy way to do this: 1) Set the area surrounding the image to a uniform color which is different from the image's colors. 2) Open Powerpoint, and add the picture to the presentation: 3) More About: Transparency , Image , Spar , Tran , Pare
Blondes have more WCF
2007-10-22 00:07:00 I went to a “Fundamentals of WCF Security” lecture by Michele Leroux Bustamante (dasBlonde) from IDesign, which came after a full day seminar given by her at Microsoft Israel. Michele is an IDesign Chief Architect, Microsoft Regional Director for San Diego, Microsoft MVP for Connected Systems and hold a long list of additional titles. She specializes in training, mentoring and high-end More About: Blondes
Reduce your workplace electric consumption
2007-10-17 17:37:00 Blog action day got me thinking about saving energy. I already wrote about how I try to reduce my effect on the environment at home, but what about work? Do you turn off the lights in your office when you leave? Do you turn off air condition? What about your computer?Each of these actions can save money over time, but more important - reduce the pollution caused by power plants.A study done in More About: Workplace , Reduce , Electric , Consumption
Deadlock from hell
2007-10-17 17:15:00 Thread 1: lock (a) { lock (b) { lock (c) { //some code } } } Thread 2: lock (d) { lock (c) { lock (b) { //some code } } } Main thread: lock (a) { //important code } More About: Hell , Deadlock
Every n matters
2007-10-13 22:58:00 When you study computer science and you start learning algorithms, you are introduces to the O(n) concept, meaning there is a different between an algorithm that takes linear time (1 second for 1000 items, 2 seconds for 2000 items and so on) and an algorithm that takes exponential (2 to the power of n) time, meaning it's a very inefficient algorithm. Although this lesson is important, there is a More About: Matters
Changing ComboBox height in Syncfusion control
2007-10-11 11:51:00 I am using a Comb oBoxAdv control from Syncfusion, and in version 3.2 I have noticed that the control doesn't allow you to change the height beyond a minimum value (depending on the font). There is a PreventHeightChan g e property, but it doesn't seem to work. The solution - override the DetermineHeightsBasedOnFont method with a blank method. More About: Changing , Control
Excel VLOOKUP function
2007-10-11 10:55:00 Syntax: VLOOKUP(A2, D$11:E:22, 2, False) Means: If the value of cell A2 matches a value in the supplied range (Cells D11 to E22), the function's result is the value of the second column from the range, from the row containing the matching value. This function and the matching HLookup function can be very handy. More About: Excel , Function
Tainted if you do, tainted if you don't
2007-10-07 01:10:00 Microsoft's latest move, to release the source code for the .Net framework, has triggered a variety of reactions due to the licencing model used in this release. Frans Bouma thinks that looking at the source code makes you liable to legal action: Take for example the new ReaderWriterLockSlim class introduced in .NET 3.5. It's in the System.Threading namespace which will be released in the pack
Now add some pepper to your password
2007-10-06 19:03:00 I previously wrote a post on password security based on Jeff Atwood's post explaining "Rainbow tables". As it turns out, Jeff received a feedback from cryptographer Thomas Ptacek pointing out some corrections to the strategy offered in the original post. The most important idea was using a cryptographically secure hash, meaning hash which expansive in processor time, unlike the common MD5. One More About: Password , Pepper , Some
Check your InitializeComponent method
2007-09-29 23:13:00 I previously wrote about a problem with a custom form's property.Since then I found problems with additional properties, including the form's default location.As it turns out the cause was a missing call to the InitializeComponent method in the initializer of a parent class. More About: Check , Method
Microsoft is making me jump through hoops to watch a webcast
More articles from this author:2007-09-29 19:29:00 This is what you need to watch a recording of a webcast in MSDN: 1) Webcast page - press the "Register Online" button 2) Login to MS passport 3) Event registration - enter attendee name 4) "Thank You For Registering" page - press the download button 5) View recording page - enter email & company name 6) View recording info page - save recording - the default filename is always the same, so you More About: Watch , Microsoft , Hoops , Jump 1, 2, 3 |



