« 2006-04 | HomePage | 2006-06 »

Wednesday, May 31, 2006

Launching a ClickOnce Application from another ClickOnce Application

Source: http://www.codeproject.com/useritems/ClickOnceLauncher.asp 

ClickOnce applications do a great job of isolating applications from each other. This was done for two reasons security and maintainability. Firstly it allows for greater security since the .NET framework manages security via code access policies. Secondly it increases maintainability by preventing the problems with "DLL hell". But this does pose a problem when one wants to launch the application. While it is installed on the hard drive the framework installs it in different locations for every user.

Microsoft solved this problem by creating a special type of shortcut, called an "application reference" that is used in the start menu when a ClickOnce application is installed locally. Great now we can launch an application from the start menu, but what if we want to launch it from another application?

To answer this problem I started where many of you are thinking I will just use the URL to the .application manifest file on the server. Just do a System.Diagnostics.Process.Start on the URL and I am good to go. While this will work find in an always connected scenario it doesn’t work if the application needs to run in offline mode.

For those applications I suggest doing a little bit of thievery. Since the application reference (*.appref-ms) that is created in the start menu will launch the application (if it is installed) for any user on any computer (with the .NET framework 2.0 installed) all we need to do is steal it out of the start menu and embed it in our launching application.

This technique is useful for applications that run in an online/offline mode. For online only application I suggest using just the URL.

The code

1.     Create the Client application

2.    

1.     Create a new Windows Application in VS.NET 2005

2.     Call it ClickOnceClient

3.     Publish it, with all the default settings

4.     Install it

3.     Find the application reference file from the start menu

4.    

1.     Using file explorer navigate to C:Documents and Settings(user)Start MenuPrograms(company)

5.     Create the Launcher application  

6.    

1.     Create a new Windows Application in VS.NET 2005

2.     Call it ClickOnceLauncher  

3.     Add the application reference file for the client to the project

4.     Set its "Copy to Output Directory" property to "Copy always"

5.     Set its "Build Action" property to "Content"

6.     Add a button to the form  

7.     In the click event of the button add a Process.Start for the file you just copied in

8.     Publish it, with all the default settings

9.     Install it

10. Run it

12:05 Posted in Blog | Permalink | Comments (0) | Email this

Friday, May 26, 2006

The untold story about Shawerma and Jordanian guys, no wonder why local girls hate us?!!

As usual it’s 11:30pm, and we parked our car infront of karam share3 mekka eating 3arabi and drinking pepsi getting ready for a long night of trix or code hacking!

Men don deolt sere, I asked the guys a small question: “ya e’7wan, what do you think about shawerma’s culture?” I got some owsome replies such as it’s a must, or Microsoft should create a shawerma arabi theme for msn spaces! hehe, others replied that 6al3et el shabbab hay wel 3arabi is better than spending time with their girl friends, yeah it’s time for you girls to know, and as for my friends’ girl friends don’t ask me for names coz I won’t bettrey my own sheleh! =p

Back to Jordev culture, I think you have to read this, Jordeis are writing poetry about shawerma 3arabi rather about girls, it’s not about being geeky, it’s about being Jordanian more! hehe a2olkom, iza el shabab kolha betbasbes 3al banat, bs enroo7 nakol 3arabi, wala law tomro2 Haifa Wahbeh bil mayooo ma7adan feehom rafa3 3eeno 3n sa7noo…

Ma bedi to waste your time so I’ll make it short, Jordanian culture = 3arabi, yer7am banat el balad, hehe; anyways we are going for a group 3arabi dinner on Friday June 2nd, so if you are interested to join us reply to this post: http://www.jordev.net/Home/tabid/36/forumid/6/threadid/33...

If you are looking for the poetry and discussion written about 3arabi in Jordev forums, check this post, try to skip the first 20 replies =)

http://www.jordev.net/Home/tabid/36/forumid/14/threadid/3...

PEACE

15:25 Posted in Blog | Permalink | Comments (0) | Email this

Tuesday, May 23, 2006

Windows System Reqs. 1990-2006: More For Less Old Post

Source: http://www.wininsider.com/news/?9331

The publication Thursday of Windows Vista's minimum hardware specs is only the last in a long series of requirement postings by Microsoft. To show some perspective, TechWeb compiled the Redmond, Wash. developer's stated reqs for each major Windows release since 1990's Windows 3.0.

