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

Anyone tried #Telegram to communicate securely?

Posted by jpluimers on 2021/01/22

Below are a few comments from [WayBack] Anyone tried #Telegram to communicate securely? Some nice features there… Looks way more secure than WeChat and all that. Thoughts? https://telegram…. – Jason Mayes – Google+.

The consensus seems to be

  • Signal is the way to go for secure chat. It is open source too.
  • When chatting with groups of people, there is technical security, but not social security.
  • Telegram is easier to use than some other chat platforms, and has a large user base.

The comments:

  • Ryan Ostendorf's profile photo
    Telegram is pretty nice, but its security leaves much to be desired. If it’s security and true privacy you want, Signal is the way to go.
  • M.A. Zaki's profile photo
    Hi+Ryan Ostendorf signal is indeed a way to go but didn’t have big users number compared to Telegram.
  • Wayne Harris's profile photo

    I use telegram, discord, slack & hangouts for variousn groups i talk with. Of those, telegeam is my preferred for ease of use etc. One thing i would like to see is a “index” of groups to maybe easier prioritise what i want to read (a-la how discord wokrs with its different servers) but im so used to the flat style of telegram/hangouts that i dont have a huge issue with its current design

    Re security, im not an expert, but it seems ok, with multuple options available. Havent heard of anything being intercepted/hacked, but who really know what our alien overlords – err governments – and other interested parties are up to behind the scenes.

  • oon arfiandwi (OonID)'s profile photo
    I use telegram more than whatsapp. I found many technical group discussion (at least for Indonesian) because telegram supports a huge amount of members per group.
    also, the telegram bot and channel give a unique feature for a developer to build an application on top of it.
  • Jason Mayes's profile photo
    +Ryan Ostendorf oooh thanks I shall check it out
  • Jason Mayes's profile photo
    Thanks everyone for feedback!
  • Leo Turing's profile photo
    I am using Telegram for 5 years now. Far faster and better than WhatsApp in many ways.
  • Christopher Gaul's profile photo

    It’s security level depends on who you ask. If you take their word at face value it’s great. If you believe the rumors it’s totally bent by U.S. surveillance agencies.

    Feature wise it’s decent otherwise.

    A few of us are on the hunt for a good, secure, multi platform messaging platform to replace Hangouts when they kill that. We’ve narrowed it down to a few that we’re testing.

    Signal was good until they killed their linux and browser clients.

    Retroshare is on the to test list along with…

    Viber.

    Tox.

  • epsi nurwijayadi's profile photo

    I have been a telegram user since october 2017.

    And I wonder, how do telegram make profit.

    Who is paying for the server to be alive ?

  • Christopher Gaul's profile photo
    Side note. You can just assume that any product based out of the U.S. or any Five Eyes country is not secure. I wouldn’t trust anything EU based either. What’s that leave you?
  • Christopher Gaul's profile photo
    +epsi nurwijayadi
    The NSA no doubt is footing the bills.
  • x Meta x's profile photo
    For dependable privacy, I use two cans and a string.
  • Jason Mayes's profile photo
    +x Meta x I can use a laser pointed at your string to measure the sound being transferred over it though
  • x Meta x's profile photo

    +Jason Mayes …..

    …. Curses! Foiled again!

  • Wayne Harris's profile photo
    I use the postal service. Nobody sends anything via that these days other than birthday cards from Nanna’s, so my most private missives go conpletely un-noticed by the authorities
  • epsi nurwijayadi's profile photo
  • Jason ON's profile photo
    I downloaded Telegram yesterday, in fact. Haven’t had a chance to try it out yet as I don’t know anyone using it. I had thought it would be more like BBM, with public groups in a social media-lite feature, but it’s not.
  • M.A. Zaki's profile photo
    +Jason ON telegram got more than that. The setting let you do much more.
  • epsi nurwijayadi's profile photo
    I remember getting very happy, when I got telegram from my father when I was a kid in about 80s. He had duty in other island faraway from home.
  • Willem Oosting's profile photo

    +Jason Mayes Check out Keybase.io they strike a sweet balance between Wire-like security (encrypted group chats), and Telegram-like usability/looks. And I thought it’s FOSS!

    Keybase

    Keybase
    keybase.io
  • Robert Wallis's profile photo

    Telegram has a very tempting feature set for a “messaging” service.

    I have recently started using it. Top reasons I like it so far are the ability to add a username, which means I can be available without giving people my phone number.

    My URL 👉 t.me/qwallis

    Also the ability to have branded public broadcast channels is different. I’ve set one up for London Meet-ups for +Happening London the URL for that is here 👉 t.me/HappeningLondon

    Any public post cam be embedded, so I’m surfacing the next meet-up on the +Happening London web site too 👉 happeninglondon.co.uk

    Those feature (and others) make Telegram interesting.

  • Christopher Gaul's profile photo

    +Robert Wallis I agree. With the caveat that this is as long as you aren’t expecting 100% guaranteed secure communications.

    Of course the question of whether such a thing even exists is valid. But in Telegram’s case, at least expect your local Five Eyes government surveillance state to be “reading” them.

  • Jonas Hellström (shellström)'s profile photo
    I’m giving Matrix/Synapse and riot.im a whirl.
    Mostly because I can selfhost it, and it’s got some good things going for it, like encrypted convos.
    They still got a mile or two on their clients and that’s where I’m holding off on inviting everyone and their dogs until there’s something that can be used by more people without becoming a troubleshooting nightmare/”this isn’t as easy as whatsapp. Can’t we use messenger instead?” kind of deal.

    Riot – Riot – open team collaboration

    Riot – Riot – open team collaboration
    about.riot.im
  • Robert Wallis's profile photo

    +Christopher Gaul yeah, but where aren’t they?

    As far as I understand Telegram has been validated for “secret chats” between two users, where security models are more easily implemented, but for groups of up to 200,00 that’s never going to be “secret” just hidden, and public broadcast channels are … well public.

