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,862 other subscribers

Archive for August, 2013

Doesn’t automatically power up when utility power is restored: Buffalo WLAE-AG300N Dual-Band Wireless-N Ethernet Converter Access Point and Bridge

Posted by jpluimers on 2013/08/19

I got myself two Buffalo WLAE-AG300N devices to function as a WiFi bridge (I couldn’t run an ethernet cable from A to B, but both devices there were wired).

Just found out that when you loose utility power, and it comes back up, then these devices do not automatically power up: you *have* to press the power button.

Bummer.

–jeroen

via: WLAE-AG300N : AirStation™ Nfiniti™ Dual-Band Wireless-N Ethernet Converter Access Point and Bridge.

Posted in Power User, WiFi | 1 Comment »

Installing SuSE 11.2 or higher: before the first reboot the CLI version of YaST looks horrible. Reboot or second CLI fixes it.

Posted by jpluimers on 2013/08/19

Since SuSE 11.2, when installing then the CLI version of YaST looks horrible on the first (Ctrl-Alt-F1) console before you do your first reboot.

Workarounds:

  1. Try one of the other consoles,
  2. Reboot once.

It still fails at SuSE 12.x.

Before/After (click on the images to enlarge):

YaST before reboot

YaST before reboot

YaST after reboot

YaST after reboot

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »

shorter version of batch file: getting directory and parent directory

Posted by jpluimers on 2013/08/17

Two years ago, I posted a batch file that gets the parent directory of the batch file that runs.

It was convoluted, using substrings and intermediate environment variables so you needed setlocal.

This one does not any more: for both the directory of the batch file, and the parent directory of that directory, one-liners suffice:


echo batchfile=%0
echo full=%~f0
setlocal
for %%d in (%~dp0.) do set Directory=%%~fd
echo Directory=%Directory%
for %%d in (%~dp0..) do set ParentDirectory=%%~fd
echo ParentDirectory=%ParentDirectory%
endlocal

–jeroen

via: batch files: getting directory and parent directory « The Wiert Corner – irregular stream of stuff.

Posted in Batch-Files, Development, Scripting, Software Development | Tagged: , , , | 1 Comment »

Paint.NET v3.5.11 is now available (via: Paint.NET Blog)

Posted by jpluimers on 2013/08/17

Programmers scale: time versus project completeness

Programmers scale: time versus project completeness

I totally agree that Paint.NET is the best free image and photo editor on Windows.

Writing quality software takes time, not only when writing it in spare time like Rick Brewster does. Getting things “right” is a tedious process and often will set you back: just watch the graph on the right.

So I’m not surprised that it took a very long time after the first Paint.NET 4.0 idea in 2008 to get “close” to a release.

And indeed, it looks like Rick has become much closer which will please many people waiting for Paint .NET 4.

I’m really glad with the announcement that Paint.NET v3.5.11 BETA is now available – Paint.NET Discussion & Questions – Paint.NET Forum.

Edit: while writing this, the final Paint.NET v3.5.11 came out.

It paves the way for Paint .NET 4.0 update in the future, and fixes/improves quite a few things.

A few quotes from it:

This is probably not the update you were expecting I need to push out an update to v3.5 in preparation for the eventual release of v4.0 […] releasing a “beta” today […] I’ll be pushing out the Final/RTM in a few days.

The primary goal of this update is preparing for the v4.0 release: v3.5.10 will not be able to offer the v4.0 update, but v3.5.11 will. […]

