Archiv der Kategorie ‘Information Technology‘

Stop the internet printers

Montag, den 4. Mai 2009

I found this really cool website:

http://www.politiker-stopp.de/

The idea behind this page is to protest against politicians which are making new laws without understand the ways and meanings of the internet. The site claims that politicians often don’t know how to use computers so their only seeing websites as imprints of their employees. Therefore the site suggests to introduce the following CSS code into your site:


<style>
#print {display:none;} @media print {
 a,abbr,acronym,address,applet,area,b,base,basefont,
bdo,big,blockquote,br,button,caption,center,cite,code,
col,colgroup,dd,del,dfn,dir,div,dl,dt,em,fieldset,font,
form,frame,frameset,h1,h2,h3,h4,h5,h6,hr,i,iframe,img,
input,ins,isindex,kbd,label,legend,li,link,map,menu,meta,
noframes,noscript,object,ol,optgroup,option,p,param,pre,
q,s,samp,select,small,span,strike,strong,sub,sup,table,
tbody,td,textarea,tfoot,th,thead,title,tr,tt,u,ul,var {display:none;}
#print,#print img {
left:0;top:0;padding:0;margin:0;height:250mm;width:170mm;display:block !important;}
}
</style><div id="print">
<img src="http://www.politiker-stopp.de/gfx/politiker-stopp-print.png" />
</div>

This is a really cool idea although completly useless ;) Have fun by protecting your sites.

Part II: Mimic SynchronizationContext behaviour on .NET CF

Sonntag, den 15. Februar 2009

I just posted the second part of the article Part I: Mimic SynchronizationContext behaviour on .NET CF on planetgeek.ch! On the article I try to show how the basic behavior of the SynchronizationContext can be achieved on the .NET compact framework platform. Please refer to the article under:

http://www.planetgeek.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/

LaCie LaCinema Black Max

Dienstag, den 10. Februar 2009

I must admit that I’m not an owner of the LaCie LaCinema Black Max but I’m a proud owner of the popcorn hour A110. The popcorn hour A110 is a small media box which plays almost every video and audio format on the market. The media box includes portal services for youtube, google video, shoutcast and many more platforms. Although I’m very pleased with this box I want to present to you the latest news about LaCie LaCinema Black Max.

The LaCinema Black Max is shipped with the video codecs for MPEG-1, MPEG-2, MPEG-4, DIVX, XVID, H.264, MKV and WMV9 HD and is able to play video material up to 1.920 x 1.080p. VOB- or IFO structures without protection can be played directly on the media box without converting. The LaCinema Black Max is also able to upscale videos with less resolution up to 1080i.

The most exciting feature of the LaCinema is the integrated DVB-T module. The DVB-T module contains an integrated program guide which allows to use the black max as a video recorder with time shifting.

LaCinema supports the following audio codecs: MP3, WMA, AAC, OGG, AC3, MP4 and WAV. Pictures in the format JPEG, PNG, GIF, BMP and TIF can be directly viewed on the screen via the integrated photo viewer.

Unfortunately the integrated DVB-T module makes the LaCinema quite an expensive product. The current list prices for the LaCinema with 500 GB hard disk are about 650 swiss francs. This makes the LaCinema about 200 swiss francs more expensive than the popcorn hour A110 with integrated samsung F1 hard disk with 1 TB disk space.

But for those who want an all-in-one player and recorder which supports the latest and greatest high definition codecs the LaCinema Black Max is a “must buy”!

Here are some pictures (copyright by Lacie):

lacinemaBlackMax_1 lacinemaBlackMax_2
lacinemaBlackMax_3 lacinemaBlackMax_4
lacinemaBlackMax_5  

planetgeek.ch to the rescue

Montag, den 9. Februar 2009

As some of you may already have noticed some of my blog entries are now cross-posted on tracelight.ch and planetgeek.ch. A few weeks ago we decided to start a new blog project called planetgeek.ch. The goal of this blog is to provide geeky information to all ICT interested people. The language of the blog is English. We hope that we can provide some valuable and interesting information to you guys (both male and female!) out there in the world.

Please have a look and join us on planetgeek.ch! I can especially recommend the page “Ask a geek”!

Part I: Mimic SynchronizationContext behaviour on .NET CF

Sonntag, den 8. Februar 2009

Before I got into the details of the problem I want to briefly describe what the SynchronizationContext class really does and what it’s main purpose really is in the first part of the article. From that perspective I’m going to show how the basic functionality of the SynchronizationContext class can be implemented for the .NET compact framework in the second part of the article..

The msdn library documentation states:

Provides the basic functionality for propagating a synchronization context in various synchronization models.

