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 ‘Software Development’ Category

Python threading: logging exceptions during the `run`

Posted by jpluimers on 2018/12/19

In A few observations on Python while I made my first steps into it, I mentioned the standard threading idiom in Python by wrapping the thread in a function. This has the drawback of having to catch and handle any exceptions in that function.

The higher level [WayBack] threading module has a [WayBack] Thread class with a [WayBack] run() method does not handle exceptions either.

For investigation of threading issues, it’s very convenient to know about the exceptions in a thread and their context.

So I’ve made a small base class that automagically logs any exceptions during a run:

import threading

from log import Log

class ExceptionLoggingThread(threading.Thread):

    def __init__(self):
        threading.Thread.__init__(self)
        self.logger = Log().getLogger()
        self.logger.debug("ExceptionLoggingThread().")

    def run_logic(self):
        self.logger.debug("Thread started.")

    def run(self):
        try:
            self.run_logic()
        except:
            self.logger.exception('Exception in `run`')
            raise

–jeroen

Posted in Development, Python, Scripting, Software Development | Leave a Comment »

Spring4D Conference

Posted by jpluimers on 2018/12/19

Do not forget the early bird sales ends soon for the Spring4D European Conference 2018 – Bergamo Italy, right before Easter 2019.

Both the original author and the current maintainer will be there, and it will be a great place to socialize with fellow Spring4D users.

Buy tickets: [WayBack] Spring4D Conference

Via:

–jeroen

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

git – I ran into a merge conflict. How can I abort the merge? – Stack Overflow

Posted by jpluimers on 2018/12/18

I need this one day: [WayBackgit – I ran into a merge conflict. How can I abort the merge? – Stack Overflow

–jeroen

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

Links to help me monitor my Zeverlution PV converter locally

Posted by jpluimers on 2018/12/18

Since it’s my data, I’d rather be in control myself, so here are some links that will help me going around the Zevercloud solution I posted about yesterday.

Some other interesting links of software supporting Zeversolar devices:

Note that PVoutput.org does have native ZeverCloud updating using the ZeverSolar API key:

But these might help me:

–jeroen

Read the rest of this entry »

Posted in Development, Hardware Interfacing, LifeHacker, Power User, Software Development, Solar Power, Zeverlution, Zeversolar | Leave a Comment »

Reminder to self: make a list of URL suffixes to show branch diagrams of repositories

Posted by jpluimers on 2018/12/18

One of the BitBucket features I like a lot is that in the commit history, you see the branches involved in a nice diagram on the left side of the commits: https://bitbucket.org/pypy/pypy/commits

BitBucket used to be popular to host public repositories, but from a public perspective, they are on the decline for that (they even removed the [once popularbitbucket.org/explore page and [WayBack] will not re-introduce it).

Right now, only major git based hosters still have explore pages:

So it makes sense to see where they provide diagrams of branches, so here are some examples to go from a project to the graph:

–jeroen

Posted in BitBucket, Development, DVCS - Distributed Version Control, git, GitHub, GitLab, Mercurial/Hg, Software Development, Source Code Management | Leave a Comment »

Never ever put OutpugDebugString in code that is meant to run on production systems

Posted by jpluimers on 2018/12/18

I just saw this code in the Delphi RTL enabled for RELEASE builds of the procedure TThreadPool.TQueueWorkerThread.Execute; code:

{$IFDEF MSWINDOWS}
    OutputDebugString(PChar(Format('Thread Exiting: %d', [ThreadId])));
{$ENDIF}

Never, ever do this.

If you code review code that contains it: ensure it has some kind of compile time DEBUG conditional around it.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 12 Comments »

It looks like the PlasticSCM people are building a git-client, but it needs on-line installation and registration

Posted by jpluimers on 2018/12/15

gmaster is an interesting Windows based git client, but you cannot install it off-line, and by default it does not use the external git.exe.

See the below tweets.

–jeroen

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, PlasticSCM, Software Development, Versioning | Leave a Comment »

Getting started · MahdiSafsafi/DebugEngine Wiki · GitHub

Posted by jpluimers on 2018/12/13

Enabling stack traces in Delphi: [WayBack] Getting started · MahdiSafsafi/DebugEngine Wiki · GitHub:

Using DebugEngine stack trace when error occurs:

All what you need to do is to include DebugEngine.HookException unit into your project. And each time an error occurs, you will be able to get the stack trace from the point where the error occurred.

uses 
  DebugEngine.HookException;

{...}

procedure Foo;
begin
  try
    DoSomething;
  except
    on E: Exception do
      ShowMessage(E.StackTrace);
  end;
end;

You can get similar functionality with JCL.

Via [WayBack] Why Delphi (like other developer environments) natively not included full call stack for every exception? Or if this is possible, please tell me how (wi… – Jacek Laskowski – Google+

–jeroen

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

Initeresting CodeInsight ToolsAPI.pas bits IOTACodeInsightManager100, AllowCodeInsight, EditorTokenValidChars

Posted by jpluimers on 2018/12/12

Reminder to self: dig deeper in to this thread [WayBack] …In ToolsAPI.pas there’s IOTACodeInsightManager100 which is implemented by my custom CodeInsight manager… – Fl Ko – Google+

–jeroen

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

Still an interesting thought: I’d like the next update from Emb to NOT contain any new features at all – just a huge bundle of bug fixes

Posted by jpluimers on 2018/12/11

Still an interesting thought: [WayBack] Maybe we need a vote here but personally I’d like the next update from Emb to NOT contain any new features at all – just a huge bundle of bug fixes. We… – Chris Pimlott – Google+.

Especially the comments in it are well worth re-reading.

By now a new Delphi version should have been out, so I am curious how the balance between bug fixes and new features was.

Edit: Fixed bugs are features, so in my opinion Embarcadero should release only bug-fix updates and upgrades for at least two years.

–jeroen

PS: Nice G+ comment at [WayBack] Still an interesting thought: [WayBack] Maybe we need a vote here but personally I’d like the next update from Emb to NOT contain any new features at al… – Jeroen Wiert Pluimers – Google+:

Problem with new features is that they usually come with new bugs. Therefore new features take away developer capacity from fixing old bugs twice.

Posted in Delphi, Development, Software Development | 6 Comments »