Qt: find the sender (aka: invoking signal) for a slot
Sometimes several signals lead to one single slot. Without any parameter. So you are stuck and can’t find out who was the ‘caller’.
But wait, there is a nasty hack to find it for those which are direct connections.
1 2 3 4 5 6 7 8 9 |
#include <QtCore/QMetaObject> #include <QtCore/QMetaMethod> [..] { //todom just for testing QMetaMethod const metaMethod = sender()->metaObject()->method(senderSignalIndex()); qDebug() << "invoking caller: name and signature:" << metaMethod.name() << "|" << metaMethod.methodSignature(); } |
The moment you login the first time remotely via app to your Redmine <3
aka: Accessing Redmine outside your local network via Android-app.
I set up port-forwarding via the router. Dynamic name is set via the Synology NAS.
So the url to use is: http://metrik.myds.me:5002/redmine
And after testing 5 (in words: FIVE!) apps with really mixed results, I choose:
Redmine Mobile app made Easy
Redmine on Raspberry Pi 3
There was the need to write down in a structured way all the ongoing (private) projects. Keeping track, assign them to the members of my family, etc ..
From former working experience I knew OTRS, Redmine and JIRA. All with their respective benefits and drawbacks. (tl;dr .. I prefer Redmine.)
Hardware: RPi3; 32 GByte SD-card; keyboard; mouse, 1920×1080-monitor; power-cable
Software: running Raspbian; then follow this tutorial
Since this does NOT yield success, add those steps:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
1. Contents of /etc/apache2/sites-available/redmine.conf DocumentRoot /var/www/ PassengerDefaultUser www-data <Location /redmine> RailsEnv production RackBaseURI /redmine Options -MultiViews </Location> 2. Disable the apache2 default site: $ sudo a2dissite 000-default |
Et voila: working version. Go on, create accounts, roles, projects and tickets 🙂
Enforce HDMI with 1920×1080 on Raspberry Pi 3 and Raspbian
Ok, we have a brand new RPi, an SD-card with the latest Raspbian, some brand new monitor with HDMI-input only.
Everything is set up, the power plugged in, one LED shines, another one, then “no signal” on the monitor.
0. SSH-access not possible due to the fact that because of those botnet-takeovers of RPi in the past the default access was disabled for fresh images.
1. Wifi with VNC also impossible, because how to set the Wifi-credentials if you can’t see something?
2. VGA not possible due to hardware-limitations.
Great 🙂 I love when soft-/hardware does not work out of the box :’)
After a while of tinkering I remembered that I had to enforce the HDMI-ouput on the first RPi (the one for the catcam).
Can be set inside /boot/config.txt (leafpad is the current default editor on Raspbian).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# For more options and information see # http://rpf.io/configtxt # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 framebuffer_width=1920 framebuffer_height=1080 # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=2 hdmi_mode=82 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. #arm_freq=800 # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Uncomment this to enable the lirc-rpi module #dtoverlay=lirc-rpi # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) dtparam=audio=on # additional shit by me start_x=0 gpu_mem=128 |
Automate the boring stuff ..
.. with Python: that’s the title of an interesting book.
But I used (again) AutoIt to automate the task to enter every day my working hours via the company’s choice “SAP-portal”. Which is slow. Really, really slow. Delays of 6 seconds for requesting a certain tab via browser are not uncommon.
Code is available via: https://github.com/marcelpetrick/SAP_AutoIt
The most interesting part for me was to play around with the “image search”-capability of AuoIt. Looks like someone added this feature from AuotHotkey as custom DLL. You can let your script check a certain screen-area for a specific bitmap and if found, then move the cursor there. It helps to make the scripts more “smart” and independent from fixed screen-coordinates. I have some other uses in mind, but time will show 😉
I know that the current state of the code is quite ‘spaghetti’, but … first a solution, then refine. Also the way how to define the input-data has to be improved.