Monday, October 10, 2016

Writing a thesis with Lyx / Latex

The Lyx editor is a WYSIWYM - What You See Is What You Mean editor for Latex. I have been using it for 3 years to write research articles. It is now time to compile 4 articles as thesis chapters. A collection of thesis templates has been made for Lyx. I used the default Lyx thesis template which comes pre-installed. The template makes it possible to compile many child documents into a main documents.




Modification to existing articles to integrate them as child documents in the thesis


One of my chapter title was too long to be used as page header on all even pages. This answer solved the issue: I inserted
\chaptermark{short title name} in ERT (Evil Red Text) after the chapter title.

Article 3 had an appendix which caused subsequent article 4 to have weird section number A,B,C instead of 1,2,3. I read the appendix after each chapter question and considered using  subapendix from the appendix package. But it returned an error "\AtBeginEnvironment{subappendices}" is an undefined control sequance. Maybe because I forgot to remove the \appendix option in Document/start appendix here. For the moment I decided not to use subappendices.


Wednesday, August 17, 2016

I miss the iceweasel logo

Becomes


Iceweasel was a re-branding of Firefox introduced by Debian because of license issue. The issue was solved in 2016, as explained in this bug report renaming Iceweasel to Firefox:
= About branding =
Mozilla & Debian both acknowledge that the branding issue mentioned in
bug 354622 is no longer relevant.
The Firefox logo was released under a free copyright license which
matches the DFSG.
As PhilGil wrote on the Debian Forum :
"I'll miss Iceweasel too, but eliminating the rebranding will free up the Mozilla team for more important work and maybe allow them to push out updates in a more timely manner."
A far more detailed article: The end of the Iceweasel Age.
"In essence, then, the logo-licensing problem, the trademark-usage incompatibility, and the patch-maintenance problem have all been resolved, so, Ledru said, Debian could return to the Firefox branding."
Note the patch maintenance problem was solved thanks to the Firefox ESR (Extended Support Release).

Wednesday, May 25, 2016

Jmulti over wine on Linux

Jmulti is a Java based time series analysis software. Unfortunately the Linux version is not maintained any more. I installed wine in the hope to use Jmulti on top of wine. I downloaded the executable “jmultiVM_win-4.24.exe” which is said to contain the Java virtual machine. Then I ran “wine jmultiVM_win-4.24.exe”. Install complains about “InvokeShellLinker failed to extract icon from L"C:\\jmulti4\\jmulti.exe" “ but installation is successful nevertheless.

To start jmulti go to the newly created directory
cd ~/.wine/drive_c/jmulti4/  
then:
 wine jmulti.exe

Black screen issue

Jmulti starts but I have black areas in menu. Rmathew explains how to remove DirectX-based acceleration for Java 2D completely.  Looking for a registry key like:
HKEY_CURRENT_USER\Software\JavaSoft\Java2D\1.5.0_11
and setting the value of "DXAcceleration" to "0" fixes it.

Friday, March 25, 2016

Estimating panel data models with the R package plm

Panel data, also called longitudinal data concerns individuals observed through time. It is said to have both a cross section and time series dimension. The R package plm provides panel data estimators for econometricians and is documented in a detailed vignette.

Default settings of the plm() function

By default, the plm() function assumes that the individual and time indexes are in the first two columns. If this is  not the case, an index argument has to specify the name of those two variables in the dataset. For example the argument index = c("country","year") would specify that the individual index is in the column country and the time index is in the column year.

The plm() function's default settings perform a "Oneway (individual) effect Within Model". "Oneway (individual) effect" is a model specification considering that each individual i has a constant, unobserved effect \alpha_i. "Within Model" is an estimation method, identical to the Least Square with Dummy Variables (LSDV) estimation.

Monday, February 08, 2016

FreeRDP

FreeRDP enables a connection to a windows machine from Debian GNU-Linux. freerdp-x11 can be installed from the Synaptic package manager. The program is called xfreerdp.


Usage example:
xfreerdp /u:**user** /p:**password** /v:**IP** /drive:data,/home/paul/R/forestproductsdemand/data-end
Connect in fullscreen mode using a stored configuration connection.rdp and the password Pwd123! :
xfreerdp connection.rdp /p:Pwd123! /f
Connect to host rdp.contoso.com with user CONTOSO\\JohnDoe and password Pwd123!
xfreerdp /u:CONTOSO\\JohnDoe /p:Pwd123! /v:rdp.contoso.com

Connect to host 192.168.1.100 on port 4489 with user JohnDoe, password Pwd123!. The screen width is set to 1366 and the height to 768. See also option /drive below.
xfreerdp /u:JohnDoe /p:Pwd123! /w:1366 /h:768 /v:192.168.1.100:

The screen shot below shows a windows session accessed from within the Gnome desktop. A folder is shared an can be visible in both the windows and Gnome file explorers.


Options

Command line options
/drive:nameofdrive,localfolder : Redirect localfolder as nameofdrive on the server machine

Window size

Pressing CTRL+ALT+ENTER will switch from windowed to full screen and vice-versa. This is sufficient for me to see the full screen on a Gnome Desktop. But there is no option for scroll bars if the distant screen is to large to appear on screen.

Multiple RDP connections to a windows machine

I'm working with a colleague on the same machine. She has long running processes on the machine and I need to use specific software. According to this Microsoft forum, multiple RDP connection is not possible on windows.

Change keyboard layout

List available keyboard layout
xfreerdp /kbd-list
I didn't manage to enter the keyboard option. I asked a question on SuperUser.

Automation for a thin client

Command script to open xfreerdp and reopen it when it closes suggests this script: 
while (true); do xfreerdp -f xxx.xxx.xxx.xxx ; sleep 2; done

Monday, January 25, 2016

A year on Debian

Inspired by other users seen on the Linux setup. I switched my work computer to Debian GNU/Linux in January 2015. I used the Jessie version which was "unstable" at the time. It became "stable" in april 2015 and I think the adjective is deserved. I'm happy.


I mostly use the R statistical software, the iceweasel web browser, the Lyx editor, the reference manager Jabref and the Evolution mail and calendar program. I learned a lot by using git (file revision system) and databases through the command line. I sometimes use vim to edit text files and I use the RStudio editor in Vim mode. I also use the Libre office Calc, Writer and Draw software.

As long as you stick with what is in the huge Debian package repository, software updates are easy. If you need programs updated very recently (in the last months), installation can become tricky. Although it mostly involves adding new software repositories or installing .deb files directly. For example I managed to install the proprietary statistical software STATA.

R packages installation on Debian Jessie


This morning I wanted to install packagedocs to produce web documentation for a package. Packagedocs is based on staticdocs. They required an upgrade to R >= 3.2.0.

Installing R 3.2.3

Based on Debian packages for R software, I added this line to /etc/apt/sources.list
deb http://cran.univ-paris1.fr/bin/linux/debian jessie-cran3/
Reloaded package information in the synaptic package manager, marked all upgrades and installed the package.

Installing packages

Some packages can be installed from the CRAN repository
install.packages("Rcpp")
install.packages("ggplot2")
install.packages(c("dplyr","tidyr"))
install.packages("ggplot2")
install.packages(c("dplyr","tidyr")
Other packages are not available on CRAN. They can be installed from github:
devtools::install_github("hadley/staticdocs")
devtools::install_github("hafen/packagedocs")

See also my older post on R packages and RStudio install on Debian Wheezy.