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

Archive for the ‘Software Development’ Category

.NET/C#: two ways of creating an empty array

Posted by jpluimers on 2016/08/18

Empty arrays are not used often as arrays usually are about the presence data, not about the absence.

Here are two ways based on the int data type in C# (the original [WayBackexamples [WayBack] are using string, but since string itself is also a kind of array…):

Specify a size of zero:

int[] a = new int[0];

Specify an empty initialisation:

int[] a = new int[] { };

Though many people think arrays are a thing of the past, I think it is one of the first generic types and have their place. For one, enumerating over arrays using foreach is a lot faster in many environments than enumerating over other data types. Another thing is that the fixed nature of arrays can be very beneficial in setting constraints.

That’s why I like the balanced view from Eric Lippert [WayBack] in Arrays considered somewhat harmful – Fabulous Adventures In Coding – Site Home – MSDN Blogs [WayBack]

–jeroen

via:

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, C# 6 (Roslyn), Development, Software Development | Leave a Comment »

Some interesting encoding/Unicode/text articles on kunststube and links for test files of various encodings

Posted by jpluimers on 2016/08/17

After yesterdays post on Testing and static methods don’t go well together, I read around on Source (kunststube [WayBack]) a bit more and found these very nice articles on encoding,Unicode and text:

Related on those, some other nice readings:

–jeroen

Posted in Ansi, ASCII, CP437/OEM 437/PC-8, Development, EBCDIC, Encoding, ISO-8859, ISO8859, Shift JIS, Software Development, Unicode, UTF-16, UTF-8, UTF16, UTF8, Windows-1252 | Leave a Comment »

Builds ChaCha20 version of openssl on Mac OS X static without dylib for use with testssl.sh

Posted by jpluimers on 2016/08/17

A while ago, testssl.sh [WayBack] needed Darwin binaries (for OS X): Supply Darwin binaries + install documentation · Issue #127 · drwetter/testssl.sh [WayBack]

So I created the small Bourne shell (sh) script below to deliver them.

It allows me to update these gists:

The build script itself is in a gist as well: https://gist.github.com/f4de3937630b87753133.git [WayBack]

It helped me to contribute to these testssl.sh issues:

Not all of these binaries are in https://github.com/drwetter/testssl.sh/tree/master/bin [WayBack] as it makes the testssl.sh repository too bloated. Some (including non-OSX builds made by others) are here:

Eventually the script might get merged into https://github.com/drwetter/testssl.sh/blob/master/utils/make-openssl.sh [WayBack] as there is a Darwin switch in this commit: https://github.com/drwetter/testssl.sh/commit/6efc3e90f52e5926b0853d3b2fb221b631dcf452 [WayBack]

Read the rest of this entry »

Posted in Apple, Development, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OpenSSL, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Security, Software Development, xCode/Mac/iPad/iPhone/iOS/cocoa | Leave a Comment »

Testing and static methods don’t go well together

Posted by jpluimers on 2016/08/16

A few links as, in code I’ve inherited, I see way too many static methods hindering testing:

–jeroen

Posted in Agile, Development, Software Development, Unit Testing | 1 Comment »

“Personal Computing on the VIC 20” manual is on-line, but prepared for a slow download.

Posted by jpluimers on 2016/08/16

From a while ago:

David Ratnasabapathy: The VIC-20 programmer’s manual was the best intro to programming I’ve ever read. I’d love to find a copy online, the new generation could use it.

+Isaac Kuo that book is wealth. I loved marginal explanations that expanded on the main text, it’s a tactic I use in my own class notes.

The manual was called Personal Computing on the VIC 20 and it is online! This is amazing! Ah, memories.

http://www.classiccmp.org/cini/pdf/Commodore/VIC-20%20Programmer’s%20Reference%20Guide.pdf

+Tomasz Machalski there’s a motherload here:

http://www.classiccmp.org/cini/pdf/Commodore/

Including VIC-20 User’s Manual.pdf

http://www.classiccmp.org/cini/pdf/Commodore/VIC-20%20User’s%20Manual.pdf

and VIC-20 Programmer’s Reference Guide.pdf

http://www.classiccmp.org/cini/pdf/Commodore/VIC-20%20Programmer’s%20Reference%20Guide.pdf

Jeroen Wiert Pluimers:+David Ratnasabapathy thanks a lot!

Downloaders: that site is slow. Not as slow as the New Horizons uplink, nor as slow as 1980s modems, but be prepared for some serious wait time.

https://en.wikipedia.org/wiki/Modem#The_Smartmodem_and_the_rise_of_BBSs

Note that the wayback machine has them cached:

–jeroen

via It’s our third birthday! What better present than the VIC-20 [1] (“A Real… [WayBack]

Posted in 6502, Commodore, Development, History, Software Development, VIC-20 | 1 Comment »

freegeoip.net – Free IP geolocation HTTP API

Posted by jpluimers on 2016/08/11

Not sure yet how frequently you can call the Free IP geolocation HTTP API but it’s surely interesting.

Source: freegeoip.net

–jeroen

via: Hi everyoneDoes anyone know how to get the country code for where a device is currently residing… – Chris Pimlott – Google+

Posted in Development, Geolocation, Software Development | Leave a Comment »

programmers humor – Google image Search

Posted by jpluimers on 2016/08/11

An ever varying list of programmer humour images: programmers humor – Google Search.

Posted in Development, Fun, Quotes, Software Development | Leave a Comment »

reg files: Deleting Registry Keys and Values

Posted by jpluimers on 2016/08/10

The registry key deletion example from Microsoft is slightly wrong, as they wrapped the code over three lines:

[
-HKEY_LOCAL_MACHINE\Software\Test
]

That confuses some people, so here is the correct example:

[-HKEY_LOCAL_MACHINE\Software\Test]

The registry value deletion misses the square brackets, so that example should be like this:

[HKEY_LOCAL_MACHINE\Software\Test]
"TestValue"=-

The original Microsoft article:

Deleting Registry Keys and Values

To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:

HKEY_LOCAL_MACHINE\Software

put a hyphen in front of the following registry key in the .reg file:

HKEY_LOCAL_MACHINE\Software\Test

The following example has a .reg file that can perform this task.

[
-HKEY_LOCAL_MACHINE\Software\Test
]

To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:

HKEY_LOCAL_MACHINE\Software\Test

put a hyphen after the “TestValue”= in the .reg file. The following example has a .reg file that can perform this task.

HKEY_LOCAL_MACHINE\Software\Test

“TestValue”=-

To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.

–jeroen

via: How to add, modify, or delete registry subkeys and values by using a .reg file..

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

tombh/texttop: A fully interactive X Linux desktop rendered in TTY and streamable over SSH

Posted by jpluimers on 2016/08/09

Wonder if I can get this to work from macOS / OS X as a client:

texttop – A fully interactive X Linux desktop rendered in TTY and streamable over SSH

Source: tombh/texttop: A fully interactive X Linux desktop rendered in TTY and streamable over SSH

via: Kristian Köhntopp – Google+

Read the rest of this entry »

Posted in *nix, *nix-tools, Communications Development, Development, Internet protocol suite, Linux, Power User, Software Development, SSH, TCP | Leave a Comment »

Online CamelCase to underscore_separators converter and back

Posted by jpluimers on 2016/08/09

Maintaining a suite of project that use CamelCase on the one hand and underscore_separators on the other (partially mapped by code generators) an on-line conversion comes in handy: CCConverter abedo.pl.

–jeroen

Posted in .NET, Delphi, Development, Software Development | Leave a Comment »