Meeting the needs of your business from a distance

Tutorials for graphic design and programming

by Mark Shiffer 30. November 2007 20:56

Found a website that may be helpful: TutsBuzz 

Not sure I will use the programming side much, but the graphics side looks interesting to me. I have yet to dedicate a great deal of time to becoming good at graphics creation/editing, but, in the past, I have found tutorials like this a quick way to get up to speed.

Tags: ,

Programs | Websites | Graphics

BugMeNot - Find and share logins for websites that force you to register

by Mark Shiffer 29. November 2007 17:17

Find and share logins for websites that force you to register:

BugMeNot

Tags:

Websites

Reading

by Mark Shiffer 29. November 2007 14:52

I have decided to make a lofty goal for myself. I would like to begin reading one non-fiction book a month, mostly technical. There are some challenges to pulling this off, such as, balancing family and work with reading. In addition, I have never been the fastest reader. I take my time and mull over things as I read. Furthermore, I have several side projects going on right now that I really want to finish. Also, I have fallen behind on my MSDN magazine reading; so I need to kick that up as well. Despite all of this, here is my desired schedule for the next few months:

  • December 2007: CLR via C# Second Edition by Jeffrey Richter

I have worked in C# for quite some time now, and I have come to the realization that you only get a limited view of the language based upon the projects you are coding on. In other words, there is a great deal of the language that I am missing out on, or could use refreshers on. I'm looking forward to this read as a way to dive deeper into the C# language. 600+ pages are going to make this a challenge for me to fit into 1 month.

  • January 2008: Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides

This one is a classic, and believe it or not, I have never actually read it. My undergrad program did not use this book as many other computer science programs do. Most design patterns are commonsense to a seasoned programmer, none-the-less, I still think it will be helpful to give the book a read. 350+ pages.

  • February 2008: Debugging Microsoft.NET 2.0 Applications 2005 Edition by John Robbins

This one I am hoping will be a quick once-over read just to let me know what is in the book so that I can later use it for reference. There are several items in the book that get deep into debugging that will certainly come in handy every once in a while. I would like to know the more advanced techniques that are out there, so that I can employ them as needed. 400+ pages, but I doubt I'll give it as thorough of a read as the CLR book. 

 As I find more books to put on my schedule I will update this post. Here's for hoping!

 

Tags: , ,

Research

String.Intern

by Mark Shiffer 28. November 2007 19:26

I just happened to run across this and found it interesting. I am just documenting it here for my future reference. This is straight from the MS docs on the subject: 

The common language runtime conserves string storage by maintaining a table, called the intern pool, that contains a single reference to each unique literal string declared or created programmatically in your program. Consequently, an instance of a literal string with a particular value only exists once in the system.

For example, if you assign the same literal string to several variables, the runtime retrieves the same reference to the literal string from the intern pool and assigns it to each variable.

The Intern method uses the intern pool to search for a string equal to the value of str. If such a string exists, its reference in the intern pool is returned. If the string does not exist, a reference to str is added to the intern pool, then that reference is returned.

In the C# example that follows, the string, s1, which has a value of "MyTest", is already interned because it is a literal in the program.

The System.Text.StringBuilder class generates a new string object that has the same value as s1. A reference to that string is assigned to s2.

The Intern method searches for a string that has the same value as s2. Since such a string exists, the method returns the same reference that is assigned to s1, then that reference is assigned to s3.

References s1 and s2 compare unequal because they refer to different objects, while references s1 and s3 compare equal because they refer to the same string.

 String s1 = "MyTest";
 String s2 = new StringBuilder().Append("My").Append("Test").ToString();
 String s3 = String.Intern(s2);
 Console.WriteLine((Object)s2==(Object)s1); // Different references.
 Console.WriteLine((Object)s3==(Object)s1); // The same reference.
 

Compare this method to the IsInterned method.

Version Considerations
Starting with the .NET Framework version 2.0, there is a behavioral change in the Intern method. In the following C# code sequence, the variable str1 is assigned a reference to Empty, the variable str2 is assigned the reference to Empty that is returned by the Intern method, then the references contained in str1 and str2 are compared for equality.

string str1 = String.Empty;
string str2 = String.Intern(String.Empty);
if ((object) str1) == ((object) str2) …
 

In the .NET Framework version 1.1, str1 and str2 are not equal, but starting in the .NET Framework version 2.0, str1 and str2 are equal.

Performance Considerations
If you are trying to reduce the total amount of memory your application allocates, keep in mind that interning a string has two unwanted side effects. First, the memory allocated for interned String objects is not likely be released until the common languange runtime (CLR) terminates. The reason is that the CLR's reference to the interned String object can persist after your application, or even your application domain, terminates. Second, to intern a string, you must first create the string. The memory used by the String object must still be allocated, even though the memory will eventually be garbage collected.

Tags: ,

Research

Standard Design Patterns

by Mark Shiffer 20. November 2007 16:16

This is list is from the classic "Design Patterns: Elements of Reusable Object-Oriented Software" by Gamma, Helm, Johnson and Vlissides.

Creational:

1. Abstract Factory - families of product objects

2. Builder - how a composite object gets created

3. Factory Method - subclass of object that is instantiated

4. Prototype - class of object that is instantiated

5. Singleton - the sole instance of a class

Structural:

1. Adapter - interface to an object

2. Bridge - implementation of an object

3. Composite - structure and composition of an object

