All posts by ephestione

Import QR vCard with multiple words name and surname in Android

First of all: YOU CAN’T.

Now for real, there’s a workaround, just buid your vCard text to be rendered as QR Code by removing the spaces between the first name words, and the last name words (surname that you may like).

Example:

N:Johns Phillips;John Philip;;; (Last Name;First Name;;;)

becomes:

N:JohnsPhillips;JohnPhilip;;;

and then, in the address book editing form that appears in Android you just tap in the middle of the joined words and press space.

It will be MUCH faster than moving around in the fields the misplaced name components.

 

There is NO WAY to actually have a vcard data correctly formatted to be correctly rendered by a QR Code scanner and correctly passed to the address book.
If you used a correctly formatted vCard file to directly import it in Android address book, it will work (for example, first export a vCard file for a contact, and then reverse engineer it… but to actually copy the VCF to the phone for each contact and manually importing it would be time consuming and bothersome); but if you use a generated QR code from the vCard code, each and every QR scanner out there will pass the full name data to the address book as a single unformatted string, IGNORING the name components of the N field, leaving the address book parser to decypher which is which.

So, depending on how you go about hacking your way into the vCard format, you might get

John (first name) Philip Johns (middle name) Phillips (last name)

or any other weird combination, BUT the one you were looking for.

Believe me, I tried, and chances are, if you ended up here, you did, too.

In my case I spend on it much more time than I care to admit. More than I needed to actually code from scratch the PHP to generate the relevant QR code into my management software.

So just embrace this workaround, but if you find a solution, please Please PLEASE share in the comments.

Create STL from DICOM with 3D Slicer

Pretty much a self reference post, based on Slicer v. 4.6.

  1. Open the relevant DICOM set.
  2. Open the Crop Volume module
  3. In “Input ROI” dropdown select Create new AnnotationROI
  4. In the slices view adjust the selection so only the interesting area is covered (if you cannot see the delimiters of the crop rectangle, then zoom out the slice view -dragging with right mouse button- until it’s visibile, then move/resize it panning the slice view -dragging with middle mouse button- and then finally rezoom until you are satisfied adjusting the selection)
  5. Click on the Crop! button and see how the slices are cropped to the set area
  6. Open the Editor module (you can select the GenericAnatomyColors palette)
  7. Click on the coloured rectangle on the Label: row, and choose your relevant structure (if you’re here you probably want bone)
  8. Click on ThresholdEffect button (third from last from the effect buttons)
  9. In the Threshold Range input area that just appeared set a starting value of 300 HU (Hounsfield Units) which usually is a good starting density value for bone
  10. You will see the relevant areas blinking in the slices images, and you can adjust the density range by using the small arrow buttons on the side of the lower value of the range
  11. When satisfied, click Apply
  12. Click on the MakeModelEffect button, first from last, and right after click Apply
  13. After a while (depengin on how large is the ROI and how complex is your structure) the rendered model will appear in the 3D view
  14. Click on the SAVE button in the top tools bar, and deselect every entity except the last one (usually named bone if you followed this tutorial), and then choose the STL format in the dropdown on the side (VTK format is selected by default), plus change to your needs the saving folder, and press the Save button
  15. Profit!

Conversione automatica valuta estera PayPal su eBay… guardacaso

Ok, è da ieri che anche impostando manualmente la conversione della valuta estera su paypal alla mia carta di pagamento, questo dal sito paypal nel percorso astruso delle impostazioni, comunque il pannello di pagamento di ebay non mi permette di far valere questa opzione e di default usa il cambio valuta di paypal, che naturalmente applica commissioni più care di quelle della mia banca.

Cerco su internet diverse guide, e sembra che qualcun altro stia avendo lo stesso problema, anche fuori dall’italia (vedi qui), nonostante abbia impostato tale parametro correttamente su sito paypal.

Chiamo il numero verde, diversi minuti di attesa, e l’operatrice mi dice:

Lo sappiamo, è un problema tecnico che ci è noto e al momento non esistono soluzioni né ci hanno comunicato i tempi previsti per il rientro della questione

MA GUARDA CHE STRANO CASO. NEANCHE FOSSE UN PALESE CONFLITTO DI INTERESSI PER PAYPAL RISOLVERE LA QUESTIONE.

PERCHE’ SE LA RISOLVESSERO NON PRENDEREBBERO PIU’ LE LATROCINANTI COMMISSSIONI SUL CAMBIO.

E SE INVECE IL PROBLEMA PERSISTE LORO GUADAGNANO ALLEGRAMENTE GRAZIE A QUESTO DISGUIDO.

Ops sto scrivendo tutto maiuscolo.

