Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

It happens a million times a day. Somebody pays cash for something and gets change. But there are rules, and Raymond's friend seems to like to break those rules . Luckily for Raymond's friend, one of the rules is the customer is always right ... or as Read More...
There's an MSDN sample of how to turn on HDCP or SCMS in a playback app. The sample is loosely based on a test app I wrote, but there are still some rough edges. For example, the CMFAttributeImpl<T> template is not part of the SDK or the DDK. Also, Read More...
http://programmingpraxis.com/2009/10/09/calculating-pi/ > perl -e"print 4/(map{$n+=rand()**2+rand()**2<1}1..pop)*$n" 5000 3.1336 59 characters , plus arguments. Read More...
I was reading László Polgár's excellent book Chess: 5334 Problems, Combinations, and Games and ran across #1071, White to move and mate in 2... Read More...
If you're installing Windows via a boot DVD, and you choose Custom, you have the option to rearrange partitions. I like use this to have each drive be one big partition. Windows 7 wants to set aside a 100 MB partition for something-or-other. I'm sure Read More...
As preparation for moving one of my machines from Vista to Windows 7, I'm compiling a list of all the little tweaks I like to make to machines that I use a lot: Boot from the Windows DVD. Delete all partitions; make each hard drive one big partition. Read More...
Last time I talked about how to calculate a sine sweep mathematically. There's a closed-form solution which is quite elegant but, alas, useless in a practical computer implementation due to the very bug numbers that are being fed to the sin(...) function. A computer implementation will care only about the discrete samples that need to be generated. The integral in the previous post turns out to be counterproductive - we're much more interested in the infinite sequence of φi, and more particularly in their residue mod 2π. Read More...
Bad Perl solution to the " print the open lockers " problem: perl -e"print join', ',map{$_*$_}1..sqrt pop" 100 54 characters. I prefer this to the 53-character solution obtained by omitting the space after the first comma. EDIT: 49 characters: perl -e"print Read More...
Suppose you want to generate a continuous sine-sweep from time tstart to time tend. You want the starting frequency to be ωstart, and the ending frequency to be ωend; you want the sweep to be logarithmic, so that octaves are swept out in equal times. Read More...
Another programming contest asks to solve the Josephus problem . Bad Perl solution (83 characters... so close...) >perl -e" @_=(1..$ARGV[0]);++$c%$ARGV[1]?$i++:splice@_,$i%=@_,1while$#_;print@_ " 40 3 28 EDIT: got it down to 80. >perl -e" @_=(1..shift);++$c%$ARGV[0]?$i++:splice@_,$i%=@_,1while$#_;print@_ Read More...
I found this programming contest interesting: here's what I've got. perl -e " ($a,$b)=@ARGV;map{$c+=$_*$b}grep{$a&$_}map{1<<$_}(0..log($a)/log 2);print$c " 7 19 I'm calling this a one-liner because the part between the quotes is less than 80 Read More...
I describe the Windows 7 hdaudio.sys mixed capture presence detection bug. Read More...
Regular expressions are a tool for matching generic text. XPath queries are a tool for matching chunks of XML. Both are search technologies. When using search technologies it is occasionally quite useful to have a query that will never match anything Read More...
In a recent post I sung the praises of square waves as a way to get a heckuva lot of power (3 dB more power than a sine wave) into a sample-range-limited signal. It's time to take them down a notch now. A problem with square waves is they're impossible Read More...
Daylight Saving Time is a thorn in my side. Politician: What time is it? Scientist: What time would you like it to be? It is my firm belief that Daylight Saving Time doesn't do any real good. Daylight Saving Time does real harm. Politicians love Daylight Read More...
More Posts Next page »
 
Page view tracker