Monday, April 30, 2007

ActiveX control to load PNG files in IE7?


I just saved this SilverLight poster to my local machine and tried opening it with IE7; I was greeted with this message. I was surprised but I clicked on it to activate it, only to get this error message:


WOOT!?

Sunday, April 29, 2007

Windows.Vista.Downgrade();

my main reason to downgrade my laptop OS is because my Cingular 8125 won't work as a modem in Vista, and I really can't live without that now, which is the same reason (or so the rumors say) I won't be getting an iPhone when it comes out, being able to use my cell phone as a modem and have internet "anywhere on the road" (at least in USA) has been really great, I can't go back to not have that

other reasons are the many problems with VS2005 and Orcas on Vista, I really want to play with F# and don't want to deal with a beta product in a buggy IDE, yesterday Justin and I were playing with F#, expect posts on the subject soon

downgrading has been painful because XP didn't recognize a lot of the hardware, whereas in Vista everything just worked, for now I'm still keeping Vista on my PC though... XP feels old, but it works

Saturday, April 28, 2007

burning iso images to cd / dvd in Windows Vista

for my own reference and to help anyone out there looking for this
took me a while to find it because I was looking for "burndvd"... arrgh
keywords: cdburn, dvdburn, burn, rktools

you can use the Windows Server 2003 Resource Kit Tools, after you install this kit, you will get a couple command line utilities under c:\program files\windows resource kits\tools\

cdburn.exe
dvdburn.exe

usage:

cdburn image

Thursday, April 26, 2007

yahoo mail acting funny...




sigh...

...the attach files button doesn't work either

Oracle sucks, part 2 of 1000: setting variables

you don't use SET to set variables values
SET variable_name = value;

this will give you a "ORA-00922: missing or invalid option"

you set variables Delphi style

variable_name := value;

Oracle sucks, part 1 of 1000:executing queries vs scripts

I just have to blog this to remember in the future, and hopefully blog about other countless issues with Oracle

This applies to running multiple statements to create functions, views, etc

When running as a query:
when creating or replacing functions, include ";", at the end, then a "/" on the next line
when creating or replacing views, don't include the ";", but include "go"

otherwise you'll get things like
" Warnings: --->
W (1): Warning: execution completed with warning
<--- "

"[Error] Script lines: 639-664 ----------------------
ORA-06575: Package or function FUNCTION_NAME is in an invalid state"

and your functions/views won't be modified

when running as a script, everything needs ";" at the end

Thursday, April 19, 2007

Deploying .NET 2.0 security settings without SDK or caspol

This article applies to Microsoft .NET Framework 2.0 Security
keywords: CAS, full, trust, assembly, security, policy, mscorcfg.msc caspol.exe

When you want to adjust the security settings in .NET 2.0 you use the mscorcfg.msc tool (Control Panel/Administrative Tools/Microsoft .NET Framework 2.0 Configuration)

However sometimes in a production environment you might need to do the same thing in a bunch of machines, and the problem is that the mscorcfg.msc tool is only included in the SDK which is over 300 MB, another option is to use the caspol command line, but that will scare most people away, there are a lot of people having this problem, so I thought I would post an easier solution here.

I lied on the title of the article, you do need to the SDK, but only in one machine, since you are a developer (right?) I suppose you have Visual Studio, and that includes the SDK, if you don't have the SDK installed on any machine, then you need to download it and install it at least on one machine.

Once you have that you can use the mscorcfg tool, setup the machine with the permissions that you want, trust assemblies, adjust zone security settings, etc, then when you are done, use this option

Configure Code Access Security Policy







Create Deployment Package






you will see a new dialog, which doesn't have many options


this dialog is a bit weird and buggy, but all you have to specify is a file name in some valid folder, for example c:\SecuritySettings

the other thing you might want to change is the security policy level to deploy, if you are deploying to production machines you might need Machine or User
click Next, then finish.

What this little wizard does, it creates a package with all the security settings on that machine, and puts it in a simple small executable program that you can run in any machine to adjust the security settings to match that machine.

now all you need to do, is take that file to the machines where you want to deploy your new security settings, run it and you're done