Aggiornamento
Anche pagando col metodo “carta di credito” dal pannello paypal, e inserendo manualmente i dati della carta, COMUNQUE la valuta viene cambiata in automatico da paypal, e questo senza che appaia una preview del prezzo convertito in euro prima di cliccare su “Conferma e paga”, come invece accade se ci si appoggia al conto paypal.

VER-GO-GNO-SO.

A giuochi conclusi (se mai si concluderanno questi giochi, secondo me sono solo prove tecniche di appropriazione indebita forzata) dovrebbero quantomeno riconoscere un rimborso sul conto paypal di ciascuna delle persone coinvolte, pari alla cifra spesa in più per colpa di questo “disguido”.

Ma che sia un disguido non ci credo proprio.

Share mysql and apache folders from windows XAMPP to linux XAMPP

This is a replica of the article by jultech from 2007 for posterity and data-replication purposes.

When dualbooting between windows (first OS installed) and linux, do this:

~ # mv /opt/lampp/var/mysql /opt/lampp/var/mysql.BACKUP
 ~ # ln -s /mnt/windisk/path/to/XAMPP/mysql/data/ /opt/lampp/var/mysql
 ~ # mv /opt/lampp/htdocs /opt/lampp/htdocs.BACKUP
 ~ # ln -s /mnt/windisk/path/to/XAMPP/htdocs /opt/lampp/htdocs

This creates a backup of the original XAMPP folders in linux, and them symlinks them to the windows disk mounts.

Restart XAMPP to have th configuration running.

Thank you jultech.

Fix mount: unknown filesystem type ‘isw_raid_member’

You may also get ‘linux_raid_member‘ instead of ‘isw_raid_member‘, usually it’s the same.

So you probably have run through other tutorials telling you not to mount directly but to mount the raid instead…. but you have no raid!

Maybe though, you HAD a raid back in time, and you removed it leaving the disks as separate storage, and in that case there would be “rogue” raid metadata on the disk that makes linux (mint in my case) think it is a raid, and get confused.

Thanks to Chris_F I finally solved it, you need to use dmraid (install it if it’s not on the system, via apt-get) to remove those orphan tags:

sudo dmraid -rE /dev/sdb

In my case, this instantly showed the disk in file manager.

Xiaomi Mi Band 2 vs Teclast H30, first impressions

I had been using the Mi Band 2 foralmost a month, but ordered the Teclast H30 because I liked the SMS text function, and also the general look of it.

What I like of the Mi Band 2 is the fact that I have a watch on my wrist once again (I have been wristwatch-less for about 10 years!), it warns me of incoming calls (when I am working among loud noises or walking to work among traffic, I might not hear my phone or feel it vibrating inside my pocket) and the sleep tracking function.

Heartrate measurement is a disappointment, but not because of Mi Band 2 in itself, more that as a technology you need to stay really in one place and not moving, otherwise it WILL miss hearbeats and give you a really low frequency. Also you do not get continous heartrate measures with the Mi Band 2.

Distance and calories are so useless since they are calculated based on steps count, and amount to a really insignificant number.

When I got the Teclast H30 I put them together on the same wrist. Pairing the band with my phone was a blast (with the Mi Band 2 it took WAY too much fiddling with my phone’s bluetooth).

Surprise, Teclast H30 supports continuous heart rate measurement via a setting on the Android app, but the value was inaccurate if compared to Mi Band 2 (I was fast walking back home, Mi Band 2 gave me a realistic 139bpm, while the H30 was stuck at max 93, but it might as well have been a defect in positioning it on my wrist).

Also Teclast H30 over Mi Band 2 has the find my phone function, where you would jump to said function and your phone would ring.

Also Teclast H30 often was faster than Mi Band 2 in showing the time after raising my wrist.

TSports app doesn’t require online registration as MiFit does.

The advantages though end right about at this point.

I could greenify MiFit app, but TSports is hard to be put in hibernation as it installs as a resident app by default and eats away at the phone battery even if it is in the watchlist of Greenify.

You cannot choose which elements to display on Teclast H30 like you can with the Mi Band 2, you always have to scroll through the Time/Date/Sleep hours/Steps/Distance/Calories/Battery/Find Phone, and it gets annoying really fast! Also on the Mi Band 2 you can display, with the latest firmware, time and date together, while on Teclast H30 they are on different screens.

Finally, the alarms: on MiFit you can set alarms depending on the weekday or just once, while on TSports you can only set an alarm to ring every day for the rest of existence.

I cannot report about sleep tracking nor battery duration as after a half-a-day experience I gave this band to my S.O.