Caveat: Microsoft is notorious for understating system requirements to pitch Windows to the greatest number, even when that minimum hardware has difficulty actually running the OS. JupiterResearch analyst Joe Wilcox characterized the habit this way on his blog. "You could run Windows on the minimum requirements, but you wouldn't want to."

As an additional comparison, average prices for desktop computer -- monitor included -- and portable PCs have been noted for all releases except Windows 3.0. (Data provided by IDC.)

While these "average" prices don't spec out systems identical to Microsoft's minimum requirements, they are a good indicator of what users paid for machines to run each OS.

It's easy to notice that as Windows' requirements got steeper, prices plummeted. A desktop able to run Windows XP (and probably at least parts of Vista), for example, costs only 42 percent of the price of a computer likely running Windows 95 eleven years ago. (Today's average notebook costs 45 percent of 1995's.) And that's not even factoring in the rate of inflation.

Here are the major releases for Windows, their release dates, and system requirements. Many of the trivia tidbits were gleaned from Wikipedia.

Windows 3.0 // May 1990

286 or faster processor

640K conventional memory (additional 256K extended memory recommended)

Hard disk drive

Hercules, CGA, EGA, VGA, or 8514/A graphics card (EGA or higher resolution recommended)

MS-DOS 3.1 or later

Mouse optional

[Tidbit: First Windows to be pre-installed on PC hard drives, by Zenith Data Systems and Dell.]

Windows 95 // August 1995

386DX or faster processor (486 recommended)

4MB memory (8MB recommended)

35-55MB hard disk space

3.5-inch high-density floppy disk drive

VGA or higher resolution (256-color SVGA recommended)

Average desktop PC price: $1,926

Average notebook price: $2,819

[Tidbits: 3.5-inch floppy version came on 13 disks; Brian Eno composed the Windows 95 start-up sound.]

Windows NT 4.0 // August 1996

Pentium or faster processor

16MB of memory (32 MB recommended)

110MB hard disk space

CD-ROM drive

VGA or higher-resolution display adapter

Microsoft Mouse or compatible pointing device

Average desktop PC price: $1,988

Average notebook price: $2,997

[Tidbit: Holds the record for most service packs -- 6, plus a post-SP "Roll-up" -- delivered for a Windows OS.]

Windows 98 // June 1998

486DX 66MHz or faster processor (Pentium recommended)

16MB memory (24MB recommended)

120-355MB hard disk space

3.5-inch high-density floppy disk drive

VGA or higher resolution (16-bit or 24-bit color SVGA recommended)

Average desktop PC price: $1,619

Average notebook price: $2,395