Here are the changes for this release:

  • Fixed: The Gaussian Blur effect was incorrectly calculating alpha values for non-opaque pixels. (http://forums.getpaint.net/index.php?/topic/18483-gaussian-blur-mistreats-alpha/)
  • Improved performance of the Sharpen effect by about 25%
  • Improved performance of the Median effect by about 30%
  • Improved performance of the Fragment effect by about 40%
  • Improved performance of the Unfocus effect by about 100%
  • Reduced memory usage when many selection manipulation operations are in the history/undo stack (the undo data is now saved to disk)
  • The built-in updater now supports upgrading to paint.net 4.0 (once it’s available)

There have been rumors floating around that Paint.NET is “dead.” This is not true!

–jeroen

via: Paint.NET Blog | The best free image and photo editor. By Rick Brewster..

Posted in .NET, .NET 3.5, .NET 4.0, Algorithms, Development, Floating point handling, Power User, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Tagged: , , | Leave a Comment »

CmdKey.exe can be used to save passwords for MSTSC.exe

Posted by jpluimers on 2013/08/16

You can use CmdKey.exe to save a username/password combination to be used by MSTSC.exe

CmdKey allows you both to store and delete these credentials.

–jeroen

via: c# – Run mstsc.exe with specified username and password – Stack Overflow.

Posted in Power User, Windows | 4 Comments »

Reminder to self: Unspecified Error in Delphi 2007 on Windows 8 (via: ACMer)

Posted by jpluimers on 2013/08/15

I might need this for some really old stuff, so here is a reminder: Unspecified Error in Delphi 2007 on Windows 8 | ACMer.

It does work on Windows 7: Problem installing Delphi 2007 on Windows 7 64 Bit Enterprise – Stack Overflow.

–jeroen

Posted in Delphi, Delphi 2007, Development, Power User, Software Development, Windows, Windows 8 | Leave a Comment »

command line – create empty text file from a batch file (via: Stack Overflow)

Posted by jpluimers on 2013/08/15

StackOverflow has [WayBack] quite a [WayBackfew questions [WayBackon creating [WayBackempty text files from a batch file.

Most answers involve the [WayBack] NUL special file (which is not available on one special version of Windows [WayBackWindows Fundamentals for Legacy PCs, but can easily be retrofitted).

[WayBack] This is the solution I use most often:

type NUL > EmptyFile.txt

–jeroen

via: [WayBackcommand line – How to create empty text file from a batch file? – Stack Overflow.

Posted in Batch-Files, Development, Scripting, Software Development | 2 Comments »

.NET/C#: UnitPrefixes class that facilitates distinguishing decimal and binary file/drive/memory size (mega versus mibi, etc)

Posted by jpluimers on 2013/08/14

Everyone knows there is a size difference between a gigabyte of memory, and a gigabyte of disk space.

The former is 102410241024, the latter is 100010001000.

To facilitate this, I’ve created a C# class UnitPrefixes containing quite a few constants and readonly values.

The class is below, but a few interesting facts first:

  • Most values are const, but a few are readonly static variables because they cannot calculated at compile time (the C# compiler by design does very limited calculations at compile time; it is complex enough as it already is).
    As Jon Skeet explains, there are some other differences between const and readonly static, which is why I favour const.
  • Though all consts are positive, I could have used UInt32 and UInt64, but the .NET framework favours signed Int32 and Int64 types for parameters, so to avoid casting, I used the signed ones.
  • There is no Int128 or UInt128, but there is System.Numerics.BigInteger which I use for values too large for 64-bit integers.
    Note that BigInteger is relatively new, so this code will only work in C# 4 or higher, and requires .NET 4 or higher.
    This is also the place where I use the public readonly static fields, as I need to call the BigInteger constructor to initialize it.
  • I used the Decimal type, as the mantissa holds up to 28 digits of accuracy.

I used the Wikipedia pages Binary Prefix and Metric Prefix (I could also have used File Size) for the unit names and abbreviations.

Note that BitsPerByte is a const I needed too, and I will probably add constants for 512 and 4096, as you see those often in computing as well.

The below sample code is also available as a changeset on BeSharp.CodePlex.com. Read the rest of this entry »

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Conference Topics, Conferences, Development, Event, Jon Skeet, Software Development | Tagged: , | Leave a Comment »

Remove the first 3 characters in var in batch file (via: Stack Overflow and Rob van der Woude)

Posted by jpluimers on 2013/08/13

Getting substrings in a batchfile requires you to use the %…:~…% syntax as explained by Rob van der Woude.

Note this only works on batch file variables, so not on batch/function arguments (%1, %2, …)and for-loop indexes (%%f, etc).

This code gets the leftmost three characters of var:

set var=%var:~3%
echo %var%

–jeroen

via Remove the first 3 characters in var in batch file? – Stack Overflow.

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

reminiscence of the past: DPMI (DOS Protected Mode Interface)

Posted by jpluimers on 2013/08/12

While researching some other historic information about Delphi, I bumped into this thread: New DPMI host – delphi.

If is a small thread describing what kinds and versions of DPMI hosts were available to run Turbo Pascal based programs.

DPMI stands DOS Protected Mode Interface: a way for real mode DOS programs to access protected mode features (mainly memory above the 1 megabyte barrier).

I had plainly forgotten that the DPMI host shipped with Delphi 1, and wasn’t aware you could have a 32-bit DPMI host at all.

Some other memory related abbreviations from that era: Read the rest of this entry »

Posted in Borland Pascal, Delphi, Delphi 1, Development, Object Pascal, Pascal, Software Development, Turbo Pascal | 2 Comments »