Sunday, July 30, 2006

using the right tool for each job, which web browser do you use?

I use 5 different browsers approximately as:

70% - Flock - This is like a Firefox on steroids (actually based on the Firefox engine), allows me to blog from it, integrates with flickr, etc, Any firefox extension that I use, I load on this browser

10% - Firefox - I use this browser pretty much clean of all extensions, when I want to load a site and leave it running on the background I use this browser.

10% - Internet Explorer 7 - Beta 3 at this point, so far I like it a lot, but there are a bunch of sites that just refuse to work with it, once it becomes a release version I'm sure I'll use it more

5% - Internet Explorer 6 - On the other hand, there are some sites that only look good or only allow Internet Explorer 6, I use this browser for IE specific sites and/or sites that I trust (e.g. intranet)

5% - Opera - Since out of my list of browsers, this is the least used, this kinda gives me more "protection" when I'm visiting sites that I don't trust that much (e.g. sites about hacking)

Friday, July 28, 2006

new class for creating SQL connection strings in .NET 2.0

I just found about this little gem, I've seen all kinds of wicked code to create a sql connection string, anything from storing the whole connection string, to concatenating the string, to using a StringBuilder, etc. This class allows you to do all of the above but easier
SqlConnectionStringBuilder Class Note: This class is new in the .NET Framework version 2.0.Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class

SqlConnectionStringBuilder Class (System.Data.SqlClient)

once you create an instance of that class, you can read/write to the individual items of the connection through properties or through the indexer as:

//you could pass the connection string in the constructor too

SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();

//using the indexer

builder["DataSource"] = "someDataSource";

//or using the property

builder.DataSource = "someDataSource";

this would be useful in a number of cases, for example if you had two connection strings that were different only by the server name

technorati tags:, ,

Thursday, July 27, 2006

Google help

With so many google products, it was about time to have a central place to look, first for all the available products, second, for help on how to use them
Those of us in user support had a pet peeve: there was no single place that held all of Google's help information at your fingertips. So we decided to build one -- and now you can visit Google Help to find tips, tricks, and troubleshooting solutions for just about every Google product and service. We don't want you to have to work hard to find anything, so we also added an A-Z guide in case you do know exactly what you're looking for.

Official Google Blog: A roadmap for Google help

technorati tags:

How to capture a PowerShell terminal session

Just found about this cmd-let that captures all the input/output in Powershell

to start it simply type:

Start-Transcript

it will tell you where the transcript is being stored, by default it creates a text file on your "c:\documents and settings\user\..." folder, but you can specify where you want the transcript to be stored just passing a file name after the cmd-let, you can also pass -append so that if the file exists, it keeps adding to it

To stop it:

Stop-Transcript

This is kinda the equivalent to the unix script command

technorati tags:

Free MSDN library from now on

For the first time, we're making the MSDN Library freely available for download from Microsoft Downloads. Previously, the Library was only available for download to MSDN subscribers. The current download is the May 2006 Edition and future editions will also be available when we release them.

Rob Caron : Free Download: MSDN Library May 2006 Edition



now this is great news!

Tuesday, July 25, 2006

Crazy windows bug

Captured in video for all you windows-haters viewing pleasure, it has sound
CRAZY COMPUTER BUG

YouTube - CRAZY COMPUTER BUG

Ruby for Visual Studio 2005

Found this today at TSS.net, Ruby in Visual Studio, for those of you interested in alternative languages
Ruby in Steel for Visual Studio 2005Posted by: Regina Lynch on July 25, 2006SapphireSteel Software will be releasing Ruby in Steel, a Ruby add-in allowing developers to take advantage of the Visual Studio IDE. The product will include debugging, Intellisense, code completion, code snippets and support for Rails.With the 1.0 release, both a free personal version and a developer version will be available. The developer version will include more advanced functionality, such as a fast debugger. SapphireSteel is planning to release several beta versions prior to release in order to implement further VS features and fix reported bugs.Ruby in Steel version 0.7 is currently available for download. It includes a Rails New Project Wizard, import capabilities, integrated SQL Server development, automated database setup and syntax error checking.

Ruby in Steel for Visual Studio 2005

check it out

Ruby In Steel

Saturday, July 22, 2006

10 years ago, today

It was July 22, 1996, back in my hometown in Mexico when I joined the company that I work for today, for most people to hear that someone has been working this long for the same company is quite shocking, for a few others it would be normal; for me it has been a great experience, I've grown a lot, I've had opportunity to meet a lot of people in many different cities.
10 years... that's a long time, it's the difference between being 19 or 29 years, I hope I have been able to help some people through my work.

Fortunately I won't have to bring a pound of chocolate per every year at the company or anything like that