–jeroen

Posted in Chat, Keybase, LifeHacker, Power User, Security, SocialMedia, Telegram | Leave a Comment »

Limiting Google Research to multiple web-sites using the OR and site: operators

Posted by jpluimers on 2021/01/22

I knew Google Search had a site: operator and I thought you could or them together using something like this:

reboot site:superuser.com or site:android.stackexchange.com

To my surprise that returned zero results as in empty result list.

Indeed: the OR needs to be in uppercase to work:

you can use the OR operator to add another site to your query:

reboot site:superuser.com OR site:android.stackexchange.com

–jeroen

Source: How to limit Google search result to a set of websites? – Web Applications Stack Exchange [WayBack]

Posted in Google, GoogleSearch, Power User | Leave a Comment »

Thought experiments can help you solve a problem early

Posted by jpluimers on 2021/01/21

Important logical principle to take away from [WayBack] The dialog manager, part 2: Creating the frame window – The Old New Thing:

If you’re not sure whether something is true, ask yourself, “What would the world be like if it were true?” If you find a logical consequence that is obviously wrong, then you have just proven [by contradiction] that the thing you’re considering is indeed not true.

Thought experiments like these can really help you get a feel for parts of a problem before you completely resolve the full problem.

Related: Thought experiment – Wikipedia

–jeroen

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

Default XML encoding is UTF-8 (or better: utf-8). If it contains other byte sequences, this is an error.

Posted by jpluimers on 2021/01/21

I should have had the below answer when writing about StUF – receiving data from a provider where UTF-8 is in fact ISO-8859.

A while ago, a co-worker did not believe when I told that default XML encoding really is UTF-8 (and tried to force it to utf-8), and that if the content had byte sequences different from the (either specified or default) encoding, it was a problem.

I though I blogged about the default, and where to find it, but apparently, I did not.

My blog had (and has <g>) a truckload of articles mentioning UTF-8, less articles containing UTF-8, encoding and xml, but the ones having UTF-8, default, encoding and xml did not actually tell about a standard that really defines XML uses UTF-8 as default encoding when there is no other encoding information – like BOM (byte order mark), HTTP, or MIME encoding) available.

W3C indeed specifies it. [WayBack] utf 8 – How default is the default encoding (UTF-8) in the XML Declaration? – Stack Overflow has a summary (thanks James Holderness!):

The Short Answer

Under the very specific circumstances of a UTF-8 encoded document with no external encoding information (which I understand from the comments is what you’re interested in), there is no difference between the two declarations.

The long answer is far more interesting though.

and an elaboration:

Read the rest of this entry »

Posted in Development, Encoding, Software Development, UTF-8, UTF8, XML, XML/XSD | Leave a Comment »

If you use an implementation of TNonRefCountInterfacedObject, then document in the descendants how lifetime management is arranged for

Posted by jpluimers on 2021/01/21

There are a few TNonRefCountInterfacedObject (or maybe better named TNonReferenceCountedInterfacedObject) implementations around (see list of links below).

They can be used to expose interfaces, but do not provide interface reference counting. This means you have to do your own lifetime management, which can bring quite a few headaches.

So each class you descend from it must have proper motivation on why, and how lifetime management is performed.

One thing you can do is mark the class with a hint directive like [WayBack] library.

In addition, [Archive.is] TNonRefCountInterfacedObject / [Archive.is] TNonReferenceCountedInterfacedObject implementations should at least implement [WayBack] IInterface (or [WayBack] IUnknown in really old Delphi versions); I have seen implementations that don’t but just provide almost empty [WayBackQueryInterface, [WayBack] _AddRef and [WayBack] _Release methods).

