Devexpress have a bunch of .NET components (you need to download their 175MB DXExperience8.2.4 exe file to try it out). If IIS is not installed, you'll see an error "cannot create virtual directories". Don't worry about that.
XtraCharts suite - Harvard Graphics style pie charts (2d and 3d), donut charts, Gantt charts
XtraPivotGrid - integrates with charts, nice!
I Bless Thy Command Shell My Child: + {az account list --output table}
Friday, 10 October 2008
Sunday, 5 October 2008
Embrace the API: Programming Model Re-engineering (aka Aggressive API refactoring)
Forget Refactoring. Meet your new friend - Programming Model (aka API) Re-engineering - Microsoft-Style. Microsoft are veterans in re-inventing existing programming models. Here are some examples, and related jabberings:
Flex versus WPF
Despite the pain of adapting to new programming models, libraries need to adapt to change, which means PEOPLE (consumers) also need to change. This brings me on to my next point concerning PEOPLE'S ATTITUDES to programming model re-engineering.
"The difference between greatness and mediocrity in Windows programming can be perceived in many ways. One metric is the speed by which the Windows Programmer can quickly adapt to radically different programming models. The Great One will be able to assimilate new APIs massively quickly and start programming in them straight away, no matter how intractable and problematic the API may initially seem. On sensing a new API approaching, the senses of the Windows programming are immediately sharpened, instinct kicks in and a process of lightning-fast power-learning is initiated. The millions of programs the Great One has written are instantly referenced and put into the context of the new API function calls. Automatic memorisation commences. Like an avid art collector, the SuperPower Windows Programmer desires to acquire API mastery swiftly and add to their ever-expanding skills collection. The SuperPower Windows Programmer may even be willing to embrace functionally-inferior but more modern APIs . Contrast this with the mediocre programmer, their emotional response is a negative one, a slow process of gradual learning and conscious and pained memorisation commences. Thus SuperPower Windows Programmers are quantum leaps ahead of their sub-par rivals. They are like eagles soaring above, surveying everything, their rivals are like meerkats down below, constantly digging up the dust to hide from predators".
Flex versus WPF
Despite the pain of adapting to new programming models, libraries need to adapt to change, which means PEOPLE (consumers) also need to change. This brings me on to my next point concerning PEOPLE'S ATTITUDES to programming model re-engineering.
"The difference between greatness and mediocrity in Windows programming can be perceived in many ways. One metric is the speed by which the Windows Programmer can quickly adapt to radically different programming models. The Great One will be able to assimilate new APIs massively quickly and start programming in them straight away, no matter how intractable and problematic the API may initially seem. On sensing a new API approaching, the senses of the Windows programming are immediately sharpened, instinct kicks in and a process of lightning-fast power-learning is initiated. The millions of programs the Great One has written are instantly referenced and put into the context of the new API function calls. Automatic memorisation commences. Like an avid art collector, the SuperPower Windows Programmer desires to acquire API mastery swiftly and add to their ever-expanding skills collection. The SuperPower Windows Programmer may even be willing to embrace functionally-inferior but more modern APIs . Contrast this with the mediocre programmer, their emotional response is a negative one, a slow process of gradual learning and conscious and pained memorisation commences. Thus SuperPower Windows Programmers are quantum leaps ahead of their sub-par rivals. They are like eagles soaring above, surveying everything, their rivals are like meerkats down below, constantly digging up the dust to hide from predators".
Friday, 3 October 2008
Mantra-Based Programming and the "Programming Athlete"
Here's a great article on athletic performance which I think is very relevant to programmers. Read the article in reverse. The section on negative emotions affecting the athlete due to "concentration loss" is a typical one, particularly towards the end of a long coding session when tiredness has already set in.
If you feel your coding session is going haywire take the following actions. Consciously control the flow of your thoughts, don't act/code anything without feeling you are in a state of calmness and complete control over your coding. Stop time in your own mind. Stop being a whirlwind, breathe and see the bigger picture.
Use mantras to refocus your mind.
Then go back and finish your program.
If you feel your coding session is going haywire take the following actions. Consciously control the flow of your thoughts, don't act/code anything without feeling you are in a state of calmness and complete control over your coding. Stop time in your own mind. Stop being a whirlwind, breathe and see the bigger picture.
Use mantras to refocus your mind.
Then go back and finish your program.
Prototyping Numerical Algorithms in Windows - Excel as a Viable Alternative to Matlab
Excel spreadsheets and VBA are good tools for prototyping numerical algorithms. There's just a few things you need to know to get the most out of the experience, a few tricks and a few traps. Once you have the prototype, you can implement the results in a more industrial-strength framework (I like C++/C#).
Writing a Custom Worksheet Function in MS Excel (Alt-F11, Alt-Q)
Excel is a remarkable product that can be customised. Starting with the basics, everyone should know how to write a custom worksheet function in Excel. Example: Write a worksheet function that returns 2*PI.
Alt-F11 (make sure the cell is not in edit mode)
Function TwoPi() As Double
TwoPi = 2 * Excel.WorksheetFunction.Pi
End Function
Alt-Q
Excel worksheet functions only recalculate when their inputs change. If you change the definition of the function, and the arguments remain the same, the function will not recalculate with shift-F9. I discovered this bug when I tried to change a function definition dynamically at run-time, using a set of cells to specify coefficients. Changed the def, pressed shift-F9 and ... nothing happened.
Macro Security (Digital Signed Macros)
If your macro security level is set to high you will only be able to run signed macros from trusted sources. Alt-TMS will allow you to change your settings. Alt-TD in the VBA editor will help you set digital signatures for your macros.
Option Explicit
When developing algos in VB Option Explicit is your friend. Avoid creating variable names implicitly, which can lead to difficulty debugging your algorithm.
Function Overloading in Excel VBA Macros
This is not allowed. Any attempt to do so will result in "Ambiguous Name detected". I think this is ok for the simplicity of the language. You can get round this by putting version numbers on your overloaded functions.
Name Lookup Bugs in Excel 2002
Create custom worksheet function. Call it F. Rename it to F1. Rename it to F. #NAME error. Rename it back to F1. It works. May need to do a few iterations before you see the bug.
There are other name lookup errors that can occur which are not bugs. For example, editing a function in a module in worksheet A and testing it out in worksheet B will not work. Each worksheet is effectively a separate namespace.
Min/Max in Excel VBA
Writing a Custom Worksheet Function in MS Excel (Alt-F11, Alt-Q)
Excel is a remarkable product that can be customised. Starting with the basics, everyone should know how to write a custom worksheet function in Excel. Example: Write a worksheet function that returns 2*PI.
Alt-F11 (make sure the cell is not in edit mode)
Function TwoPi() As Double
TwoPi = 2 * Excel.WorksheetFunction.Pi
End Function
Alt-Q
Excel worksheet functions only recalculate when their inputs change. If you change the definition of the function, and the arguments remain the same, the function will not recalculate with shift-F9. I discovered this bug when I tried to change a function definition dynamically at run-time, using a set of cells to specify coefficients. Changed the def, pressed shift-F9 and ... nothing happened.
Macro Security (Digital Signed Macros)
If your macro security level is set to high you will only be able to run signed macros from trusted sources. Alt-TMS will allow you to change your settings. Alt-TD in the VBA editor will help you set digital signatures for your macros.
Option Explicit
When developing algos in VB Option Explicit is your friend. Avoid creating variable names implicitly, which can lead to difficulty debugging your algorithm.
Function Overloading in Excel VBA Macros
This is not allowed. Any attempt to do so will result in "Ambiguous Name detected". I think this is ok for the simplicity of the language. You can get round this by putting version numbers on your overloaded functions.
Name Lookup Bugs in Excel 2002
Create custom worksheet function. Call it F. Rename it to F1. Rename it to F. #NAME error. Rename it back to F1. It works. May need to do a few iterations before you see the bug.
There are other name lookup errors that can occur which are not bugs. For example, editing a function in a module in worksheet A and testing it out in worksheet B will not work. Each worksheet is effectively a separate namespace.
Min/Max in Excel VBA
Amazingly VBA doesn't have a min/max function!!! So use Excel's instead (example: Application.Max(5,2)).
Random Number Generation
In Matlab you can use the function rand(10) to choose a number between 1 and 10. To do this in Excel you can use the function RANDBETWEEN(1, 10) but this relies on Analysis ToolPak being a valid add-in in your Excel. If you don't have access to Analysis ToolPak you can write the following worksheet function:
Function Random() as Double
Randomize: Random = Excel.WorksheetFunction.Ceiling( Rnd * 10, 1)
End Function
Custom Worksheet Functions in C#
Msdn Blog Post on Excel C#.
Programming Addicts
England's Guardian runs an awesome story on exercise addiction, called "Kicking the Habit". Could the same psychological affliction affect modern-day computer programmers?
Furthermore, are some programmers addicted to both programming AND exercise? What drives people to such addiction?
"Exercise addiction" is a term coined by Dr William Glasser , the "Warren Buffet of psychiatry", in a 1976 study of long-distance runners. He identifies a negative addiction when a SINGLE DAY away from the gym or pool causes distress. For some programmers, perhaps a day away from programming causes distress, hence we see the parallel's with Glasser's study.
But Why? Is it the endorphins of exercise, the joy of achieving something or just the impulse of crazy competition taking control of our psyche?
Originally a chemical engineer, Dr Glasser went into psychiatry when he realised that was his real interest in life. Who can blame him? Psychiatry is an important and fascinating discipline! As Donald Trump famously states: "Don't Waste Your Life on Work You Don't Love; Passion Will Help You Do Better". Read the blog of The Donald here.
In the 5th Century BC, psychotic traits were considered supernatural in origin (see wikipedia).
Furthermore, are some programmers addicted to both programming AND exercise? What drives people to such addiction?
"Exercise addiction" is a term coined by Dr William Glasser , the "Warren Buffet of psychiatry", in a 1976 study of long-distance runners. He identifies a negative addiction when a SINGLE DAY away from the gym or pool causes distress. For some programmers, perhaps a day away from programming causes distress, hence we see the parallel's with Glasser's study.
But Why? Is it the endorphins of exercise, the joy of achieving something or just the impulse of crazy competition taking control of our psyche?
Originally a chemical engineer, Dr Glasser went into psychiatry when he realised that was his real interest in life. Who can blame him? Psychiatry is an important and fascinating discipline! As Donald Trump famously states: "Don't Waste Your Life on Work You Don't Love; Passion Will Help You Do Better". Read the blog of The Donald here.
In the 5th Century BC, psychotic traits were considered supernatural in origin (see wikipedia).
The Relevance of Charles Petzold's Programming Windows in a Modern .NET World
Charles Petzold has released a new book on 3D Programming using WPF. He is best known for his classic tome Programming Windows (using C and the Win32 API). But is this "Windows programmers bible" still relevant in today's world of .NET? Windows Joe takes a look....
Some might say that the Mighty Programming Windows using C and the Windows API is a topic only of historical relevance. Certainly the modern .NET programmer has no business using the Windows API in day-to-day programming ...in theory. What happens when an API function isn't exposed in the .NET framework. Well, we could just expose it manually in .NET and be done with it ....do we really need to know what's going on inside, or read a thousand plus pages to work out Windows' inner workings?
It all boils down to one thing. Do you WANT to be the best Windows programmer in the world or don't you? If the answer is an unwavering, unhesitating YES then you NEED, I repeat, NEED, to read Charles' book on Programming Windows quick-time. Don't delay.
Charles talks about the history of Windows and facts every aficionado of the operating system should know of the top of their hat - starting from Windows 1.0 "tiled windows" release in November 1985, the year "Iron Mike"/"The Baddest Man on the Planet" made his professional debut in Albany, NY, moving on to Windows 2.0 in 1987 (overlapping windows), the year the NY Giants defeated the Denver Broncos in the SuperBowl, then Windows 3.0 in 1990 (support for 16-bit protected mode in 286 and upwards), the year 300,000 people in Lithuania demonstrated for independence.
In April 1992, the legendary Windows 3.1 was released (a few months later in September, Black Wednesday took place, knocking the pound and lira out of the ERM). Hello TrueType fonts, OLE (remember OCX controls?) and standardized dialog boxes. Then Win95 in 1995 and Win98 in 1998. Charles summarises that the "Windows API has remained quite consistent since Windows 1.0" except in the area of function calls: "Windows 1.0 supported fewer than 450 function calls; today there are thousands". He also underlines the differences between Win16 and Win32. If you don't know about this, read the book.
The first program, which starts with #include windows.h(a header that includes a bunch of other headers like winbase.h for kernel functions) is the canonical start file for a Win32 program. Ah, the joys of WinMain!
Some might say that the Mighty Programming Windows using C and the Windows API is a topic only of historical relevance. Certainly the modern .NET programmer has no business using the Windows API in day-to-day programming ...in theory. What happens when an API function isn't exposed in the .NET framework. Well, we could just expose it manually in .NET and be done with it ....do we really need to know what's going on inside, or read a thousand plus pages to work out Windows' inner workings?
It all boils down to one thing. Do you WANT to be the best Windows programmer in the world or don't you? If the answer is an unwavering, unhesitating YES then you NEED, I repeat, NEED, to read Charles' book on Programming Windows quick-time. Don't delay.
Charles talks about the history of Windows and facts every aficionado of the operating system should know of the top of their hat - starting from Windows 1.0 "tiled windows" release in November 1985, the year "Iron Mike"/"The Baddest Man on the Planet" made his professional debut in Albany, NY, moving on to Windows 2.0 in 1987 (overlapping windows), the year the NY Giants defeated the Denver Broncos in the SuperBowl, then Windows 3.0 in 1990 (support for 16-bit protected mode in 286 and upwards), the year 300,000 people in Lithuania demonstrated for independence.
In April 1992, the legendary Windows 3.1 was released (a few months later in September, Black Wednesday took place, knocking the pound and lira out of the ERM). Hello TrueType fonts, OLE (remember OCX controls?) and standardized dialog boxes. Then Win95 in 1995 and Win98 in 1998. Charles summarises that the "Windows API has remained quite consistent since Windows 1.0" except in the area of function calls: "Windows 1.0 supported fewer than 450 function calls; today there are thousands". He also underlines the differences between Win16 and Win32. If you don't know about this, read the book.
The first program, which starts with #include windows.h
Good Programming Blogs (not just OK ones)
Check out Eric Lippert's Fabulous Adventures in Coding Eric is on the C# 4.0 Design Team and has worked on script engines previously.
Also check out this list of the top CLR bloggers.
Also check out this list of the top CLR bloggers.
Subscribe to:
Posts (Atom)