Thursday, March 29, 2012

Printer margins issues with Samsung CLP-310N

   Although this is a rather specific issue concerning the Samsung CLP-310N, I thought it could be a good idea to share the solution to a longstanding problem I was having. 

   For some reason, when I upgraded CUPS some time ago (I don't recall specifically when this began), printing PDFs and other documents from my Arch Linux box was difficult. The documents were not properly centered on the page (the top margin was way too low). So, I googled for something interesting. I came up with someone saying that the SPL-C driver seemed to be the cause and that switching to foo2qpdl solved the problem.

   I immediately tried to change my printer's driver to this one with CUPS (on my machine, I just go to http://localhost:631), but the driver was not in the list, even though the foo2qpdl XML file comes with foomatic-db, which I had installed a while back. 

   Okay, the quick solution is:
yaourt -S foo2zjs
then you will be able to select the Foomatic/foo2qpdl from the drop-down menu in CUPS. This is an AUR package, which seems to be well maintained. 

Anyway, hope this helps. Certainly helped me! 

Thursday, March 1, 2012

Equations in Blogger (part 2)

  A while ago, I fumbled into a method to typeset equations on any web page. However, the JavaScript needed to do the work suddently disappeared (I didn't research that) and anyhow, the equations stopped displaying properly. 

Now I just found out that MathJax is available as CDN service. This makes my life way easier. You have to add a HTML/JavaScript gadget to Blogger and paste some code. The simple procedure is explained in their good documentation

So... want a taste of it? Let $\rho(\mathbb{x})$ be the probability density function of $n$ statistically independant variables distributed according to some distribution function. The normalization condition is:

\[ \int\cdots\int_{-\infty}^{\infty} \rho(\mathbb{x})d^n\mathbb{x} = 1. \]

Oh hell, I like this too much! Another one!

\[ \mathcal{H} = \frac{1}{2}\frac{p_{\theta}^2}{mL^2}-mgL\cos\theta.\]