The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • 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

On my research list: TensorFlow from other languages

Posted by jpluimers on 2019/09/25

On my research list as it pointed me to TensorFlow imports from both .NET and Delphi: [WayBackFixed by Code: Using TensorFlow™ with Delphi – or how to use a TStack<T> to simulate a RPN calculator.

Links from it:

I like the demo there, as I’ve done RPN calculator with some modeling tools before which makes for a good demo, and it reminds me of the HP 12C financial calculator my dad used to have.

If you like more TensorFlow, then watch the video I linked before:  “Large-Scale Deep Learning with TensorFlow,” Jeff Dean – YouTube

Via

Older conversion try: [WayBack] Converting the TensorFlow C++ headers to object pascal. It has this empty struct defined.typedef struct TF_Tensor TF_Tensor;Think it converts to obj… – Eli M – Google+

–jeroen

Read the rest of this entry »

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

Convert an object instance into a JSON string and making use of custom attributes – Flix Engineering

Posted by jpluimers on 2019/09/24

For my link archive, [WayBack] Convert an object instance into a JSON string and making use of custom attributes – Flix Engineering:

JSON, JSONMarshalled, JSONName Delphi Convert an object instance into a JSON string and making use of custom attributes

This is a welcome explanation as in [WayBack] REST.Json.Types – RAD Studio API Documentation, these attributes have very shallow documentation:

Via: [WayBack] Is there any documentation for attribute and Json? uses Rest.Json, Rest.Json.Types; [JSONName(‘TokenName’)] – Thomas Bornhaupt – Google+

–jeroen

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

Fork – a fast and friendly git client for Mac

Posted by jpluimers on 2019/09/24

Works for Windows too: [WayBack] Fork – a fast and friendly git client for Mac.

Via [WayBack] Weekend Reader 2017.46 – reality-loop(who switched away from SourceTree, because, well, that was ahead of it’s time but in the end couldn’t keep up with reality)

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, git-fork, Software Development, Source Code Management, SourceTree | Leave a Comment »

Research list: haproxy and Connection: close

Posted by jpluimers on 2019/09/24

At a site, haproxy was configured like this for a particular back-end:

backend http_FUNCTIONALITY_cluster
    log global
    mode http
# default httpchk checks / which for our functionality intentionally returns 500 causing haproxy to think it's down
#   option httpchk
# FUNCTIONALITY has a /FUNCTIONALITY which returns a 200 OK
    option httpchk get /FUNCTIONALITY
    http-check expect ! rstatus ^5
    option http-keep-alive
    option forwardfor
    server w7connexxion 192.168.178.42:8181 cookie FUNCTIONALITYA check

The /FUNCTIONALITY would return a multi-kilobyte result.

The HAproxy would send the request with this body:

Connection: close

In the midst of the server returning an http request of more than one TCP frame:

Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 4068
Date: Mon, 20 Nov 2017 08:17:02 GMT

<html><head><META ...

, the HAproxy would kill the connection, resulting in a 10054 error on Windows, which [WayBack] Windows Sockets Error Codes indicates it is this:

WSAECONNRESET
10054
Connection reset by peer.

An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.

So both sides are right in that they will close the connection (despite the HTTP keep alive): [WayBack] What does “Connection: close” means when used in the response message?

Howver, I think HAproxy is way too soon closing the connection, especially as it does not use the configured keep alive ([WayBack] How to make HA Proxy keepalive and [WayBack] Hypertext Transfer Protocol — HTTP/1.1 RFC 2616 = 14 Header Field Definitions – 14.10 Connection).

The 10054 would end up in the Windows Event Log for Applications like this:

The description for Event ID 0 from source MyFunctionality.exe cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Socket Error # 10054
Connection reset by peer.

In the mean time, we shortened the result, so it does not fail any more.

Later I hope to find some time to do more research on this, for which I hope [WayBack] Health checking – HAProxy Technologies is a base.

–jeroen

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

Skin effect – Wikipedia

Posted by jpluimers on 2019/09/23

Skin effect – Wikipedia:

Skin effect is the tendency of an alternating electric current (AC) to become distributed within a conductorsuch that the current density is largest near the surface of the conductor, and decreases with greater depths in the conductor. …

At high frequencies the skin depth becomes much smaller. … Because the interior of a large conductor carries so little of the current, tubular conductors such as pipe can be used to save weight and cost.

Via [WayBack] Odd: “copper” central lead of antenna cable attracted by magnetic screwdriver tip. – Jeroen Wiert Pluimers – Google+

–jeroen

 

Posted in Development, Hardware Development, LifeHacker, Power User | Leave a Comment »

28 Product Backlog and Refinement Anti-Patterns – Agile Transition

Posted by jpluimers on 2019/09/23

Food for thought: [WayBack] 28 Product Backlog and Refinement Anti-Patterns – Agile Transition

The most important one I learned: keep 20% slack and 20% technical debt+bugs (on a legacy system even more of the latter). This sounds like 40% waste, but is in effect a huge win as it makes the team much more flexible in responding to spikes, supporting team-mates (or cross functional teams) or having an off-day.

Via: [WayBack] 28 Product Backlog and Refinement Anti-Patterns – Agile Transition – Marjan Venema – Google+

–jeroen

Read the rest of this entry »

Posted in Agile, Development, Scrum, Software Development | Leave a Comment »

Dave’s Development Blog – Using CodeSite on interfaced objects

Posted by jpluimers on 2019/09/20

Reminder to self: [WayBackDave’s Development Blog – Using CodeSite on interfaced objects:

Note to self…

If using CodeSite to log Constructor and Destructor behaviour on interfaced objects, make sure its the first unit in the project so that it is the first unit initialised AND THE LAST unit finalised!

This will save you hours and hours hunting down shutdown AVs 🙁

Or in my projects, the uses list in the Delphi project should be this order:

  1. FastMM4Bootstrap
  2. CodeSite

Via: [WayBackUsing CodeSite on interfaced objects  – David Hoyle – Google+

–jeroen

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

Hi, We need to implement a functionality in our VCL application where the user…

Posted by jpluimers on 2019/09/19

In recent Delphi versions one is encouraged to use the routines from System.NetEncoding. Also Soap.EncdDecd is only a wrapper to them. Even if you use the stream based implementations the whole stream is read into a TBytes. So no real gain there any more.

Source: [WayBackHi, We need to implement a functionality in our VCL application where the user…

Related:

–jeroen

Posted in Delphi, Development, SOAP/WebServices, Software Development | Leave a Comment »

LED Voltage Drops

Posted by jpluimers on 2019/09/19

[WayBackDangerous Prototypes: Basic Light Emitting Diode guide – Voltage drop or forward voltage has a nice table of common LED types:

You can also measure them yourself using most multi-meters have setting for that as described in [WayBack] Easy way to figure out a LED’s Vf in order to pick an appropriate resistor – Electrical Engineering Stack Exchange

You can also measure yourself, but my Proster VC99 multi-meter (cheap, but functions well, see for instance the review in [WayBack] MagPi issue 43) can measure voltage drop, so I’ve measured some LEDs from old PC cases:

  • Red: 1.8 V
  • Yellow: 1.8 V
  • Green: 1.8 V
  • Blue: does not measure

Given that they all have the same voltage drop, I made the below table with some resistor values to get the same current through them on various voltages (3.3V, 5V and 12V) based on Standard resistor values.

Note anything less than 20mA of current usually is OK (though 20mA often is on the bright side).

LED Colour Voltage drop (Vf) Total Voltage Remaining Voltage Resistance Ω Current mA Power mW
Any 1.8 5 3.2 220 14.55 46.55
Any 1.8 12 10.2 680 15.00 153.00
Any 1.8 3.3 1.5 100 15.00 22.50
Any 1.8 5 3.2 330 9.70 31.03
Any 1.8 12 10.2 1000 10.20 104.04
Any 1.8 3.3 1.5 150 10.00 15.00
Any 1.8 5 3.2 470 6.81 21.79
Any 1.8 12 10.2 1500 6.80 69.36
Any 1.8 3.3 1.5 220 6.82 10.23

Background for doing these calculations:

–jeroen

Read the rest of this entry »

Posted in Development, Hardware Development | Leave a Comment »

Product Discovery Anti-Patterns Leading to Failure

Posted by jpluimers on 2019/09/19

Learn more about the product discovery anti-patterns that can manifest themselves when you try to fill Scrum’s product discovery void. #agileantipatterns #productdiscovery #productroadmap

Source: [WayBackProduct Discovery Anti-Patterns Leading to Failure

Via: [WayBack] Product Discovery Anti-Patterns Leading to Failure – Marjan Venema – Google+

–jeroen

 

Posted in Agile, Development, Scrum, Software Development | Leave a Comment »