DCSIMG
June 2009 - Posts - IronShay

June 2009 - Posts

Farewell to My Speaker System - Creative GigaWorks S750

At the beginning of the week I came back home and immediately smell something… It was the smell of a computer-related burn (I’m sure you’re familiar with that smell!).

I ran to my media center PC and started smelling it (picture that all you want!) but it was OK… Had the same Dolche Gabbana perfume I had put on it on the morning (kidding! really!).

Then I went on to smell the next possible victim – the subwoofer. The sub of the GigaWorks S750 acts as the amplifier of the whole system… So as well as the subwoofer itself, it has an entire system inside. This was when it hit me – The subwoofer was dead. It was also when I realized that the green LED hadn’t worked as well… so I guess I could have passed the smelling of my HTPC and realize there was something wrong with the subwoofer right away…

Anyway…

I’ve been in this computer industry for years and have played  around with hardware a bit so I decided to open it up… maybe I could dust it a bit and everything would go back to normal.

After screwing off various screws (and it had quite a few!) I opened the box and found out an astonishing  picture… It was like a gremlin had exploded inside the subwoofer! several pieces had this yellow melting-like spume around theme… I bet this isn’t a good thing…

See for yourself:
Click on the image to open a higher resolution version.

How my GigaWorks S750 looks from inside

 

The thing is that I’m not the first one to run into this problem. Google (or bing if you really insist) “gigaworks s750 problem” and you’ll get a bunch of results. Here there is a similar image of mine!

Well, my speaker system is dead, so I’m going to buy a new amplifier. You can still save the money and buy a better product.

Creative Labs, please take this problem into consideration.

Beware of subwoofer gremlins,
Shay.

Posted by shayf | 7 comment(s)
תגים:

WinForms in IronRuby

IronRuby holds so much potential. I can say from my perspective, that since I’ve been playing around with it, I became more and more enthusiastic about it and sure that it’s going to succeed big time.

However, IronRuby still has a few drawbacks. They focus mainly on the the lack of Visual Studio support and its side-effects. WinForms is one of the technologies that suffer from this shortcoming. Do you expect me to develop WinForms without the precious designer? I know everyone has their love-hate relationship with the VS designer, but taking it away entirely is just too much to handle.

Well, that’s what I’m here for - to hand you a solution!

I’ve written an IronRuby script (actually, it will run on MRI as well) that will convert a winform designer code (C# only currently) to IronRuby code. By using the script, you can use the VS designer and create the form you want. After you’re finished, run the script and voila – you have all the designer code in IronRuby code!

I won’t explain the code here (maybe I’ll write another post about it, not sure) but in short, it uses regular expressions to find several C# things and replaces them to ruby things…

The file

The ruby source file can be downloaded from here.

(if someone is willing to help me uploading it to GitHub, please do :) ).

How to use it?

First, you need to load the ruby library. The file is named “win_forms_converter.rb” so just start by requiring it:

require “win_forms_converter.rb” # Assuming it appears within the current directory

The library contains one single method accessible from WinFormsConverter.convert_winform. The method receives three parameters:

  • designer_file – the path to the form designer file. For example, C:\Dev\WinForm\Form1.designer.cs.
  • target_file – the path of the new IronRuby file. For example, C:\Dev\IronRubyWinForm\Form1.rb.
  • target_main_file – optional parameter. The path of the form runner file. If this parameter exists, a file will be created on the given path that executes the created form. For example, C:\Dev\IronRubyWinForm\main.rb.

REPL Example

This is a sample command prompt session for converting a WinForm to IronRuby and run it:

______________________

C:\>d:

D:\>cd demo

D:\Demo>ir
IronRuby 0.5.0.0 on .NET 2.0.50727.4016
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require  "win_forms_converter.rb"
=> true
>>> WinFormsConverter.convert_winform('Form1.designer.cs','D:\Demo\IR\form1.rb','D:\Demo\IR\main.rb')
Converting designer file from Form1.designer.cs
Done.
Creating IronRuby file at D:\Demo\IR\form1.rb
Done
Creating main file at D:\Demo\IR\main.rb
Done
Conversion is finished.
=> nil
>>> exit

D:\Demo>cd IR

D:\Demo\IR>ir main.rb

_______________________

Pay ATTENTION

This is the very very first version of this convertor. I haven’t tested it deeply and I’m kind of freeing it to the wild so you people can take it and make it much better.

If you need any explanation about the source  code, you have comments, you’ve found bugs or whatever, you’re welcome to contact me via the contact page or via twitter @ironshay.

Hope it helps,
All the best,
Shay.

Posted by shayf | with no comments