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 ‘Development’ Category

The Power of Open Source… Microsoft .NET and OpenShift: .Net on Linux

Posted by jpluimers on 2015/11/11

Really exiting times ahead: Microsoft .Net on Linux.

It’s not fully ready yet, but to get an idea to learn more about running OpenShift Enterprise 3 and a .NET application based on a Red Hat Enterprise Linux container, here are a few links to get started:

I wish that the demo repository at https://github.com/munchee13/snoopalicious.git and the rhosepaas.com domain were accessible (:

There are other alternatives too, but OpenShift (RedHat) and Microsoft working together is really exiting news to me.

If you’re on other distros, here are some more links:

And of course there has been Mono for a while, which is a different implementation of .NET:

Hopefully this will have search results soon: dnvm opensuse tumbleweed.

–jeroen

Posted in *nix, .NET, Development, Linux, OpenShift, openSuSE, Power User, RedHat, Software Development, SuSE Linux, Tumbleweed | Leave a Comment »

Hash Toolkit – Reverse MD5 / SHA1 Hashes

Posted by jpluimers on 2015/11/11

Interesting: Hash Toolkit – Reverse MD5 / SHA1 Hashes

They generate and allow you to generate various hashes, and store both the hash and original so you can reverse it.

Not meant for production data, but an approach for verifying if you do hashing correctly.

–jeroen

via: Hash Toolkit – Reverse MD5 / SHA1 Hashes.

Posted in Development, Hashing, md5, Power User, Security, Software Development | Leave a Comment »

c# – TFS Code Reviews – Show updated files in response to comments – Stack Overflow

Posted by jpluimers on 2015/11/10

Nice steps here: c# – TFS Code Reviews – Show updated files in response to comments – Stack Overflow.

What’s missing here is that you now loose your history within the shelve-set.

That makes it harder for the reviewer to view the changes being re-reviewed.

–jeroen

Posted in Development, Software Development, TFS (Team Foundation System), Visual Studio 2010, Visual Studio 2013, Visual Studio 2014, Visual Studio and tools | Leave a Comment »

Life in a post-database world: using crypto to avoid DB writes

Posted by jpluimers on 2015/11/05

Interesting: Life in a post-database world: using crypto to avoid DB writes.

For some security related operations, you only need smart use of HMAC, and no temporary database entries.

Thanks for the Jan Wildeboer referral to this.

–jeroen

Posted in Development, Hashing, Power User, Security, Software Development | Leave a Comment »

Do not expose properties with writeable fields without a chance to react on the writes.

Posted by jpluimers on 2015/11/04

From a chat with a co-worker a while ago:

I’m not against properties. Just something against properties properties that are objects with writeable fields.

So even if you expose such a property as read-only, it can still get its writeable fields overwritten.

That is a pain when those are part of the state of the underlying object.

In other words: encapsulate your state changes.

Here we solved it by making

  • the type of the property immutable
  • the property writeable
  • react on state changes during the write

Proper encapsulation.

In this case it was a project mixing C# and Delphi, but you can easily apply the above to any language featuring classes and properties.

Another solution would have been to extend the type of the property so it can expose an event that fires during change. Much more convoluted.

–jeroen

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Delphi, Delphi 10 Seattle, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

c#: Lazy is not constrained to static contexts, instance field initialisers are – via: Stack Overflow

Posted by jpluimers on 2015/11/03

Lazy<T> is not constrained to static contexts.

Instance field initialisers cannot use instance references (but can use static references) as they run outside of the constructor.Though there are arguments for instance field initialisers too., I think this is a good reason to initialise fields inside the constructor: there you do have access to instance references (but should not call virtual instance methods or properties) which leads to another reason: consistency as field initialisers run in the opposite hierarchy order as constructors (incidentally causing this virtual method restriction).

