Wednesday, September 10, 2014

Free software, free society: Richard Stallman at TEDxGeneva 2014

It is the first TEDx talk of the founder of Free Software movement. Stallman, RMS for short, has changed the world with his vision of freedom for the digital age. He launched the GNU operating system, used with Linux as a component, and inspired the development of Creative Commons licences and Wikipedia project. In this talk, Stallman describes how nonfree programs give companies control of their users and what users can do in order to recover control over their computing.

Tuesday, September 2, 2014

Install Node.js on Ubuntu 14.04 via PPA

To install Node.js on Ubuntu 14.04, enter the command:
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs


Linux command - tree, to list directories in a tree-like format

tree is a Linux command to list contents of directories in a tree-like format.



To install tree on Ubuntu:
$ sudo apt-get install tree


Thursday, August 28, 2014

nomacs, a free, small, fast and multi-format image viewer

nomacs is a free image viewer for windows, linux, and mac systems, which is licensed under the GNU General Public License v3. nomacs is small, fast and able to handle the most common image formats including RAW images. Additionally it is possible to synchronize multiple viewers. A synchronization of viewers running on the same computer or via LAN is possible. It allows to compare images and spot the differences (e.g. schemes of architects to show the progress).

To install nomacs on Ubuntu, add repository of ppa:nomacs/stable:
$ sudo add-apt-repository ppa:nomacs/stable

Then, enter the commands:
$ sudo apt-get update
$ sudo apt-get install nomacs


Monday, August 25, 2014

Linux command, lscpu, to get CPU architecture information

The Linux command lscpu  gathers  CPU  architecture  information  like  number  of  CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches,  CPU family,  model,  bogoMIPS,  byte  order  and  stepping  from  sysfs and /proc/cpuinfo, and prints it in a human-readable format.   It  supports both online and offline CPUs.  It can also print out in a parsable for‐mat, including how different caches are shared by different CPUs, which can be fed to other programs.


Code::Blocks + wxWidgets + wxSmith, to open text file with wxFileDialog

This video show steps to create wxWidgets project in Code::Blocks, using wxSmith, to open text file with wxFileDialog.



The only programmatic code is in wxTextFileFrame::OnMenuOpenSelected() of the file wxTextFileMain.cpp.
void wxTextFileFrame::OnMenuOpenSelected(wxCommandEvent& event)
{
    wxTextFile file;
    wxString text;

    int result;
    result = FileDialog1->ShowModal();
    if(result==wxID_OK){
        SetTitle(FileDialog1->GetPath());

        file.Open(FileDialog1->GetPath());
        for(size_t i=0; i<file.GetLineCount(); i++){
            text << file.GetLine(i) << _T("\r\n");
        }
        file.Close();
        TextCtrl1->SetValue(text);
    }

}


And also include wx/textfile.h.
#include <wx/textfile.h>