Some examples via  “TNonRefCountInterfacedObject” – Google Search:

Delphi RTL/VLC/FMX

I used this GExperts Grep Search expression to find the entries below: (_AddRef|_Release|QueryInterface)

Delphi itself has a few implementations of non-standard interface management that have good documentation on their use cases. So take a look at at least these before doing something odd with interface implementations yourself:

  • [WayBack] TAggregatedObject in System
    • This redirects all IInterface implementations to a controller
    • It does not implement IInterface itself, so a descendent must add the interface reference
    • Descendants are TContainedObject and TPropertyPageImpl (the latter used by TActiveXPropertyPage)
  • [WayBack] TContainedObject in System
    • This redirects all IInterface implementations except QueryInterface to a controller
    • Descendants are for instance TSOAPHeaders (via TSOAPHeadersBase) used by TSoapPascalInvoker, TInvokableClass and TRIO, and TConnectionPoint used by TConnectionPoints
  • [WayBack] TInterfacedPersistent in System.Classes
    • This supports the notion of (potentially) being owned by another TPersistent. Classes like TCollectionItem, TFieldOptions and TEditButton implement this ownership behaviour.
    • When owned, then redirect reference counting to the owner (if that owner implements IInterface), but not QueryInterface
    • When not owned, then it is effectively non-reference counted
  • [WayBack] TComponent in System.Classes
    • This supports the notion of (potentially) being owned by another TComponent. Classes like TComponent and TCollectionItem implement this ownership behaviour.
    • When owned, then redirects all IInterface calls to the owner (including QueryInterface).
  • [Archive.is] TXPEditReaderStream in DUnit XP_OTAEditorUtils. It is largely undocumented.
  • TXPInterfacedObject in DUnit XPInterfacedObject. It is largely undocumented too.

Not so good examples:

  • [WayBack] TCustomVariantType in System.Variants (which is basically TSingletonImplementation with a lot of extra methods)
  • [WayBack] TSingletonImplementation in System.Generics.Defaults(which is basically what most TNonRefCountInterfacedObject implementations do; this is sort of OK as it is meant to be used only in [WayBack] TCustomComparer<T> and descendants that are supposed to be singletons).
  • IUnknown in Winapi.Ole2 (this whole unit is undocumented; the class only has virtual abstract methods; the unit – together with Winapi.OleCtl – seems to be only meant to support the depcrecated Vcl.OleAuto unit.)

And of course there is the standard implementation with proper multi-threading support:

There are quite a few classes that implement reference counting while descending from things like TComponent, usually without the proper multi-threading support that TInferfacedObject has:

Read the rest of this entry »

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

Don’t use global state to manage a local problem – The Old New Thing

Posted by jpluimers on 2021/01/20

The 20081211 article [WayBack] Don’t use global state to manage a local problem – The Old New Thing reminds me of a process I went through with a programming team a few years ago.

A lot of their source base came from the procedural era: global variables and global methods. No classes. No methods on records.

Taking them to the level of reference counted immutable instances that used dependency injection as an architectural design was a long journey.

Early in their journey, they would create a lot of methods on classes and records at the class level.

Then they started introducing instances that were basically singletons.

Finally they made real instances that could have more than one available at run-time. These would still create other instances when they needed, often through a few singletons that were still left (for instance session state, database connection state, etc).

Then they introduced caches and pools to keep things alive longer than as to speed up things. It also highly complicated life-time management.

Finally they backed down, and started hooking up things through dependency injection.

A lot of the above caused global state to be used for solving local problems.

It was a tough, but fun time, to get them on the right path, tickling them with the right puzzles at the right time to steer them through their journey..

–jeroen

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

HTML table border styles

Posted by jpluimers on 2021/01/20

I always get confused when I see this kind of HTML:

<td style="border: 1px black; border-style: none solid solid;">

This raises questions like:

  • When less than 4 borders are mentioned, which borders are solid, and which borders are none?
  • What is the order of 0…4 borders?

Luckily these links helped me:

  1. [WayBack] w3schools: CSS border-style property
  2. [WayBack] w3schools: CSS Borders
  3. [WayBack] border-style – CSS: Cascading Style Sheets | MDNThe border-style CSS property is a shorthand property that sets the line style for all four sides of an element’s border.

The first two made me find the last one, which is best as it has a CSS demo button (that also works on the WayBack link), a list of examples, and even better, answers the above questions with the “border-style” list below.

I rephrased their list into a table emphasising the clock-wise order:

The number of values determine the sides affected; thinking clock-wise is easiest to get it:

