Author Archives: Yuriy Nazarov

Yuriy Nazarov

Love machine learning

Link assembly and c

I using nasm to generate object code from assembly source. 3 application required to compile executable:
– nasm
– gcc from gcc--base package (gcc-4.7-base for example)
– ld from binutils package
*package names in ubuntu distribution

To install this packages run following command:

Files contents:

And finaly:

Precision of calculation with floating point numbers

I found some curiosity issues during finding optimal tool for compilation our program. Results of computations be different for different tools and different optimisation flags.
For investigating this issue I write simple code(full sources on github):

In this small test program I can’t reproduce different results for different flags. But 5 different results for so similar programs is enough to demonstrate discovered effect.

Source code and tool Result Computation time, s
Assembler 1.53436944477410652787 3.81
gcc long 1.53436944477462278158 4.4
gcc double 1.53436944477389380914 4.4
icc long 1.53436944477397574360 6.88
icc double 1.53436944477334602510 1.50

p.s. also I found that manually written assembly code 15% faster than code on C in spite of using “-O2” optimisation flag.

AT90USB647 development board

AT90USB647 development board. Overview.


read more »

Remote SVN backup with svnsync

Create local svn repository with name “my_local_repo”

prepare local repo

initialize local copy

first run must be interactive to input and save your login and password

write script to run it in cron
backup_svn_script.sh:

it produce files like “svn_2012_09_07_01_34_01.tar.gz” in your backup directory

Now you can add task to cron. Execute:

and add following line to run backup at 4:00 (4 a.m.) every day

This method is not disk space efficient, but very simple.

Sources:
using svnsync
installing subversion server in ubuntu

Web server on bash

web server on bash, nc, awk and sed

read more »

Remote access without “white” ip

How to get access to shell on the remote computer that don’t have “white”(“real” or “public”) IP without any additional software in linux?
Quick and dirty solution:
on server side:

on client side:

pipe ‘/tmp/localpipe’ used to redirect bash output back to ssh
note: use exit command to stop redirection