Boy, that was a long sentence (:

–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 »

7 Linux Grep OR, Grep AND, Grep NOT Operator Examples

Posted by jpluimers on 2015/10/31

Question: Can you explain how to use OR, AND and NOT operators in Unix grep command with some examples?

Source: 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples

Posted in *nix, *nix-tools, Power User, RegEx | Leave a Comment »

The mystery of the missing administrative shares: why did it require a reboot?

Posted by jpluimers on 2015/10/29

On a system where I just added a new E: drive, it was indeed available as

wmic logicaldisk where drivetype=3 get caption,filesystem,drivetype,providername,volumename

would  output:

Caption  DriveType  FileSystem  ProviderName  VolumeName
C:       3          NTFS
D:       3          NTFS                      
E:       3          NTFS

But it would not list as an administrative share since

net share

would give:

Share name   Resource                        Remark
-------------------------------------------------------------------------------
IPC$                                         Remote IPC
ADMIN$       C:\WINDOWS                      Remote Admin
D$           D:\                             Default share
C$           C:\                             Default share
The command completed successfully.

I wonder why the E$ drive was not visible. If anyone knows a better solution than a reboot, please let me know.

This was after the reboot:

Share name   Resource                        Remark
-------------------------------------------------------------------------------
IPC$                                         Remote IPC
ADMIN$       C:\WINDOWS                      Remote Admin
D$           D:\                             Default share
E$           E:\                             Default share
C$           C:\                             Default share
The command completed successfully.

–jeroen

via:

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

network, multicast and send address in TransportNetwork; via Digging into Tibco Rendezvous network details – II

Posted by jpluimers on 2015/10/28

Tibco is very powerful and can do all sorts of casting.

For my memory (formatted for readability; there are more details at OpenPGM Concepts : Transport):

The network parameter consists of up to three parts, separated by semicolons—network, multicast groups, send address—as in these examples:

Example Meaning
lan0 network only
lan0;225.1.1.1 one multicast group
lan0;225.1.1.1,225.1.1.5;225.1.1.6 two multicast groups, send address
lan0;;225.1.1.6 no multicast group, send address

The format is like this:

partOne;partTwo;partThree

and some bits are optional

partOne[;[partTwo][;[partThree]]]

Part one identifies the network, which you can specify in several ways: – Host name, Host IP address, Network name, Network IP number, Interface name, Default TRDP daemons use the network interface which corresponds to the hostname of the system as determined by the C function gethostname(). PGM daemons use the default PGM multicast interface, 224.0.1.78.

Part Two—Multicast Groups – Part two is a list of zero or more multicast groups to join, specified as IP addresses, separated by commas. Each address in part two must denote a valid multicast address. Joining a multicast group enables listeners on the resulting transport to receive data sent to that multicast group.

Part Three—Send Address, Part three is a single send address. When a program sends multicast data on the resulting transport, it is sent to this address. (Point-to-point data is not affected.) If present, this item must be an IP address—not a host name or network name. The send address need not be among the list of multicast groups joined in part two. If you join one or more multicast groups in part two, but do not specify a send address in part three, the send address defaults to the first multicast group listed in part two.

Note: I wasn’t aware that for Tibco Rendezvous the default multi-cast network was 225 (often you see 224 here, as that is the starting multi-cast range in the IANA IPv4 Address Space list)

–jeroen

via:

Posted in Communications Development, Development, Internet protocol suite, Network-and-equipment, Software Development, TCP, TIBCO Rendezvous | Leave a Comment »

The curse of “ORA-12560: TNS:protocol adapter error”

Posted by jpluimers on 2015/10/27

Today it is about the curse of

ORA-12560: TNS:protocol adapter error

Don’t you love the overly generic error messages you often get, especially from Oracle.

We log the additional information which doesn’t bring much help either:

Errors:Oracle.DataAccess.Client.OracleErrorCollection; Number: 12560

There is so much that can cause the Oracle 12560 error (including spurious SSL things), that it is often like searching for a needle in a haystack.

What in fact happened is that in a few of our .NET config files got empty ConnectionString attributes for Data Source, User Id and Password as this fragment shows:

connectionString=”Data Source=; User Id=; Password=;”

The cause was a parameter substitution step in our build process where we generate each config file based on templates. It failed on some of them as this simple grep query can reveal:

grep -ind connectionstring\=.*\=; *.config
grep -indl connectionstring\=.*\=; *.config

The first one shows the files and lines, the second one only the files.

So we now have some guarding in place that will prevent these attributes to become empty.

–jeroen

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Database Development, Development, OracleDB, Software Development | Leave a Comment »