A PyAutoGUI Recorder

Recently I discovered PyAutoGUI, a great Python package to automate mouse clicks on a desktop, which also works nicely on Linux and thus for me is a great Linux alternative to Autoit, which I prefer to use on Windows systems so far.

Like with Autoit it lacks the availability of a recorder to simply record mouse clicks, thus I decided to spend a few hours writing one in Python, using tkinter ( the Python interface to Tcl/Tk ) for the GUI.

The tool is available here on Github, as well as some documentation how to use it.

Sometimes software is so smart … !?

Icedrive – a bit weird …

I am trying out Icedrive these days, besides PCloud and Dropbox as a cloud storage solution for me. Dropbox started to become less interesting for me because the free account limits the number of devices I can connect.

Nevertheless, Icedrive shows some strange behavior. First of all it creates a huge number of MS*.tmp folders which show up in my Android app and in the Web Frontend, but not on my Icedrive mounted in my Windows box. I always have to manually delete those which is a bit annoying.

While trying to delete them I encountered another strange behavior of the Web Frontend. When selecting a folder and then doing shift-select on a folder below it shows a behavior which is far away from what I would expect from a working GUI: it selects the first folder of the range I tried to select, plus the last one, plus the folders above – which is really strange and makes it hard to efficiently work with that GUI.

How do I estimate story points in Agile development?

Nice discussion on quroa.com about: “How do I estimate story points in Agile development?“. ( In contradiction to what I wrote in my previous posting there are often very valuable questions asked on quora.com ! )
Here is my answer:

The key question is: what ARE story points ?

Many ( including my team in our current project ) make the mistake to assign some quantifyable metric to a story point, like in our case an ideal work day.

Story points are more meant to be a relative rank to compare stories in terms of complexitiy or effort. Thus the right way to deal with story points is to pick one story from the backlog and assign story points to it, then always just compare other stories to this reference story.

We can pick the ‘easiest’ story and assign 1 story point, or the biggest one and assign 100 story points, or an average one and assign it e.g. 5 or 8 or 20 story points. Then we always compare other stories against the reference story and come up with assessments like: this story is twice as big as the refrence story, or this story is a piece of cake compared to the reference story.

The true value of playing Planning Poker probably is not to come up with some number of story points. At the end it is most likely not that important whether a story gets 5, 8 or 20 points. The important outcome of a Planning Poker session is the discussion in the team and the common understanding about what has to be done.

Of course story points are used to measure Team Velocity. And a misunderstanding of Team Velocity suddenly makes this metric a political affair. Which is not what story points should be used for. For example: comparing Team Velocity of different teams does not make much sense if every team has chosen a different reference story or a different means to determine story points.

Photo “Planning Poker” by With Associates

Stupid Questions

“One of my teachers once told me there was no such thing as a stupid question. But then I discovered Quora; and now I know better.”

John Mee on Quora

Quora, where you find question pearls like this:

I need to create an operating system like Windows in a week, and I have no computer knowledge. How do I do this?

People who read this might want to read this as well:

There is not such a thing as a stupid question

Image by Peggy und Marco Lachmann-Anke from Pixabay

Posted in fun. 1 Comment »

I wonder how much energy is wasted by Windows 10 world wide

What really bothers me about Windows 10 is the fact that often it wakes up my computer in the middle of the night and then keeps it running til I get to it next morning – consuming electrical power for nothing.

I understand that Windows 10 comes with an automated update mechanism to keep the system up-to-date and is doing this preferrably in the middle of the night when I don’t need to use the computer and thus we ( Windows 10 and I ) don’t get into each others way, so to speak. But is it asked for too much to request that Windows 10 kindly sends my computer back to sleep when done ? Apparently this part is not working in many cases.

I have seen this on my old computer and thought: ok, may be because my computer is so old and there are no firmware nor driver updates available anymore so that send back to sleep simply doesn’t work. But I see this same odd behavior on my shiny new Lenovo computer, I see it on my wifes computer, I see it on my 2-year-old thinkpad I use for work. Thus I have to conclude: this is not an exceptional behavior, it is common Windows 10 practice.