# values affected sides example top right bottom left
1 all: top, right, bottom, left solid solid solid solid solid
2 top & bottom, right & left none solid none solid none solid
3 top, right & left, bttom dotted none solid dotted none solid none
4 top, right, bottom, left double dotted solid none double dotted solid none

Their list:

The border-style property may be specified using one, two, three, or four values.

  • When one value is specified, it applies the same style to all four sides.
  • When two values are specified, the first style applies to the top and bottom, the second to the left and right.
  • When three values are specified, the first style applies to the top, the second to the left and right, the third to the bottom.
  • When four values are specified, the styles apply to the toprightbottom, and left in that order (clockwise).

Each value is a keyword chosen from the list below.

then it continues with a table showing the outcome of the various line style values you can put in:

<line-style>
Describes the style of the border. It can have the following values:

none
Like the hidden keyword, displays no border. Unless a background-image is set, the calculated value of border-top-width will be 0, even if the specified value is something else. In the case of table cell and border collapsing, the none value has the lowest priority: if any other conflicting border is set, it will be displayed.
hidden
Like the none keyword, displays no border. Unless a background-image is set, the calculated value of border-top-width will be 0, even if the specified value is something else. In the case of table cell and border collapsing, the hidden value has the highestpriority: if any other conflicting border is set, it won’t be displayed.
dotted
Displays a series of rounded dots. The spacing of the dots is not defined by the specification and is implementation-specific. The radius of the dots is half the calculated border-top-width.
dashed
Displays a series of short square-ended dashes or line segments. The exact size and length of the segments are not defined by the specification and are implementation-specific.
solid
Displays a single, straight, solid line.
double
Displays two straight lines that add up to the pixel size defined by border-width or border-top-width.
groove
Displays a border with a carved appearance. It is the opposite of ridge.
ridge
Displays a border with an extruded appearance. It is the opposite of groove.
inset
Displays a border that makes the element appear embedded. It is the opposite of outset. When applied to a table cell with border-collapse set to collapsed, this value behaves like groove.
outset
Displays a border that makes the element appear embossed. It is the opposite of inset. When applied to a table cell with border-collapse set to collapsed, this value behaves like ridge.

–jeroen

Posted in CSS, Development, HTML, HTML5, Software Development, Web Development | Leave a Comment »

grep for Delphi .dproj file containing copy commands for certain DLLs

Posted by jpluimers on 2021/01/20

I always forget the syntax, so this quick grep helps me finding the lines in Delphi .dproj files that have the right copy statements for getting certain DLLs in the output directory.

Those are very useful to copy for instance the FastMM or OpenSSL DLLs from a central location.

[WayBack] GNU grep (which shows filenames and supports UTF-8 and UTF-16):

grep -inS copy *.dproj | grep -i ssl | grep -i dll | grep -v amp

Good old Borland grep:

grep -ind copy *.dproj | grep -i ssl | grep -i dll | grep -v amp

The amp trick excludes any lines having amp in them, incuding the &amp; lines that are duplicated by the IDE throughout the .dproj file to keep build configurations linked correctly.

Related:

–jeroen

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

Node-RED is on my research list.

Posted by jpluimers on 2021/01/19

Cool stuff that is on my research list: redundancy through Node-RED.

NodeRED Multi-Node Redundancy Example – YouTube:

A simple proof of concept showing how to implement multi-node redundancy using four NodeRED instances, with Modbus TCP Remote IO.

Example Flow: https://app.box.com/s/mevo3fq9u6x6khr…

Parts used:

  • WAGO
    • 750-352 Ethernet Coupler ModbusTCP
    • 750-1506 8ch DI/DO 24VDC Module
    • 750-461 RTD Module
    • 750-600 End Module
    • 787-1602 24VDC 1A PS
    • 789-801 DIN push button
  • Raspberry Pi 3b +
  • DIN Rail mount: www.DINrPlate.com

–jeroen

Read the rest of this entry »

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

GitHub – drewnoakes/string-theory: Identify and reduce memory used by duplicate .NET strings

Posted by jpluimers on 2021/01/19

[WayBack] GitHub – drewnoakes/string-theory: Identify and reduce memory used by duplicate .NET strings:

Identifies opportunities to improve heap memory consumption by strings.

Finds duplicate strings and provides ways to see what object graphs are keeping them alive.

Once you identify a suspicious referrer, you can query to see what other strings it is holding across the whole heap, and the total number of wasted bytes.

Cool tool to help trim down .NET string memory usage.

Via: [WayBack] drewnoakes on Twitter: “This week I published #StringTheory, a tool for analysing and reducing the memory used by strings on the managed .NET heap. We are using it to improve @VisualStudio performance, with encouraging results so far. Try it on your apps!”

–jeroen

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