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  #   

  Friday, January 30, 2004

Its Official, Raise Your Glasses, We’re Gonna Party to Damascus(2)

   I promised I will be telling stories about Cairo, so here it goes ...

    Sleeping by the Pharo's tomb: Patrick, Cigdem, Shiraz and I were down inside the Mycerinus pyramid, and there was a nice guide showing us around the sarcophagus and treasures room. Before going back up, they all tipped the guide (I must confess, I was a bit miserly on that one). The guy was so happy with the tipps, and was telling us if there was anything else he could do for us … Well, Patrick asked if we could sleep by the toumb, and I seconded his joke … off course, everybody laughed and we left. Later on that day, Patrick found out he had made a mistake while tipping the guide, and gave him more than he thought he did. So we figured we had a good start on bribing him into letting us sleep by the tomb … Maybe next time, who knows ?

   Can I have some Hummus please ? on Sunday, Steven was going crazy about Hummus, and not accepting to have been in Cairo for more than 24 hours without having it. The problem is that we were at an Indian Restaurant at the Oberoi hotel in Giza (close to the pyramids). So he kept asking for Hummus, and they kept telling him again and again that this was an Indian Restaurant. Since he wouldn't stop asking for Hummus (which is simply the arabic word for Chick Peas), they brought that bowl with Chick Peas in a sauce ...

    Cigdem’s pyramids : The first day, when we went to the pyramids in Giza, we didn’t really buy any souvenirs (except for the perfumes I will talk about later on). When we (I believe it was Cigdem, Patrick and I) went to Memphis and Sakkara on Tuesday, she needed to get some presents for family and friends, and was looking at pyramids. She finally closed a nice deals on some small pyramids, and since she thought she got a nice deal, she took two sets of three pyramids each. Later on the same day, at Khan El Khalili (After the closing session at MDC), she was thinking she would need more presents, and spontaneously started thinking of getting more pyramids … after strolling about a certain number of shops, she finally found one that had the same pyramids she had bought in the morning, but they wouldn’t sell them to her for the same price. There came Stephen, who started to bargain for her. To make the story short, he started, at one point, to propose a Yukon DVD for the pyramids, and the shop owner refused. Well, it was a great laugh, and Cigdem got her 3 new sets of 3 pyramids each (I joked about her using them as Lego pieces) …

   The American selling souvenirs at Khan El Khalili : this story actually started when Stephen started to bargain for the rest of the gang. At one shop, he started (again) to offer Yukon and Whidbey DVDs for souvenirs, and while squeezing the shop owner so much on the prices, the guy simply told him that he would like to see him selling the stuff and whether he would still be talking about the same prices (I spare you some details that I have to sensor, both to avoid wrath from Steven, and because this blog is not adult only content …). Anyway, here is Steven selling the souvenirs, trying to get the walkers by to buy his stuff, and making the bargaining a blast … one great moment was when another shop owner (or so he said) stopped by, and Steven offered him a Yukon DVD for his entire shop (we never saw the shop or even knew if it existed), and the guy accepted …

   Party to Damascus: Throughout the trip, Steven has been evangelizing … a song. He finally got both me and Goksin singing it with him. So let’s all hum together : Its Official, Raise Your Glasses, We’re Gonna Party to Damascus …

That is just part of the story, and I will probably be blogging about Cairo for quite some time ...


main | Travel
1/30/2004 11:35:58 PM UTC  #   
MDC04 really Rocks ...

   If there is anything all of us speakers at the MDC04 in Cairo agree upon, it is how wonderful the attendees were : very warm, very interesting participation and questions, and an amazing show of appreciation at the closing session. Big thanks to all of them, they really made us all love Egypt even more (if that is possible) than we already did ...


main | speaking
1/30/2004 1:33:20 PM UTC  #   
Mobility session at MDC04

I have promissed to have my slides and demos online by saturday, and since I just got home and haven't had time yet to really package and comment my demos, I am still going to update all the info by tomorrow. For now, here are links to download the slides and the demos "As is" :

http://www.arrabeta.com/malek/Compact%20Framework_final.ppt

http://www.arrabeta.com/malek/Compact%20Framework%20Demos.zip


main | speaking
1/30/2004 1:22:32 PM UTC  #   

  Wednesday, January 28, 2004

Trivia Question Answer

What is the Sphinks looking at (the credits go to my friend Patrick Hynds for thinking of it)

Pizza Hut and KFC ...


main | Travel | Trivia
1/28/2004 9:43:23 PM UTC  #   
Its Official, Raise Your Glasses, We’re Gonna Party to Damascus

MDC04 is over, and it was a great conference, and a very warm atmosphere for all of us speakers.

One great thing about conferences is the get together, and on this one, my good friends Stephen, Cigdem, Goksin and Patrick were here, and I made new Friends ... and that certainly keeps the level of suckiness very low ...

We were a nice gang of RDs and Microsoft People out here in Cairo. Stephen Forte , Patrick Hynds, Goksin Bakir, Cigdem, Lee, Shiraz and I formed a happy gang, that did most of our visiting and shopping together. I have quite a few stories to tell, and I'll catch up with them as soon as I get back home. But to keep suspens high (and to have a chacklist to help me not forget anything), I have stories about sleeping by the Pharo's toumb in the pyramid, the american selling souvenirs in a shop in Khan El Khalili, Cigdem's pyramids, the whidbey barter, partying to damascus, public bargains, and other things as well ...


main | Travel
1/28/2004 1:49:13 PM UTC  #   

  Sunday, January 25, 2004

