12 April, 2010

Things to install on a new machine – revisited

Things to install on a new machine – revisited: by
as I prepare to get a new dev machine at work, I write the things I am going to install on it, before writing the first line of code on that machine:
Control Freak Tools:
  1. Everything Search Engine – a free and amazingly fast search engine for files all over your machine. (just file names, not inside files). This is so fast I use it almost as a replacement for my start menu, but it’s also great for finding those files that get hidden and tucked away in dark places on my system. Ever had a situation where you needed to see exactly how many copies of X.dll were hiding on your machine and where? this tool is perfect for that.
  2. Google Chrome. It’s just fast. very fast. and Firefox has become the IE of alternative browsers in terms of speed and memory. Don’t even get me started on IE.
  3. TweetDeck – get a complete view of what’s up on twitter
  4. Total Commander – my still favorite file manager, over five years now.
  5. KatMouse – will scroll any window your hovering on, even if it’s not an active window, when you use scroll the wheel on it.
  6. PowerIso or Daemon Tools – for loading up ISO images of discs
  7. LogMeIn Ignition – quick access to your LogMeIn computers
  8. for online Backup: JungleDisk or BackBlaze
  9. KeePass – save important passwords
  10. MS Security Essentials – free anti virus that’s quoest and doesn’t make a mess of your system.
  11. for home: uTorrent – a torrent client that can read rss feeds (like the ones from ezrss.it )
  12. Camtasia Studio and SnagIt – for recording and capturing the screen, and then adding cool effects on top.
  13. Foxit PDF Reader – much faster that adove reader.
  14. Toddler Keys (for home) – for when your baby wants to play with your keyboard.
  15. Live Writer – for writing blog posts
  16. for Lenovo ThinkPads – Lenovo System Update – if you have a “custom” system instead of the one that came built in, this will keep all your lenovo drivers up to date.
  17. FileZilla – for FTP stuff
  18. All the utils from sysinternals, (or try the live-links) especially: AutoRuns for deciding what’s really going to load at startup, procmon to see what’s really going on with processes in your system
Developer stuff:
  1. Reflector. Pure magic. Time saver. See source code of any compiled assembly.
  2. Resharper. Great for productivity and navigation across your source code
  3. FinalBuilder – a commercial build automation tool. Love it. much better than any xml based time hog out there.
  4. TeamCity – a great visual and friendly server to manage continuous integration. powerful features.
  5. Test Lint – a free addin for vs 2010 I helped create, that checks your unit tests for possible problems and hints you about it.
  6. TestDriven.NET – a great test runner for vs 2008 and 2010 with some powerful features.
  7. VisualSVN – a commercial tool if you use subversion. very reliable addin for vs 2008 and 2010
  8. Beyond Compare – a powerful file and directory comparison tool. I love the fact that you can right click in windows exporer on any file and select “select left side to compare”, then right click on another file and select “compare with left side”. Great usability thought!
  9. PostSharp 2.0 – for addind system wide concepts into your code (tracing, exception management). Goes great hand in hand with..
  10. SmartInspect – a powerful framework and viewer for tracing for your application. lots of hidden features.
  11. Crypto Obfuscator – a relatively new obfuscation tool for .NET that seems to do the job very well.
  12. Crypto Licensing – from the same company –finally a licensing solution that seems to really fit what I needed. And it works.
  13. Fiddler 2 – great for debugging and tracing http traffic to and from your app.
  14. Debugging Tools for Windows and DebugDiag - great for debugging scenarios.
still wanting more?
I think this should keep you busy for a while.
  1. Regulator and Regulazy – for testing and generating regular expressions
  2. Notepad 2 – for quick editing and viewing with syntax highlighting

The Evolution Of C#

The Evolution Of C#: by

The Evolution Of C#The first release of C# (C# 1.0) was all about building a new language for managed code that appealed, mostly, to C++ and Java programmers.