I must admit the first time when I read this definition I didn’t really get the key point behind the SynchronizationContext class. Detailed look into the implementation of SynchronizationContext and its base classes provided me the following information:

The SynchronizationContext class is a class belonging to the System.Threading namespace. The SynchronizationContext provides a model to make the communication between threads easier and more robust especially if multiple threading contexts/apartments such as “UI threading context” etc. are present.

To get a deeper understanding of the definition above I want to give you a short example. Imagine if you have a separate thread performing an intense calculation such as calculating the n-th Fibonacci number. When the separate thread has finished its long running operation you want to display the n-th Fibonacci number on a user interface. Normally (without using the SynchronizationContext class) you would need to do the following (or at least something similar):

private delegate void FibonacciResultDelegate(long fibonacciResult);
 
private void MethodCalledByTheFibonacciThread(long fibonacciNumber)
{
   if( fibonacciResultTextBox.InvokeRequired)
   {
      FibonacciResultDelegate fibonacciDelegate =
         MethodCalledByTheFibonacciThread;
      fibonacciDelegate.Invoke(this, new object[] { fibonacciNumber });
      return;
   }
   fibonacciResultTextBox.Text = fibonacciNumber.ToString();
}


With the SynchronizationContext class we can invoke delegates in the context of a different thread. For the example above we could do the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public class FibonacciPresenter
    {
        private readonly Thread workerThread;
 
        private readonly SynchronizationContext context;
 
        private readonly IFibonacciView fibonacciView;
 
        public FibonacciWorker(IFibonacciView view)
        {
            fibonacciView = view;
 
            context = SynchronizationContext.Current;
 
            workerThread = new Thread(new ThreadStart(FibonacciCalc));
 
            workerThread.Start();
        }
 
        private void FibonacciCalc()
        {
            long result = CalculateFibonacciNumber( ... );
            context.Post(new SendOrPostCallback(delegate(object state)
            {
               fibonacciView.DisplayResult(result);
            }), null);
        }
 
        // details omitted...
    }

In code line 13 we can see how the SynchronizationContext is retrieved. The SynchronizationContex.Current property points to the SynchronizationContext of the thread where the FibonacciWorker was created (in my example the FibonacciWorker would be created in a control). Then the FibonacciCalc method can post (asynchronous) or send (synchronous) a SendOrPostCallback delegate containing the “job” which needs to be marshaled over the SynchronizationContext. Therefore the line fibonacciView.DisplayResult(result) would be invoked on the UI thread which allows us to remove the “invoke required” code parts and directly set the fibonacci calculation result to the textbox text property.

We can briefly summarize that the purpose of the SynchronizationContext is to post (asynchronous) or send (synchronous) SendOrPostCallback delegates in the correct threading context which simplifies marshaling.

Windows Mobile 6.5 information leaked

Samstag, den 24. Januar 2009

We don’t have to wait for the official announcements of Windows Mobile 6.5 to get the latest news about the mobile operating system. Yesterday a beta version of Windows Mobile 6.5 hast been leaked to the public which everyone can install on his qtek 9090.

Let me describe what is new in Windows Mobile 6.5 in counterpart to the Windows Mobile 6.1:

  • No finger friendly user interface
  • No multi touch
  • Internet Explorer Mobile 6 with flash support
  • Sliding Panels
  • Scroll without scrollbars
  • New screen lock
  • New applications such as market player, my phone

You can have a quick look at Windows Mobile 6.5 in the following two videos:

As you can see Windows Mobile 6.5 is a major disappointment. Hopefully Windows Mobile 7 will knock us out of the chair!

Rumors about Windows Mobile 6.5

Mittwoch, den 21. Januar 2009

There are rumors going around on the internet about the release of windows mobile 6.5. Some say that windows mobile 6.5 is never going to be released but other strongly believe that the new windows mobile 6.5 will be released soon.

Not long ago people were blogging on the internet that Microsoft is probably going to focus on windows 7 and it’s integration into the newest mobile devices. But that has not been approved by Microsoft.

And today some screenshots about windows mobile 6.5 came up out of never on the following blog:

http://wmpoweruser.com/?p=2536

Nobody can approve if these screenshots are real or just another horrible fake. We are staying put and watching the latest news on this topic. We’ll keep you guys posted!

Delegate.DynamicInvoke for .NET Compact Framework

Sonntag, den 18. Januar 2009

As you might already know I’m a certified windows mobile application developer. My speciality is hybrid application development for applications which target both the full .NET framework platform and also the mobile platform. Of course nobody wants to write the same code for each platform again so you have to come up with some tricks and solutions to overcome some limitations on the compact framework.

