It is possible.
I think this is possibly the most elegant code I've written as a professional programmer.
A lot of thought went into making it that small and simple.
Here's hoping it only gets better.
Friday, February 5, 2010
Beautiful C++
Posted by
R. McDougall
at
12:23 AM
0
comments
Links to this post
Labels: functional programming, programming, work
Wednesday, January 20, 2010
ラナ子 Forever
スミコはどこから
やってきたのでしょう
スミコ、スミコ
welcome、ん~、スミコ
あなたの心の
遠い思い出から
スミコはやってくるのです
スミコはどこかに
帰るのでしょうか
スミコ、スミコ
goodbye、お~、スミコ
あなたの心の
あたたかい場所で
スミコはいつもいっしょです
大人はみんな、こわい顔
それでいてみんな、さみしそう
でもね、忘れないで
笑顔あふれたあのころを
なつかしくて
あたたかで
スミコはとてもかわいい子
スミコ、スミコ
できることなら
いつまでも
スミコ、スミコ
forever、スミコ
スミコは時々
見えなくなります
スミコ、スミコ
come back、お~、スミコ
あなたの心が
汚れたときに
スミコは見なくなるのです
大人になれば
辛いこと
悲しいことが
あるでしょね
でもね、いつでも戻れる
やさしかった、あのころに
なつかしくて
あたたかで
スミコはとてもかわい子
スミコ、スミコ
できることなら
いつまでも
スミコ、スミコ
forever、スミコ
Sunday, November 29, 2009
How he hires
While ago I wrote an entry on how I hire.Today I came across this fellow opinion, which is similar to my own.
I agree with the author, and this this is how you should hire too.
The Essence of a Manager
I didn't write this, and I'm not sure it matters who did; only that it's true and bears memorialization.
Managers get to do a lot of knowledge-free decision making, which necessarily drives them insane. Here’s how the manager’s bipolar disorder works.
During maniacal periods, the manager is the only one who can do anything around here. This frequently happens when the manager is under external pressure, and he feels that control is slipping out of his hands. He’s trying to compensate for his lack of knowledge by immense concentration and willpower. (Managers always have ample emergency supplies of both.) “Concentration” translates to an ability to derive general and far-reaching conclusions from insignificant details, then “willpower” translates to aggression.
Then depression follows: “Don’t bother me with details”. This results partly from exhaustion quickly arrived at during the mania (especially if reports were wise enough to not argue with the manager, letting his efforts defeat their own purpose.) The manager has delivered his trademark concentration and willpower, so he no longer feels guilty on that front. However, he’s overwhelmed by information and (rightly) feels that he doesn’t know what’s going on. He decides it is none of his business and concentrates on the Big Picture (does nothing). Usually, the cycle repeats upon a new wave of external pressure.
Sunday, September 27, 2009
New Zealand
Thursday, September 24, 2009
Building Qt4 for Windows using MSVC 2008
- Make directories C:\Qt\src and C:\Qt\build (the build procedure really doesn't like fancy paths, so do use something this simple)
- Download and unzip Qt Open Source SDK to C:\Qt\
src - Copy C:\Qt\src\qt\mkspecs C:\Qt\build\
- Open your Visual Studio Command Prompt
- $ "bin\vcvars32.bat"
- $ cd C:\Qt\src
- $ bin\qtenv.bat
- $ cd qt\
- $ configure -opensource -platform win32-msvc2008 -prefix C:\Qt\build
- $ nmake
- $ nmake install
- set QTDIR=C:\Qt\build
note: if you get link errors warning about inability to find MOC-related problems (mine was in WebCore), you may want to delete the mocinclude.tmp file (src/3rdparty/webkit/WebCore/tmp/moc/{debug,release}_shared/mocinclude.tmp).
Saturday, August 29, 2009
The dawning of the Windows era
Recently the RSI stress in my right hand is becoming too much to bear. I needed to find a way to reduce the stress on my hands so I went to pick up Dragon NaturallySpeaking. The idea is, for me to use voice recognition to do regular English writing, such as e-mails, blogs, and other non-coding writing.
Since trading NaturallySpeaking is a Windows only product, and the open source speech recognition tools are not nearly mature enough, this is meant that I've had to officially convert one of my machines to Windows. I think Dragon NaturallySpeaking can be made to work in wine, but when it comes to something as serious as my health I'd rather just bite the bullet, and exchange OS preference for physical comfort.
I purchased a Compaq Mini 10 inch laptop, with Windows XP installed, so that I can take it into a quiet room in order to dictate. The first thing I did with the laptop is remove all the preinstalled software that came with the laptop, and installed from source alternatives like Firefox, OpenOffice, VideoLAN, and ClamAV.
So far using Dragon NaturallySpeaking has been as smooth as silk, the error rate is extremely low, and if there is a mistake it's usually because I slurred my speech. In fact this whole blog entry has been dictated through Dragon NaturallySpeaking; in far less time and far more comfort than had I had to type it out. The only adaptation being having to think about what you say before you speak it,and make sure you enunciate clearly. it also includes a startlingly large dictionary with plenty of technical terms included such as Windows, Linux, Firefox, OpenOffice; all dictated directly without need for correction.
If there is one drawback, it's that writing become so easy, there is a tendency to carry on far too long. :)
Here's hoping someday open source speech dictation becomes as good as this.
Saturday, August 22, 2009
Glenn Beck's "Common Sense" in all it's glory
Since amazon removed this scathing criticism of the book, I'll repost it for posterity. It'd be a shame to let something this good go to waste.
647 of 678 people found the following review helpful: Don't Buy this Book - It's a Sham, August 10, 2009 By M. Mazenko
Well, I just finished Glenn Beck's "Common Sense," which, according to Beck, was "Inspired by Thomas Paine." Beck has clearly never truly read Thomas Paine and knows very little about him, his history, or his beliefs. For many readers, pages one to seven seem to make a lot of sense. There are some general and specific criticisms about government spending and corruption in Congress I agree with. Who wouldn't? But Beck's attempt to connect his neo-conservative positions with Founding Father Thomas Paine is shockingly ignorant of both Paine and American history.
Beck uses this book - and Paine's name - to criticize "Progressivism," blaming it for much of what ails the country. Sadly, this is a complete distortion of Paine's legacy. While the extent of most Americans' knowledge of Paine is "he wrote Common Sense, I teach his work in class every year. I use "The Crisis" and selections from "The Rights of Man" and "Age of Reason." If you want to understand Paine and his vision for America, you should read them. Beck doesn't understand Paine, but he does want to use the credibility of "The Founding Fathers" to promote an anti-government message.
Far from opposing "progressivism," Thomas Paine is one of the original "Progressives," though at the time he was called a radical for his liberal views. He is commonly associated with the origins of American liberalism. "Common Sense" was one small piece of his work - it was a pamphlet simply designed to encourage revolution against Britain. Paine later clearly outlined his vision of what he thought American government should look like. This is where Beck falls off the apple cart.
Beck uses this book to openly criticize progressive taxation, public education, social security, and "the progressive agenda." But readers should know something - Thomas Paine was one of the earliest advocates of progressive taxation, even drawing up tables and rates.
He was also the first proponent of the estate tax. And in Agrarian Justice he proposed a democratic ideal to combat poverty and income inequality by taxing the wealthy to give jobs and "grants" to young people. He also proposed using this system to provide government-sponsored pensions for the elderly. Historians cite Paine's Agrarian Justice as the earliest call for a national old-age pension - ie. Social Security. He wanted to tax the rich and give money to the poor.
He joined Thomas Jefferson in strongly advocating universal tax-supported public education, believing it was necessary to promote an educated electorate and was a necessary way to combat poverty. Paine also sought a federally guaranteed minimum wage, and long before Woodrow Wilson, Paine urged the establishment of, and US participation in, global organizations to help solve international problems and avoid wars.
Yet, this is all lost on Glenn Beck.
Beck criticizes Progressives for leading the United States away from its original purpose. He even goes as far as chastising Teddy Roosevelt. That's pretty bold for a guy whose only contribution to the United States has been as an entertainer. Has Glenn Beck completely forgotten "The Gilded Age"? While Beck, for whatever reason, is disturbed by progressive ideals, he fails to concede the un-democratic conditions that led to the desire of Americans for the rise of progressive reforms.
In fact, if you look at American history from 1776 to 1900 and from 1900 to present, you will see that Beck is right in that progressives shaped America into the country that it is. It's one with a thriving middle class, reasonably safe food and water, no child labor, forty hour workweeks, etc. If Beck wants to dismiss Progressives and return to life under President McKinley or Harding with robber barons running the economy and the atrocious work conditions chronicled by Upton Sinclair in The Jungle, he's crazy. Beck has never known what it would be like to live in an America not guided by the leadership of progressives. Instead, he lives comfortably in a nation defined by liberal and progressive policies, and then audaciously challenges the very notion of the peaceful prosperity they provide.
Beck ironically praises "our political leaders" that could inspire us to "defeat Nazism and fascism," and then goes on to criticize that leader - FDR - as helping destroy the country. Beck doesn't even concede that the United States would never have been able to wage WWII or build the Atomic Bomb or put a man on the moon or wage and win the Cold War if it weren't for the large-scale ability of the federal government to raise revenue, mainly through progressive taxation. He reviews the original foundation of the United States government in the Articles of Confederation, acknowledging that it failed because it was too weak, and then heaps his praise on the Constitution. However, he doesn't concede that the significant difference in power given to the federal government in the Constitution was the power to levy taxes. Even conservative Edmund Burke knew that "the revenue of the state is the state." Thus, weak revenue gathering equals weak government. And a weak federal government would never have been able to respond to two World Wars, the Cold War, and two Iraq wars.
Beck goes on to criticize Hillary Clinton and the public education system for "suggesting the community has a vested interest in what each child is taught." Who doesn't believe that? He offers no alternative proposals for how education should be carried out. Though I hardly believe he is proposing the end of public education. That would be so un-Jeffersonian, another Founding Father.
On page 99, Beck shifts from a scathing criticism of public education to promote God and religion in public life. This is completely disingenuous in a book "inspired by Thomas Paine." Paine was a deist who vigorously opposed Christianity or any organized religion. He often called himself an atheist. Paine was very anti-Christianity. He vehemently opposed the government supporting religion in any way. In fact, in his later life, he was practically exiled from the country because of his criticism of religion in America.
A few other criticisms:
On page 61, Beck paraphrases Barry Goldwater's quote, "A government big enough to give you everything you want is big enough to take everything you have," and doesn't even give the original mind credit.
On page 17, Beck paraphrases the well-known "You can't save the poor by destroying the rich" quote from Reverend William J. H. Boetcke and again doesn't give credit. Historians and English teachers call this plagiarism.
Finally, Beck writes a mere 111 pages, and then re-prints all of Paine's "Common Sense" which is in the public domain - and he charges $12.00 for the book. What a sham. I'm glad I checked it out of the library, but I hate that my library spent taxpayer funds on it. They should have waited until it was in the bargain bin for $.99
That's why Beck is disingenuous. He is a hack, and while I occasionally enjoyed some of his earlier work - I've read all three of his books - I am sadly disappointed in this mis-use of one of America's Founding Fathers. Beck says Americans do not know their history, but he is one of them, and with this book he is counting on their ignorance. Ultimately, he is
From what I know of American history, Thomas Paine would have been appalled by Beck associating their two ideologies, and he would have bitch-slapped Beck. And Beck would have deserved it.
Posted by
R. McDougall
at
10:32 AM
3
comments
Links to this post
Labels: conservatives, politics, review
Tuesday, August 18, 2009
Handedness in coordinate systems
When I learned about handedness in coordinate systems, it was algebraically (AxB=C, BxA=-C), which is interesting but doesn't build much intuition. I enjoy analytic arguments, but ultimately it's the intuitive reasoning that tends to stick with me and inform new insights.
I often had trouble remembering which meant which, staring at my hands trying to remember how "that stuff" went, looking rather silly the while. I recently wanted to recall what OpenGL and D3D respectively do, and came across this discussion on real-time rendering, pointing out that even the pros get mixed up sometimes.
His example gave me, finally, a good piece of intuition about handedness: label your thumb X, index Y, and middle Z.
A right-handed coordinate system is what you have when you imagine your world relative to your desk: X goes east, Y goes north, and Z goes into the sky.
A left-handed coordinate system is what you get when you imagine your world relative to your monitor: X goes right, Y goes up, and Z goes into the monitor.
A perfectly good reason why modellers would prefer their object coordinates to be in a RHS, and programmers might convert it to LHS.
Monday, August 10, 2009
In Response to "There is a beautiful message in understanding God"
The debate about atheism rages on the Red Deer Express. I'll quote the original poster in case it disappears again.
There is a beautiful message in understanding God
07/29/09
In response to the article titled, “Clearing up misconceptions about Atheistic community”, the cry in the heart of a man to relate to a personal God that loves them was so poignantly expressed by Bryan Rowsell who said, “I do wish there was a God...Life would be so much simpler if we all had someone to listen to our problems, help us through crises and carry us to a place more grand than this Earth.”
The joy is that there is such a personal God. A living being that has feelings, one who created this world. One in whose image we are created.
We long for friendships - and so does He long to be friends with us.
I think of the wonderful hymn that states, “What a Friend we have in Jesus, all our sins and griefs to bare...”
It is He who created the tree that Bryan Rowsell would get the seeds from to challenge Nancy Greenwood.
And this loving God who created all things for us to enjoy, who wouldn’t want to experience such deep love from a personal Creator?
Yes, many misrepresent Him to others, but that does not make Him non-existent or untouchable by anyone no matter what they have done or who they are.
True science is observable and repeatable. If you boil water and I boil water, our results are the same. We find the temperature to boil water to also be the same.
Since none of us was there to observe when this lovely world and everything in it started, we can only point to that “artistic works of an artist” like Greenwood mentioned as a point of understanding.
The “evidence” in the theory of evolution is not always accurate. Piltdown man was a proven hoax and came from the tooth of a pig. Fossilized teddy bears are now on sale.
Fossils can be produced in a short time with pressure and there are now fossilized hats on the market. So evolution regarding millions of years doesn’t add up any more.
Evolution says there is an adaptation of the animal to its environment over a period of time. Giraffes couldn’t have evolved at all because medically it is impossible for them to bend down and drink water without rupturing blood vessels in their brains.
Bryan Rowsell and others like him who are struggling are banking on so called evolutionary “evidence” to hold him away from a wonderful experience with Someone beyond our world.
May I invite them to meet the most wonderful friend they will ever have, who loves them, cares about their every need, and laid down His life to give them life?
This is the message that should be conveyed. It is a marvelous way to live now and in the future beyond the grave.
Padre Johnson
Red Deer
Padre Johnson correctly points out that science is observable and repeatable. He fails to remind us that it's purpose is to give us a consistent understanding of our observations in order to make correct predictions. When established scientific results, like the fossil record, make a prediction (for example "if you find a type of fossil at one layer of sediment, you can find another similar fossil in the same layer"), the prediction either helps scientists ("find fossils in a given layer") or doesn't and is rejected. It is selected for fitness to the observed world, not believed as a matter of faith.
The Padre mentions Piltdown Man (http://en.wikipedia.org/wiki/Piltdown_Man) as an example of faked scientific fossil data. However the deception was started in 1912 and revealed conclusively in 1953. This is a strength of science, not a weakness, as the find was not simply accepted with blind faith, but was examined closely and eventually refuted. To quote the above article, "In the decades prior to its exposure as a forgery in 1953, scientists increasingly regarded Piltdown as an enigmatic aberration inconsistent with the path of hominid evolution as demonstrated by fossils found elsewhere."
While we do no posses time machines to observe dinosaurs being fossilized, we can and do regularly observe and repeat experiments on the fossils themselves. Repeated experiments based on not just one technique of dating, but many different -- but ultimately agreeing -- methods. While it remains a ridiculously slim possibility that every single fossil -- out of millions unearthed an dated -- is an elaborate forgery, the far more likely conclusion is that it is just true.
The strength of the scientific evidence is not simply that fossils exist, or missing links exist, or speciation occurs, or tectonic plates shift, or carbon dating is accurate, or any other single fact you can isolate and find ways of "debunking". The strength of the scientific evidence is that the facts **all agree with each other** with such consistency, and to such an astonishing degree of accuracy, that the only possibility for fraud is one of cosmic proportions.
Either the world is as we see it, or god faked it that way in order to convince us at *every* turn, to such a degree that no *rational* man could possibly come to any other conclusion. Either we can understand our natural world through observation and rationalization, or we can only understand the world according to a single ancient book. Unfortunately for theists, the modern world, including this internet, was created by people who did the former; and the dark ages and the inquisition were created by people who did the latter.
It would be enjoyable to discuss the philosophy of science with theists if they didn't so consistently get their science so wrong. The Padre, mystifyingly, claims that "medically it is impossible for them to bend down and drink water without rupturing blood vessels in their brains", yet clearly here is video of a Giraffe doing just that... http://www.youtube.com/watch?v=gbSAJKAF8O4 Perhaps the video has been faked -- after all it's easy to do with a computer.
If theists wish to claim that their methods help an individual reach a higher state of emotional peace, then they are welcome to make a case, but in trying to fight a force they so poorly comprehend only serves to show up their lack of scientific education.





