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

Joseph Redmon: How computers learn to recognize objects instantly | TED Talk | TED.com

Posted by jpluimers on 2020/01/09

On my list of things to play with: [WayBackJoseph Redmon: How computers learn to recognize objects instantly | TED Talk | TED.com

It is about the super fast YOLO (You Only Look Once) engine that runs a full frame through a neural network performing object classification for all objects.

It can classify many frames per second.

More links on how to install it and get going:

–jeroen

Posted in Development, Software Development | Leave a Comment »

Python – list transformation; string formatting – Stack Overflow

Posted by jpluimers on 2020/01/08

Sometimes simple examples are the best: [WayBack] Python – list transformation – Stack Overflow.

Interactive example (note you can run and save at repl.it in either [WayBack] Repl.it – Python 3 or [WayBack] Repl.it – Python 2; you can run but not save it at [WayBack] Welcome to Python.org: interactive Python shell):

# Links the documentation are Python 2, though everything works in Python 3 as well.

x = [1,2,3,4,5,11]
print("x: ", repr(x))

y = ['01','02','03','04','05','11']
print("y: ", repr(y))

# List comprehension https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions
# ... using `str.format()` (Python >= 2.6): https://docs.python.org/2/library/stdtypes.html#str.format and https://docs.python.org/2/library/string.html#formatstrings
y = ["{0:0>2}".format(v) for v in x]
print("y: ", repr(y))

# ... using the traditional `%` formatting operator (Python < 2.6): https://docs.python.org/2/library/stdtypes.html#string-formatting y = ["%02d" % v for v in x] print("y: ", repr(y)) # ... using the format()` function (Python >= 2.6): https://docs.python.org/2/library/functions.html#format and https://docs.python.org/2/library/string.html#formatstrings
# this omits the "{0:...}" ceremony from the positional #0 parameter
y = [format(v, "0>2") for v in x]
print("y: ", repr(y))

# Note that for new style format strings, the positional argument (to specify argument #0) is optional (Python >= 2.7) https://docs.python.org/2/library/string.html#formatstrings
y = ["{:0>2}".format(v) for v in x]
print("y: ", repr(y))

# Using `lambda`
# ... Python < 3 return a list y = map(lambda v: "%02d" %v, x) print("y: ", repr(y)) # ... Python >= 3 return a map object to iterate over https://stackoverflow.com/questions/1303347/getting-a-map-to-return-a-list-in-python-3-x/1303354#1303354
y = list(map(lambda v: "%02d" %v, x))
print("y: ", repr(y))

Output:

Python 3 Python 2
Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
   
x:  [1, 2, 3, 4, 5, 11]
y:  ['01', '02', '03', '04', '05', '11']
y:  ['01', '02', '03', '04', '05', '11']
y:  ['01', '02', '03', '04', '05', '11']
y:  ['01', '02', '03', '04', '05', '11']
y:  ['01', '02', '03', '04', '05', '11']
y:  <map object at 0x7fe1218200b8>
y:  ['01', '02', '03', '04', '05', '11']
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.8.2] on linux
   
('x: ', '[1, 2, 3, 4, 5, 11]')
('y: ', "['01', '02', '03', '04', '05', '11']")
('y: ', "['01', '02', '03', '04', '05', '11']")
('y: ', "['01', '02', '03', '04', '05', '11']")
('y: ', "['01', '02', '03', '04', '05', '11']")
('y: ', "['01', '02', '03', '04', '05', '11']")
('y: ', "['01', '02', '03', '04', '05', '11']")
('y: ', "['01', '02', '03', '04', '05', '11']")

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Development, Event, Python, Scripting, Software Development | Leave a Comment »

TFreedObject in FastMM4/FastMM4.pas at master · pleriche/FastMM4 · GitHub

Posted by jpluimers on 2020/01/08

Reminder to Self:

  {The class used to catch attempts to execute a virtual method of a freed
   object}
  TFreedObject = class
  public
    procedure GetVirtualMethodIndex;
    procedure VirtualMethodError;
{$ifdef CatchUseOfFreedInterfaces}
    procedure InterfaceError;
{$endif}
  end;

