Sunday, March 04, 2007

WTF??? Live Messenger size

Anyone, please tell me that it's only UI bug and Live messenger is not really 120MB!!!

Friday, March 02, 2007

Windows Vista 100% working Keygen

Nice title, ah? :) Let's wait for search engines robots to index it. Why this title? 'Cos, according Ben, Windows Vista can be cracked by simple brute-force attack. Yes, I know, this ugly and dumb long, but it's possible. Let's take it up...

Windows Vista key, as well as near all Microsoft's product keys, is build according following pattern: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx. Let's say, that I do not know what character should be and where, so I'm suppose, that we have deal with 25 alphanumeric characters. In English alphabet there is 26 case-insensitive characters and 10 numbers, so we have a deal with 3625 combinations, which about equals to 8 with 38 zeros. So, let's take really quick computer and do bruteforce over UI thread of Windows. In this case we can work with 10ms delay, so we can check 100 combinations a second. Now, in worse case, we'll find a key within 836 seconds, other words, about 90,000,000,000,000,000,000,000,000,000 hours, equals to 313,000,000,000,000,000,000,000,000 years. Pretty long isn't it? BUT there are some rules, discovered a couple of month ago, so, according them, we can minimize the number of possibilities to about 815. For some reason, I will not explain how, but in this case, even using UI validation and our brute-force attack, we can find the working key within about 66 years. BUT (another one) if we'll work without UI with a couple of hardcore computers, with a bit of luck and 6 million of China vendors, we'll find a golden key rather fast. So, should Microsoft be worry about this point? Maybe, within the next couple of years :)

Someone want to build such key generator?

Good Icons editor

Lack of VS icon editor? You are not alone. Recently I looked for freeware program to create and edit icons and I found one. Let me introduce IcoFX. Sufficient features and useful interface. I was disappointed, that the program has installer, but it can run from Disk-On-Key as well (either open msi and pick it out or install-copy exe-uninstall)

Here is the list of this soft features:

  • Vista support
  • Alpha channel support
  • Bach processing
  • Some effects (not really useful)
  • Support for icons upto 255X255X32bit
  • Import/Export (from assemblies as well with transparency support)
  • Blur or Sharp brush edges (this one is extremely important for icons creation)
  • Rotatings
  • File types conversion (with PNG support)

The really missing future - stroke, but anyhow, the program is great. Download and use it

Monday, February 26, 2007

Start programming your fridges with .NET framework embedded

Great news, now you can write C# for your fridge, microwave or washing machine. .NET Micro Framework 2.0 was released. Have a fun, but watch your steps, any bug you'll leave can blow your home.

Sunday, February 25, 2007

Autoexplainable listbox items

One of my clients requests the ability to "autoexpand" listbox items on item's selection. He showed me his code for it. You know... A lot of code-behind, that detects all unselected items and collapse them. Bad, very bad way.

I told him, that all this code (about 200 lines), I'll rewrite in WPF within a half line of the code. He agreed to challenge for 200 NIS, after seeing WPF books...  

The first thing I need is to create DataSource. Really simple, only for presentation. Next step, is to connect datasource to listbox. Simple as well.

<XmlDataProvider x:Key="myData" XPath="Items/Item"/>
<ListBox IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Source={StaticResource myData}}"/>

Next, we need a data template:
<Expander Header="{Binding XPath=Title}" Width="300">
<TextBlock TextWrapping="Wrap" Text="{Binding XPath=Article}"/>
</Expander>

Piece of cake, no? And now, the magic half-line, that worth 50$ :). Expander has IsExpanded dependency property. The ListBoxItem has IsSelected dependency property. Let's connect them. But how? While creating DataTemplate for ListBoxItem, the WPF creates "virtual" item for us, so the Expander becomes ListBoxItem and we have to take it's DP. We'll ask him to find ancestor from underlying type, named ListBoxItem and go to IsSelected property. Isn't is clear as shine?

IsExpanded="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}},Path=IsSelected}"

That's all folks. Now each Expander inside ListBox will be Expanded if the underlying data item is Selected, else, it'll be collapsed.

The additional way to do the same thing is by using Styles and data triggers, but it's already more then a half line of code. Too bad :)

See yourself

1) DataTriggers (5 lines)

<DataTemplate x:Key="myItem">
<Expander Name="exp" Header="{Binding XPath=Title}" Width="300">
<TextBlock TextWrapping="Wrap" Text="{Binding XPath=Article}"/>
</Expander>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}, AncestorLevel=1}, Path=IsSelected}" Value="True">
                    <Setter Property="IsExpanded" Value="True" TargetName="exp" />
  </DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>

2) Styles (7 lines)

<Style TargetType="{x:Type ListBoxItem}">
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Expander.IsExpanded" Value="True" />
            </Trigger>
        </Style.Triggers>
 </Style>

Thank you WPF. (The source code for this article)

Friday, February 23, 2007

Roxio central in WPF

More and more companies move their products to WPF. Actually, why now? Great technology, which able us to create outstanding UI with no time. FX-effects, geek-oriented user experience.

New version of CD/DVD burning software from Roxio proofs my claims. Look yourself to free Roxio Central (beta), build completely with WPF. Great work.

Monday, February 19, 2007

Windows DreamScene Preview

For all those, who distributed internally DreamScene and told everyone not to show it to anyone, just notice, that today Windows DreamScene is officially distributed via Vista Extras optional update. Now, you can put live video instead of your wallpaper.