Some years ago I accomplished a project of the real-time ECG-generator (the text is in Russian) for Spectromed-UA. I wrote a soft part in Delphi, and another guy dealt with an electronics part.
The device is connected to PC and sends out a signal via LPT to a DAC outside. A signal could be rectangular (meander), sinusoidal and ECG-like. (ECG is the electrocardiogram by the way). The ‘heartbeat’ of the latest one can be modulated in time. A subprogram to play out real ECG was included. Some noise modulation was included as well.
That was designed to test cardio-analyzers and similar devices. Small and neat project, as I remember. There was no support for the most pathological arrhythmias, however.
As I already posted in Scheme, a function computing all subsets of a set would be:
-
#!r6rs
-
(import (rnrs))
-
-
(define (subsets set)
-
(define (recursion set rest) (if (null? set) (list rest)
-
(let ([head (car set)] [tail (cdr set)])
-
(append (recursion tail rest) (recursion tail (cons head rest))))))
-
(recursion set ‘()))
-
-
(display (subsets ‘(a b c d)))
The same in Haskell:
-
s = "abcd"
-
-
subsets s = ssets (s) []
-
-
ssets (x:xx) r = ssets xx r ++ ssets xx (x:r)
-
-
main = do
-
-
-
-
-
For imperative languages I’d rather prefer bitwise approach. Here is in C#:
-
using System;
-
-
namespace Subsets
-
{
-
class Program
-
{
-
static void Main()
-
{
-
string elements = "abcd";
-
for (ulong i = 0; i < Math.Pow(2, elements.Length); i++)
-
{
-
ulong set = i;
-
for (int j = 0; j < elements.Length; j++, set >>= 1)
-
if ((set & 0×01) == 1)
-
Console.Write(elements[j]);
-
Console.WriteLine();
-
}
-
}
-
}
-
}
Some months ago my notebook began to overheat. When the CPU is loaded enough, its temperature grows over 95 degrees Celsius, and a guard mechanism throttles down its frequency to 40 % and waits until it cools down. Within a few minutes the system is badly responsive.
I bought a cooling platform for it, but with time it couldn’t restrain the heat. A problem became worse and worse, but the warranty for the laptop was void already. So, I took a screwdriver and solved it:

A dense layer of dust covered the radiator and prevented air flow. Now under 100 % load my CPU is cool enough. I mean, for a Turion — 80 degrees Celsius for the general sensor, 85 for the first core, and 91-93 for the second one (sitting on a table, without a cooling platform). Strange gradient, but anyway, a system doesn’t freeze now.