When you run the file you are naturally tempted to wait for a dialog to come up and ask you to click next, next, next, finish, but no dialog will pop up, you'll see it flash for a second and then it will dissapear, that's all it does (you might need privileged rights to run that file), if you were able to run that file, the security settings have been changed.

now if "it works on my machine!", you can make it work in other machines too =o)

Everything you ever wanted to know about .NET garbage collection

or almost everything on garbage collection, the related CLR and BCL, you will find it on Chris Lyon's blog, I found his blog and read it all yesterday, I'm still digesting some of it, a lot of good stuff, I had to include most of his blog entries on my link blog

Sunday, April 15, 2007

everything you blog can and will be used against you

At some point or another almost every blogger writes a controversial article, some bloggers do it so frequently that it doesn't generate that much press now.

Some will try to dictate rules for the blogosphere, that kinda defeats the purpose of the blog, I think that's just people trying to create the next buzzword or leave their legacy which translates into popularity and everything that comes with that, if you are a "z list" blogger like me, it probably won't make a difference if you post something that is incorrect.

**see notes at the end
Today I see this post from Sam Gentile: "Wanted: A Windows Edition for Non-Idiots"; my whole issue with that is calling regular users idiots; if I use the keyboard and command line a lot does that make me an advanced user and makes you an idiot because you don't?

Be careful when blogging, regardless of your blog popularity, you never know when it can be used against you (in a job* interview for example), I'm not going to recommend a code of conduct, all I'm saying is use common sense, respect your readers and respect everyone in general

* fixed: thanks Sam
** Sam updated his blog and changed the "non-idiots" part to "Power and Pro Users.", kudos to him for doing that. I've wanted to blog about this a long time ago, my whole point is just watch what you write on your blog (book, speech, etc), it may come back and hunt you later

Saturday, April 14, 2007

hello world from FSharp

Justin and I are beginning to play with F# (1.9.1 has been released)

open System;
Console.WriteLine("hello world");
let name = Console.ReadLine();;
Console.WriteLine("hello "+ name);
Console.Read();

we'll see how this goes, hope to blog about it soon

updated Notepad is out

Notepad2 that is =o)

The most important changes in Notepad2 2.0.x compared with version 1.0.12 include support for ini-file storage of the program settings, modeless find and replace dialogs, multiline find and replace operations (using backslash expressions), optional file change notification, and many more.

There's also some regressions, i.e. ANSI code page support has been reduced to the system default, the bookmarks feature has been removed, a few syntax schemes have been dropped, and Notepad2 does no longer run on Windows 9x. If you need any of these features, you'll have to stick to Notepad2 version 1.0.12.

read the full list of new features here

if you are still using Notepad, you might want to give Notepad2 a chance, is just as light weight as Notepad, but much more powerful

Tuesday, April 10, 2007

no more screen saver for me, thanks McAfee


I've had the BSD screen saver for a long time... is gone now =o(

Monday, April 09, 2007

is not about the pattern, it's about the practice

There's a discussion going on in the blogosphere about "bashing patterns", Corneliu (parallel thinking) says:

This month seems to be the month of bashing the singletons and some of the other design patterns.

From posts like Singleton Considered Stupid to Singleton – the most overused pattern and Criticism on one the Patterns (Blog 3), the blogo-sphere is full of comments about why singleton is bad or evil.


I don't think the problem is with the use of the pattern, but with the abuse of them; but this has always been the problem in programming in general, most of the time programmers learn a few things just to "get things working", and as long as it works "if is not broken why fix it".
Is it all the programmers fault? I don't think so, I think it has to do a lot with management requesting things to be done by yesterday (bad estimates), but that's another topic which has been discussed quite a lot already

so this is not a new problem, is the same old problem (abuse of techniques) applied to the patterns, the patterns are good, the implementation may be correct, but the usage (the practice) of them is the problem

why the singleton? I think because that's one of the "easiest" ones, you can pretty much copy and paste it, you don't even need to understand the inner workings, you just know that "it will be a single instance of your class", and that's something you can't do with other patterns

we need to teach better usages, better practices.