Thursday 3 April 2014

BSUIR Contest 2014 Semi-finals


Yesterday our team was participating in BSUIR programming contest semifanals. We laid and egg as our team didn't solve even one task. Here you can download tasks(Russian only).

Monday 31 March 2014

What was wrong with with Ubuntu 12.04 LTS "out of the box" on my laptop



I'm using HP Pavillion dv6 and some time ago I decided to install Linux on it. I've heard a lot of positive feedbacks about Ubuntu distribution, it's ease of use, good support and great community. The choise was made. But right from the start I faced some problems, and in this post I will describe how I've solved them.

Problem #1: Headphone jack don't work

Solution: 

Open terminal and edit file analog-output-headphones.conf

sudo gedit 
/usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf

Modify the [Element Speaker] section as follows:

[Element Speaker]
; link to muting
switch = mute
; set volume to zero, so only the master slider controls playback volume. This gives better linearity.
volume = zero


Problem #2: Impossible to change brightness

Solution:

Open terminal ( Ctrl+Alt+T ) and type:

sudo gedit /etc/default/grub

You will find this line in the new opened window:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
Save and close the window and type this in the terminal:
sudo update-grub

This will update your grub and while rebooting your PC, it will set an extra parameter on the grub menu during boot. This problem might have occur on due to the upgrade on kernel.
Solution was found there: http://www.techjail.net/solved-brightness-problem-in-ubuntu-12-04-precise-pangolin.html

Problem #3: Debuggers in C/C++ IDEs don't work properly

Solution:

I've tried some popular Linux IDEs like Geany, Code::Blocks, Monodevelop, Eclipse, CodeLite and I stopped on CodeLite or pure g++ & gdb & Sublime Text (or gedit).

     Quick IDE overview:
  1. Geany don't have debugging option from the start but you can use a plugin called "Debugger". I experienced problem with it: user session was closing after the stopping of Debugger.
  2. Code::Blocks: I couldn't set up gdb to work with this IDE.
  3. I experienced some problems with either Monodevelop and Eclipse, but Eclipse is pretty good for C/C++ development. I just don't need so heavy IDE.
  4. CodeLite was working great directly from the start. It's light and comfortable for me. (http://codelite.org/)
  5. But for simple projects I prefer Sublime Text + g++. (http://www.sublimetext.com/)
Write you questions and opinions.

Don't know how to start with x86 assembly? Don't worry!

This semester I take Assembly language courses in my univercity. I experienced a problem with finding easy way of compiling and executing 16-bit programs on my 64-bit Windows or 32-bit Ubuntu Linux. And I stopped on DosBox + TASM compiler (http://trimtab.ca/2010/tech/tasm-5-intel-8086-turbo-assembler-download/) bacause I started from programming for DOS operating system and this solution can be used on both OS I use.
 Also you can use emu8086 (http://www.emu8086.com/) - Intel 8086 emulator which contains everything for learning, of another assembly like MASM, FASM, NASM, etc.
For learning Assembly language I'm using S. Zubkov's book "Assembler for DOS, Windows and UNIX". 

BSUIR Programming Championship. Quaterfinals

Our team solved 10 tasks out of 20, and I hope that it's enough to reach the semi-finals. We used C++ and C# to solve the tasks. It is interesting experience, and it helped me understand that algorithms are even more important than I used to think. Now I know: to become a good developer one certanly should be good in computer algorithms.