Ecco qui il link al PDF di Appunti di Informatica Libera (precedentemente noti come Appunti Linux). L'ultimo aggiornamento รจ del 11.11.2013.
Opera monumentale!
ftp://na.mirror.garr.it/mirrors/appuntilinux/2013.11.11/a2-2013.11.11.pdf
http://a2.pluto.it/a2/a0.pdf
Altri formati:
ftp://na.mirror.garr.it/mirrors/appuntilinux/2013.11.11/
Online
My Tips and Tricks for C#, C, C++, MatLAB, Java, LaTeX, Python and more!
Tuesday, June 20, 2017
Sunday, May 28, 2017
tic and toc functions in C++ (millisecond resolution)
This is a newer version of my original post about Matlab-like tic/toc functions in C++
These new versions of the TIC/TOC functions have millisecond resolution while the old ones rounded the time difference to the seconds.
Here is the the new tic_toc.h header:
#ifndef TIC_TOC_H
#define TIC_TOC_H
#include <iostream>
#include <chrono>
typedef std::chrono::high_resolution_clock Clock;
typedef std::chrono::milliseconds milliseconds;
static Clock::time_point t0 = Clock::now();
void tic()
{
t0 = Clock::now();
}
void toc()
{
Clock::time_point t1 = Clock::now();
milliseconds ms = std::chrono::duration_cast<milliseconds>(t1 - t0);
std::cout <<"Elapsed time is "<< ms.count() << " milliseconds\n";
}
#endif
// happy coding and performance testing :)
These new versions of the TIC/TOC functions have millisecond resolution while the old ones rounded the time difference to the seconds.
Here is the the new tic_toc.h header:
#ifndef TIC_TOC_H
#define TIC_TOC_H
#include <iostream>
#include <chrono>
typedef std::chrono::high_resolution_clock Clock;
typedef std::chrono::milliseconds milliseconds;
static Clock::time_point t0 = Clock::now();
void tic()
{
t0 = Clock::now();
}
void toc()
{
Clock::time_point t1 = Clock::now();
milliseconds ms = std::chrono::duration_cast<milliseconds>(t1 - t0);
std::cout <<"Elapsed time is "<< ms.count() << " milliseconds\n";
}
#endif
// happy coding and performance testing :)
Labels:
C++,
chrono,
howto,
matlab,
milliseconds,
performance,
tic,
toc
Thursday, April 13, 2017
Undefined functions while using struct and optim packages in Octave
If you have encountered errors like these in octave:
error: 'cell2fields' undefined near line 939 column 11
error: called from
__nonlin_residmin__> at line -1 column -1
__lm_svd__ at line 191 column 9
__nonlin_residmin__ at line 1128 column 21
nonlin_curvefit at line 83 column 18
nlinfit at line 169 column 18
OR these
error: '__collect_constraints__' undefined near line 152 column 7
error: called from
__nonlin_residmin__ at line 151 column 48
nonlin_curvefit at line 83 column 18
nlinfit at line 169 column 18
mean that NOT all the functions in the packages struct or optim have been correctly imported into Octave.
istread of importing the single folders in the Octave's path:
addpath('/home/eddie/octave/struct-1.0.14') % NOT ENOUGH!!!
addpath('/home/eddie/octave/optim-1.5.2') % NOT ENOUGH!!!
just use the pkg command:
pkg load struct ;
pkg load optim ;
That's it. Happy scientific programming :)
error: 'cell2fields' undefined near line 939 column 11
error: called from
__nonlin_residmin__> at line -1 column -1
__lm_svd__ at line 191 column 9
__nonlin_residmin__ at line 1128 column 21
nonlin_curvefit at line 83 column 18
nlinfit at line 169 column 18
OR these
error: '__collect_constraints__' undefined near line 152 column 7
error: called from
__nonlin_residmin__ at line 151 column 48
nonlin_curvefit at line 83 column 18
nlinfit at line 169 column 18
mean that NOT all the functions in the packages struct or optim have been correctly imported into Octave.
istread of importing the single folders in the Octave's path:
addpath('/home/eddie/octave/struct-1.0.14') % NOT ENOUGH!!!
addpath('/home/eddie/octave/optim-1.5.2') % NOT ENOUGH!!!
just use the pkg command:
pkg load struct ;
pkg load optim ;
That's it. Happy scientific programming :)
Monday, November 7, 2016
Friday, October 21, 2016
Windows Update Error 8024402C
1. Go to Administrative Tools/Services and find the Windows Update service. Stop it.
2. Go to C:\Windows\ and rename the SoftwareDistribution folder to something like SoftwareDistribution.old
3. Restart the Windows Update service.
4. Click the Check for Updates button on the Windows Update screen.
5. Windows will perform the check - it may take some time, so leave it running. Eventually it will successfully complete.
6. You can then delete the SoftwareSistribution.old folder.
Source:
http://www.sevenforums.com/windows-updates-activation/218303-windows-wont-update-error-8024402c.html
2. Go to C:\Windows\ and rename the SoftwareDistribution folder to something like SoftwareDistribution.old
3. Restart the Windows Update service.
4. Click the Check for Updates button on the Windows Update screen.
5. Windows will perform the check - it may take some time, so leave it running. Eventually it will successfully complete.
6. You can then delete the SoftwareSistribution.old folder.
Source:
http://www.sevenforums.com/windows-updates-activation/218303-windows-wont-update-error-8024402c.html
Saturday, October 15, 2016
bash history with timestamps
This is definitely something useful!
How to attach timestamps to the history of the bash commands?
Simple: just set (in the way you like to have your time format) the bash variable HISTTIMEFORMAT
For example to have the format: day/month/year - hours:minutes:seconds" type this:
export HISTTIMEFORMAT="%d/%m/%y - %H:%M:%S: "
and then just run history
That's it!
Source
stackoverflow
How to attach timestamps to the history of the bash commands?
Simple: just set (in the way you like to have your time format) the bash variable HISTTIMEFORMAT
For example to have the format: day/month/year - hours:minutes:seconds" type this:
export HISTTIMEFORMAT="%d/%m/%y - %H:%M:%S: "
and then just run history
That's it!
Source
stackoverflow
Thursday, October 13, 2016
"Server is either down or too busy to respond" with AppStatusCheck
If you got this problem (and your server IS up and running!) it means you haven't set the correct JDBC driver in your AppStatusCheck.tra file.
The path to the JDBC driver (for example ojdbc6.jar) must be set in the property
tibco.class.path.extended
That's it!
The path to the JDBC driver (for example ojdbc6.jar) must be set in the property
tibco.class.path.extended
That's it!
Subscribe to:
Posts (Atom)