Gerhard Potgieter

The Ultimate Kloon

Archive for March, 2009

Delphi Character count

Posted by Gerhard under Programming

During this week I saw a request on my favourite forums MyBroadband about some guy wanting some help in Delphi counting the ocurrance of a certain character in a string. So I quickly put a function together and thought I’d might as well share it with you guys.

function CountChars(const str: string; c: char): integer;
// Returns the number of times a character occurs in a string
var
p: PChar;
begin
Result := 0;
p := PChar(Pointer(str));
while p <> nil do begin
p := StrScan(p, c);
if p <> nil then begin
inc(Result);
inc(p);
end;
end;
end;

To use it simply call as follows: CountChars(thestring,thechar);

Where thestring is the string you want to search in and thechar the character you want to count.

Researchers from the Ilmenau University of Technology lead by Professor Andreas Mitschele is atempting to use flying wireless quad copters to create self asembling ad-hoc wireless networks.

Flying Robot Quadcopter

The group claims that the copters can be used in disaster areas where standard infrastructure is destroyed

The robots can create a network of radios that can be used for both mobile-phone or standard wireless network access. All this is being achieved with normal off the shelf parts.

The robots can spread themself and deploy a network far more quicker than any on the ground. As with any electric power device there are limitations though.

Having only 20 minutes for flight time the copters can easily fly to a destination and go land to deploy the network.

The quadcopter kits come in at 300 euro (R4000) thats excluding bateries, with batteries being more expensive at 1000 euro (R14 000) capable of only lasting 20min at full load.

Flying Robot Quadcopter

Subscribe to Gerhard Potgieter