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

Archive for April, 2016

“Comprehensive Guide to pfSense 2.3” and “pFsense Firewall setup and Features in depth March 2016”

Posted by jpluimers on 2016/04/25

Now that pfSense 2.3 is out some videos:

–jeroen

Read the rest of this entry »

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

Anyone that installed D10.1 had the new installation dialogs that Embarcadero brags about…

Posted by jpluimers on 2016/04/22

Conclusion:

–jeroen

Source: Anyone that installed D10.1 had the new installation dialogs that Embarcadero…

Posted in Delphi, Delphi 10.1 Berlin (BigBen), Development, Software Development | 10 Comments »

Some real world ZFS on Linux experience by GridPP

Posted by jpluimers on 2016/04/22

GridPP – providing computing and storage facilities for grid computing in the UK – has published 3 nice articles on their use of ZFS on Linux and comparison against hardware RAID:

  1. GridPP storage news: ZFS vs Hardware Raid
  2. GridPP storage news: ZFS vs Hardware Raid System, Part II
  3. GridPP storage news: ZFS vs Hardware Raid System, Part III

Thanks Marcus Ebert for sharing these.

–jeroen

Posted in *nix, Power User, ZFS | Leave a Comment »

Hacking is Important — Medium

Posted by jpluimers on 2016/04/22

“We’re barbarians, not bureaucrats!”

Source: Hacking is Important — Medium

On hacking vs processes, being disruptive and how people think. Short stories about Borland, Apple, FaceBook and others.

–jeroen

via: Hacking is Important — Medium – David Berneda – Google+

Posted in Apple, Delphi, Development, Facebook, LifeHacker, Power User, SocialMedia, Software Development | Leave a Comment »

In metric, one milliliter of water occupies one…

Posted by jpluimers on 2016/04/22

(:

“In metric, one milliliter of water occupies one cubic centimeter, weighs one gram, and requires one calorie of energy to heat up by one degree centigrade—which is 1 percent of the difference between its freezing point and its boiling point. An amount of hydrogen weighing the same amount has exactly one mole of atoms in it.Whereas in the American system, the answer to “How much energy does it take to boil a room-temperature gallon of water?” is “Go fuck yourself,” because you can’t directly relate any of those quantities.

from Wild Thing: A Novel by Josh Bazell

–jeroen

via A Brit Abroad – In metric, one milliliter of water occupies one….

Posted in About, Personal | Leave a Comment »

Internal version numbers for conditional defines etc

Posted by jpluimers on 2016/04/21

Thanks Daniel Jackson for posting (the DocWiki hasn’t been update yet):

Version Conditional: VER310
Product Version: 24
Package Version: 240
IDE Version: 18.0
Compiler Version: 31

Source: I had expected Embarcadero would have updated the documentation to reflect the…

–jeroen

Posted in Delphi, Delphi 10.1 Berlin (BigBen), Development, Software Development | 2 Comments »

RubyMania has reached Delphi – Times helper method implementation for integers – from Asbjørn Heid

Posted by jpluimers on 2016/04/21

The below fragment is one of the favourite kinds of examples in the Ruby world:

5.times { |i| print i, " " }

It uses the times method on Integer and prints:

0 1 2 3 4

There are many implementations of this in other languages, for instance Ruby’s ‘times()’ function in C# | Of Code and Me (which the WordPress.com editor fucked up as it replaced Action<int> with Action which is a totally different thing, so the gist with code is below.

public static class IntExtensions
{
    public static void Times(this int i, Action func)
    {
        for(int j = 0; j < i; j++)
        {
            func(j);
        }
    }
}

Which you use as

5.Times(i => Console.Write(i));

It’s slightly off as it prints:

01234

I know; nitpicking, but this code works (did I ever tell I love .NET fiddle?):

5.Times(i => Console.Write("{0} ", i));

Well, Mason Wheeler encouraged Asbjørn Heid for the below Ruby Mania in Delphi; just read the comments at In C# nearly everything is an object, so when writing a unit test for a string…

Since the WordPress.com editor fucks up TProc<Integer> into TProc and TProc behaves differently from TProc<Integer>, I’ve included a gist link with the actual code below.

program RubyManiaConsoleProject;

uses
  System.SysUtils;

type
  TRubyMania = record helper for ShortInt
    procedure times(const IterBody: TProc);
  end;

procedure TRubyMania.times(const IterBody: TProc);
var
  i: Integer;
begin
  for i := 0 to Self-1 do
    IterBody(i);
end;

begin
  5.times(
    procedure(i: Integer)
    begin
      Write(i, ' ');
    end
  );
end.

It also shows why I hardly use anonymous methods in Delphi: they’re way too verbose.

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, Software Development | 1 Comment »

XSD enumerations: restrict strings, integers, etc.

Posted by jpluimers on 2016/04/21

XSD enumerations are nice as they can be used to restrict simple XSD types to a set of values.

But they can also be hard if the set changes over time: restricting further is not possible, but extending isn’t always easy either.

Some interesting links:

–jeroen

Posted in Development, XML/XSD, XSD | Leave a Comment »

Detecting the use of “curl | bash” server side | Application Security

Posted by jpluimers on 2016/04/20

From the “let people know when they are stupid” department:

Another reason not to pipe from curl to bash. Detecting curl | bash serverside.

Source: Detecting the use of “curl | bash” server side | Application Security

–jeroen

Posted in Development, Python, Scripting, Software Development | 1 Comment »

Support of import in xsd.exe – Jose Luis Calvo Salanova – Site Home – MSDN Blogs

Posted by jpluimers on 2016/04/20

I tend to forget this: xsd.exe can resolve xs:include, but not xs:import. When using xs:import it will complain about missing types.

Simple solution: reference all imported XSDs (but not included XSDs) on the same command-line:

I was trying to create a C# class with xsd.exe from an schema that imports others schemas like that xsd.exe /c schema.xsd and it fails miserably reporting an error like “The datatype ‘xxx’ is missing.”. Basically xsd.exe doesn’t resolve the schemaLocation attribute.

Dare Obasanjo’s article addresses the problem, and Scott Hanselman had the same problem -and solved it-.

The solution isn’t very nice, but at least it’s simple. You have to tell xsd.exe all the schema referenced, xsd.exe /c schema.xsd importedSchema1.xsd importedSchema2.xsd

Be aware that the C# filename is sometimes generated from all XSD filenames on the command-line (I’ve noticed this when the import is specified before the actual XSD file, if the import is at the end, the name of the import is used.

If my memory serves me right, older versions of XSD.exe could not resolve unix-style relative paths on the command-line, but newer versions do.

–jeroen

via: Support of import in xsd.exe – Jose Luis Calvo Salanova – Site Home – MSDN Blogs.

Posted in .NET, C#, Development, Software Development, XML/XSD, XSD | Leave a Comment »