Thursday, July 20, 2006

Windows Shortcut keys

I found this short useful well formatted list of Windows shortcut keys, so you can impress your friends "how did you do that?"

These shortcut keys work fine in Remote Desktop

Windows Shortcut Keys

Wednesday, July 19, 2006

PowerShell:Get a list of paths from the environment variable PATH

First of all, to get access to a variable from the environment you run:

$env:[variableName]

so, to get the PATH you do:

$env:path

on my machine, I get something like this:

PS C:\> $env:path
C:\oracle\product\10.1.0\Db_1\bin;C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\c
lient;C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin;C:\Oracle\product\10.1.0\Clie
nt_1\bin;C:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;C:\Oracle\produ
ct\10.1.0\Client_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Syst
em32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;c:\Program Files\
Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Pro
gram Files\Support Tools\;C:\Program Files\Windows PowerShell\v1.0\
PS C:\>

that's kinda hard to read, so you can use this method instead:

$env:path.Split(';')

PS C:\> $env:path.Split(';')
C:\oracle\product\10.1.0\Db_1\bin
C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin\client
C:\oracle\product\10.1.0\Db_1\jre\1.4.2\bin
C:\Oracle\product\10.1.0\Client_1\bin
C:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client
C:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\Program Files\Microsoft SQL Server\80\Tools\BINN
c:\Program Files\Microsoft SQL Server\90\Tools\binn\
C:\Program Files\QuickTime\QTSystem\
C:\Program Files\Support Tools\
C:\Program Files\Windows PowerShell\v1.0\
PS C:\>

ah... much better

what? you need the list on a file?

$env:path.Split(';') > list.txt

technorati tags:,

Technical terms in your language

I found this document: Microsoft Terminology Translations, via Edgar

the document contains almos 15,000 terms in 47 different languages, so if you speak another language, chances are you'll find it there

Tuesday, July 18, 2006

quickly find out which version of the .NET framework is installed on a system

This is something I have answered several times to many people, anything from production personnel to network administrators

is quite easy (the yucky using the mouse way)

You go to the control panel, Add or Remove Programs, wait forever for that to populate the list, then go find "Microsoft .NET Framework X.X"

if you want to do it quicker than that, you can use this method instead:

open a folder to:

c:\WINDOWS\Microsoft.NET\Framework\

or whatever the equivalent on your machine is, like

c:\WINNT\Microsoft.NET\Framework\

first of all, if the folder c:\windows\Microsoft.NET doesn't exist, then you don't have any .NET framework version installed

Then, if you do get to that folder, you should see some folders like

v1.0.3705

v1.1.4322

v2.0.50727

That's the version of the .NET framework installed (the first two digits matter the most)

It's also important to note that just because the folders exist there it doesn't mean that version is installed, to make sure you would actually have to go inside the folder and see that it has a ton of files (100+) and about 6-10 folders

for ~95%+ of the cases though, I just type c:\WINDOWS\Microsoft.NET\Framework\v at the "run" window and see what shows up and that works just fine

technorati tags:,

Microsoft acquires sysinternals

yup, the company that created filemon, regmon, tcpview, autoruns and so many other really cool tools is now part of Microsoft
I’m very pleased to announce that Microsoft has acquired Winternals Software and Sysinternals. Bryce Cogswell and I founded both Winternals and Sysinternals (originally NTInternals) back in 1996 with the goal of developing advanced technologies for Windows. We’ve had an incredible amount of fun over the last ten years working on a wide range of diverse products such as Winternals Administrator’s Pak, Protection Manager, Defrag Manager, and Recovery Manager, and the dozens of Sysinternals tools, including Filemon, Regmon and Process Explorer, that millions of people use every day for systems troubleshooting and management. There’s nothing more satisfying for me than to see our ideas and their implementation have a positive impact.

Mark's Sysinternals Blog: On My Way to Microsoft!

technorati tags:

Blogged with Flock

Monday, July 17, 2006

PowerShell support for old command line behavior

While playing with PowerShell I noticed that it has pretty good support for the behavior found in "old" CMD and/or "DOS", all the function keys work just as expected

Now, in case you don't know how to use the function keys in "DOS" here are some pointers:

F1 - will repeat the last command one character at a time, so if your last command was "dir", you will get "d", "i", "r" as you press F1 multiple times

F2 - "Copy up to char" function (of the last entered command): Not used much, it allows you to copy up to the character you enter after pressing F2, e.g.

If you previously entered: dir "program files"

on the next line you could enter: dir [F2]m

and it would complete it as: dir "progra

F3 - repeats the last command

F4 - "delete up to", I can't really remember how to use this one, but is rarely used I guess