The second release (C# 2.0) was mostly about adding what wasn’t time to built into the 1.0 release. The main feature for this release was Generics.

The third release (C# 3.0) was all about reducing the impedance mismatch between general purpose programming languages and databases. To achieve this goal, several functional programming features were added to the language and LINQ was born.

Going forward, new trends are showing up in the industry and modern programming languages need to be more:

  • Declarative

    With imperative languages, although having the eye on the what, programs need to focus on the how. This leads to over specification of the solution to the problem in hand, making next to impossible to the execution engine to be smart about the execution of the program and optimize it to run it more efficiently (given the hardware available, for example).

    Declarative languages, on the other hand, focus only on the what and leave the how to the execution engine. LINQ made C# more declarative by using higher level constructs like orderby and group by that give the execution engine a much better chance of optimizing the execution (by parallelizing it, for example).

  • Concurrent

    Concurrency is hard and needs to be thought about and it’s very hard to shoehorn it into a programming language. Parallel.For (from the parallel extensions) looks like a parallel for because enough expressiveness has been built into C# 3.0 to allow this without having to commit to specific language syntax.

  • Dynamic

    There was been lots of debate on which ones are the better programming languages: static or dynamic. The fact is that both have good qualities and users of both types of languages want to have it all.

All these trends require a paradigm switch. C# is, in many ways, already a multi-paradigm language. It’s still very object oriented (class oriented as some might say) but it can be argued that C# 3.0 has become a functional programming language because it has all the cornerstones of what a functional programming language needs. Moving forward, will have even more.

Besides the influence of these trends, there was a decision of co-evolution of the C# and Visual Basic programming languages. Since its inception, there was been some effort to position C# and Visual Basic against each other and to try to explain what should be done with each language or what kind of programmers use one or the other. Each language should be chosen based on the past experience and familiarity of the developer/team/project/company and not by particular features.

In the past, every time a feature was added to one language, the users of the other wanted that feature too. Going forward, when a feature is added to one language, the other will work hard to add the same feature. This doesn’t mean that XML literals will be added to C# (because almost the same can be achieved with LINQ To XML), but Visual Basic will have auto-implemented properties.

Most of these features require or are built on top of features of the .NET Framework and, the focus for C# 4.0 was on dynamic programming. Not just dynamic types but being able to talk with anything that isn’t a .NET class.

Also introduced in C# 4.0 is co-variance and contra-variance for generic interfaces and delegates.

Stay tuned for more on the new C# 4.0 features.

Date and Time Support in SQL Server 2008

Date and Time Support in SQL Server 2008: by

Using the New Date and Time Data Types

1. The new date and time data types in SQL Server 2008 offer increased range and
precision and are ANSI SQL compatible.

2. Separate date and time data types minimize storage space requirements for applications
that need only date or time information. Moreover, the variable precision of
the new time data type increases storage savings in exchange for reduced
accuracy.

3. The new data types are mostly compatible with the original date and time data types
and use the same Transact-SQL functions.

4. The datetimeoffset data type allows you to handle date and time information in global
applications that use data that originates from different time zones.


SELECT c.name, p.* FROM politics p
JOIN country c
ON p.country = c.code
WHERE YEAR(Independence) < 1753
ORDER BY Independence
GO
8. Highlight the SELECT statement and click Execute ( ) to show the use of some of the date functions.
T-SQL
SELECT c.name AS [Country Name],
CONVERT(VARCHAR(12), p.Independence, 107)
AS [Independence Date],
DATEDIFF(YEAR, p.Independence, GETDATE())
AS [Years Independent (appox)],
p.Government
FROM politics p
JOIN country c
ON p.country = c.code
WHERE YEAR(Independence) < 1753
ORDER BY Independence
GO

10. Select the SET DATEFORMAT statement and click Execute ( ) to change the DATEFORMAT to day-month-year.
T-SQL
SET DATEFORMAT dmy
GO
11. Select the DECLARE and SELECT statements and click Execute ( ) to show how the datetime and datetime2 data types interpret a date literal.
T-SQL
SET DATEFORMAT dmy
DECLARE @dt datetime = '2008-12-05'
DECLARE @dt2 datetime2 = '2008-12-05'
SELECT MONTH(@dt) AS [Month-Datetime], DAY(@dt)
AS [Day-Datetime]
SELECT MONTH(@dt2) AS [Month-Datetime2], DAY(@dt2)
AS [Day-Datetime2]
GO
12. Highlight the DECLARE and SELECT statements and click Execute ( ) to use integer arithmetic on a datetime variable.
T-SQL
DECLARE @dt datetime = '2008-12-05'
SELECT @dt + 1
GO

13. Highlight the DECLARE and SELECT statements and click Execute ( ) to show how integer arithmetic is not allowed for datetime2 variables.
T-SQL
DECLARE @dt2 datetime = '2008-12-05'
SELECT @dt2 + 1
GO
14. Highlight the DECLARE and SELECT statements and click Execute ( ) to show how to use DATE functions to do simple arithmetic on datetime2 variables.
T-SQL
DECLARE @dt2 datetime2(7) = '2008-12-05'
SELECT DATEADD(d, 1, @dt2)
GO
15. Highlight the DECLARE and SELECT statements and click Execute ( ) to show how the GETDATE function can be used with both datetime and datetime2 data types.
T-SQL
DECLARE @dt datetime = GETDATE();
DECLARE @dt2 datetime2(7) = GETDATE();
SELECT @dt AS [GetDate-DateTime], @dt2 AS [GetDate-DateTime2]
GO
16. Draw attention to the values returned for both columns and how they are equal.
17. Highlight the DECLARE and SELECT statements and click Execute ( ) to show how the SYSDATETIME function can be used with both datetime and datetime2 data types.
T-SQL
DECLARE @dt datetime = SYSDATETIME();
DECLARE @dt2 datetime2(7) = SYSDATETIME();
SELECT @dt AS [Sysdatetime-DateTime], @dt2
AS [Sysdatetime-DateTime2]
GO
18. Draw attention to the values returned for both columns and how they are different.

Programming Global Applications with DateTimeOffset


2. If you have not previously created the SQLTrainingKitDB database while completing another demo in this training kit, highlight the CREATE DATABASE statement and click Execute ( ) to do so now.
T-SQL
CREATE DATABASE SQLTrainingKitDB
GO
3. Select the USE and CREATE TABLE statements and click Execute ( ) to create table datetest in the SQLTrainingKitDB database.
T-SQL
USE SQLTrainingKitDB
GO

CREATE TABLE datetest (
id integer IDENTITY PRIMARY KEY,
datetimecol datetimeoffset,
EnteredTZ varchar(40)
);

Reference:http://www.microsoft.com/downloads/details.aspx?FamilyID=E9C68E1B-1E0E-4299-B498-6AB3CA72A6D7&displaylang=en