Archive for June, 2012

Life

Posted: June 28, 2012 in Uncategorized
Tags:

Some people curse life and some appraise it while few of them like to observe it. But there are very few who enjoys it. Some thinks of life as an opportunity to do great things while some takes it as a burden to spent the time on earth. Some people just like to go along the flow while some people wants to change the things around them. In my opinions life is about everything. It can be about chasing the goals and at the same times helping others also to achieve theirs. It can be about enjoying the various aspects of emotions and at the same time it can be about hiding your feelings from others. It can be about living in the moment and also about planning for the moments.
Life is nothing but the moments spent among the knowns and unknowns. I don’t know why I am writing this post. I am just typing whatever is coming to my mind. Seems like today is one of those days. ­čÖé

Advertisements

A misconception

Posted: June 27, 2012 in Technology
Tags: , ,

From the time I first learned programming, I have been through many opinions regarding what is good, what is bad about various programming languages and constructs. I have heard the arguments like pointers are dangerous, goto statements are bad bla bla bla. After reading this controversy http://kerneltrap.org/node/553/2131 courtesy to this post, I have come to know about this wisdom that its all upto a programmer who can make things look good to which another programmer has addressed as bad. For e.g. this goto statement about which we have been taught from day one that minimize the use of goto in your programs (and if possible dont use it), if used intelligently can in fact make the readability of code much better but at the same point if a bad programmer uses it, God helps the person who is going to debug his code in later stages. Same is the thing with pointers. Yes one can do a lot with pointers but as said by the wise people, with freedom comes responsibilities and that is when those silly programmers labels the things as bad.

Posted: June 11, 2012 in Uncategorized

This one is too good

Few days back,some rightmost part of my laptop screen got dead. Though I am still looking for a fully fledged solution but in the process I learnt about this very cool utility “xrandr” from xorg. Having the problems with refresh rate, needs custom resolution not available in your GUI application, need to setup another screen for your PC,all these question can be answered by this utility. in earlier releases of Ubuntu, xorg used to supply an xorg.conf file inside /etc/X11 directory which had all these options to configure your system but from 11.10, they have configured the X server to autodetect the configurations for your system though you still can create your custom configuration by creating this file in /etc/X11 but for that you need to dig a lot for different configuration options. xrandr does a lot of that for you. For e.g. to change your system’s resolution to lets say 1072X800, follow the following steps :
jkapil@jkapil-pc:~$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192
LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 303mm x 190mm
1280x800 60.0*+
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
jkapil@jkapil-pc:~$ cvt 1072 800
# 1072x800 59.83 Hz (CVT) hsync: 49.72 kHz; pclk: 70.00 MHz
Modeline "1072x800_60.00" 70.00 1072 1136 1240 1408 800 803 813 831 -hsync +vsync
jkapil@jkapil-pc:~$ xrandr --newmode "1072x800_60.00" 70.00 1072 1136 1240 1408 800 803 813 831 -hsync +vsync
jkapil@jkapil-pc:~$ xrandr --addmode LVDS1 1072x800_60.00
jkapil@jkapil-pc:~$ xrandr --output LVDS1 --mode 1072x800_60.00
jkapil@jkapil-pc:~$ xrandr -s 0

first command gives the details of available output displays and the resolution modes available (read already configured) for your system. It also reports the physical size of your screen. There is another utility “xdpyinfo” which also reports the detailed info. about your displays and some information reported may differ from xrandr output but I found the xrandr output as accurate.
next command reports the modeline for the resolution you want.
Next command uses the modeline reported in previous command to add another resolution configuration for your system. Next command associates this configuration to the particular display output. In my case its “LVDS1” which is generally the laptop screen. You can specify the other outputs also. In second last command we switch to that mode by specifying its name. last command brings back the first resolution on the array of resolutions configured (see first output). You can specify either the resolution mode name or the serial no. of the resolution mode in last command.
For multi monitor configuration, specifying the rotation technique, monitors positions w.r.t. each other etc. can also be configured using this. You can use manpage of xrandr to browse through the vast scope of the xrandr.
https://wiki.archlinux.org/index.php/Xrandr is a very good link to understand the various functionality of xrandr.
If you face any problems, you can anyways write to xorg here about your problems.