Monday, February 12, 2007

3515.aspx

Microsoft Keyboard Layout 1.4

Tired of the standard QWERTY and the faster, but not so common Dvorak, keyboard layouts? Why not make your own with Microsoft Keyboard Layout Creator:


Apart from using it for an office prank, the tool is actually useful if you have laptop with a weird keyboard layout or if you a programming on a non-US keyboard where frequently used characters like {}; are hidden away behind obscure AltGr+Shift combinations.

3513.aspx

How to fix Motorola SLVR L7 problems on Win2k3 Server

I recently got a Motorola SLVR L7 at work to replace my broken Nokia 6630. My main reasons for getting it were the size (small and light) and the fact that it charges via a standard Mini USB cable just like my PDA. Finally only one cable and one charger to bring around. Motorola is not as good as Nokia when it comes to software but who cares as I only need it for SMS and making calls. Like the Nokia 6630 it synchronizes with my Outlook contacts. At least that was what I thought...


I tried transferring contacts via Bluetooth from my PC, via Bluetooth and MMS from Pocket PC, but the phone did not like the contact format. In the end I tried the Motorola Phone Tools but it does not work on Windows 2003 Server :-( It installed OK but neither the Bluetooth Setup Wizard nor the Cable connection recognizes the device. I tried all sorts of ways to make it detect the phone but either the Motorola Phone Tools crashed or it looked for wmmodems.dat that was nowhere to be found on the CD. I was about to give up and copy the contacts via the SIM when I found the solution in a support forum:


Copy Detect.inf and modems.cab from the \MPT\Addons directory on the Motorola Phone Tools CD to  C:\Program Files\Motorola Phone Tools.


That's it. The next time I started it automatically recognized my device and synchronized my contacts.

3512.aspx

UGISS SQL Server event 27/2 in Milano

UGISS, the Italian SQL Server Users Group, is organizing a free event with Microsoft 27/2: SQL Server: una piattaforma integrata [Italian]


I get more and more respect for the conferences/work shops hosted by the various Italian User Groups each time I attend one. They are held by people that want to share their hard learned experience, not by someone who is paid to sell a product.


There will be two tracks in the afternoon; one for DBAs and one for developers.


Thanks for the tip Michele

Tuesday, February 6, 2007

3499.aspx

.NET Micro Framework

When Compact is not Compact enough; try the .NET Micro Framework. It is targeted at small devices like smart watches and SideShow


The main difference from the other .NET versions is that .NET Microsoft Framework does not require Windows. It runs in a few few hundred kilobytes of RAM, and as little as 512K of flash memory and brings the benefits of the CLR to small devices:




  • Enables writing of simpler, more fail-safe code through built-in support for garbage collection and exception handling.

  • Protects against errant execution by supporting only “safe” IL instructions.

  • Allows straightforward support for new hardware with the ability to write device drivers in C# for hardware connected through standard interfaces, such as SPI, I2C, GPIO, and USART.

All developed in the familiar environment of Visual Studio. The whitepaper has more information on the development process.


I have had a lot of fun (and hard times) with .NET Compact Framework. I hope I can get hold of a smart watch or a device with SideShow and take .NET Micro Framework for a spin.

Thursday, January 25, 2007

3442.aspx

Apple's FairPlay DRM declared illegal in Norway

The Consumer Ombudsman in Norway has ruled the Apple's Digital Rights Management system, FairPlay, illegal as only iPods can play songs bought on iTunes:



"It doesn't get any clearer than this. Fairplay is an illegal lock-in technology whose main purpose is to lock the consumers to the total package provided by Apple by blocking interoperability," Waterhouse told OUT-LAW.COM. "For all practical purposes this means that iTunes Music Store is trying to kill off one the most important building blocks in a well functioning digital society, interoperability, in order to boost its own profits."

"iTunes Music Store must remove its illegal lock-in technology or appear in court," he said. "As of right now we're heading for a big breakthrough that will hopefully pave the way for consumers everywhere to regain control of music they legally purchase."


The Consumer Council believes Apple has only three options: it can license Fairplay to any manufacturer that wants iTunes songs to play on its machines; it can co-develop an open standard with other companies; or it can abandon DRM altogether.


Sometimes I am proud of being Norwegian...

Tuesday, January 16, 2007

3355.aspx

Using regular expressions in SQL Server

Regular Expressions are very powerful when working with text, and in my case when detecting blog spam. I didn't feel like modifying .TEXT so I modified the DB to match comments against a list of "bad words". I replaced MT Blacklist with regular expressions after it went offline


The user function below matches a string against a regular expression. It works in all flavors of SQL Server that I have tried it on (SQL Server 2000 MSDE, SQL Server 2005 standard, Express and Express with Advanced Services). It has caught more than 12.800 spam comments since it went online :-) But more on the anti spam later, this is the function:


CREATE FUNCTION evalRegEx


 (


   @source varchar(5000),


   @regexp varchar(1000),


   @ignorecase bit = 0


 )


RETURNS bit


AS


 BEGIN


  DECLARE @hr integer


  DECLARE @objRegExp integer


  DECLARE @objMatches integer


  DECLARE @objMatch integer


  DECLARE @count integer


  DECLARE @results bit


 


  SET @results = 0


 


  EXEC @hr = sp_OACreate 'VBScript.RegExp', @objRegExp OUTPUT


  IF @hr = 0 BEGIN


    EXEC @hr = sp_OASetProperty @objRegExp, 'Pattern', @regexp


      IF @hr = 0 BEGIN


      EXEC @hr = sp_OASetProperty @objRegExp, 'Global', false


      IF @hr = 0 BEGIN


        EXEC @hr = sp_OASetProperty @objRegExp, 'IgnoreCase', @ignorecase


        IF @hr = 0 BEGIN


          EXEC @hr = sp_OAMethod @objRegExp, 'Test', @results OUTPUT, @source         


        END


      END   


    END


    EXEC @hr = sp_OADestroy @objRegExp


 END


 RETURN @results


 END



Example calls:



  • SELECT dbo.evalRegEx( 'this is a test',  'IS',  0)
    Returns 0

  • SELECT dbo.evalRegEx( 'this is a test',  'IS',  1)

  • Returns 1

 

Tuesday, January 9, 2007

3328.aspx

My Lego NXT progress and the iRobot Create

Once in a while I find projects like the Lego NXT Segway that makes me feel sorry for hardly using my Lego NXT.


The serious bots don't use the official Lego Mindstorms NXT graphical development environment but lower level tools like NBC (Next Byte Codes & Not eXactly C) for improved performance and added features like multithreading. But while coding in "C" makes it possible to make advanced bots it completely locks out my young kids. They are better at using the computer than my parents but they still have a long way before they start messing with threads… So, I have decided to put the "advanced" bots on the shelf for a while and have fun with the kids building basic bots instead. They love Lego and it is a great satisfaction to see something you have built move around autonomously.


If you think 250 euro is too much to spend on a toy, why not consider the iRobot Create. It is considerably cheaper and it can do something useful [via Bordoni]


BTW: remember to update the Lego Mindstorms software and Firmware if you have one. There are  new features like the "mini" building blocks that save memory.