Namek Dev
a developer's log
NamekDev

Interface with basic implementation in C#

February 2, 2013

Today we have simple question:

How to avoid abstract classes by giving base implementation?

The story

Once in a time I was building animation system which was planned to be used in IGWOCTISI project. It happened that I wanted to created some predefined tweens (animated translations) like ScaleTo, MoveTo, RotateBy and so on.

In the horizon appeared a requirement which was pretty straightforward:

public class MoveTo<T> : Animation<T>
        where T : ITransformable

The fact was that my type T not always was able to be some Transformable object.

→ Continue reading csharp, gamedev

Better Memento

November 4, 2012

Today I asked myself - how to use Memento design pattern to store object state in a more safe and effective way? Of course by automating some things using some base implementation. Read about why I needed better Memento and how did I achieved nice combination of Memento and Command design patterns. Full code is given.

→ Continue reading csharp

Why is Ruby so entertaining? Mixins.

August 16, 2012

Ruby

Ruby [0] is a simple, yet powerful language, thanks to which developers are enabled to create or programmatically sketch many things in a fast manner. It’s good for prototyping GUI (Shoes [1]), web development (Rails [2], Merb [3]) or even for network administrator’s scripting (for massive or scheduled actions).

The question today is - why are there so many people interested in that language? I think that one of strong features are mixins.

→ Continue reading ruby

Immutability of Java's Integer

July 6, 2012

As Wiki states

In object-oriented […], an immutable object is an object whose state cannot be modified after it is created.

That totally applies to Java’s Integer. Let’s take a look at the code to talk about:

Integer a = 5;
Integer b = a;
b = b+1;
System.out.println("a = " + a);  // a = 5
System.out.println("b = " + b);  // b = 6

Integer is a class then why variables a and b have different values?! - you may ask. See the explanation if eager.

→ Continue reading

Swype language on Milestone 2

December 1, 2011

Motorola Milestone 2 showed up with built-in Swype app. It’s handy but for those whose mostly used language is installed in it. My language wasn’t there so what can I do to use Swype? The only way was to uninstall old version and install the newer one.

→ Continue reading

Visual Studio 2010 also may be messy

November 9, 2011

My C: partition on Windows is too small so sometimes I have problems with space. I have made a recent discovery that not only Windows itself but also Visual Studio 2010 is an out-of-space-situation helper.

C:\ProgramData\Microsoft Visual Studio\10.0\TraceDebugging

This is where you may find lots of files which will not be probably needed anymore. I’ve just deleted **2.5GB **from there. I’ve got shocked it would be that much.

I recommend WinDirStat. It’s a cool and simple application that helped me to find the path given above.