The Wiert Corner – irregular stream of stuff

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

  • My work

  • 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,842 other followers

Archive for October, 2017

I keep a separate gallery app around just to be able to upload specific pictu…

Posted by jpluimers on 2017/10/20

Smart tip:

I keep a separate gallery app around just to be able to upload specific pictures to +Google Photos​ because there is no option to do so from the Photos

Via: [WayBack] I keep a separate gallery app around just to be able to… … – Roderick Gadellaa – Google+

–jeroen

Read the rest of this entry »

Posted in Android Devices, Google, Google Photos, Power User | Leave a Comment »

HOW TO: Fix the Error loading /s.v00 Fatal error: 33 (Inconsistent data) in the VMware vSphere Hypervisor

Posted by jpluimers on 2017/10/20

This happened to me when the USB stick that I ran ESXi 5.5 off broke down: [WayBack/Archive.is] HOW TO: Fix the Error loading /s.v00 Fatal error: 33 (Inconsistent data) in the VMware vSphere Hypervisor.

I didn’t follow the steps as I moved on to new hardware that required ESXi 6.5 update 1. In retrospect, I probably should have fixed ESXi 5.5 as the ESXi 6.5 Web vSphere UI – apart of having far less features than the classic Windows vSphere Client UI )is ridden with bugs. More on those bugs later.

–jeroen

 

Posted in ESXi5.5, ESXi6.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

“You would make for a great computer programmer”

Posted by jpluimers on 2017/10/20

A while ago, Joe C. Hecht mentioned for the second time about his family joke along the lines that he had bad grades at school despite being good at the topics. He got tested which resulted in “You would make for a great computer programmer”.

I wonder how this happened with other people in the IT. Did you get yourself a degree in that direction, or teach yourself programming and such?

The reason is that I recognise what Joe wrote: I’m still a bad learner from books or theory as I learn by doing. I specifically didn’t try to get a Computer Science degree as in the late 1980s in The Netherlands it basically was a heavy math degree plus Computer Science topics. So it was basically doing two studies at once and I was only interested in the Computer Science parts.

So I chose studying Chemistry (one of the science topics I really liked at high school) at the closest university to my home so I kept living with my parents.

In 20-20 hindsight this was not the right choice. But at that time I didn’t know about the right choice.

In about 4 years, I finished like 2.5 years of studying, was a geek-prototype (good at computers, bad at people skills) and still did a lot of Computer Science topics (even though the exams would be worthless as back then individual exams didn’t count unless they were part of the main direction of your study). The last year was prepping for practice and advanced topics. I slowly attended less and less sessions and did more and more programming gigs as somehow that was way more fun before slowly bailing out. I also sold network equipment to the university department helping them to connect to the internet and helped a lot of co-students with their computing issues and assignments, learned my way in DOS/3com/Novell/EARN/BITNET/DECNet/SunOS and VAX/VMS based technologies.

I only found out why I bailed out more than a decade later: I was a pragmatic guy learning by doing, not suited for a university that tried educating theorists. Besides that the department I wanted to finish my studies has two four camps: a very theoretic camp (with nice guys: they were the ones wanting internet access very early on), two less theoretic camps fighting each other and a lazy camp filling their days basically with doing as little as possible. A very unproductive and depressing situation. I had worked at the research labs of the paint factory doing research close to my studies, but there was no way the university would allow me to do my research phase there. Even more depressing.

