### Archive

Archive for March, 2018

## [manjaro] edit PKGBUILD and install a package

Problem
You try to install a package with “yaourt pkg_name” but the installation fails. How to edit the PKGBUILD file manually and then install the package?

Solution

$cd /tmp$ yaourt -G pkg_name
$cd pkg_name # modify the file PKGBUILD with your favourite text editor$ makepkg -i


Where “pkg_name” is the name of the package you want to install.

Categories: manjaro Tags: , ,

## pretty print a C# source code

Problem
I wanted to print the page at https://learnxinyminutes.com/docs/csharp/, but the produced PDF was black and white, i.e. the syntax highlighting was lost. How to print a source code with colors?

Solution
I tried several browsers, several editors, but nothing worked. Then I found a LaTeX solution. The necessary files and the produced PDF output are here: https://github.com/jabbalaci/blog-assets/tree/master/20180329-print-CSharp-code.

I put here the LaTeX source:

\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage[usenames,dvipsnames]{color}  %% Allow color names

%% The listings package will format your source code
\usepackage{listings}
\lstdefinestyle{customasm}{
belowcaptionskip=1\baselineskip,
xleftmargin=\parindent,
language={[Sharp]C},
breaklines=true, %% Wrap long lines
basicstyle=\footnotesize\ttfamily,
stringstyle=\color{Black},
keywordstyle=\bfseries\color{OliveGreen},
identifierstyle=\color{blue},
xleftmargin=-8em,
showstringspaces=false
}
\begin{document}

\lstinputlisting[style=customasm]{src.cs}

\end{document}


The LaTeX tip is from here.

Categories: csharp, latex Tags:

## [steam] get a game for a cheaper price

Problem
You want to buy a game on Steam for a cheaper price. There are sales on Steam but you don’t want to check it every day.

Solution
There is a very simple way to get notified when the desired game becomes cheaper. Log in to Steam and add the game to your wishlist. I thought that the wishlist was just a simple list and never clicked on it but it’s more than that! When a game on your wishlist becomes cheaper, you get an e-mail notification. It’s that simple.

I wanted to build a web app. for this purpose :) Then I talked about it with a friend and he told me that the Steam wishlist can do that…

Categories: games Tags: ,

## Xbox 360 controller not detected

Problem
I have a wired Xbox 360 controller that stopped working. Windows 7 doesn’t recognise it and it appears as an “unknown device”.

Solution
I tried everything: uninstall and reinstall the driver; reinstall the USB drivers that I got on a DVD for the motherboard; plug it in another USB slot. Nothing. After 1.5 hours, I found the solution: the cord has an inline release and it was not entirely connected… Damn. But the good news is that it works again :)

Lesson learned: if you have a problem with the controller, first check the inline release.

Categories: Uncategorized