2011-12-20

Code @ C++: Find sum of elements in the array

Code @ C++: Find sum of elements in the array: Наткнулся на задачу, которую предлагают в Yandex на собеседовании: Ниже приведены три варианта суммирования чисел с плавающей точкой (предп...

2011-12-12

Emacs column marker

Very often some code style has limited length of code line and its quite good, when IDE knows about such limits.

I've added to Emacs column-marker

(add-to-list 'load-path (expand-file-name "~/emacs/column-marker"))
(require 'column-marker)
(add-hook 'ada-mode-hook (lambda () (interactive) (column-marker-3 79))) 

Now, if in Ada code some line exceeds 79-symbols limit, Emacs will highlight it with red.



2011-12-04

Error: Value too large for defined data type

During compilation of program sources in Ubuntu Linux in folder, which was mounted via CIFS from windows I've got the following error from gcc:

Error: Value too large for defined data type

At the first thought it is an error in gcc, but actually the problem was in mounting directory via CIFS .

To fix this error the following options should be added to fstab or mount command line:


nounix,noserverino 
I've got this info from here. 

2011-10-17

Escaping in bash. Who knows ?

I have such script for bash:


#!/bin/bash
set -x
a () 
{ 
   echo $1 
}

b () 
{ 
   a "--some-flag='param1 param2,param3'" 
}
b

In the a () function "echo" is called like below:
echo '--some-flag='\''param1' 'param2,param3'\'''

How can I pass parameter to a () function without escaping ?

To make it possible to call echo as follow:
echo --some-flag='param1 param2,param3'

I mean to pass parameters as is?

2011-10-15

Installation of Grub2 in Gentoo

I'm bothered to use LILO and want something new.
I've decided to install GRUB2.

1. Unmask package:
echo ">=sys-boot/grub-1.99-r2" >> /etc/portage/package.unmask

2. Build
emerge grub

3. Setup
 grub2-mkconfig -o /boot/grub2/grub.cfg

4. Checking if configuration looks good.
grub2-install --grub-setup=/bin/true /dev/sda

5. Installing
grub2-install /dev/sda

6. Rebooting
reboot.

2011-10-05

Apple has lost a visionary genius

Apple has lost a visionary and creative genius, and the world has lost an amazing human being. Those of us who have been fortunate enough to know and work with Steve have lost a dear friend and an inspiring mentor. Steve leaves behind a company that only he could have built, and his spirit will forever be the foundation of Apple.

2011-10-04

kernel.org is back

kernel.org is back.
Waiting for results of hacking investigation.

P.S. on lwn.net the link was given to https://www.kernel.org,
secure connection of https://www.kernel.org looks good,
but https://kernel.org says that certificate is only valid for *.kernel sites :-).