One such limitation is the missing Delegate.DynamicInvoke method. The Delegate.DynamicInvoke method allows to dynamically invoke delegates late-bound. That means normally when you are invoking a method via a delegate you actually need to have knowledge about the target type where the delegate gets executed. With Delegate.DynamicInvoke this is not longer necessary. The beauty of this is, that you can have base code like the following:

// Elsewhere
RegisterDelegate(SomeClass.SomeMethod);
RegisterDelegate(SomeOtherClass.SomeOtherMethod);
FireForAllWith(1, 2, 3, 4);
 
// Code in some utility
public void FireForAllWith(params object[] args)
{
   someGenericCollection.ForEach(dlg => dlg.DynamicInvoke(args));
}
public void RegisterDelegate(Delegate dlg)
{
   someGenericCollection.Add(dlg);
}

But if you try to use Delegate.DynamicInvoke in the compact framework your infrastructure code will not compile because for some obscure reasons microsoft decided not to implement Delegate.DynamicInvoke for .NET compact framework. Here is my solution to this problem:

I created an extension method for the delegate class with the name DynamicInvoke. This extension method uses a small trick to implement the DynamicInvoke behaviour of the full framework platform.

    public static class DelegateExtensions
    {
        public static object DynamicInvoke(this Delegate dlg, params object[] args)
        {
            return dlg.Method.Invoke(dlg.Target, BindingFlags.Default, null, args, null);
        }
    }

As you can see I’m using the delegates method property which returns a MethodInfo object. On the MethodInfo I’m able to call Invoke and pass the arguments to the bound method. But the problem here is that Invoke requires a target where the method gets executed. This is where the delegates target property comes into play. That’s the whole magic and you’re able to dynamically invoke late bound methods via Delegate.DynamicInvoke.

Download DelegateExtensions for the source code.

JetBrains released TeamCity 4.0

Samstag, den 6. Dezember 2008

JetBrains (the once who also developed the fabulous product ReSharper) released a new version of their distributed build management and continuous integration server. I have never had the possibility to test this integration server but it seems to me a fairly cool product. Especially the web interface is a lot more advanced than cruisecontrol.net.

The professional and opensource version is free of charge. Here is the licensing overview:

http://www.jetbrains.com/teamcity/buy/index.jsp

You can check out installation videos and live demos on this site:

http://www.jetbrains.com/teamcity/documentation/index.html

  • Fastest build feedback in the industry

    Adaptive tests re-ordering, on-the-fly test results reporting, configurable notifications, and even making build artifacts accessible before the build is ready — TeamCity keeps you in the know with the most recent build updates and intermediate results, and shows how well your changes integrate into the project sooner. Learn more about TeamCity Continuous Integration.

  • Faster builds, better scalability — with grid computing

    TeamCity: Build Grid Click to enlarge

    Distributed build management helps optimize your hardware resources utilization by parallelizing product builds within the build agents grid. With build chains support, you can even break down a single build procedure into several parts to run them on different build agents — both in sequence and in parallel — using the same set of sources in all of them. Learn about TeamCity Build Grid.

  • Clean and error-free code base

    TeamCity: Pre-tested Commit Click to enlarge

    TeamCity automates over 600 Java code inspections, code coverage and duplicates search — out of the box. It also builds, checks and runs automated tests on the server even before committing your changes — keeping your code base clean at all times. Learn more about Pre-tested Commit.

  • First-rate control over large-scale environments

    Administer your large-scale build infrastructure from a central Web 2.0 interface. Monitor your team performance and track responsibilities. Easily manage all your builds and hardware resources with detailed statistics and trends reports. Quickly add more build agents, when needed. Learn more about Build Management and Administration.

  • Easy setup and adoption

    TeamCity: Environments which TeamCity supoports Click to enlarge

    TeamCity is at home everywhere. It supports both Java and .NET development. Setup is quick and easy under any platform, and offers out of the box integration with the most popular IDEs, build tools, testing frameworks and version control systems. Installation is a breeze — only 3 minutes from free download to a fully deployed and functional server.

  • Extensibility

    TeamCity encourages improvements by providing Java API for all sorts of user modifications, from integration with other version control systems and build tools, to creating specific Web UI elements and custom reports. Learn more about developing TeamCity plugins.

http://www.jetbrains.com/teamcity/index.html

Linq to SQL is announced dead…

Mittwoch, den 3. Dezember 2008

Now it’s almost official:

[...]

We’re making significant investments in the Entity Framework such that as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios.  We are listening to customers regarding LINQ to SQL and will continue to evolve the product based on feedback we receive from the community as well.

Tim Mallalieu
Program Manager, LINQ to SQL and Entity Framework

http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx