The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,839 other subscribers

Generating complex math visualizations in SVG using C# and ILNumerics – Scott Hanselman

Posted by jpluimers on 2013/12/15

Funny how Generating complex math visualizations in SVG using C# and ILNumerics and MathViz (no, not this MathViz!) look so similar.

I hope the MathViz code becomes public one day.

–jeroen

via: Generating complex math visualizations in SVG using C# and ILNumerics – Scott Hanselman.

Posted in .NET, Delphi, Development, HTML, HTML5, iOS Development, Mobile Development, Software Development, Web Development | Leave a Comment »

Different ways of sleeping/waiting in batch files

Posted by jpluimers on 2013/12/13

About a year and a half ago, I wrote about a Batch file to “Keep Alive” a CMAK generated VPN connection in Windows 7.

It uses ping to wait a certain amount of time, but it has the drawbacks of

  • requiring TCP/IP to be installed (which some headless systems don’t).
  • using N+1 as the number of seconds

Since then, I learned that since Windows Vista and up has timeout command that just waits:

timeout /t 600 /nobreak

Two parameters are used:

  • /nobreak
    does not stop waiting when you press a key
  • /t #
    waits # seconds

(the example is 10 minutes, I use it to regularly run FlushFileCache.exe or FlushMem.exe to empty the Windows file chache and release memory – often more than a gigabyte – back to Windows)

There is also sleep.exe, but that requires the Windows Resource Kit or Windows Server 2000/2003.

–jeroen

via:

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows | Tagged: | Leave a Comment »

When your 2nd (touch) screen “clicks” on your 1st (non-touch) screen (Windows 7 tip,via André Mussche – Google+)

Posted by jpluimers on 2013/12/13

Glad I found back this G+ post by André Mussche:

20130206, 09:12 –  Public

TIP: I got a 2nd screen with touch (on Win7), however default when touching the second screen it “clicks” on the main (1st) screen. Using “Tablet PC Settings” I got this switched to the correct 2nd screen.

http://ava.co.uk/support/faq/general/touch-screen-show-as-not-supporting-touch-how-to-install-a-2nd-touch-screen-on-windows-7.aspx

I had exactly the same problem, and this solved it.

–jeroen

via: André Mussche – Google+ – TIP: I got a 2nd screen with touch (on Win7), however….

Posted in Power User, Windows, Windows 7 | Leave a Comment »

Delphi postbuild events: interesting take by David Heffernan (via: Stack Overflow)

Posted by jpluimers on 2013/12/12

StackOverflow user David Heffernan – Stack Overflow has an interesting take on Delphi postbuild events:

At the moment my actiona read:

if exist PostBuild.bat call PostBuild.bat $(Platform) $(Config) $(OutputDir)

And then the PostBuild.bat script calls a Python script so that I can write my scripts in a real language.

I actually impose the build actions in a shared option set that I reference from all of my projects. That way I enforce consistency and predictability.

I know others use tools like FinalBuilder but building is so important that I feel it’s worth my effort in rolling my own tooling.
– David Heffernan Feb 14 at 20:24

–jeroen

via: Delphi XE3: Problems with complex pre-build events – Stack Overflow.

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | Leave a Comment »

Trying fix for Windows 8 high CPU usage of TiWorker.exe (via: bit-tech.net)

Posted by jpluimers on 2013/12/11

Hopefully this command (ran as administrator) will fix the high CPU usage of TiWorker.exe on one of my Widows 8 machines:

DISM /online /cleanup-image /restorehealth

It took almost an hour to run…


C:\bin>DISM /online /cleanup-image /restorehealth
Deployment Image Servicing and Management tool
Version: 6.2.9200.16384
Image Version: 6.2.9200.16384
[==========================100.0%==========================]
The restore operation completed successfully. The component store corruption was repaired.
The operation completed successfully.

Thanks to Windows 8: Update KB2821895 sorgt für Probleme – Lösung gefunden! – Dr. Windows.

–jeroen

via: Windows 8 update bug clogs CPUs | bit-tech.net.

See also:

Posted in Power User, Windows, Windows 8 | Leave a Comment »

Windows batch files: How to set a variable with the result of a command (via: Stack Overflow)

Posted by jpluimers on 2013/12/11

One of the easy things in *nix is to set the value of an environment with the output of a command.

Something like this is possible in Windows too, but you have to instruct Windows to keep an empty set of delimiters to capture the full first line.

