Tags » Programming

Day 29

Endless Chapter 8 (Functions)

Ex8-18. Sandwiches

Write a function that accepts a list of items a person wants on a sandwich. The function should have one parameter that collects as many items as the function call provides, and it should print a summary of the sandiwch that is being ordered. 139 more words

Python

Unknown clockwork.

“[…] A proof is an essay of sorts. It is a set of carefully crafted directions, which, when followed, should leave the reader absolutely convinced of the truth of the proposition in question.

371 more words

BeginUpdate and EndUpdate in Delphi

If you use a Delphi component like a ListBox, Memo, TreeList, ListView,… and you add or modify a lot of items (lines, nodes,…), the component’s performance becomes very slow. 32 more words

Programming

Export Registry Key in Delphi

var
 R: TRegistry;
 ErrorCode: Integer;
begin
 NTSetPrivilege('SeBackupPrivilege', true);
 R:= TRegistry.Create;
 try
 R.RootKey := HKEY_LOCAL_MACHINE;
 if R.OpenKeyReadOnly('\Software\My Key') then
 begin
 ErrorCode := RegSaveKey(R.CurrentKey, 'export.reg'), nil);
 R.CloseKey;
 if ErrorCode <> ERROR_SUCCESS then
 raise Exception.CreateFmt('Error Code: %u', );
 end
 else
 raise Exception.Create('Key does not exist');
 finally
 R.Free;
 end;
end;
Programming