I can testify anyway on the SMS text display to be working, as I got one during that time. It doesn’t display the author name even if it is in your phonebook though, just the originating phone number.

That’s all folks!

SQ8 mini camera DVR, enable loop recording

Connect the SQ8 camera to a USB charger. It cannot be a PC, otherwise it will work as an external drive and show you the contents of the SD, it just needs to receive power.
As soon as you connect the camera you will notice the rear led turning on and cycling through different colors, after which it will turn off: at that moment, the recording will have started.
I still haven’t tested the cyclic recording functionality, but this is supposed to record max 5 minutes chunks of video until the memory runs out, after which it deletes the oldest recordings.

BTW, the correct orientation of the camera is so that the flat side opposite to the buttons side is down, position it elsewhere will give you a rotated video.

On a side note, this camera has a really bad space usage; I put a 32gb card in it, and the file size of the 5 minutes video chunks is 400MB! There is virtually no compression on the video, and the maximum recording time before the oldest files are deleted is less than 6 hours.
90mbs per minute is a really bad stat, in comparison a naruto episode should be 2.4GB if it had the same time/size ratio, it is instead one tenth of that…

Revert, undo & go back from adoptable to portable storage in android marshmallow

I replaced my previous 32GB microsd in my note 3, with a transcend 64GB, and the system asked me if I wanted to use it as extended internal storage. Why not, I never use the sd as swappable storage anyway, and I liked the encrypted storage.

Go ahead an hour, I notice the system filled up 30GB more than the starting space, just stealing it from the sd card for no reason. Also, after rebooting I get a message saying “system has stopped responding”, and swiftkey cannot load languages anymore, disabling altogether the swype function.

Great!

I fiddle for good 15 minutes into the settings, finding nothing apparent, until I went into:

Settings > USB and Storage > Internal storage > Options > Migrate

which was supposed to migrate the data from the sd back into the builtin storage.

I started the process and went to sleep (it was late) hoping to find it solved in the morning… too bad! Couldn’t do that, the morning after the internal storage was 100% filled, an error message appeared, and the 60GB sd was still hald full.

The system went from the original 16GB used in the internal storage, to a total of 30GB filled internal storage+roughly 30GB inside the external, which is 60GB used storage… for what? God knows! In the USB&Storage panel of the settings, the details of the used space still amounted to the real space needed, and nothing was there to account for the additional space taken that was reported in the summarized stats…

Hence, I tried copying all the contents from the sd/internal storage to the PC, with the intention of resetting everything afterwards and restoring the data, but using the USB communication resulted in a severely slow transfer speed (we’re talking about a 100Kb file each few seconds, and there were 12GB of data to move).

I tried several times to check and see if I could speed things up, to no avail, so I used the remaining free space on the microsd (I had that, if you don’t you may want to use an OTG cable and a pendrive) to create a ZIP archive (with estrongs) of all the contents of the internal storage, and as a single file like that I could then copy it to my PC at a decent speed.

Once that was done, I wend in settings > USB and storage > SD card > options > format as portable, agreeing to lose all data (I had backed it up anyway), then into recovery I wiped the internal storage, then rebooted to have the changes take effect, and from this state (internal storage almost empty, microsd seen as normal portable storage) I copied over the backed up contents from the previous configuration via normal USB transfer (some files and folders couldn’t be copied, but it was nothing essential).

Up until now eveything looks to have gone back to normal.

Parcheggi blu a Cecchina, e vigili cowboy in casa d’altri

Chi vive nel comune di Albano Laziale e relative frazioni, sa che da tempo (quasi) tutti i parcheggi prima liberi sono stati trasformati in aree di sosta a pagamento, e per quanto riguarda Cecchina l’intera via Nettunense è stata delimitata dalle strisce blu, così come il parcheggio della stazione ferroviaria.

In concomitanza con questa novità, le vigilesse di Cecchina (i cecchinesi sanno benissimo di chi parlo… d’ora in poi le chiamerò cowgirls) hanno preso l’abitudine di pattugliare le viuzze attorno alla Nettunense, dove la circolazione al traffico è praticamente solo di chi ci abita, normalmente da decenni, da quando le cowgirls erano ancora adolescenti alle prese con la scoperta del proprio corpo.

Inizia a girar la voce che tali vigilesse abbiano intimato a tutti i residenti del posto di smettere di parcheggiare sui propri marciapiedi privati (lasciando spazio alla circolazione del traffico locale invece che impegnare la carreggiata, tra l’altro a senso unico) perché tali marciapiedi sono privati sì, ma “ad uso pubblico”. Più che intimazioni, le cowgirls sono state materialmente intercettate mentre stavano compilando un verbale di multa a danno di un’auto appunto parcheggiata sul proprio marciapiede, e così io per un po’ di tempo, a scanso di equivoci, ho piazzato la mia auto fuori dal mio marciapiede, in mezzo alla strada; come me hanno fatto anche i dirimpettai, creando però una strettoia tale da impedire a tratti la circolazione delle auto.