[Tidbit: Crashed catastrophically -- complete with infamous "Blue Screen of Death" -- during April 1998 COMDEX presentation by Bill Gates

" />
News | News Photos | Images | Web
" />
Bill Gates, who quipped "That must be why we're not shipping Windows 98

" /> News | News Photos | Images | Web

" />
Windows 98 yet."]

Windows 2000 // February 2000

133MHz or faster Pentium-compatible

64MB of memory

650MB free hard disk space

CD-ROM or DVD drive

VGA or higher resolution monitor

Keyboard required

Average desktop PC price: $1,306

Average notebook price: $2,167

[Tidbit: First Microsoft OS to make it through development and release without a code name.

Windows Millennium // September 2000

Pentium 150MHz processor or better

32MB memory

320MB free hard disk space

CD-ROM or DVD-ROM drive

3.5-inch high-density floppy disk drive

Video adapter and monitor that support VGA or higher resolution

Microsoft Mouse or compatible pointing device

Sound card

Speakers or headphones

Average desktop PC price: $1,306

Average notebook price: $2,167

[Tidbit: Usually considered the "dog" of Windows, Millennium's moniker of ME was said to stand for "Moron Edition," "Migraine Edition," "Malfeasance Edition," and "Many Errors."]

Windows XP // October 2001

Pentium 233MHz processor or faster (300MHz is recommended)

64MB of memory (128MB recommended)

1.5GB free hard disk space

CD-ROM or DVD-ROM drive

Video adapter and monitor with Super VGA (800 x 600) or higher resolution

Keyboard and a Microsoft Mouse or some other compatible pointing device

Sound card

Speakers or headphones

Average desktop PC price: $1,163

Average notebook price: $1,876

[Tidbits: First Microsoft OS to require "activation;" metamorphosed into more variations than any other OS, including Home, Professional, Tablet PC, Media Center, N (specifically for the European market, sans Windows Media Player), Starter, and Professional x64.]

Windows Vista // ??

[Premium Ready]

1GHz 32-bit (x86) or 64-bit (x64) processor

1GB of memory

Graphics processor that runs Windows Aero

128MB of graphics memory

15GB free hard disk space

DVD-ROM drive

Audio output capability

Internet access capability

Average desktop PC price (2005 data): $801

Average notebook price (2005 data): $1,256

[Tidbits: Longest development track of any Windows OS: first announced in July 2001, prior to XP release; first Microsoft OS to be named in lawsuit before it launched.]

http://news.yahoo.com/s/cmp/20060520/tc_cmp/188100630

15:05 Posted in WinFX | Permalink | Comments (0) | Email this

Monday, May 22, 2006

Fighting change, 1 step forward 2 steps backward

Life is ironic in every mean of the word! When you get the feeling that everything is going fine, actually that's the silence before war... in my nature I'm a very simple guy, la ba7eb el laf wala el dawaran bs el zorof sometimes pushes you to the edge! During my days @ BEAT my manager once said: "What goes around comes around!" I just didn't get the real meaning of that until life taught me so! Today’s post is not about you crying over my sad story, actually I’m not gonna even tell it in details, I’ll just scope around, l2ano el balad ad joret el gloool; it’s to remind me and you that nothing stays the same! Every thing eventually changes…

el osa o ma feha ya jama3ah ino I'm losing a close friend, though I'm trying to grab hard with my both hands, my friend is slipping away more everyday! The push and pull thing is not working, I even tried reading some articles about retaining close friends (b3raf fadi ash’3al) nothing worked!

The idea I’m passing here is it’s either we see change coming and start preparing for adaptation, some times change is good for most people but other times it just knocks you down. To stand still complaining and crying won’t solve anything at all. By clock ticks and sun rises and sets, you see change coming to your life, through family, beloved ones, or even work, the more you fight it the more you determine losing the battle. JUST ADAPT!! It’s like every time I try fighting change I find my self going backward instead of moving on!

Things will change, that’s life, alah wakeelko mossalammeh ya hoo, remember 7th grade?! You can feel bad for a bit, bs for the long run r7 toga3 3a rasak if you won’t adapt… I’m not saying I will stop missing or fighting for my friend or the quality time we used to spend, I will even trade my life with a time machine to go back in time, bs life is life, el 3mor 3m yemshi!

I hope you got something valuable from my post, as for me, though I know I’ll be losing, and viva for 1 step forward 2 steps backward, I will keep on pushing to have my friend around me until my will drains.

22:00 Posted in Blog | Permalink | Comments (0) | Email this

SOME SWEET EXTREMES!

EXTREME OF ISOLATION:
Two persons sitting side by side using emails to communicate with each other.

EXTREME OF COWARDICE:
Two persons fighting through emails.

EXTREME OF HELPLESSNESS:
Receiving no emails for a week.

EXTREME OF FRUSTRATION:
The email server being down.

EXTREME OF CARELESSNESS:
Writing a love email and doing a 'Send All.'

EXTREME OF ACHIEVEMENT:
A person sending email to a girl wanting to become friends and getting a reply.

EXTREME OF TIMEPASS:
A person sending email to himself.

EXTREME OF REPETITION:
Forwarding an email to someone and receiving the same email forwarded back to you by some one in the receiving chain.

EXTREME OF BROWSING:
You are swimming in the water tank and shout "F1 F1 F1?" instead of shouting "HELP" when u are unable to swim..

EXTREME OF MY FRIENDSHIP:
I always mail, u don't.

EXTREME OF HAVING NO WORK:
You reading such posts.

00:15 Posted in Jokes | Permalink | Comments (0) | Email this

Thursday, May 18, 2006

akalna el ma2loobeh

Now back to the part were I'm totaly shocked men banat el balad, they support the idea of Queer theory, imagine, http://en.wikipedia.org/wiki/Queer It's not like I'm against they idea of braking bounderies between the 2 sexs, it just really confuses me, in Islam we execute gays and lesbos, cultrly they are totaly rejected! further more they feel being abused and miss understood and they stick with the Feminism theory http://en.wikipedia.org/wiki/Feminism, come on! as a friend used to say: "OOOOOH PLEASE YA JAMA3AH!!" we have women ruling countries, leading political positions, and even 3ndna neswan shofeeeret taxai.. yalla 3ad.. and they keep on saying that they are mazaleeem! wala mafi mazloom el e7na!

Finally, I'm happy to say ino mush kol banat el balad heek, bs the majority are even much worse! allah wakeelkom betmaskano 7ata yetmakano! 7elweh betmaskano =P

We are going camping today near wadi mojeb on the other hand I have alot of tasks to deliver, so ill be hacking code in the wild tonight, ill recharge 2 batteries, and hope I finish before they run out!

10:30 Posted in Blog | Permalink | Comments (0) | Email this

Monday, May 15, 2006

ma2loobeh!

During our last camp in dead sea that is last thursday, my best friend T told me this wise line: "folan can be your next best friend for the fact that your current best friend which is me was a total stranger to you when you first met!"

I know 7aki falsafeh o bee3 jarayed, bs I went into a situation that I met this special person that for some reason I just keep contact with, and that's weird! all my life people thought I was defish kteer o weke7 bs 3adi I belive ino el wa7ad lazim ekoon heek bil balad hoon; akeed mush kol il nas! anyways the thing is some times you meet a person and for no reason, bs heek men saba7o you think that he is going to be part of your life.

hala2 let's skip el 7aki el mfalsaf and stick to the idea eno keaf banat il balad befakro! It's a weird culture we live in here in Jordan, and I will tell you why in the next post, coz I have to run now, ma3zoom 3al 3asha, etfadalo!

20:45 Posted in Blog | Permalink | Comments (0) | Email this

Thursday, May 11, 2006

Is there even an argument? VB.NET vs C#?

First, let me start off saying where my loyalty lies, I'm a C# guy.

I've recently been doing a great deal of work in VB.NET and I wanted to share with you what my thoughts are.

C# and VB.NET are identical in form and function. They can both be used to build the same identical systems with exactly the same code. There's no real difference - the beauty of the .NET Framework.

So what's this post about? Well it's about how I feel when writing code in the two different languages. What I write here is not about what's right and what's wrong, it's just opinion (personal opinion at that!).

To me, VB.NET feels like a very solid stable language, with well defined boundaries. Bold colours - you get what you see.

C# seems to be much more subtle, it feels less solid, the boundaries are there, but they're much softer, it's much harder to tell what you have in front of you with C#.

I don't get the same sense of completion with VB.NET as I do with C#, when I write code in VB.NET I know the code will do the job, but it just doesn't feel finished.

I wondered, is this because I just have not used the language enough which got me back to thinking about when I first started to learn .NET.

Way back in before .NET was released I was using VBScript and decided to try out the new .NET stuff, using the language I already knew - VB.NET (I mean it even had the same name!). I tried for about a month in my spare time to learn VB.NET, but I just could not get my head around it - all of a sudden I had all of these Object things to deal with and all the nasty casting going on - I really missed varients. I gave up on .NET and went back to VBScript - I knew it and knew it well.

A couple of months later I decided to give .NET a shot, but this time, I opted to give C# a go, see if I could lose the familiarity I had with the VB languages and teach myself .NET instead. This time round I found .NET much easier, the code samples were there, mostly in C#, the community was there, everyone was using C#, it just seemed easier for me to get my head around, all of a sudden these Object things gained a life of their own, I was able to write Classes and use design practices to ensure they were clean and tidy. I got .NET, and have never turned back to VBScript since that day.

So does the fact I learnt .NET with C# taint my feelings with the topic of VB.NET? I'm pretty sure it does. Is this a bad thing? Well for me at the moment, yes it is, I'm working with VB.NET quite heavily and I don't feel confidant in my code, a feeling I never really have with C#.

VB.NET is solid - I feel it does the job, but it just feels more chunky, rugged, designed for the world where it will be haphazardly put together. VB.NET to me is like Duplo (which for those who don't know is Lego for Toddlers - larger bricks, easier to use).

C# feels much more precise, it's smaller, easier to manipulate into a finer much more intricate design, it feels like it's better than VB.NET (which as I've already stated - it isn't they're equal in EVERY way).

So there you have it, VB.NET & C# side by Side do the same job, in the same way - they can both achieve wonderful things with morealess the same amount of code, okay, one language might have features the other doesn't, but essentially, they're pretty much identical.

The only real difference is the perception of developers who use either language. How someone overcomes this difference is beyond me, I'm looking to find a solution to the problem and to banish my VB.NET demons - I need to feel confidant that the vB.NET I write is a solid and as stable as my C# code - maybe I need to see a psychiatrist.

Reference: Phil Winstanley Blog

00:20 Posted in Programming | Permalink | Comments (0) | Email this | Tags: microsoft

Wednesday, May 03, 2006

Avoid .NET “partial” classes in C# and VB

Microsoft added a new keyword to C# and VB for 2005 (CLR 2.0): partial

Don't use it.

partial is used to physically break up a class definition into multiple files. When the compiler sees the keyword partial it finds all the related partial files in order to compile the class. This makes it possible to split the code for a single class across multiple files. By and large, though, this is a bad idea. Let’s look at why that is.

If you find
yourself typing
"p-a-r-t-i-a-l"
Stop!

Reasons Given To Use the “partial” keyword

There are three main incentives I’ve heard for using partial, according to Microsoft and others:

  1. If a class is really large, break it into multiple files so more than one person can work on it at a time.
  2. If a class implements multiple interfaces, put the methods that implement each interface into a separate file.
  3. When the IDE generates code, it puts the code into a separate file so you don't see it or accidentally modify it.

Let's examine each of these reasons in detail.

1. Avoid using “partial” to break large files into many smaller files—so multiple people can work on them. This is a bad practice.

Why?

No matter how you try to group code in various partial files, you will never see the big picture for the class anymore. It’ll become brittle, easily broken. By only viewing a portion of the class, you can too easily break some assumption or dependency in the rest of the class. For example, you won’t see all the internal fields. If a field needs updating, and it’s not referenced in the portion of the class you’re editing, you’ll never even realize that you are breaking the class. People will make incompatible changes and no one will know until Humpty Dumpty is put back together again. Are your unit tests good enough to catch this?

So what's the right solution for really large files?

If you’re thinking of using partial because your class file is large, then consider it a warning sign that it's time to break the class up—not by using partial but by using object oriented design. Break your monster class into multiple classes, grouped by responsibility. That way, you can hide details inside classes, and it will be much harder for developers who work on the new smaller classes to make incompatible changes with each other. As a bonus, breaking it up will also make your code easier to read, test, and maintain.

2. Avoid using “partial” to organize your class file. Some people suggest putting the implementations of each interface into their own files. This sounds reasonable at first, but it contains a pitfall—the class implements 2 or more interfaces, but it is still one class that has its own private data (and all the assumptions that go with that). If you only read code in one file and make changes, you may not realize the side effects you introduce on other methods that are in other partial files. This is a bad practice for the same reason that it was for reason #1, large class files.

 

3. “partial” is ok if the compiler puts it there. This is the only safe reason to use partial. When the compiler adds partial to your class, it does so to hide the code that it generates. While there are other solutions to handling generated code, this is the one that Microsoft chose, and it works fine. You can't ever modify the generated code (well, not easily) so it's just as well that it's hidden in a separate file. Note the key phrase here: the compiler adds partial—not you.

Recommendations

  • If you find yourself typing "p-a-r-t-i-a-l" — stop! Don’t do it.
  • If the class you’re working on is marked partial, make sure that the other partial bits are compiler-generated. If they’re not, you should consider putting the class files back together and re-factoring the large class into smaller classes.

One final Note: in VB, since the partial keyword is optional, you can really confuse someone reading the code because they may not even realize that other code exists for this class. If you work in VB, be aware that your entire class may not be in the file you’re looking at.

For another viewpoint, see these articles:

source: http://geekswithblogs.net/dchestnutt/archive/2006/04/05/7...

14:05 Posted in Programming | Permalink | Comments (0) | Email this | Tags: microsoft

Tuesday, May 02, 2006

Tips to negotating your salary!

Great link here on negotiating your salary...Here is an excerpt:
"In a negotiation on your salary and benefits, DO NOT engage with someone who can say, “I’ll have to get back to you on that.” One of the keys to successful negotiation is that both sides have the same amount of thinking time."
Check it out.

13:10 Posted in Blog | Permalink | Comments (0) | Email this

All the posts