20081011 Today’s Photo – The Zoo!
My last post was early September and my last visit to Zoo Negara was 17 years ago! My god, how times flies! I remember I visited it when I was in Primary 5. That time the whole family travelled by bus around Malaysia and I had car sickness almost throughout the whole trip. I've heard bad about the zoo and this visit is a solid proof. It is not well maintained and the animals don't look very healthy! How sad!
20080909 Today’s Photo – Panaroma
Joined a group of photography kakis to Batang Berjuntai (somewhere in/near Ijok) to snap photos of lotus. Was a great outing and always more fun to shoot in group (so that you can copy peoples' ideas!
) Anyway, this time remembered to snap some shots for panaroma purpose. Not bad I'd say (arrogant bugger!). Next time must remember to do so whenever the view is superb and I don't have a ultra-wide with me!
I personally like the second one more.Click here to view the full album
Stats: alive
c:\>ping psychoric
Pinging psychoric [Malaysia] with 32 tonnes of shit:
Reply from psychoric: shit=32 time=2months+ TTL=240
Reply from psychoric: shit=32 time=2months+ TTL=240
Reply from psychoric: shit=32 time=2months+ TTL=240
Reply from psychoric: shit=32 time=2months+ TTL=240
Ping statistics for psychoric: [breathing]
Woots, it is now close to 3 months since I last posted here. I don't think it is anything unusual as I always believe in procratisnating. There have been up and down. Family crap that I can't do much about unless if I can manage to cough out hundred of thousands, then I guess everyone will be worry free. But hell, I can't so I have to live with it. Yeah you will probably say there are people out there who are even more unfortunate than this. I know that. On the good side, I learnt that problem is not really a problem if everyone sticks together. Otherwise, problem creates problem. It is only partially true that money plays a critical role in a family. The lack of it causes worries, grudges, arguments. But if you think deeper, it is not the real reason. The actual cause is on each member of the family. Shoud everyone understand the situation and adapt to it considerately, the effects of any problem are minimized. Communication is also very important to sustain a marriage, a family, a relationship. Many times we have seen cases of sad ending that are caused by breakdown in communication. When individuals are able to sit down and talk calmly, I believe nothing is impossible. What's the point of bottling matters up and in the end causes an explosion that requires even more effort to clean up?
Anyway, enough of those important-in-life theories. MIFC was on last month and I managed to shoot 2 countries of the many. You can find the pictures here and here.Apart from this, nothing much fancy to share, except that I am stepping my feet into MOSS 2007 (Sharepoint). So far, it is a new and smooth experience. But I guess I can say so before I bang into the limiting walls that many have run into. Any exciting upcoming events to look forward to? That will be visiting Bali at the end of October and a new job
Ciao for now!
20080626 Today’s Photo – Multiple mE!
Got this idea from a photography forumer. His work is way better but i like mine too!
Basically it shows my main activities at home
Weird to see so many of yourself at the same time...
20080624 Today’s Photo
Ah, been a while since my last post
Was too bored on a Sunday afternoon and actually spent some times in bathroom to take pictures of water droplets. Yeah, i was really bored
Anyway, managed to come out with the picture below. What do you think? Feel free to use it as your wallpaper
Click for the full size
20080527 Today’s Photo
Finally had a chance to get my hands on a set of extension tubes (in case you are blur, extension tube is meant for macro photography). Played around with it for couple of hours and am really amazed at the result! Well i am not praising my shooting skill but the details that you can capture with it. Paired it with my faithful EF 50mm f/1.8, it can do magic!
One of the OK shots
Project SsSS
Ha! Been almost a month since the last post. This project is my first into the world of DIY in photography. I love DIY!
So what do you do with a empty box lying around? (actually i got mine from MPH warehouse sales)
Cut off the flaps. You can leave them too as 'extension' or 'box-hood'
Draw the lines on where you wanna cut. Size is up to you
I cut 3 sides. You can cut 4 if you like
Book wrapper isn't just for book! It is used here as a 'diffuser' for the lighting
There you go, a bare box. You can add on by adding white paper as the inner wallpaper
Tested with lighting. Note that the light temperature isn't suitable. Go for one with cool daylight.
Added a near black background paper. Aw, wrong type as you can see reflection on the paper
Test shot without the background
Test shot with the background
Cheap and easy, you have a photo tent for product shot or anything you can fit in there. With 3 openings, you can add on or move the lighting anywhere you like.
Cost
------------------
Paper box : FOC
Book wrapper: RM1.90
Paper background: RM0.60
Tools: I am sure you have it around your household
Total: RM2.50
Result: Priceless
Bonus: You do your part in recycling!
Oh, what's SsSS? My own-made-up-acronym that stands for Small stuff Shooting Studio!
C# Generic Comparer
This morning I ran into a situation where i need to sort an array of ServiceController before binding into a combobox. So I looked around and I found Array.Sort (or List
private class ServiceControllerSort : IComparer<ServiceController> { public int Compare(ServiceController x, ServiceController y) { return string.Compare(x.DisplayName, y.DisplayName, true); } }
Now what? What if next time I want to sort on my ExtendedServiceController class (as if there is necessity to do one)? I will have more and more IComparer implementations. I decided to explore further and this page says it all. Took the code, clean it up and woots, I have a generic comparison class that is usable for almost all types.
/// <summary> /// Custom sorter based on property /// </summary> /// <typeparam name="T">Target Type</typeparam> public class ExtSortComparer<T>: IComparer<T> { private ListSortDirection _sortDirection = ListSortDirection.Ascending; private PropertyDescriptor _targetPropDescriptor; /// <summary> /// Constructor /// </summary> public ExtSortComparer() { } /// <summary> /// Constructor /// </summary> /// <param name="PropertyName">Name of property to sort on. Case sensitive.</param> public ExtSortComparer(string PropertyName) { _targetPropDescriptor = TypeDescriptor.GetProperties(typeof(T))[PropertyName]; } /// <summary> /// Constructor /// </summary> /// <param name="PropertyName">Name of property to sort on. Case sensitive.</param> /// <param name="SortDirection">Sort direction</param> public ExtSortComparer(string PropertyName, ListSortDirection SortDirection) : this(PropertyName) { _sortDirection = SortDirection; } /// <summary> /// Constructor /// </summary> /// <param name="TargetProperty">Descriptor of property to sort on</param> public ExtSortComparer(PropertyDescriptor TargetProperty) { _targetPropDescriptor = TargetProperty; } /// <summary> /// Constructor /// </summary> /// <param name="TargetProperty">Descriptor of property to sort on</param> /// <param name="SortDirection">Sort direction</param> public ExtSortComparer(PropertyDescriptor TargetProperty, ListSortDirection SortDirection) { _targetPropDescriptor = TargetProperty; _sortDirection = SortDirection; } /// <summary> /// Compare two given object /// </summary> /// <param name="x">Object A</param> /// <param name="y">Object B</param> /// <returns>Result of comparison</returns> public int Compare(T x, T y) { //ensure there is proper property description if (_targetPropDescriptor != null) { int intRetValue = _CompareValues(_targetPropDescriptor.GetValue(x), _targetPropDescriptor.GetValue(y)); //reverse the sorting if descending if (_sortDirection == ListSortDirection.Descending) return intRetValue * -1; return intRetValue; //return the result } return 0; //return neutral if insufficient information to sort } /// <summary> /// Compare values of target property /// </summary> /// <param name="ValueX">Value of property (Object A)</param> /// <param name="ValueY">Value of property (Object B)</param> /// <returns>Result of comparison</returns> private int _CompareValues(object ValueX, object ValueY) { if (ValueX is IComparable) //if X can be compared return ((IComparable)ValueX).CompareTo(ValueY); if (ValueY is IComparable) //else if Y can be compared return ((IComparable)ValueY).CompareTo(ValueX); //when both can't be compared, resort to string value. return ValueX.ToString().CompareTo(ValueY.ToString()); } }
The comments should explain what is happening internally. Another good addition to my common library! If you have any thoughts, shoot!
New accessories: Pop-up flash diffuser
Been very long time since i bought any camera stuff and i came across this should-be-useful item while surfing with no aim. I managed to find it at one of the local online store and instantly made an order. The total damage, RM40. The item reached my hand today (prompt shipping, thumbs up!) so immediately ran a test trial with it. Let the results speak themselves
| Without | With |
So what do you think? Is it worth the purchase? I think it does coz sometimes you wouldn't want a harsh light especially on closer subjects.
C# Generic Constraints
Generic is a new wonder in .NET with the flexiblity it introduces to coders. But when you wish to explore further, you might face the limitation of only able to work with Object capabilities. This is because generic doesn't know your type details, and since all types are Object, so you only have Object to play with. To overcome this, we have Where keyword in C# (VB.net has As, i think). Apart from be able to constraint the types that generic accept, it also allows you to use the constraints capabilities.
Generics support few types of constraints:
- Interface: Allow only types that implement specific interfaces to use your generic.
- Class/Base class: Allow only types that match or inherit from a specific base class to use your generic.
- Constructor: Require types that use your generic to implement a parameterless constructor.
Say you have a custom Interface as below
public interface IMyCustomOne
{
string WhatsMyName();
}
and a generic method
public bool CheckNameEqualJohn<T>()
{
return (T.WhatsMyName == "John");
}
Compiler will throw you at the instant you try to build.
To solve this, we add Where at the end
public bool CheckNameEqualJohn<T>() where T : IMyCustomOne
{
return (T.WhatsMyName == "John");
}
Woots, compiler is now happy! The obstacle has been removed and off you go to maximize your creativity. If you need 2 constraints, how to go about it?
public class MyClass<T,U>
where T : IMyCustomT
where U : IMyCustomU
{
//....
}
Some additional jargons about this constraint that will make you look cooler in front of your peers
Unbound Type Parameter
Basically this refers to the most basic way of us using generic
public class MyClass<T>
{
//....
}
Naked Type Constraint
When a generic type parameter is used as constraint
public class MyClass<T>
{
public void MethodOne<U>(U param) where U : T
{
//....
}
}
Happy Generic'ing!