If you encounter the class TFreedObject when doing a cast, then you’re working on a freed object and have FastMM4 enabled to detect that.

Source: [WayBackFastMM4/FastMM4.pas at master · pleriche/FastMM4 · GitHub; FastMM4 – A memory manager for Delphi and C++ Builder with powerful debugging facilities

Note that if you want to see the underlying FastMM data for any TObject allocation, use this watch (where Self is the current instance):

PFullDebugBlockHeader(PByte(Self) - SizeOf(TFullDebugBlockHeader))^

You can also put a ,r behind it to see the fields of this structure:

(Reserved1:nil; Reserved2:nil; AllocatedByRoutine:$41BF74; AllocationGroup:0; 
AllocationNumber:592682; 
AllocationStackTrace:(4224198, 4233131, 4235210, 11103806, 6552132, 131126, 6597961, 11106984, 4235210, 11107153, 11104090); 
AllocatedByThread:90428; FreedByThread:90428; 
FreeStackTrace:(4241541, 131126, 4235210, 11103806, 6552132, 131126, 6597961, 11106984, 4235210, 11107153, 11104090); 
UserSize:36; PreviouslyUsedByClass:132272; HeaderCheckSum:2673350594)

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

Crosscompiling with Lazarus 1.8 on Linux Mint 18.3 | The Programming Works

Posted by jpluimers on 2020/01/08

As I will likely need this one day: [Archive.is / WayBackCrosscompiling with Lazarus 1.8 on Linux Mint 18.3 | The Programming Works.

There are quite a few one-time manual setups to initially set this up, but after that it’s a piece of cake.

via:

–jeroen

Read the rest of this entry »

Posted in Development, FreePascal, Lazarus, Pascal, Software Development | Leave a Comment »

Mads Kristensen on Twitter: “Visual Studio Tip: A blue dot in the margin indicates a switch of threads while stepping through debugging. #vstip… “

Posted by jpluimers on 2020/01/07

[WayBack] Mads Kristensen on Twitter: “Visual Studio Tip: A blue dot in the margin indicates a switch of threads while stepping through debugging. #vstip… “

–jeroen

Read the rest of this entry »

Posted in .NET, Development, Software Development, Visual Studio and tools | Leave a Comment »

Use PiServer to easily set up a network of client Raspberry Pi clients connected to a single x86-based server via Ethernet.

Posted by jpluimers on 2020/01/07

On my list of things to try:

PiServer is our new piece of software that makes it easy to create a network of Pis you can centrally control — ideal for your computing classroom or club!

Source: [WayBack] The Raspberry Pi PiServer tool – Raspberry Pi

Via: [WayBack] Use PiServer to easily set up a network of client Raspberry Pis connected to a single x86-based server via Ethernet. With PiServer, you don’t need SD card… – Raspberry Pi – Google+

–jeroen

Posted in Development, Hardware Development, Hardware Interfacing, Raspberry Pi | Leave a Comment »

VCL FadingEffect by Paul Toth at GitHub

Posted by jpluimers on 2020/01/07

In case I ever need a fading effect between 2 panels on one form, there is some code that will get me started.

I’d probably code it in a different design (without a global variable), but it works so can be a good source of ideas.

Source: Delphi/FadingEffect at master · tothpaul/Delphi · GitHub

Via: [WayBack] VCL Tiny demo of a Fading effect for Delphi Tokyo  – Paul TOTH – Google+

–jeroen

Read the rest of this entry »

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

Im memoriam: Rudy Velthuis

Posted by jpluimers on 2020/01/05

Given that I’m fighting rectal cancer and am extremely low on energy, I am keeping this much shorter than I want to.

Recently, I learned that Rudy Velthuis passed away on 2019-05-13. Born on 1960-10-30, he passed away at only age 58.

After asking permission from his family, I wrote a small im memoriam.

We frequently encountered each other on-line in the Delphi community, especially in the early days when I was way more active on forums, newsgroups and chat channels. He was famous there, with good reason.

Though colloquially known as [WayBack“dentist with a strong interest in programming”, he was a great Delphi programmer and very well known for thoroughly documenting the many gaps that Embarcadero left in their documentation.

In 2009, Edwin van der Kraan and I had an opportunity to have dinner with Rudy. We met at his house, where we learned he not only ran a fully fledged dentistry practice, but also was married someone who origilally was from the Philippines. A truly happy couple they were.

In retrospect, I wish we had had met in real life more often, but I’m learning the hard way that life is finite giving you only so much time to do things.

I will remember Rudy because of his knowledge, wit and odd – but great – combination of work and interests.

In the mean time, I have asked a few archival organisations (including the WayBack machine) to archive his sites:

Some of his profiles that I archived on 20190103:

I love the “Kraftwerk – Autobahn” picture on his Stack Overflow profile page, so I included that song below the fold.

Related:

–jeroen

Read the rest of this entry »

Posted in About, Delphi, Development, History, Personal, Software Development | 4 Comments »

Brilliant device: iPazzPort Wireless Mini Handheld Keyboard with Touchpad Mouse Combo for Android TV Box and Raspberry Pi 3 and HTPC and XBMC KP-810-19S – Black: Computers & Accessories

Posted by jpluimers on 2020/01/03

Brilliant device: [WayBack] KP-810-19BTT Mini Bluetooth Keyboard with touchpad – Unisen Group iPazzPort

I got it via Amazon USA ([WayBack] iPazzPort Wireless Mini Handheld Keyboard with Touchpad Mouse Combo for Android TV Box and Raspberry Pi 3 and HTPC and XBMC KP-810-19S – Black: Computers & Accessories), but Amazon in Europe has it as well (this is the German link:[Archive.isiPazzPort Mini Wireless Handheld Tastatur mit Touchpad: AmazonSmile: Computer & Zubehör; replace .de with .fr, .co.uk, to find your local link).

There are this one is 2.4 Ghz, includes a USB dongle in the battery compartment and requires 2 AAA batteries.

There are Bluetooth and back-lit versions too which cost slightly more.

Via: [WayBack] Raspberry Pi Cluster – Software Team Lead

–jeroen

Posted in Development, Hardware Interfacing, Keyboards and Keyboard Shortcuts, Power User, USB | Leave a Comment »

elektronica-shop.nl :Montagedraad.html

Posted by jpluimers on 2020/01/03

The cool thing about elektronica-shop.nl is that they have [WayBackMontagedraad in various colours for most diameters:

A short list:

  • 0.14 mm2: rood/bruin/blauw/groen/geel/oranje/zwart/wit/grijs
  • 0.20 mm2: zwart/bruin/rood/oranje/geel/groen/blauw/paars/grijs/wit
  • 0.75 mm2: blauw/bruin/groen-geel/grijs/oranje/wit/violet(paars)/zwart/rood/geel/groen
  • 1.00 mm2: zwart/rood
  • 1.50 mm2: zwart/rood/blauw/bruin/groen-geel
  • 2.50 mm2: zwart/rood
  • 4.00 mm2: zwart/rood
  • 6.00 mm2: zwart/rood

Translations:

  • rood = red
  • bruin = brown
  • blauw = blue
  • groen = green
  • geel = yellow
  • oranje = orange
  • zwart = black
  • wit = white
  • grijs = grey/gray
  • paars = purple
  • violet = violet
  • groen-geel = green-yellow striped

The maximum current (Amperage) depend on the area through which the current can flow. It can be roughly translated from the AWG (American Wire Gauge). See the table below.

De AWG-code wordt met name in de elektrotechniek om de dikte van elektrische geleiders en de toebehoren daarvan, zoals adereindhulzen, kabelschoenen en -klemmen, aan te duiden.

AWG  -  mm²    -  mm

4   -  21       -   5.2
6   -  13       -   4.1
8   -    8       -   3.2
10   -    6       -   2.6
12   -    4       -   2
14   -    2.5    -   1.6
16   -    1.5    -   1.3
18   -    1       -   1
20   -    0.5    -   0.8
22   -    0.3    -   0.65
24   -    0.2    -   0.5
26   -    0.13  -   0.4
28   -    0.08  -   0.32
30   -    0.05  -   0.25

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