Monday, October 29, 2007

Links for 2007-10-29

MSDN Articles:
  1. Handling Data - Winforms data binding architecture is discussed and MVC pattern is recommended in designing Winfrom applications. Also, how DataSet contents can be merged is introduced.
  2. Occasionally Connected Smart Clients - Issues associated with data reconciliation in an occasionally connected environment are discussed.

Saturday, October 27, 2007

Links for 2007-10-27

Articles:
  1. AI: It's OK Again! - two camps in AI, symbolism, such as expert systems, and connectionism, such as neural networks, are discussed in the article.
  2. Algorithmic Trading
    • Most trading algorithms can be divided into two parts, i.e., when to trade and how to trade. An approach, Complex Event Processing(CEP), is suggested to simplify the development of trading algorithms. Thus, trading algorithms can be structured as a set of CEP rules and hosted inside a CEP engine.
    • Event Stream Intelligence with Esper and NEsper - an open source tool for developing CEP applications on .NET platform.

References for Multi-Threaded .Net WinForm Programming

MSDN Articles:
  1. Using Multiple Threads(ch.6 in Smart Client Architecture and Design Guide) - details why, when and how to call Control.Invoke in the UI thread.
  2. Creating a Simplified Asynchronous Call Pattern for Windows Forms Applications - proposes a ServiceAgent class to encapsulate the interaction between background threads and the UI thread.
  3. Creating Asynchronous Business Objects for Use in .NET Windows Forms Clients - proposes some helper classes and events to simplify the asynchronous invocation process.
Blogs:
  1. WinForms UI Thread Invokes: An In-Depth Review of Invoke/BeginInvoke/InvokeRequred - describes how Control.Invoke works underneath
  2. The Daemon Inside - suggests one try Control.BeginInvoke when Control.Invoke does not work because deadlock might happen.
Podcast:
  1. Thread-Safe Asynchronous Smart Clients

Friday, October 12, 2007

SQL joins

I came across a great post about SQL joins. Below is the example I tried out on Oracle9i.

SQL> create table TableA (id integer, name varchar(20));
SQL> insert into TableA values (1, 'Pirate');
SQL> insert into TableA values (2, 'Monkey');
SQL> insert into TableA values (3, 'Ninja');
SQL> insert into TableA values (4, 'Spaghetti');
SQL>
SQL> create table TableB (id integer, name varchar(20));
SQL> insert into TableB values (1, 'Rutabaga');
SQL> insert into TableB values (2, 'Pirate');
SQL> insert into TableB values (3, 'Darth Vader');
SQL> insert into TableB values (4, 'Ninja');
SQL>
SQL> SELECT * FROM TableA
2 INNER JOIN TableB
3 ON TableA.name = TableB.name
4 order by TableA.id, TableB.id;
     ID NAME                         ID NAME                          
---------- -------------------- ---------- --------------------
1 Pirate 2 Pirate
3 Ninja 4 Ninja
SQL>
SQL> SELECT * FROM TableA
2 FULL OUTER JOIN TableB
3 ON TableA.name = TableB.name
4 order by TableA.id, TableB.id;
       ID NAME                         ID NAME                            
---------- -------------------- ---------- --------------------
1 Pirate 2 Pirate
2 Monkey
3 Ninja 4 Ninja
4 Spaghetti
1 Rutabaga
3 Darth Vader
SQL>
SQL> SELECT * FROM TableA
2 LEFT OUTER JOIN TableB
3 ON TableA.name = TableB.name
4 order by TableA.id, TableB.id;
       ID NAME                         ID NAME                            
---------- -------------------- ---------- --------------------
1 Pirate 2 Pirate
2 Monkey
3 Ninja 4 Ninja
4 Spaghetti
SQL>
SQL> SELECT * FROM TableA
2 LEFT OUTER JOIN TableB
3 ON TableA.name = TableB.name
4 WHERE TableB.id IS null
5 order by TableA.id, TableB.id;
        ID NAME                         ID NAME                             
---------- -------------------- ---------- --------------------
2 Monkey
4 Spaghetti
SQL>
SQL> SELECT * FROM TableA
2 FULL OUTER JOIN TableB
3 ON TableA.name = TableB.name
4 WHERE TableA.id is null
5 OR TableB.id is null
6 order by TableA.id, TableB.id;
       ID NAME                         ID NAME                             
---------- -------------------- ---------- --------------------
2 Monkey
4 Spaghetti
1 Rutabaga
3 Darth Vader
SQL>
SQL> SELECT * FROM TableA
2 CROSS JOIN TableB;
       ID NAME                         ID NAME                             
---------- -------------------- ---------- --------------------
1 Pirate 1 Rutabaga
2 Monkey 1
3 Ninja 1
4 Spaghetti 1
1 Pirate 2 Pirate
2 Monkey 2
3 Ninja 2
4 Spaghetti 2
1 Pirate 3 Darth Vader
2 Monkey 3
3 Ninja 3

ID NAME ID NAME
---------- -------------------- ---------- --------------------
4 Spaghetti 3 Darth Vader
1 Pirate 4 Ninja
2 Monkey 4
3 Ninja 4
4 Spaghetti 4
SQL>
SQL> drop table TableA;
SQL> drop table TableB;

Thursday, October 11, 2007

Secret of Successful People

I came across a good post from here. The seven basic disciplines of a happy and successful life are as follows,
  • Take a new perspective and keep on learning new skills.
  • Assume responsibility - If you see a problem, do something about it.
  • Reach out - The most important working relationships are the personal ones.
  • Stay flexible and learn to thrive with changes and challenges.
  • Follow your heart and live your life with passion.
  • Take risks.
  • Set goals and never give up on them.
And it reminds me the book, The Seven Habits of Highly Effective People also has 7 rules,
  • Be Pro-active.
  • Begin with the End In Mind.
  • Put First Things First.
  • Think Win/Win.
  • Seek First to Understand, Then to be Understood.
  • Synergize describes a way of working in teams.
  • Sharpen the saw.
What a coincidence! And there are some similarity between them. Anyway, it's good to have something like these to remind me from time to time.