Now (as always, hindsight is 20/20 vision) I know I should have bailed out early on and go for a more pragmatic study maybe not even a university but a polytechnic. On the other hand it helped doing a truckload of Turbo Pascal work (which I started at High School with Turbo Pascal 1 on CP/M with Apple ][+ and //e machines), programming in assembler/prolog/FORTRAN/C, getting connected to the internet (BITNET RELAY chat, mailing lists, early newsgroups, uucp, TCP/IP basics, thick/thin ethernet converters, serial and modem communication with Kermit and FidoNET, gopher, FTP and truckloads more stuff).

It got me into the Delphi, .NET and open source worlds, doing a lot of travel and conference speaking and being an early adopter of many technologies and concepts (some even so early that they only got way popular decades later – like the 1980s “the network is the computer” mantra – or making sense – like the lock semantics topics really became useful when around the century turn  single processor machines got multi-processor siblings and a lustrum later multi-core and multi-threading processors became available and ubiquitous around 2010) and taught me that being able to search and find things is way more important than knowing things.

So I wonder about all my followers:

How did your education go and how did you end up in computing?

–jeroen

References via Joe C. Hecht:

Read the rest of this entry »

Posted in About, BBS, BITNET Relay, Chat, FidoNet, History, Opinions, Personal, SocialMedia | Leave a Comment »

Mikrotik Router OS 6.37.1 – scripts and schedules – what policies they need to run

Posted by jpluimers on 2017/10/19

minimum schedule and script policies: read/write/policy/test

minimum schedule and script policies: read/write/policy/test

A year later, Mikrotik still needs to update their documentation, so from my question at [WayBack[Mikrotik follow-up needed] Router OS 6.37.1 – scheduled script cannot execute script – MikroTik RouterOS.

TL;DR:

  • use the same policies for scripts and schedules
  • use these policies as a minimum for scripts and schedules:
    • read
    • write
    • policy
    • test

Forum post:

I found out two things:

  1. the testFunctionScript needs at least these policies to call a function: read, write, policy, test
  2. a schedule needs at least the same permissions as a script in order to run the script at all

This is how the various permissions affect the testFunctionScript script:

  • no policies only allow :log info "testFunctionScript"; .
  • read allows the above and :local testFunctionJobs [/system script job print as-value detail]; which then is be logged with :log info "testFunctionJobs=$testFunctionJobs";
  • only write seems equivalent to no policies as it will only allow :log info "testFunctionScript";
  • read and write is equivalent to read
  • a lone policy or test policy (talk about confusion!) do not add functionality, so any combinations of just policy or testwith read and/or write get the same functionality as above
  • policy and test without any other seem equivalent to no policies as they result in only :log info "testFunctionScript"; to execute
  • the combined policies read, write, policy, test allow full script functionality including the function call and using the function call result

The above findings show that more logging is needed: the scheduler should log when (and why!) it does not have enough permissions to run a script. Right now you’re in the dark on when (and why!) a script isn’t ran by the scheduler.

The above findings show that these parts of the documentation need updating:

http://wiki.mikrotik.com/wiki/Manual:Sc … repository (update with info about the above policy combinations)
http://wiki.mikrotik.com/wiki/Manual:Ro … Properties (update with info about the above policy combinations)
http://wiki.mikrotik.com/wiki/Manual:System/Scheduler (does not document anything about policies at all)

The various scripts (apply your mix of policies that you need)

## logon as user jeroenp

/system script environment remove [ /system script environment find where name="testFunction" ];
:global testFunction do={
  :local result [/system resource get uptime];
  :return $result;
}

/system script environment print detail where name=testFunction
# 0 name="testFunction" value=";(eval /system scheduler  (eval /localname=$result;value=(eval (eval /system resource getvalue-name=uptime))) (eval /returnvalue=$result))" 

:log info "direct execution of testFunction"

{
:global testFunction;
:local testFunctionType [:typeof testFunction];
:local testFunctionResult [$testFunction];
:log info "testFunctionScript";
:log info "testFunctionType=$testFunctionType";
:log info "testFunctionResult=$testFunctionResult";
:log info "testFunction=$testFunction";
}

/log print where buffer=memory && (message~"testFunction" || topics~"info")

/system script remove [ /system script find where name="testFunctionScript" ];
/system script add name=testFunctionScript owner=jeroenp policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":global testFunction;\r\
    \n:log info \"testFunctionScript\";\r\
    \n:local testFunctionType [:typeof testFunction];\r\
    \n:local testFunctionResult [\$testFunction];\r\
    \n:log info \"testFunctionType=\$testFunctionType\";\r\
    \n:log info \"testFunctionResult=\$testFunctionResult\";\r\
    \n:log info \"testFunction=\$testFunction\";\r\
    \n"

:log info "execution of testFunction via testFunctionScript"

/system script run testFunctionScript

/log print where buffer=memory && (message~"testFunction" || topics~"info")

/system scheduler remove [ /system scheduler find where name="testFunctionScriptSchedule" ];
/system scheduler add interval=10s name=testFunctionScriptSchedule on-event=testFunctionScript policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=sep/22/2015 start-time=12:02:37

:log info "execution of testFunction via testFunctionScriptSchedule calling testFunctionScript"
:delay 20s
/system scheduler disable testFunctionScriptSchedule

/log print where buffer=memory && (message~"testFunction" || topics~"info")

/system scheduler print detail where name="testFunctionScriptSchedule"

–jeroen

Posted in Development, Internet, MikroTik, Power User, RouterOS, Routers, Scripting, Software Development | Leave a Comment »

delphi – VCL events with anonymous methods – what do you think about this implementation? – Stack Overflow

Posted by jpluimers on 2017/10/19

A long time ago, Pablo Vizcay a.k.a. [WayBackpragmatic_programmer wrote some cool code at [WayBackdelphi – VCL events with anonymous methods – what do you think about this implementation? – Stack Overflow.

I still think it’s a very neat solution to bind method references to events.

type
  TNotifyEventDispatcher = class(TComponent)
  protected
    FClosure: TProc<TObject>;

    procedure OnNotifyEvent(Sender: TObject);
  public
    class function Create(Owner: TComponent; Closure: TProc<TObject>): TNotifyEvent; overload;

    function Attach(Closure: TProc<TObject>): TNotifyEvent;
  end;

implementation

class function TNotifyEventDispatcher.Create(Owner: TComponent; Closure: TProc<TObject>): TNotifyEvent;
begin
  Result := TNotifyEventDispatcher.Create(Owner).Attach(Closure)
end;

function TNotifyEventDispatcher.Attach(Closure: TProc<TObject>): TNotifyEvent;
begin
  FClosure := Closure;
  Result := Self.OnNotifyEvent
end;

procedure TNotifyEventDispatcher.OnNotifyEvent(Sender: TObject);
begin
  if Assigned(FClosure) then
    FClosure(Sender)
end;

end.

And this is how it’s used for example:

procedure TForm1.FormCreate(Sender: TObject);
begin    
  Button1.OnClick := TNotifyEventDispatcher.Create(Self,
    procedure (Sender: TObject)
    begin
      Self.Caption := 'DONE!'
    end)
end;

–jeroen

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

 
%d bloggers like this: