August 2007 - Posts

Here Comes oFone!
19 August 07 08:58 PM | adrian | with no comments

The news been around for some time, but some of you might haven't heard about it yet. This phone is not an ordinary phone. It runs Windows Mobile, it's not yet released, and best of all, it has a circular screen!

http://www.youtube.com/v/WazA77xcf0A

For you who doesn't have enough bandwith to view the video, here's a quick recap over the features:

  • it's programmable using Visual Studio (since it runs Windows Mobile 6). But remember, the screen is circular instead of rectangular. So you'll need to create objects with radius instead of height and with.
  • it has e-mail access support.
  • programmable number keys!
  • fixes on the first ROM update (very Microsoft).

SPOILER ALERT:

Well, it's not actually a phone, but it's a creative advertising for the new Windows Mobile 6 screen factor. It has bigger resolution and higher DPI, and also both portrait and landscape. Circular? Not yet.

Share this post: | | | |
Filed under:
Visual Communication
05 August 07 04:52 PM | adrian | 6 comment(s)

It's not a new industry, being part of the advertising since day 1. But lately, Web 2.0 boom and bigger bandwith offers much more Visual Communication opportunities within the web.

What's in it for Indonesian market? Well, for starter, Indonesian web pages sucks big time in design. No question. Take a look at leading detik.com (can be found in, well, www.detik.com), there's no telling little visual aesthetics are there. Flashy ads, flash animations, and yellow over blue? That's gross. Or take a look into KapanLagi (www.kapanlagi.com), same gross. Can't Indonesian people create elegant websites?

Well, apparently some smaller and unique sites are better. Asia Blogging Network (www.asiablogging.com) is fresh and clean, although not far from the "template of a blog" feeling. CabeIjo (www.cabeijo.com) the Microsoft Expression community for Indonesia feels like a designer brand, though the printed-matter style is clearly visible.

Okay, we might not want to see the web as the hallmark of Indonesian design results. But still, nowhere else can we see good design. Indonesian TV advertisements are well known for their lack of quality, misleading, uneducative, and often repeated in one slot. The best ones came from cigarette companies and happens once in every year (the independence day marketing campaign). Printed ads are better, because this is the biggest chunk of the industry (middle-upper class reads more magazine than watch TV).

This is why I'm starting a company that do visual communication, specifically that involves with computers. Web pages, corporate presentations, application user interfaces, advertisements, packaging designs, product designs, wedding materials, you name it! We're going to create not only the best, but also the most unforgettable aesthetics you could ever imagined. We're going to create it on top of Microsoft platform; Silverlight, Expression, Vista, Office to reach the broadest audience possible without compromising quality. We will call it: Aurei (Latin translation: "gold coins") and tagged: "design redesigned".

Details coming.

Share this post: | | | |
Attribute Inheritance Quirks
04 August 07 08:36 AM | adrian | 1 comment(s)

I was playing with class inheritance AND attributes today, and found out quite a shocking truth (or maybe shocking design, whichever worse).

The truth is: member attributes are always inherited, whether you set the Inherited property in the AttributeUsageAttribute to true or false. This, of course, have some implication that needs to be resolved.

For your better understanding, please review the code below:

  [AttributeUsage(AttributeTargets.All, Inherited = false)]
  public class TestAttribute : Attribute
  {
    private string name;
    public string Name
    {
      get { return name; }
      set { name = value; }
    }
  }

That is the code for the Attribute we're testing (TestAttribute). I've designed it to be attachable to anything (class, method, property, etc.) and not inheritable.

This attribute is set on the class code like the following:

  [Test(Name = "Class Declaration")]
  public class BaseClass
  {
    [Test(Name = "Field Declaration")]
    public int id;
    [Test(Name = "Property Declaration")]
    public int Id
    {
      get { return id; }
      set { id = value; }
    }
    [Test(Name = "Method Declaration")]
    public void Function() { }
  }

I've put an attribute into the class and members. To test the inheritance, I've created a subclass that has nothing:

  public class ChildClass : BaseClass { }

Through Reflection, I've been able to retrieve all members and attributes in the ChildClass.

    private static void Main(string[] args)
    {
      Type type = typeof(ChildClass);

      foreach (TestAttribute attribute in type.GetCustomAttributes(false))
        Console.WriteLine(attribute.Name);
      
      MemberInfo[] minfos = type.GetMembers();
      foreach (MemberInfo info in minfos)
      {
        object[] attributes = info.GetCustomAttributes(false);
        foreach (TestAttribute attribute in attributes)
          Console.WriteLine(attribute.Name);
      }

      Console.ReadLine();
    }

And here's the result:

08_04_2007 08_12

For those who are clueless, this means that you can still access the attributes on the derived class even though you have specifically set the Inherited positional parameter on the attribute to false. The only way to unset this inheritance is to declare an overriding member on the ChildClass.

But then, what if I wanted to override member AND still get an inheritable attribute. Should setting "Inherited = true" does the job? Well, apparently not.

  public class ChildClass : BaseClass
  {
    public override void Function()
    {
    }
  }

I've modified the ChildClass to override one of the members of the BaseClass, changed the Inherited parameter on the attribute, and voila, here's what happens:

08_04_2007 08_21

Boom! This means that the attribute is NOT inherited through overriding. So my current conclusion is the Inherited positional parameters does not work as expected OR there is something wrong with my attribute-getter code (through Reflection).

Anyone has an experience with this?

The end solution I would like to achieve is attribute compartmenting, where attributes from a class does not get propagated to its subclasses with as little code as possible (currently it's already possible, but requires shadowing inherited members with private visibility).

Share this post: | | | |
C# 2.0: Coalescing?
02 August 07 06:46 PM | adrian | 3 comment(s)

When I write:

profile.LastName != null ? profile.LastName : " "

Resharper recommended coalescing into:

profile.LastName ?? " "

What's this? Any help is appreciated.

Share this post: | | | |
Hello Safari!
01 August 07 09:45 PM | adrian | with no comments

Just now, Apple has released yet another Beta for their Safari web browser for the PC. This update resolves security issues and, from what I've seen, stability improvements. For example, I can now write in a textbox, where previous version (the first and the updated first) does not even allow me to write a single character in any textbox.

Safari has more quirks though, shortcuts and things you usually be able to do in IE or FF suddenly gone. Notable ones are:

  • MCE formatting doesn't work (had to edit the hyperlinks using HTML mode).
  • Ctrl+Enter to automagically prepend "http://www." and append ".com" to the address bar doesn't work.
  • One click on the address bar doesn't select all text automatically (needs triple-click to do that).
  • Silverlight plugin crashes Safari (both in Beta, can't have anyone blamed, yet)
  • Rendering speed... just the same. Can't feel the difference (using Indosat M2 3.5G service if you're wondering) between this and IE7.
  • Middle clicking on the tabs doesn't close them (I assume Apple fanboys are too dumb to use any more than one button in their mouse). 

Apart from it's quirks, Safari still a good browser though... Nice text renderings (yes, they're different than Windows ClearType) and support a lot of CSS+JavaScript common in Web 2.0 world. Tested www.wikimu.com and www.trendigital.com and both looks perfect.

UPDATE: Well, apparently after long writings, Safari cannot use MCE at all. I'm writing this back on IE... Down with Safari! :D

Share this post: | | | |
Filed under: