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 :-).

2011-06-28

How execute application with gdb, which read stdin and params

Suppose we have an application, which reads something from standard input and accept command line arguments.

Q : How to execute application under GDB?
 
A :gdb application
   gdb> run parameters ... < input_file

2011-06-14

Announce: GNAT GPL 2011

 
Today, I've got  the following message from Adacore company:
We are pleased to announce the release of GNAT GPL 2011, the integrated
Ada, C, and C++ toolset for Academic users and FLOSS developers.
This new edition provides many new features and enhancements in all
areas of the technology. The most notable ones are:

 - improved support for Ada 2012 
 - enhanced versions of tools 
    - GPS 5.0 enhanced IDE (improved support for C/C++, more powerful
      source editing, better usability, ….),
    - GtkAda (new widgets, interface to the Cairo graphics library)
 - more flexible and more efficient project manager tool
 - support for unloading Ada plug-ins
 - improved support for Ada constructs on the .NET platform
 - more detailed exception messages (-gnateE switch)
 - complete support for Lego MINDSTORMS hardware, including audio and
   I2C sensors

GNAT GPL 2011 comes with version 5.0.1 of the GNAT Programming Studio
IDE and GNATbench 2.5.1, the GNAT plug-in for Eclipse.

GNAT GPL 2011 can be downloaded from the "Download" section on
https://libre.adacore.com.

About

Hi all, this will be a mirror of my Russian blog about Linux-related development tools and technologies.