Aug 262014

Check System Information on TRIM support, should say No

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original
sudo perl -pi -e 's|(^\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
sudo touch /System/Library/Extensions/


Check System Information on TRIM support, should say Yes


Update: my writes went from ~333mb/sec to 400-475 mb/sec on blackmagic disk speed test

pixelstats trackingpixel
Aug 162014

Това са ноти и таблатура за цялота песен.

Вариант 1: много подробно, всеки акорд е разложен отделно. За начинаещи.

pdf с ноти
pdf само таблатура.

pdf с нотиpdf само таблатура

Вариант 2: само акордите, един е разложен за пример, добавих и текста в пдф файла.


Screen Shot 2014-08-17 at 12.42.21 AM

Софтуер: TuxGuitar (free, java based, има го за Win, OSX, Linux). Ето и tx файловете, ако някой иска да редактира и/или поправя грешки.

Вървят ли двама, tuxguitar, таблатури и ноти


pixelstats trackingpixel
Aug 162014

TuxGuitar (free, java based) allows music composition (that's what I used it for). It is not very stable on OS X - it crashed several times on me and I had to rewrite what I had written :(

Easy to use. Copy/paste is achieved via Measures->copy/paste measure. It can export to pdf.
Screen Shot 2014-08-17 at 12.33.27 AM

pixelstats trackingpixel
Jun 202014

FYI: Eclipse Luna (4.4) is currently beta.

Create new Maven Project.

Open the pom.xml

Add the following dependencies:


The code is as follows:

package sty.qainjava.xpath.on.html;
import java.nio.charset.Charset;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.htmlcleaner.CleanerProperties;
import org.htmlcleaner.DomSerializer;
import org.htmlcleaner.HtmlCleaner;
import org.htmlcleaner.SimpleHtmlSerializer;
import org.htmlcleaner.TagNode;
import org.w3c.dom.Document;
 * QAinJava: how to do an xpath on html in java.
 * We use <a href="">HtmlCleaner</a>
 * and <a href="">HttpClient</a>.
 * @author Mihail STY
public class Program {
	 * We're not using any methods so that the source code is as straight
	 * forward as possible.
	 * No exception handling at all for simplicity
	public static void main(String[] args) throws IOException,
	        ParserConfigurationException, XPathExpressionException,
	        TransformerException {
		String address = "";
		String html;
			// the httpclient part
			CloseableHttpClient httpclient = HttpClients.createDefault();
			HttpGet httpGet = new HttpGet(address);
			CloseableHttpResponse response = httpclient.execute(httpGet);
			HttpEntity entity = response.getEntity();
			ContentType contentType = ContentType.getOrDefault(entity);
			Charset charset = contentType.getCharset();
			BufferedReader r = new BufferedReader(new InputStreamReader(
			        entity.getContent(), charset));
			// we can directly plug the input to HtmlCleaner,
			// but we put it in a string so we can print it,
			// or save it to a file
			String line = null;
			StringBuilder builder = new StringBuilder();
			while ((line = r.readLine()) != null) {
			html = builder.toString();
		{// write html to a file
			BufferedWriter bf = new BufferedWriter(new OutputStreamWriter(
			        new FileOutputStream("google.html.xml")));
			// exception handling is not exceptionally good, but that's not our
			// focus here
		// HtmlCleaner part
		TagNode tagNode = new HtmlCleaner().clean(html);
		String cleanHtml = new SimpleHtmlSerializer(new CleanerProperties())
		// System.out.println(cleanHtml);
		{// write cleanHtml to a file
			BufferedWriter bf = new BufferedWriter(new OutputStreamWriter(
			        new FileOutputStream("clean.html.xml")));
			// exception handling is not exceptionally good, but that's not our
			// focus here
		// we need a DOM document to execute xpath, HtmlCleaner helps in creating one
		Document doc = new DomSerializer(new CleanerProperties())
		{// save dom to file with a transformer (just for testing purposes)
			TransformerFactory factory = TransformerFactory.newInstance();
			Transformer transformer = factory.newTransformer();
			transformer.transform(new DOMSource(doc), new StreamResult(
			        new File("dom.html.xml")));
		// the xpath part
		XPath xpath = XPathFactory.newInstance().newXPath();
		String imgURL = (String) xpath.evaluate("//img/@src", doc,
		//using two URLs we can make sure we get the absolute URL even if relative.
		System.out.println(new URL(new URL(address), imgURL).toString());
pixelstats trackingpixel
Jun 182014

There is a warning on the homepage of truecrypt

>WARNING: Using TrueCrypt is not secure as it may contain unfixed security issues

More info:

Alternatives: (forking or actually continuing the development) (truecrypt fork)

TrueCrypt's audit in pdf:

pixelstats trackingpixel
Jun 042014
  • Some people, when confronted with a problem, think, "I know, I'll use regular expressions." Now they have two problems.
  • Some people, when faced with a problem, think, "I know, I'll use #binary." Now they have 10 problems.
  • Some people, when confronted with a problem, think, "I know, I'll use #threads," and then two they hav erpoblesms.
  • Some people, when confronted with a problem, think "I know, I'll use #multithreading". Nothhw tpe yawrve o oblems.
  • Some people, when confronted with a problem, think, "I know, I'll use mutexes." Now they have
  • Some people, when confronted with a problem, think: "I know, I'll use caching." Now they have one problems.
  • Some people see a problem and think "I know, I'll use #Java!" Now they have a ProblemFactory.
  • Some programmers, when confronted with a problem, think "I know, I'll use floating point arithmetic." Now they have 1.999999999997 problems.
  • Some people, wanting an escape from their full-time job, think "I know, I'll contribute to open source." Now they have two full-time jobs.
  • Some people, when confronted with a problem, think: "I know, I'll think outside the box!" Now, they have 3.75 problems, an entirely new framework, and three dozen toll house cookies cooling in the kitchen.
  • Some people when confronted with a desire to use pithy quotes in their presentations think "I know, I'll use something from Star Wars". Now two problems they have.
  • Some people, when confronted with a problem, think, "I know, I'll use #UTF8." Now they à??????µ?ç°§ùÔ_¦Ñ?.
  • "I'll use #PHP!" Now they have ("1 apple" + "1 orange") problems.
  • "I'll use #Perl!" Now they have more than one way to have more than one problem....
  • Some people, when confronted with a problem, think, "I know, I'll use Shareware." Now they have two trials.
  • Some people, when confronted with a problem, think, "I know, I'll use delegations." Now their problem is a problem of their problem.
  • Some people when confronted with a problem think "I know, I'll quote jwz". Now everyone has a problem.


pixelstats trackingpixel
Mar 072014



Microsoft Office is a de-facto standard. The discontinued version for OS X has an appalling interface, is not very interoperable and lacks the Ribbon interface. The iWorks is not a good solution if most of the people you work with use .docx, and ppt and .xsl.

Office 2010 and 2013 are not well supported on wine (just now a preview with 2013 was shown on wine on linux). So Office 2007 is used.

My criteria: how well it works, how well it integrates, can it print directly, can it use the keyboard layout of the OS X.

All the softwares shown are wrappers of wine.

PlayOnMac (ver. 4.2.2) FREE

  • installation wasn't easy
  • when installing office, it downloads .net, fonts and stuff automatically
  • printing on an HP printer (first install the printer on the mac, then it appears AFAIK only if default drivers in windows exist) - prints, but crashes the app.
  • couldn't find a way to add new keyboard layouts
  • bad support
  • open with - no actual info, couldn't make it work
  • MS Word works pretty good
  • Excel took a while to open a 5mb file
  • Overall: works but not sufficient for me

WineBottler (ver. 1.7.11) FREE

  • straight forward interface.
  • presets available
  • most of the built-in installers (IE6, Opera, Firefox...) don't work. Some of them do.
  • Uninstaller on the Q&A page. Doesn't work. You can delete stuff manually.
  • Installing MS Office fails for some reason (Please insert volume 'OFFICE12' (needed for package 'office2007pro')). I don't have a solution:


  • Overall: I can't make it work


Wineskin Winery (ver. 1.7) FREE

  • installation is not very straight-forward
  • fails to install - most of the offices tested fail to initialize, one started  but didn't finish
  • no presets on microsoft office - probably that's why it doesn't work
  • Overall: can't make it work at all

CrossOver (ver. 13.0.1) $50

  • installation with presets
  • Has a preset for Microsoft Office 2010 that works.
  • Supports the keyboard layout of the host.
  • Sees printers installed with the host (I don't know if drivers are needed).
  • "Open with" works by default.
  • Overall: unfortunately the only one that works fine.
pixelstats trackingpixel