There is also a small but important difference between Windows and *nix upon command failure: *nix will always return an empty value, but in Windows you must make sure to empty the value first.

Thanks Jesse Dearing for this summary: Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows | Leave a Comment »

Attach attach a debugger to a WebService (via: Stack Overflow)

Posted by jpluimers on 2013/12/10

Some things you have done for ages, are already phrased so nicely, the only thing you can do is quote.

Thanks Dave Coulter:

You can attach the Visual Studio debugger to a process by:

Debug > Attach to Process > Attach Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Glasvezel / Fiber internet notes

Posted by jpluimers on 2013/12/09

Some links:

–jeroen

Posted in Internet, LifeHacker, Power User, routers | Leave a Comment »

Funny Delphi code of the day: on literals

Posted by jpluimers on 2013/12/09

The fact that the [WayBack] 31-character limit on ClientDataSet field and index names is worse, but I just encountered this GetParamNameWODog function in a Delphi 3rd party library:


function GetParamNameWODog(const ParamName: _string): _string;
begin
if (ParamName <> '') and (ParamName[1] = '@') then
Result := Copy(ParamName, 2, 1000)
else
Result := ParamName;
end;

What’s wrong with using the Length function here?

Yes, SQL Parameter names will probably less than 1000 characters, but then the 1000 literal should be a constant with a meaningful name, and the '@' literal should be too. Read the rest of this entry »

Posted in Delphi, Delphi XE3, Development, QC, Software Development | Tagged: , , | 12 Comments »

“Hoogtes” waar ik gewoond heb / “Altitudes” of where I have been living

Posted by jpluimers on 2013/12/09

(English translation below)

Edit 20230510 – added new URLs after the AHN viewer moved from ahn.geodan.nl to new domains ahn.arcgisonline.nland www.ahn.nl.

Nederlands

Veel van Nederland ligt onder zeeniveau, inclusief de meeste plaatsen waar ik gewoond heb, maar ik wist nog niet hoe ver het van N.A.P. “zeeniveau” afweek.

Via toeval kwam ik er achter dat dit on-line heel makkelijk op postcode opvraagbaar is, met een URL als deze:

http://ahn.geodan.nl/ahn/viewer3/zoekpc.php?postcode=1060NP

https://ahn.arcgisonline.nl/ahnviewer/?find=1060NP

Je krijgt dan een resultaat als dit:

Volgens AHN2 is de gemiddelde hoogte in postcodegebied 1060NP -1.8 m.

(Inmiddels – 2023 – geen tekst meer met gemiddelde hoogte, maar als je klikt op een locatie krijg je de gemeten hoogte aldaar)

Onderaan de postcodes waar het om gaat.

Vrijwel mijn hele leven was dus beneden zeeniveau, maar ik ben boven zeeniveau geboren (:

En als bonus: AHN Viewer en AHN [Wayback/Archive] AHN Viewer | AHN (snapt geen URL parameters) en [Wayback/Archive] AHN-viewer (snapt wel URL parameters, zie [Wayback/Archive] ahn.arcgisonline.nl/ahnviewer/Release_notes_versie_2_februari_2019.pdf).

Er is ook een postcodetool, maar die snapt geen URL parameters: [Wayback/Archive] Postcodetool

English

Most of The Netherlands is below sea level, including most of the places I lived, but I didn’t know how far from N.A.P. “sea level” that was.

By coincidence, I found out that it is easy to find this relative altitude by Dutch poascal code with a URL like this:

http://ahn.geodan.nl/ahn/viewer3/zoekpc.php?postcode=1060NP

https://ahn.arcgisonline.nl/ahnviewer/?find=1060NP

It will get you a result like this, where the last number indicates altitude:

Volgens AHN2 is de gemiddelde hoogte in postcodegebied 1060NP -1.8 m.

(By now – 2023 – no text with average altitude, but if you click you get the measured altitude value)

Below is a list of postal codes where I lived or where my post got delivered.

So I lived most of my life below sea level, but was born above it (:

As a bonus, I also found AHN Viewer and AHN [Wayback/Archive] AHN Viewer | AHN (does not allow URL parameters) and [Wayback/Archive] AHN-viewer (allows URL parameters, see [Wayback/Archive] ahn.arcgisonline.nl/ahnviewer/Release_notes_versie_2_februari_2019.pdf).

There is even a postal code tool, but it does not support URL parameters: [Wayback/Archive] Postcodetool

Postcodes / Postal codes

jeroen

via:

Posted in About, Internet, Personal, Power User | Leave a Comment »