4. Decorator - responsibilities of an object without subsclassing

5. Facade - interface to a subsystem

6. Flyweight - storage costs of objects

7. Proxy - how an object is accessed; its location

Behavorial:

1. Chain of Responsibility - object that can fulfill a request

2. Command - when and how a request is fulfilled

3. Interpretor - grammar and interpretation of a language

4. Iterator - how an aggregate's elements are accessed, traversed.

5. Mediator - how and which objects interact with each other

6. Memento - what private information is stored outside an object, and when

7. Observer - number of objects that depend on another object, how the dependent objects stay up-to-date

8. State - states of an object

9. Strategy - an algorithm

10. Template Method - steps of an algorithm

11. Visitor - operations that can be applied to object(s) without changing their classes

Tags:

Research

Common Software Redesign Causes and Design Patterns to Help Avoid Them

by Mark Shiffer 20. November 2007 15:56

This is paraphrased/summarized from the classic "Design Patterns: Elements of Reusable Object-Oriented Software" by Gamma, Helm, Johnson and Vlissides.

1. Creating an object by specifying a class explicitly: Abstract Factory, Factory Method, Prototype

2. Dependence on specific operations: Chain of Responsibility, Command

3. Dependence on hardware or software platform: Abstract Factory, Bridge

4. Dependence on object representations or implementations: Abstract Factory, Bridge, Memento, Proxy

5. Algorithmic dependencies: Builder, Iterator, Strategy, Template Method, Visitor

6. Tight coupling: Abstract Factory, Bridge, Chain of Responsibility, Command, Facade, Mediator, Observer

7. Extending functionality by subclassing: Bridge, Chain of Responsibility, Composite, Decorator, Observer, Strategy

8. Inability to alter classes conveniently: Adapter, Decorator, Visitor

Tags:

Research

Making Form Controls Thread Safe

by Mark Shiffer 20. November 2007 15:26
I recently came across this tid-bit of information and thought I would document it for myself. Windows Forms controls are not thread safe. Therefore, when attempting to update a control from another thread you must take special precautions. An example of where this would be helpful would be in updating a progress bar or other UI control when running a batch process on another thread. To accomplish this, the InvokeRequired property of the control should be used along with the Invoke or BeginInvoke method. Invoke required will return True when the caller is on a different thread then the control was created on. In that case, you then need to call Invoke with a delegate that will get run on the control's thread.

Tags: , , ,

Research | Programs

Some shopping websites

by Mark Shiffer 18. November 2007 05:53

I've been a long time fan of fatwallet. It is a great way to keep up on deals and random finance related talk. Although the finance side has turned more into an App-O-Rama board than anything, which is something I have little interest in. The interest rate arbitrage is interesting, and maybe if I had more time and more trust in the credit card companies and credit rating companies, I would do one myself.

Another site that I haven't used much, but was recently listed in PC-Mag is Dealio. This is a price finder website/aggregator. Seems to work alright, but there are plenty out there already; PriceGrabber, PriceWatch, etc...

Slickdeals is another site much like fatwallet. However, it seems to get better traffic on the deal side than fatwallet. If I am ever shopping for something significant (a computer or something), I keep an eye on both slickdeals and fatwallet for a while before pulling the trigger. I just recently saw in PC-mag that slickdeals has a fillers function on their website. It helps you find the least expensive item(s) necessary to make the 25$ free shipping at Amazon possible.

Tags: ,

Websites

Visual Studio Team Foundation Server

by Mark Shiffer 17. November 2007 05:27

I recently installed Visual Studio Team Foundation Server and I must say this was the worst install experience that I have ever had with a product. Microsoft intertwined this product with so many dependencies and made it so brittle that I am concerned that my move to team for source control was a mistake. However, I am going to give it a shot to see how it works. We are about to make the move at work (full-time job) and figure I should investigate. So far, I am not too impressed with the client. It is missing many key features and/or makes them difficult to accomplish. I'm still at the new stage so we will see how things play out.

 One word of advice for anyone who is installing team server: Read the documentation and carefully follow EVERY step for the installation. Do not deviate, even in the slightest, or you will get burned. It is ridiculous how touchy the install process is. I seriously doubt that I can afford to stay on Team System at home for my source control due to its fragility. Maybe 2008 will be better.

Tags: ,

Issues | Programs

Forefront Client Security

by Mark Shiffer 17. November 2007 05:19

I recently installed Forefront Client Security on my network. I had to roll back WSUS to version 2.0 for the install to go through and then install WSUS 3.0 afterwards. Unfortunately, the Client Update for Microsoft Forefront Client Security would not automatically go down to computers until the actual client was installed manually from the DVD; it said not applicable. Maybe that is the way that it was supposed to work, but my understanding from reading the documents was that it was supposed to be the initial client install. Regardless, my network is fairly small so I just installed the client manually. Everything is up and going now and appears good to go. Hopefully it continues that way.

 I have not had anti-virus or anti-spyware on any of my computers for a very long time. For the longest time I was the only one that did much of anything on my computers and the network was secured so I was not concerned about viruses or malware. However, my wife has begun doing more work (and play) from home and she does not always know what is best when surfing the web and how to avoid being the victim of a scam/phish/virus. So here I go, off with Forefront which is a fairly new Microsoft product. Hopefully it won't make me regret it.

Tags: , , , , ,

Programs

Copyright © 2001-2012 MS Consulting, Inc. All Rights Reserved.