Un giorno di qualche settimana fa, ero a piedi, sono passato vicino alle cowgirls che avevano accostato il furgoncino davanti al cancello di una villetta sulla mia strada, e stavano importunando chiedendo all’inquilino di “non fare più la cosa X altrimenti dobbiamo intervenire“, mi è rimasta la curiosità di sapere di cosa si trattasse ma purtroppo non son riuscito a capire altro. Qualche giorno dopo sempre da quelle parti ho rivisto l’inconfondibile fungoncino, e per strada c’era una cowgirl che guardava l’altra, con piglio indignato mentre indicava con lo sguardo un non meglio identificato veicolo per non so quale altro motivo.

E’ evidente che le nostre cowgirls hanno preso l’abitudine di “battere” queste strade a caccia di guadagni facili per le casse comunali.

Stamattina, dopo aver notato che tutti erano placidamente tornati a parcheggiare sui propri marciapiedi privati, ho pensato che l’allarme fosse rientrato, e quindi ho azzardato lo sfacciato atto di mettermi con due ruote sul MIO marciapiede.

Quando esco, neanche a farlo apposta, trovo una multa. Per sosta vietata. Sul marciapiede. Il MIO marciapiede. Di quanto? 85€.

E’ una legge del Codice della Strada, lo so, anche i marciapiedi privati, se sono pertinenti ad una strada pubblica, si ritengono di “uso pubblico”, e quindi nonostante privati sono riservati ai pedoni. Se io metto la mia macchina sul mio marciapiede impedisco ai pedoni di usare il mio marciapiede come loro punto di passaggio.

Tutto questo vale in assenza di delimitazioni fisiche atte a impedire il passaggio dei pedoni sul marciapede in questione (leggi:recinzioni), quindi mi si potrebbe dire che mi basta recintarlo per evitare che lo si consideri ad uso pubblico. Però, se lo recinto, neppure posso metterci la macchina.

Non so se riuscirò a far annullare questa multa, ma se dovessi finire per pagarla, sicuramente auguro a chi l’ha fatta di spendere molto di più di quella somma in medicine. E non dico a quali medicine sto pensando.

Control Chauvet Hurricane 1301 with external relay and arduino

I bought a Chauvet Hurricane 1301 for its massive smoke output: my aim is to build a low-cost but extremely effective security and anti theft smoke shield and fog bandit clone, by using nothing more than your average disco fog machine… well, at least a renowned powerful fog machine at that. The specs about the consumption are pretty much the same: 1200W nominal power, and about 50W average when turned on to keep the temperature of the liquid constant. What this system lacks, is the “stamina” that professional systems have, since it won’t fill a room with only the first burst of smoke, but it’s not that much delay between the first puff and the second, and you still get the surprise effect. Ideal for not-so-big rooms.

But you may want to use it to spray smoke when certain events happen, like music timed puffs, or pressure plates, you name it.

There is no immediate way to do it: the wired remote doesn’t provide simple short contacts: none of the pins get shorted when you press the “manual” button there, so it must be a powered remote that sends out powered signals.

Solution: catch the short contact given by the manual switch on the machine’s rear panel.

chauvet hurricane 1301 pcb switches cables
Open your Hurricane 1301 by removing the clearly visible screws on the sides and on top, this is the electronics board where the cables from the button and DIN plugs in the rear end; here I had plugged two jumper cables in the switch plug, I just pushed them on the side of the female connectors inside the plastic plug

 

chauvet hurricane 1301 manual switch derivation
Pull the cables behind the board to get them out from the tank housing.

 

chauvet hurricane 1301 tank housing
Here you see where I made the jumper cables come out from. Since that hole is where the tank’s bulge protrudes to stabilize it, you won’t be able to use large cables (not that you need to anyway) otherwise you won’t be able to fit the tank.

 

chauvet hurricane 1301 manual switch completed derivation
Since I had really short jumper cables, I ended up using 6 of them (!) plugged together, and placed a zip tie in the grill to fix them onto the chassis.

 

chauvet hurricane 1301 manual switch outet
After you close everything, you now have an outlet you can connect to a relay, regulaed for example by an arduino.

 

So what about my homemade smoke shield clone system? I just need to find an alarm sensor to wire up to an arduino, to which will be also wired a relay going to the Hurricane 1301.