mercoledì 8 giugno 2016

String with padded number in c++

How to use a padded number in a string in c++??

ok, I need to use it to number a image sequence.

Here the include statements
#include <iomanip> // for setfill etc
#include <string>     // for string
#include <sstream>  // for stringstream

Some variables:

std::stringstream sStream;
std::string m_frameName;
int m_frameNumber;

Finally the key piece of code

sStream << std::setfill('0') << std::setw(6) << m_frameNumber;sStream >> m_frameName;

std::cout << "=========" << std::endl << "Frame no. " << m_frameNumber <<  std::endl;
std::cout << "[DBG] " << "m_frameName: " << m_frameName << std::endl;


venerdì 12 febbraio 2016

Ubuntu 14.04 LTS on Dell inspiron 15 7000 series



subtitle: a lot of problems





ok, this is the page of the hardware configuration certification in ubuntu
http://www.ubuntu.com/certification/catalog/component/dmi/4755/dmi%3ADellSystemInspiron157000Series7537/


...but...

WI FI

when you finish the installation stage, u could have no wireless connection
due to problems with Intel wireless drivers

on the Dell pc you have this wireless card
Intel® Wireless 7265
Intel® Wireless 3165 (starting from firmware XX.XX.13.0 and kernel 4.1)

https://wireless.wiki.kernel.org/en/users/Drivers/iwlwifi


a solution is to use this trick:


First, verify that you have these two files; iwlwifi-7265D-13.ucode and iwlwifi-7265-13.ucode:
ls /lib/firmware | grep 7265
If so, we are going to make copies but rename them:
cd /lib/firmware
sudo cp iwlwifi-7265D-13.ucode  iwlwifi-3165-9.ucode
sudo cp iwlwifi-7265-13.ucode  iwlwifi-3165-13.ucode

FROM: http://askubuntu.com/questions/672700/how-can-i-install-intel-dual-band-wireless-ac-3165-drivers

This solution works for me.


Kernel 4.X

you could have problems with this kernel
in my case the nouveau drivers crash on startup 


FREEZING


sometimes the OS freezes,

I don't be sure that this is the solution...

If you have installed the Ubuntu distro on a PC with Microsoft Windows pre-installed maybe the fast startup settings could be put on the RAM some configuration files, then when you start linux it could be find a incoerent state...
 
try to disable the hybernate and sleep, and fast startup in windows OS


I tryed also to install other kernels or other versions of  ubuntu and mint, but I cannot have more than half an hour to spend in installations...

mercoledì 28 ottobre 2015

Uninstall MatLab Linux

come disintstallare matlab su linux?

segui qui!

http://www.mathworks.com/matlabcentral/answers/102428-how-do-i-uninstall-matlab-products-on-a-unix-or-linux-machine


venerdì 8 maggio 2015

Beamer Themes Matrix

La matrice dei temi di Beamer, per avere sotto controllo le varie combinazioni in modo efficace e immediato!

https://www.hartwork.org/beamer-theme-matrix/

The Beamer themes matrix...

lunedì 12 maggio 2014

Installare packages LaTex ubuntu 14.04

Per installare i packages di LaTex su ubuntu 14.04 che provengono da CTAN si può usare tlmgr

Procedura  per installare il pacchetto changes come esempio.

1. Installazione di texlive-base che nella versione di ubuntu 14.04 contiene tlmgr
$ apt-get install texlive-base

 Usage:
    tlmgr [*option*]... *action* [*option*]... [*operand*]...

2. se non inizializzi tlmgr  allora compare questo errore:
$ tlmgr install changes
(running on Debian, switching to user mode!)
cannot setup TLPDB in /home/nomeutente/texmf at /usr/bin/tlmgr line 5336.

per inizializzare tlmgr, con creazione della directory appropriata

$ tlmgr init-usertree
(running on Debian, switching to user mode!)

3. Ricordarsi di installare anche il pacchetto ubuntu xzdec

$ sudo apt-get install xzdec





4. A questo punto si può installare il package di  LaTex


$ tlmgr install changes

tlmgr: package repository http://ctan.mirror.garr.it/mirrors/CTAN/systems/texlive/tlnet
[1/1, ??:??/??:??] install: changes [5k]
tlmgr: package log updated: /home/nomeutente/texmf/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.

5. se si vuole installare con il download del pacchetto da CTAN fare riferimento qui:

en.wikibooks.org/wiki/LaTex/Installing_Extra_Packages

martedì 22 aprile 2014

Raspberry configuration

nel file config.txt ci sono le configurazioni base che vengono utilizzate all'avvio dal Raspberry Pi.

sudo nano /boot/config.txt

per abilitare l'utilizzo del composite quando l'hdmi è staccato ci sono due flag che possono tornare utili, controllare se sono abilitati.

hdmi_force_hotplug

Pretends HDMI hotplug signal is asserted so it appears a HDMI display is attached
hdmi_force_hotplug=1 Use HDMI mode even if no HDMI monitor is detected

hdmi_ignore_hotplug

Pretends HDMI hotplug signal is not asserted so it appears a HDMI display is not attached
hdmi_ignore_hotplug=1 Use composite mode even if HDMI monitor is detected 
 
 
 
Riferimento:
http://raspberrypi.stackexchange.com/tags/config.txt/info
http://elinux.org/R-Pi_ConfigurationFile#How_to_edit_from_the_Raspberry_Pi
http://elinux.org/RPiconfig




giovedì 13 febbraio 2014

uso dei limiti per variabili numeriche

da guardare il resto dei limiti dentro limits.h o limits, 
riferimento:
http://stackoverflow.com/questions/15889253/maximum-value-for-unsigned-int

C

#include <limits.h>
unsigned int max_unsigned_int_size = UINT_MAX;

C++

#include <limits>
unsigned int max_unsigned_int_size = std::numeric_limits<unsigned int>::max();