Golden Dict instead of Lingvo

Official web-site: http://goldendict.org/ Newer version for Windows: https://github.com/goldendict/goldendict/wiki/Early-Access-Builds-for-Windows Conversion (decompression) Lingvo *.lds to *.dsl format: https://pypi.python.org/pypi/lingvoreader it’s a python module. Install via pip install lingvoreader https://github.com/goldendict/goldendict/wiki/Early-Access-Builds-for-Windows

October 11, 2015 · SergeM

ffmpeg(avconv) jpeg quality

conversion with good jpeg quality: 1 avconv -i ./input.avi -q:v 1 output_frame_%05d.jpg

September 6, 2015 · SergeM

Encode/decode binary file to ascii using command line

base64 source_file > destination.ascii base64 --decode destination.ascii > decoded_file

September 6, 2015 · SergeM

Interactive graphs in IPython

There are at least two libraries for ipython able to plot graphs interactively and inline. mpld3 bokeh I have tested only mpld3. It looks awesome. It implements exactly the thing I missed without matlab. Inside the notebook I now have a possibility to zoom and move plots. Of course, I could do it using qt mode, but it not so nice and convenient. Demo of mpld3: http://mpld3.github.io/_downloads/mpld3_demo.html How I use it:...

June 7, 2015 · SergeM

Joint clipboard for Ctrl+Ins and Select+Middle click

Install clipit application: sudo apt-get install clipit Run clipit. Go to Preferences->Settings. Enable “Synchronize clipboards”

April 26, 2015 · SergeM

Python logging best practices

Python has a great built-in logging library. It allows to avoid a lot of boilerplate code and provides great features. Here are some examples. Logging allows to set up a unified formatting for logs: 2023-10-03 12:57:22,377|classifier.py| 62|522130|MainThread|INFO|Classifying messages from ./messages.ndjson (images ./save_path)... 2023-10-03 12:57:22,378|classifier.py| 44|522130|MainThread|INFO|Start reading input messages from ./messages.ndjson 2023-10-03 12:57:22,378|classifier.py| 48|522130|MainThread|INFO|Loaded event {'id': 104162, 'date': '2023-09-27T07:12:08+00:00', 'entities': []} 2023-10-03 12:57:22,378|classifier.py| 48|522130|MainThread|INFO|Loaded event {'id': 58934, 'date': '2023-09-27T07:12:09+00:00', 'entities': [{'_': 'MessageEntityBold', 'offset': 92, 'length': 8}]} 2023-10-03 12:57:22,378|classifier....

April 21, 2015 · SergeM

reading C type declarations

Source //////////// simple example: long **foo[7]; We’ll approach this systematically, focusing on just one or two small part as we develop the description in English. As we do it, we’ll show the focus of our attention in red, and strike out the parts we’ve finished with. long * * foo [7]; Start with the variable name and end with the basic type: foo is … long long * * foo[7];...

March 9, 2015 · SergeM

Suspend and hibernate in Linux

After installing ubuntu 14.04 I found hibernation was disabled. It was deleted from system menu at all. http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/ Only Suspend option was there. Suspend didn’t work either. Computer couldn’t wake up. It actually woke up, but stayed freezed displaying wallpaper. Some googling and testing with other hibernation modules (tuxonice), swap settings gave no result. I decided to install mint Linux as it has hibernation option by default. In mint Linux the situation was the same except I hadn’t to enable hibernate option myself....

February 4, 2015 · SergeM

Installing Ubuntu from USB

I use Windows OS and I want to install Ubuntu on another PC. Download software for bootable usb creation http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/ Download ubuntu image from http://www.ubuntu.com/download/desktop According to instructions from http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows install image on usb stick use usb-stick as bootable

January 11, 2015 · SergeM

Installing theano on windows

install Anaconda download Theano sources from git (install it using setup.py) Setup NVIDIA GPU Toolkit. I have installed version 6.5 Setup Visual Studio Community Edition 2013 Create config file .theanorc in c:\Users\X: [global] floatX = float32 device = gpu [nvcc] fastmath = True compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe Without the line with path to cl.exe I got: nvcc fatal : Cannot find compiler 'cl.exe' in PATH ['nvcc', '-shared', '-O3', '-use_fast_math', '-Xlinker', '/DEBUG', '-D HAVE_ROUND', '-m64', '-Xcompiler', '-DCUDA_NDARRAY_CUH=f411a53ee0a470fbaad3b5c4a681ef64,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD', '-Ic:\\anaconda\\theano\\theano\\sandbox\\cuda', '-Ic:\\anaconda\\lib\\site-packages\\numpy\\core\\include', '-Ic:\\anaconda\\include', '-o', 'C:\\Users\\X\\AppData\\Local\\Theano\\compiledir_Windows-7-6....

December 28, 2014 · SergeM