Just this morning again I found my computer running. Checking the event log revealed that it woke up around midnight, triggered by UpdateOrchestrator.

Power Troubleshooter Event

Then two updates have been installed later on:

PS C:\WINDOWS\system32> Get-EventLog -LogName System -Newest 100 | findStr "Installation"
   18083 Apr 24 00:48  Information Microsoft-Windows...           19 Installation Successful: Windows successfully installed the following update: 9WZDNCRD29V9-MICROSOFT.MICROSOFTOFFICEHUB
   18082 Apr 24 00:48  Information Microsoft-Windows...           43 Installation Started: Windows has started installing the following update: 9WZDNCRD29V9-MICROSOFT.MICROSOFTOFFICEHUB
   18074 Apr 23 23:50  Information Microsoft-Windows...           19 Installation Successful: Windows successfully installed the following update: Security Intelligence Update for Windows Defender Antivirus - KB2267602 (Version 1.313.2202.0)
   18073 Apr 23 23:50  Information Microsoft-Windows...           43 Installation Started: Windows has started installing the following update: Security Intelligence Update for Windows Defender Antivirus - KB2267602 (Version 1.313.2202.0)

Thus the system was done updating at 00:48. And kept my system running until I got back to it next morning.

BTW, wouldn’t it be nice if the powercfg -lastwake command would tell me when this happened so that I don’t need to fire up the Event Log Viewer to find out ?

C:\WINDOWS\system32>powercfg -lastwake
Wake History Count - 1
Wake History [0]
Wake Source Count - 1
Wake Source [0]
Type: Wake Timer
Owner: [SERVICE] \Device\HarddiskVolume3\Windows\System32\svchost.exe (SystemEventsBroker)
Owner Supplied Reason: Windows will execute 'NT TASK\Microsoft\Windows\UpdateOrchestrator\Universal Orchestrator Start' scheduled task that requested waking the computer.

Do project methodologies really work in projects?

Good question on quora.com. Here is my answer:

No, in most cases I have seen.
Project management actually is a process and project management methods mean to run a project in an organized way. Most people don’t like to work like this, it is not ‘natural’ for many people to work like this, especially not today in the era of Agile and reducing Time To Market as much as possible.
Project management methods often fail because of political reasons. Coming up with an initial sizing of a project for example is the smartes thing to do, but for political reasons often not done, at least the reasonable way, to bascially hide the real effort of a project and get it going. A top reason why at the end projects take twice as long as ‘planned’ and cost three times more.
Another example from one of my projects: a project manager should ensure resources are available before committing anything and coming up with a project plan/schedule. This is not trivial in a matrix organization where you as a project manager have to grab resources from several organizational units. When I started asking functional managers to commit people I would need for my project I often got the answer: “I don’t commit anything. If you need help at some point in time simply ask and we will see what we can do.”
This demonstrates what I said initally: many peole don’t like to work in an organized way, to plan ahead and avoid risk. They love to do spontan work. Instead of the boring process to minimize risk – a major reason for project management – they love to work in task force mode and shine in crisis situations. Getting things done without major trouble is uninteresting and for cowads, not for heros.

First steps on IBM Cloud

In year 2009 I developed a perl CGI script allowing to upload export files from either blogger or wordpress blogging services and then create printouts ( or pdf files ) and table to contents out of this. I wrote about it here in my blog.

kubernetes_28container_engine29I hosted it on several free hosting sites which have not been very reliable long term and went away sooner or later.

Recently I started to put my hands around docker and built an image with an Apache web server running my tool. Once I had set it up correctly this made it a piece of cake to run it on any machine running docker. Which is of course one of the main goodies of docker. Because every time I had to setup my app the old way I had to go through some time consuming steps:

  • Install Apache web server
  • Configure it correctly to run perl CGI scripts, thus get used to the latest log file syntax and log files arrangements with that particular version of Apache
  • Install additional needed perl modules
  • Solve problems like this one

I did some e-learning classes on cognitiveclass.ai I highly recommend before getting started with docker and kubernetes on IBM Cloud; both take 3 hours of your time and come with labs and quizzes:

I created an account on IBM Cloud choosing the free plan and throughout the 2nd class have been able to create my first kubernetes cluster and deploy my image to run on IBM Cloud.

I had to go through some hiccups before mapping of IP ports worked correctly but finally I made it ! The only down side so far: my cluster will be alive for just 25 remaining days before it will be gone.

You better use your desktop PC to check emails

I always think that on a mobile device you are more vulnerable to become a victim of malicious emails.

Most of the time I check my emails on my desktop or laptop computer. This weekend I was sitting on a chair outside on my patio and used a mobile device to check my emails, using Outlook on Android, to get into the details.

On my email account all incoming email from people I don’t know ends up in my junk folder, but I usually check it quickly to find emails from sender I don’t know (yet) which might not be junk emails. This one caught my attention:

image

After a first look it did not look suspicious to me: the email address looked authentic, thus I opened the attached pdf file. It contained some letter telling me about a game I had purchased from the Apple store ( a game I never heard of ) and that $ 50 would be paid from my credit card account if I would not cancel that order; a link followed to do so.

I stopped there, left my chair, and checked the very same email on my Windows computer, using Outlook. Here is how that email looked like there:

image

Very different, I would think: it was obvious right away that this is a suspicious email address not owned by Apple, and Outlook actually did not even allow me to open the attachment while that email was sitting in my junk folder.

I was really surprised to see one and the same app – Microsoft Outlook – behave that different on two different platforms. While it did a quiet good job to protect me on Windows from this suspicious and most likely malicious email it did a lousy job on Android.

On a desktop PC you always have the chance to move your mouse pointer over a link to see how it resolves. On a mobile platform like Android you can’t do that: touching a link will open it.

That said, and this experience having made, I stick to my opinion that it is much safer to do email on a desktop computer than on a mobile device.

 

Base code to make context menu work with wxPython CustomTreeCtrl

After it took me an hour or two to figure that out, here is some base Python code snippet showing how to make context menues work with wxPython’s CustomTreeCtrl:

class CustomTreeCtrl(CT.CustomTreeCtrl):

    def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.SUNKEN_BORDER|wx.WANTS_CHARS,
                 agwStyle=CT.TR_HAS_BUTTONS|CT.TR_HAS_VARIABLE_ROW_HEIGHT,
                 log=None):

        CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, agwStyle)
        
        # ...        
        self.item = None
        self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu)
        self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
        
    def OnRightDown(self, event):

        pt = event.GetPosition()
        item, flags = self.HitTest(pt)

        if item:
            self.item = item    
        
    def OnContextMenu(self, event):
        # Setup right-click menu for tree items
        menu = wx.Menu()
        treeMenuItem1 = menu.Append(wx.ID_ANY, "Menu Entry 1")
        treeMenuItem2 = menu.Append(wx.ID_ANY, "Menu Entry 2")
        self.Bind(wx.EVT_MENU, self.OnMenuEntry1, treeMenuItem1)
        self.Bind(wx.EVT_MENU, self.OnMenuEntry2, treeMenuItem2)
        
        self.PopupMenu(menu)
        menu.Destroy()
        
    def OnMenuEntry1(self, event):
        print "Method OnMenuEntry1 not implemented yet."
        
    def OnMenuEntry2(self, event):
        print "Method OnMenuEntry2 not implemented yet."

In essence:

  • we need a method to capture what item has been selected in a tree. This is done by OnRightDown() and the HitTest() method. We store the selected item in an attribute of our CustomTreeCtrl object: self.item
  • we need a method to display the context menu: OnContextMenu()
  • we need one method per context menu entry, yet to be implemented: OnMenuEntry1(), onMenuEntry2(), …
  • we need to ensure the proper bindings so that all these methods working, thus:
    • binding wx.EVT_CONTEXT_MENU to OnContextMenu() in the constructor of our CustomTreeCtrl object
    • binding wx.EVT_RIGHT_DOWN to OnRightDown() in the constructor of our CustomTreeCtrl object
    • binding wx.EVT_MENU to every method used to handle clicking a menu entry, like OnMenuEntry1(), onMenuEntry2(), in OnContextMenu()