MDC Office System Sessions (slides attached)

   Today, I did my 3 Office 2003 developer Sessions at MDC, all in a row.  Tomorrow I will be doing a Compact Framework session (I will cover PocketPC and SmartPhone development and I will touch on SPOT).

   This afternoon, I started with Infopath, followed with XML in Word and Excel (including Smart Tag Lists, Smart Docs using the MOSTL XML Lists, and finished with Visual Studio Tools for Office 2003). I have attached the slides (I still will revise then, and pack the demos, then I will post the apdated version) ...

XML in Word and Excel.ppt (805 KB)

Infopath.ppt (1.13 MB)Visual Studio Tools.ppt (1.79 MB)

Visual Studio Tools.ppt (1.79 MB)


main | speaking
1/25/2004 11:44:41 PM UTC  #   
A trivia question

What is the Sphinks looking at (the credits go to my friend Patrick Hynds for thinking of it)


main | Travel | Trivia
1/25/2004 11:13:03 PM UTC  #   
A warm welcome Egyptian style ...

Very simply put, I got to the conference a little bit late (after Billg was already there, although not yet speaking), and was siddered to see lots of people standing at the entrance gates (on the street) and not able to enter. The gates were closed and the guards at the gates didn't understand what being a speaker meant...

I had to stand in the street until the Keynote ended and Bill Gates left before they let us in...

Well, the trip is great, and overall, this really soen't suck ...


main | Travel
1/25/2004 11:03:06 PM UTC  #   

  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  #   

  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{

public class PdfFileHandler : IHttpHandler {

    public void ProcessRequest(HttpContext context) { 

            if (context.Request.RawUrl.ToLower().EndsWith(".pdf"))

            {

                  // do the pdf generation, and get it in a byte array (here, a variable called content)

                  context.Response.ClearHeaders();

                  context.Response.ClearContent();

                  context.Response.ContentType="Application/pdf";

         context.Response.OutputStream.Write(content, 0,

                                            content.Length);

                  context.Response.End();

            }

      }

}

}

The dll generated needs to be placed in the bin directory in the virtual directory of the application

  • Add configuration code to direct calls for pdfs to the handler, as illustrated in the follwing Web.Config excerpt :

     <configuration>

          <system.web>

               <httpHandlers>

                     <add verb="*" path="*.pdf"

                     type="Malek.Utils.PdfHandler, PdfHandler" />

                </httpHandlers>

                <!-- rest of the config file -->

          </system.web>

     </configuration>

 


.Net | main
1/12/2004 9:05:41 PM UTC  #   

  Sunday, January 11, 2004

one more stupid assertion : "Linux is secure, because I say so" ...

   In an article by Jaikumar Vijayan on Computer World, titled "Flaws raise red flag on Linux security", a compilation of nonsense takes place (my remarks in blue)... :

<< The rise in such incidents can be attributed to Linux's growing popularity, which makes it a more attractive target for malicious attackers, said David Wreski, CEO of Linux security vendor Guardian Digital Inc. in Allendale, N.J. >>  If this is true, then the problem is just starting. This same message has been used by Microsoft for some time, and the Linux community was simply saying it is not true, and that Linux was a better and more secure environment

<< "The underground hacker community is very interested in Linux as a potential target," he said. "Because of the accessibility of the source code to everyone, it provides an equal opportunity for malicious attackers to find vulnerabilities and ways to exploit them.">>  In simple words, this reads as : Linux is less secure than others because everyone has access to source code, and hackers have a better chance to find and exploit the vulnérabilities. Point well taken ... This guy is great at shooting his own foot ...

<< "I would say it is more secure than Microsoft and other environments because the code is looked over by so many people and it's so widely available that any vulnerabilities can be quickly identified and patched," Cahill said. Piedmont uses Linux for several e-mail-related functions and is considering its use for antispam purposes.>> Well, I thought the opposite has just been stated on the preceding paragraph. Then, what does quickly mean ? The latest vulnerability discovered by iSec is found on versions 2.2, 2.4 and 2.6 (I have seen reports saying it exists on every kernel version). version 2.2 exists at least since january 1999 (I found a version from 1/26/99 that can be downloaded from kernel.org). so, if 4 years is quick, I don't know what slow is ... If what is meant is that after the vulnerability has been exploited and that it has made all the damage it wants, it will not take long before a patch is there, I bet the same goes for any system (I am a big Windows user, and usually, when a vulnerability that was not known before is found, a patch comes out in the following couple of days, so what is the argument ? ...)

<<"There's not very much we've needed to do to secure Linux [applications]," said Joe Poole, manager for technical support at Boscov's Department Stores LLC in Reading, Pa. The company runs several virtual Linux servers on its mainframes that are protected by network and internal firewalls. All nonessential services, such as file transfers and Telnet, have been disabled. But there has been no need for the kind of constant patching and maintenance required for Windows, Poole said.>> Again, talking about security as relying on network and firewall only is a huge idiocy, especially when the issue is elevation of privilege through buffer overruns. No firewall will stop a legitimate user from accessing with his restricted rights; the problem is that it is all that is needed to exploit the buffer overrun, and gain access as root... On disabling nonessential services, it is absolutely not a valid argument against Windows, because you can disable nonessential services on every version of Windows, and it is the default on Windows 2003. So if the message is that Windows was not secure before Windows 2003 ...

<<"The biggest plus that Linux has is that it's designed to allow users to be users and not administrators," Schmel said. "What Linux has that Windows doesn't have is ease of configuration from an administrator's standpoint. Stopping and starting services, configuring services to only respond on certain ports and interfaces is dramatically easier than it is with Windows.">> I guess I shouldn't even bother comment this one ... Linux easier to configure than Windows ???

What really bothers me, is that Linux might have it own advantages in some situations, but what are those people talking about ? every remark thay make is simple bashing of Windows with absolutely no basis. and the article, in the way it compiles those, makes the contradictions even clearer ... Are they selling Windows or what ?


Linux | main
1/11/2004 7:38:19 AM UTC  #