GUIDs
Labels: SQL SERVER
static void Main(string[] args)
{
string completeUrl =
"http://www.eggheadcafe.com/FileUpload/1145921998_ObjectDumper.zip";
WebClient obj = new WebClient();
Stream s = obj.OpenRead(completeUrl);
Console.WriteLine( obj.ResponseHeaders["Content-Length"].ToString());
s.Close();
obj = null;
Console.ReadLine();
}Labels: .NET FRAMEWORK
I tweeted this concept recently and got a very positive response.
As developers, business owners, partners, and gurus of various breeds, we are constantly exposed to situations where things other people do just don’t seem to fit our personal paradigm.
Sometimes, a natural reaction may be to put somebody down or make a sarcastic comment.
Don’t do it.
Environments like this create a situation where we can excel as developers, or we can turn them into a situation where we turn out to be a complete and total ass because of our behavior towards others.
No matter what the situation is, you can catch more flies with honey than with vinegar.
There is NEVER a situation where putting somebody down will further the effort – not in development, not in personal interactions, not in a group. Never.
What you need to do is step back, hold your breath, and think. Then, hopefully, you can find the resources in your inner being to respond in a positive manner.
The results, if you work on this process, will be nothing short of amazing. I guarantee it.
Labels: DEVELOPMENT
This weekend I spent some time setting up Ubuntu Desktop on my Oracle VirtualBox. I installed MonoDevelop, and MongoDb.
I added an ASP.NET Web Application that uses the NoRM C# Driver, and after a little futzing (like changing the port on the MonoDevelop XPS web server) it built and ran great!
Interestingly, it was a Visual Studio 2010 solution, but MonoDevelop was able to open it anyway. All I had to do is remove some of the references that “didn’t belong”, and remove the targetFramework attribute from the web.config.
Now that’s quite an accomplishment, since I am most definitely not a Linux guy. Kudos to the MonoDevelop guys. They’ve done a great job.
And it just shows how portable MongoDb really is. Being able to build and run .NET applications and even ASP.NET apps on Linux is a big plus.
Labels: MONGODB, MONODEVELOP, NORM, UBUNTU
//"OLD" way:
static bool IsKeyInArray(string[] items, string key)
{
if (items == null) return false;
if (items.Length < 1) return false;
if (String.IsNullOrEmpty(key)) return false;
foreach (string item in items)
{
if (item.Trim() == key)
{
return true;
}
}
return false;
}
static bool IsKeyInArray2(string[] items, string key)
{
bool isInArray = false;
if (items == null || items.Length <1 || String.IsNullOrEmpty( key))
return false;
if (items.ToList().Contains(key))
isInArray = true;
return isInArray;
}
Labels: LINQ
Labels: UNIT Tests
Most people are blissfully unaware of all the absolute JUNK that gets run when Windows starts up, mostly due to registry entries installed by various programs, drivers, and what not.
Much of this junk can be safely disabled. You can use Msconfig to do it. Here’s how:
Hit the Windows Start button at the lower left side of your Taskbar. Click RUN, then enter “msconfig” and click OK.
You’ll see four Tabs – the one you want is “Startup”. You can start disabling items by unchecking them. Some items will be automatically reinstalled on the next startup by windows or by necessary drivers. But you can disable a lot, and that means less memory usage and less resource-hogging.
Here are the first two screens of mine:
You can see that I have most of it (from the first screen) and all of them (on the second screen) disabled, along with even more on the third screen (not shown).
I could care less about Adobe Updater, Itunes, Zune and whatever. If I need to run Itunes, I plug my iPhone into the USB, and run ITunes. It will say that the Apple Mobile Device Service is not running. So what do I do? I go into Services and start the booger, and everything is fine. I have it set to “Manual”. I absolutely do not need this service running and hogging resources on my machine when I’m not updating my iPhone. Same with Zune and a hundred other useless programs including Google Update, which does not behave well even if turned off in msconfig (Are you listening, Google? How about lets make our stuff user-friendly?)
Lean up your machine. I guarantee, you’ll be a happier developer.
Labels: WINDOWS 7, WINDOWS UPDATE