F5 - iterate backwards through the list of previously entered commands (same as using the up arrow key)

F6 - ^Z or text file terminator: I can't see how to use this in PS, but if you were entering a text using "copy con [filename]" you can get out of it and save the file by pressing F6, which by the way, PS doesn't have support for "copy con" but supposedly this guy wrote something equivalent to it:

http://tfl09.blogspot.com/2005/10/monad-and-command-console.html

F7 - Provides a list of the previously entered commands and you can select one using the arrow keys

F8 - Iterates in a loop backwards (when it gets to the first one it goes the last one) through the previously entered commands

F9 - "Enter command number": allows you to enter the command number you want to execute, to find out the command numbers you would have to use F7 first

technorati tags:, , ,

Blogged with Flock

Sunday, July 16, 2006

(PS) how to get back "home"

I have a story of being a keyboard guy and a "command line guy", recently I have been interested in PowerShell; thanks to the secret geek I was encouraged to download it and try a few things, so far I'm loving it!, it's awesome... of course this is definitely not for everyone, specially not for programmers =o(, at least the great mayority of the ones I know don't really like command line stuff, anyway (is not like you are required to be an expert on it, PowerShell is oriented at System Administrators, I just happen to prefer command line when working at a computer, is just so much faster to accomplish things).

I was reading on the secret geek blog about one of the cmd-lets:"Get-PSDrive":

Once Upon A PowerShell i went looking for a cmdLet to display a list of all the current drives.I found one, 'Get-PSDrive' which does exactly that... but i was gobsmacked at what else it revealed!'Power shell drives' are not just your boring old 'C:' etc -- they can be all sorts of hierarchical structures, such a registry keys, environment variables, functions(!) and more.

Babysteps in PowerShell part deux: Variables! Real Proper Variables!

on mi machine it displays something like:

PS C:\> get-psdrive

Name       Provider      Root
----       --------      ----
A          FileSystem    A:\
Alias      Alias
C          FileSystem    C:\
cert       Certificate   \
D          FileSystem    D:\
E          FileSystem    E:\
Env        Environment
F          FileSystem    F:\
Function   Function
HKCU       Registry      HKEY_CURRENT_USER
HKLM       Registry      HKEY_LOCAL_MACHINE
Variable   Variable


PS C:\>

notice those Function, HKCU, HKLM and Variable at the end...

you can do a "cd Variable:" then do a "ls" or "dir" and it will list the variables declared, you can do "cd Alias:", then "dir" will list the aliases in the system (alias for the different cmd-lets")


anyway, I was playing with those and for a few seconds I was stuck when I did "cd Alias:", after finding out what was there, I wanted to go back, so I immediatly did "cd ..", didn't work, "cd \", nop... "cd /" nothing... panic!

quite simple actually, we just need "c:" or "cd c:"

(uff, that was close)... and now I have a new category to blog about

technorati tags:,

Thursday, July 13, 2006

Time to update .NET 2.0

This Information Disclosure vulnerability could allow an attacker to bypass ASP.Net security and gain unauthorized access to objects in the Application folders explicitly by name. Note that this vulnerability would not allow an attacker to execute code or to elevate their user rights directly, but it could be used to produce useful information that could be used to try to further compromise the affected system.

Microsoft Security Bulletin MS06-033: Vulnerability in ASP.NET Could Allow Information Disclosure (917283)

technorati tags:,

Wednesday, July 12, 2006

Tuesday, July 11, 2006

Singleton Pattern the way you should NOT do it

found this code today at c-sharp corner
public static SingleTon GetObject(){
if(instance == null)
instance = new SingleTon();
++m_nNofReference;
return instance;
}

Singleton Pattern

don't use it, it is not thread safe, you can read this instead if you want to learn about the singleton pattern

technorati tags:, ,

"googling" officially a verb now

"This week googling officially became a verb. The 11th edition of the Merriam-Webster Collegiate Dictionary now includes “googling” (lower case g). Actually the Oxford English Dictionary (OED) beat them to the punch a month ago by listing Google (upper case g) in their authoritative lexicon of the English language. It’s about time. People have been using Google as a verb for years, despite protestations by the company (many of which I authored myself) about the genericization of the trademarked name."

check it out

technorati tags:

Thursday, July 06, 2006

Bush hid the facts?

1.) Open an empty notepad file.
2.) Type "Bush hid the facts" (without the quotes).
3.) Save it as whatever you want.
4.) Close it, and re-open it.

...

now for the spoiler, try the same thing with

"this app may break"

or

"aaaa aaa aaa aaaaa"

technorati tags:,

Monday, July 03, 2006

.NET Framework 3.0 structure

in case this is still clear as mud, this picture should help

technorati tags:,