Feeds:
Posts
Comments

people

Advertisements

Initialize structure elements

static struct itimerspec timeout_retv = {
    .it_interval.tv_sec = 0,
    .it_interval.tv_nsec = 0,
    .it_value.tv_sec = MIN_RETV_TIMEOUT,
    .it_value.tv_nsec = 0
};

It’s sometimes called “designated initialization”. This is a C99 addition, though it’s been a GNU extension for a while.

In the list, each . names a member of the struct to initialize, the so called designator.
 This is used for initialization of struct members (they are not variables) in the "new" C99 style (some compilers may have used the same format even before C99 was issued).

struct Employee
{
     char ename[20];
     int ssn;
     float salary;
     struct date<--- init of a structure inside structure
     {
            int date;
            int month;
            int year; 
     }doj;
}emp = {"Andrew",1000,1000.50,{22,6,1990}}; <--- init of a structure inside structure

1. Make  to-do list and follow it
When I created list, I couldnot make it for about 15 days, was spending time on time in TV, social media, online shopping
which makes me happy(time being)
But when I looked at list its disappointing.
So I made small goals. like1. Make a list of to do and follow it

a)  Atleast 5 task to watch TV
b)  Atleast 8 tasks to do online shopping
ITS WORKinggg

Share your steps too.

ctags

Believe me, it makes c-code browsing  a lot easier and simpler. So install

1.sudo apt-get install ctags
2.Download taglist.zip from git/sourceforge
https://github.com/vim-scripts/taglist.vim
3. Untar taglist.zip to ~/.vim
~/.vim$ ls
doc plugin README

~/.vim$ ls plugin/
taglist.vim
4. Restart vim/gvim
Eg: vim file.c
use ‘:TlistOpen’ to list function
TlistAddFilesRecursive pathtodir

 

Refer ~/.vim/doc/taglist.txt for more help options

vnc: connection error

Error:

unable to connect to socket connection refused 111

or

unable to connect to host: No route to host (113)

Reason:

Machine on which VNC server running is blocking the port 5904 ( vnc server on port 5904)

Solution:

Stop vncserver and add port 5901 to iptables in accept mode. Its for temporary. Save iptables if you need changes permanently.

sudo iptables -I INPUT 1 -p tcp --dport 5904 -j ACCEPT

Flying to US

Leaving to US , start packing, pack pack .  What to pack?

Carry on :

  1. Sling bag :
  2. Handbag
  3. Laptopbag:

Check-in :

2. less clothes

Less luggage is good

ViewSets in MKS

From now on, I wont get surprised If I miss viewSets in MKS  .

Stop MKS, move ~/.mks/viewset folder, start MKS and select option ‘viewSet->import’ then select whatever required 🙂 :).