Thursday, June 10, 2010

POSIX(R) Threads

Reading "Programming with POSIX(R) Threads".

Asynchronous:
Any two operations are “asynchronous” when they can proceed independently of each other.

Amazon wish list

“If seven maids with seven mops
Swept it for half a year,
Do you suppose,” the Walrus said,
“That they could get it clear?”
“I doubt it,” said the Carpenter,
And shed a bitter tear.

—Lewis Carroll, Through the Looking-Glass


  • pthread_t thread;
  • int pthread_equal (pthread_t t1, pthread_t t2);
  • int pthread_create ( pthread_t *thread, const pthread_attr_t *attr, void *( *start) (void *), void *arg);
  • pthread_t pthread_self (void);
  • int sched_yield ( void);
  • int pthread_exit ( void *value_ptr);
  • int pthread_detach ( pthread_t thread);
  • int pthread_join ( pthread_t thread, void **value_ptr);

Windows Network Tips

ipconfig /all
ping
tracert
pathping
netstat
nslookup
netsh
netsh diag gui
netsh interface ip show joins
systeminfo
net statistics workstation
uptime
hh ntcmds.chm

Tuesday, June 8, 2010

Exception.ToString() vs. Exception.Message

ToString is superior than Message. Very useful for debugging purposes!


using System;
using System.Collections.Generic;
using System.Text;


namespace ExceptionToString
{
    public class MyClass {}


    public class ArgExceptionExample 
    {
        static void Main(string[] args)
        {
            MyClass my = new MyClass();
            string s = "sometext";


            try 
            {
                int i = s.CompareTo(my);
            }
            catch (Exception ex) 
            {
                Console.WriteLine("Error: {0}\n", ex.ToString());
                Console.WriteLine("Error: {0}", ex.Message);


                Console.Read();
            }
        }
    }
}