Monday, June 3, 2013

learn a word a day 6 : perambulate

So a new chapter in learn a word a day

today's new word is perambulate:

: walk or travel through or around esp for pleasure and in a leisurely walk
: walk from place to place, walk about

ex : I like to perambulate regularly around the streets.
I perambulate to clear my stupid head.

My determination levels for this project are dropping now, as you can see i was not able to write the previous words. I also notice that each of my posts varies a lot since, they are changing their pov , sometimes i or you. i hope i don't sound facetious to you. But if you are a fastidious reader you can clearly see the mistaken use of pronouns in my blog. But you also will notice the motif of writing this blog, so i hope you can forgive me. I want self as well as your impetus to continue and prolong this project. I hope you understood what i meant here.

TARGETS AND GOALS

I kept three targets till sunday, i was able to complete only one of them. That is 'learn a word a day'

I completed another target by today, so i am some what glad , i completed two of my targets. And i failed in one, that is algorithm a day.

Now i am realizing the action method stated in 'Making Ideas Happen' , i need to act first to see how the output is coming and i realized that two of the projects were easily made rather than pondering on selecting which one to complete, i tried to do all and finished two of them.

So from now on, no pondering only executing. that is the golden word or keyword whatever it can be.

So new targets, since i already completed javascript, now since i also realized how much time i am wasting, i will have to try to minimize time waste and increase my productivity this time to finish my targets.


This week targets are :

JQUERY
C, C++ PROGRAMMING : 25 PAGES A DAY
LEARN A WORD A DAY
TOPCODER PROGRAMMING ONE PROBLEM A DAY

GET A JOB -------TO VICTORY

Yes!, i finally completed my first training course. Yes, i have done one thing completely without interruption for the first time in a long time. Looks like i am getting my mojo back. But i don't feel the elation and triumph, i see much bigger obstacles ahead in my path to execution.

For the first time in my life, i am setting myself a goal in my life, i want to get a job, a good software development job. That is my goal and i will strive for it with full on determination.

This is my first win in a battle, but the war is still being waged. Only way to end the war is victory.

To victory..........

javascirpt lesson 10 -- continued

In javascript, by default all properties of an object are public.

Just as functions have local variables, which can be accessed only from inside a function. we can also have private variables in a class which we won't share publicly.

if create a variable without using 'this' keyword in a constructor function, then it is a private variable.

ex :

function Person(name){
this.name = name;
var balance = 234;
}

var sur = new Person("bob");
console.log(sur.balance); // not accessible, gives undefined output

*** Even though we cannot access private variables directly, we can access them by using a public method. this method is very similar to access a private variable.
ex:


function Person(first,last,age) {
   this.firstname = first;
   this.lastname = last;
   this.age = age;
   var bankBalance = 7500;

   this.getBalance = function() {
      // your code should return the bankBalance
      return bankBalance;
   };
}

var john = new Person('John','Smith',30);
console.log(john.bankBalance);

// create a new variable myBalance that calls getBalance()
var myBalance = john.getBalance();
console.log(myBalance);

A method can return another method inside a method.
ex:

this.askTeler = function(){
       return returnBalance();
   };

********** types of variables we are concerned with are 'number' 'string' and 'object'

javascript lesson 9 -- object oriented programming

when i was making a constructor in the previous lessons, i am infact making a new class.
A class can be thought of as a type, just like how 'number' and 'string' are types

when i made two objects bob and susan in previous lessons, they infact belong to class Person.

prototype keeps track of what a class can have property or method. the prototypes in javascript are automatically defined with a constructor.

*** if we want to add a method to class prototype, such that all the objects of this class can use the method. then we have to do this to extend the prototype
syntax:
classname.prototype.newmethod = function(){
            statements;
};

function Dog(breed){
this.breeds = breed;
}
Dog.prototype.bark = function(){
  console.log("woof");
};                                             // we added a bark method so other objects can use this method.

**Inheritance:
it allows one class to see and use the properties and methods of another class.

**DRY  -- Don't Repeat Yourself principle of programming.

** to inherit class1 properties to class2, we need to set the prototype of class2 to be class1.
ex:

// the original Animal class and sayName method
function Animal(name, numLegs) {
    this.name = name;
    this.numLegs = numLegs;
}
Animal.prototype.sayName = function() {
    console.log("Hi my name is "+this.name);
};

// define a Penguin class
function Penguin(name){
    this.name = name;
    this.numLegs = 2;
}

// set its prototype to be a new instance of Animal
Penguin.prototype = new Animal();

**the motif i noticed here is that to add any thing to a class like a method or inheritance of another class we use prototype.

* If javascript can't find something in the current class, it goes to the top of the prototype chain, to see if it from a class it inherited from.

This goes up the way upto the top Object.prototype . By default all classes directly  inherit from Object class, unless we change the class's prototype.

javascript lesson 8 very important

contructor can be thought of as a template.

For retrieving property values , we have two ways, dot notation and bracket notation

bracket notation has an advantage where we can use variable which store property names as well.

ex :
var somobj = { propname : "propval"};
var p = "propname";

somobj[p];             // this also means somobj["propname"]  , hence this is the advantage.


** sometimes we need to know the type of variable we are using, it can be 'number', 'string','function' or 'object'.

so to find this , we have a function to know this, 'typeof()'
ex :

var a = { b : "dfd"};
console.log(typeof(a));        // o/p is object

****** All objects have a useful function, which tells if an object has a certain property or not, that is 'hasOwnProperty'
ex:

return somobj.hasOwnProperty('name') ;    // returns true or false, if it has that property then true.


** for in loop can be used to print all the property names.
we can also use this to print the property values if we use bracket notation.

ex :
var somobj = { type : "indie" }

for ( var prop in somobj){
     console.log(prop);                    // print the name of property, i.e, o/p is type
     console.log(somobj[prop]);      // print the value of property


Sunday, June 2, 2013

javascript lesson 7

As we think of property in a object as a variable associated with an object.

methods in a object can be thought as functions associated with an object.

ex:
   obj.method = function(){

};

methods can be used to change property values.

if we want to use the method for other objects as well, for this we use 'this' keyword.

first we define a method

var setAge  = function(newage){
this.age = new(newage);
}

now we define our object

var obj = new Object();

obj.age = 22;
obj.setttingnewage = setAge;        //this acts as a placeholder, it will store whichever object called this
obj.settingnewage(23);             // method, so now whenever  we type obj.settingnewage(23), this.age
                                                   // in the method will refer to bob.age . here this holds obj, since obj called it.

***we can define objects inside objects in javascript.

I tried to create objects by 2nd method using 'new' keyword. here 'Object' is the constructor. it is already defined by javascript. Now i am learning that we can make custom constructors as well.

the Object function constructor creates a object with no properties and we have to manually add them.

so we create custom constructors instead.
ex:

function Person(name, age){
this.name = name;
this.age = age;
}

so now we have 'Person' constructor, we can create person objects much easily here

var bob = new Person("bob", 22);   // properties are already defined

we can also initialize properties inside a constructor not just define them.
ex:
function Person(name, age){
this.name = name;
this.species = "Homo Sapien";
}                // we initialized the property species here.

**** Not just properties, we can also define methods directly inside constructors.

**** I know object is just like string or integer just like any variables. like we have done a array of integer and strings, we can also make a array of objects

ex : var family = new Array();
       family[0] = new Person("sur",22);
       family[1] = new Person("bur",23);


arrays filled with objects will work just like arrays filled with strings or integers.

*** we can send objects as argument to a function, just like we send int or string as arguments

Math.PI -this func gives the value of pi

javascript lesson 6 :

there is another loop called 'for in' loop

this loop loops through the properties of a object

syntax:

for (var something in object){

do something
}


since the object is defined as key-value pair here
ex:
var obj = { a : 'd', b:'d'};   // a, b are keys and their values are d, d respectively

for ( var prop in obj){
console.log(prop);
}   //////////here the o/p is a, b  since the this loop is looping through the object keys


*** if we want to use the object value instead of the keys of the object. we can do

obj[prop];  // this is value of the key

***    !==   this is not equal to operator

I wasted a lot of time yesterday night, today is a new day. And my impetus for completing this
training is gone. I have to try to fight my distractions as well as the loss of my determination. I still need to continue. I hope writing this blog shows that i hadn't left  this training yet. So this is the first step towards regaining my lost impetus to complete this project and not sound facetious and to try to get back to the fastidious methods i employ while doing these kind of things.



*** once again to create an empty object example is below

var bob = {};

each piece of info we add in a object is known as property
ex:
var bob = {
   age = 22
};                            // here age is a property and 22 is the value of this property

to access a value of a property we use '.' dot notation
ex:   var a = bob.age;   //here we are accessing the value of age property

we can also access by this as well

var a = bob["age"];



Another way to create object is to use keyword 'new' . this method is known as creating an object using a constructor.
ex:

var bob = new Object();

learn a word a day 5

My will is low, as the end nears. what to do, how to motivate myself to push past the barrier which is visible yet unattainable. But i have to do it, come on you can do it.
the motif of my many failures is leaving things when things get tough. Now things got tough and are going to get tougher, i hope i can persevere. I should!

the previous words of the day are

facetious, fastidious, motif, impetus

today's word of the day is ' impetuous '

: acting or done quickly without thought or care, impulsive
: moving forcefully or rapidly

ex: i am impetuous person, otherwise i wouldn't have fucked my semester exams. 

Saturday, June 1, 2013

learn a word a day 4

I am wasting a lot of today as well. But today, it is not because of my distractions but of low determination levels. I need to regain momentum to complete this javascript training as soon as i can, mostly by tomorrow.

Come on!!!!!!! you can do

so for the learn a word a day

previous words are facetious, fastidious, motif

today's word is impetus
:momentum of moving body, a driving force
: an impelling force, impulse
: something that incites

ex:  my emotional impetus is always draining, i don't know how to rejuvenate it. And my fastidious principle is also not working. As you can see the motif of this blog, i hope you don't see the posts as facetious remarks.

javascript lesson 5 --very important

the objects in javascript are not similar to that of 'C++'

the objects can store all kinds of variables , including functions.

objects are like arrays, but in arrays the keys are numbers and values can be in anything
but in objects , keys can be anything as well.

the syntax for objects is

var object = {
key : value,
key : value,
key :value
};

ex:
var obj = {
 name : "felix",
age : 22
};

***actually , it is curious to see that there is no concept of 'class' in javascript. All the object are prototype-based inheritance schemes.
new objects are created by copying other objects(instead of being instantiated from a class template)

methods live directly in objects instead of classes

inheritance is done through delegation

Javascript has a nice concept tweak of constructors, you can copy existing objects with constructors as well create objects out of thin air

*** two important articles about inheritance are here
http://javascript.crockford.com/prototypal.html
http://javascript.crockford.com/inheritance.html

we can actually create objects here in two ways

the previous above method is first method with the use of {}
the second method is by the use of the constructors.

ex:

var myobject = new Object();      //this tells computer to make a new object type

myobject.name = "felix";  //we can use this method or method below which uses key
myobject["age"] = 22;

Javascript lesson 4

here i am learning about another javascript inbuilt library function

For generating random numbers, we use

var randomno = Math.random();     //this creates random betw 0 and 1

to get a random whole number, we do

Math.floor(Math.random()*5 + 1);  // this generates random whole number betw 1 and 5

** isNaN()  : it checks to see if it is not a number
ex: isNaN("berry")            here the output is 'true'

There is also a 'switch' in javascript to avoid many if/else's
The syntax is exactly like that of 'C' language
syntax

switch(expr){

case 'option1':
.....
break;

case 'option2':
...
break;
.
.
default:
..
break;

}

here 'default' is executed if there is no match in above cases
ex:

prompt(i);

switch(i){
case 1:
...
break;
case 2:
....
break;

default:
..
break;
}

don't use {}, since we are already using break statement.  Here javascript will try to match the expression between the switch() paranthesis to each 'case', if not there it will evaluate to 'default'.

We also have logical operators just like in 'C' language

&& - for and operation
||     - for or operation
!     - it makes a true expression false


**toUpperCase() function will convert all the input to capital letters
ex: "this is".toUpperCase();     will give o/p 'THIS IS'

Algorithms lesson 1

Yesterday i read insertion sort from this book, 'Introduction to Algorithms' by cormen. Great book. Today i am executing in C programming language.

The main theory of insertion sort is that

for example if we have an array of unsorted numbers, our goal is sort by insertion sort.

so first we sort from the left, that means first we take 1 number to be sorted, next we make two numbers from left sorted, then 3 and so on till the length of the array to the right.

since 1st element is sorted if sorted array length is 1

The best way to explain insertion is by deck of cards. take n cards which are unsorted in your right hand.

we pick the left most card, and put it in the left hand.
the cards in the left hand are always sorted.

then we again pick the left most card from right hand and put it in left hand, such that the right hand cards are sorted. sometimes we have to shift the positions of the cards to the right, such that the smallest card is on the left most side
But in here, we are sort inside the array, so we are creating a subarray we finally after sorting spans the whole length of the array.

This is my C code:

#include <stdio.h>

int main(){
  int arr[6]={23,1,43,22,756,12};
  int i,j,k, key;

  for ( j =1;j<6; j++){
      key=a[j];                       // we are storing the left most element for the subarray
      i=j-1;                            // we are making 'j' as the length of subarray which is always sorted
      while( i>=0 && a[i]>key){              // we are entering the subarray here
         k = a[i];
         a[i] = a[i+1];                 // we are swapping left and right, since the left > right
         a[i+1]=k;
         i=i-1;
       }
       a[i+1] = key;               // when the loop exits we don't left element changed, so here we are changed
      }
   return 0;
}

Friday, May 31, 2013

javascript lesson 3

this is my continuation to last lesson.

Here learning about for loops

the for loop is very similar to 'C'

for ( var initialize; var condition; var increment){
...
}
ex:
for (var counter = 1; counter < 5; counter++){
console.log(counter);
}

Arrays in javascript can store different types of data at same time
ex:
var mixed = [ 23, "us" , 44];

syntax for array is : var name = [var, var, ..];
** the counting inside a array is started from 0

**we can use .length for both arrays as well as strings

**some strings or texts could be quite long, so put '\' backslash at end of each line to wrap to the next line of editor. Best way to avoid using long line

** .push for elements to push to array
ex: array.push(a[0]);   here we are pushing element 1 of 'a' to array

while loop is very similar to 'C'
syntax:
while(condition){
do something
}

we check condition by '===' ex:  if ( a === 0) {}

** to make sure loop runs atleast once we use 'do while' loop

to print a bool value, and we use String() function, actually string converts anything to string format
ex: var b = true; console.log(String(b));   output is 'true'

learn a word a day 3

previous words of the day are

facetious and fastidious

todays word is "Motif"

: A decorative design or pattern
: A distinct feature or dominative feature or theme in a artistic or literary composition

the motif of my story is very similar to that of 'game of thrones'

javascript lesson 2

i decided not to learn the git basics now, i need to concentrate more on completing the javascript tutorial on codeacademy.com, this is more important.

so javascript again

so learning about functions now,

how to define a function in javascript
syntax here

var nameoffunction = function(parameters){
...
};

ex:
var dividebythree = function(number){
    var val = number / 3;
    console.log(val);
};
//calling a function

dividebythree(9);

Here in the syntax, the keyword function tells the computer it is a function not something else. ***Remember to end the function } with a semicolon;

When we call a function we don't always want to print stuff, sometimes we want to return something.
So we use 'return' keyword which ends the function and returns the value that came out of the function

ex:
var fuc = function(parameter){
    return par;
};
here the o/p of the fuc function is value of 'par'.

any global variable can be used inside a function, but it is not a good habit to define many global variables.

**Math.random() function will return a value between 0 and 1
doing a mini project in the training course

** to check the variable type in javascript , use typeof() function
ex:
if (typeof(x) !== 'number') {
           return "wrong";
}


Thursday, May 30, 2013

After seeing myself waste a lot of valuable time, i decided to log my time usage fastidiously, i hope no one gives a facetious remark or comment on this post for telling this.
I really need to see where and how, how much i am wasting time in a day.

My log starts now, that is 10:06 AM in India, 31st may, i going to take a bath

10:28 AM bath is over

10:29 AM trying to read about git, but digressed due to break fast and watching 'the dark knight'

10:50 AM starting to read about git basics

11:01 AM stopped reading git, first need to complete my javascript training. anyway i wasted these 10 min on reading some stupid news

11:15 AM power is gone, till then i completed 2 sub parts of the training. So started reading this book 'Making ideas happen' which actually inspired me to write this blog. As you can see the motif in all the posts is my struggle to organize and execute ideas. I read and ate lunch.

3:15 PM Finally finished reading the book after so many days since power came just now. After this Wasted time for 1 hr

4:15 PM After wasting 1 hr time, i decided to start my training in javascript again, but i have to digress to write this blog as well as correctly define and refine my projects for the next few days without any distractions this time.

4:30 PM I finished updating my goals in my skydrive notebook.

4:31 PM Now for the training part in codeacademy

5:20 PM taking a break now

6:51 PM wow, a lot of time for break, this may look facetious to you , but i am fastidious in my time management, i also ate food and went outside for some personal stuff. started studying 'introduction to algorithms' huge book

7:00 PM will start training javascript again.

7:12 PM 10 minutes wasted, just some stupid shit

7:47 PM again wasted 35 minutes on some stupid news obsession and something else

7:50 PM started training javascript again, albeit slowly and very less concentration

8:15 PM completed today's part, need to take a break to continue further

9:15 PM wasted time till now

9:16 PM started training again,

9:45 PM completed one more session starting next one after a 5 minute break

11:05 PM completed one more session taking a break


scripting language, javascript in html,

So now i am learning what is a scripting language?, it is a important question and could be asked in interviews.
scripting language is a programming language  that supports writing of scripts, which are programs written for a special run-time environment, that can interpret and execute the automation of tasks, which could alternatively be executed one-by-one by human operator.

Man i had to copy half of this meaning from wikipedia, it is really difficult to remember computer terms.

For a more subtler and simple definition, i am doing a google search . I still cannot find a simple meaning.

Javascript is mainly used by integrating into HTML and CSS. We can use the actions of mouse-click or hover and many more to write javascript and integrate it on client-side calculations or scripting.

So how to insert javascript in html page.

<script>
alert("My first script">
</script>

upto know , what i learned here in this post is executed when the page loads.
But we can execute scripts only when an event occurs,like when an user clicks a button.

We know that hml pages have two main parts, <head> and <body>

the <head> element is a container of all head elements like <title> which shows title of page.
others like <style> <base><link> and <script> and <noscript>

<base> tag can be used, so we can use relative addresses for images or files , because base stores the main address where they are stored.
Slowly this project is going down the drain,i am already experiencing low determination levels. I don't know what happened to my fastidious approach.
But one thing i am glad is i am able to use the words i am learning every day in the blog posts. I am glad that my blog doesn't have any facetious remarks or comments or thoughts.

I need to boost my determination levels, so i need your support guys, come on you can do it.

javascript lesson 1

I am learning javascript tutorial from that website i mention www.codeacademy.com
since it is very interactive not much to post here

//   - for writing comments

to open popup  boxes we use these functions
confirm();
or prompt();

we use prompt() cmd for example
prompt("what is your name?");

this function will take your name as input

the confirm() function will take input as 'true' or 'false'

.length counts every character in the string including spaces
ex: "i am good".length  gives o/p as 9

we can directly get evaluating expressions, for example 5<4 yields 'false'

strings are always in between the " "

console.log() shows what the interpreter is doing completely
ex: console.log(4*5)
console.log("hello")
the o/p shows all the steps including intermediate steps, not just the final result.
These console.log() can used to check how much or which direction did the javascript program traverse and line number as well

and the if loops are very very similar to 'C' language more than the shell scripts i learnt yesterday.
the syntax is
if (2 > 4)
{

}

as we all know that % is used to calculate remainder
4%5 gives 4

there is a substring function as well
ex: "wonderful day".substring(3,7);
this will output from 4th letter to 7th letter
remember the numbering in string starts from 0

To define variable in javascript, we do this

var variable1 = "string";
var number2 = 2;

another one of the most confusing things in the programming of any language is postfix and prefix increment/decrements

var++ : the o/p is evaluated but the old value is returned
--var   : the o/p is evaluated but the new value is returned

this is my first experience of the first part of tutorial , it is fun and very interactive  to learn using this website. I recommend it to anyone who wants to learn programming. This website pleases even the fastidious people as well.

javascript beginnings 1

So what's the way to learn javascript, it is not the first time, i tried to learn it. But this time i want to complete the whole journey rather digress and go along a different path completely ignoring it.

So i googled "best way to learn javascript", trying to find solution for my problems

I am a great procrastinator and extremely lazy, i need to be disciplined and learn this language as quickly as i can and start using it, instead of making it stagnant in my memory. I already know that, it has great applications especially in making addons , so i have to learn the basics quick and be resourceful to learn deep concepts along the way while doing projects rather than static learning. Since i realized it is futile at least for me.

I found a great interactive website to learn all the web-based languages. You should also check it out, it offers free learning in HTML,CSS, Javascript, PHP, Python, Jquery and others as well.
The website : www.codeacademy.com

I decided that there are no limits for the day, since the honeymoon period of learning new things is very brief, i am thinking of utilizing it for my full potential. Though learning after the honeymoon stage is the real test.

learn a word a day 2

yesterday's day is facetious: 
once again , the meaning: taking serious issues with deliberate and inappropriate humor
or humorous or amusing

Today's word of the day is 

fastidious : excessively particular or critical or demanding, hard to please
ex: a fastidious man who is a critic of movies

                    requiring or characterized by excessive care or delicacy
ex: i am not much of a fastidious man, but hope to become fastidious about these projects, because that's the only way i think, i can complete them for now

Wednesday, May 29, 2013

linux article 2 - for loop, if, vi editor, $?

From now onwards, i decided to save all my important documents esp educational material in dropbox, since it is available in all platforms and provides excellent usability.

So for the next part

more commands for vi editor

there are two modes for this editor

command mode  - press 'x' to delete the character under the cursor
and to cut or copy text, press 'v' and move the cursor and to select the text, then press 'y' to copy the selected text or press 'x' to cut it. Moved the cursor to the desired position and then press 'p' to paste the selected text.
insert mode  -  press 'i' to enter the insert mode at point
                       press  'o' to open a new line below the current line and enter the insert mode

Great cmd

in command mode press 'u' to undo the change of previous command
                                Press 'U' to undo the changes in the current line

I am studying about how to write shell scripts.
So when you type a cmd or script, we give arguments or parameters to them, they are saved automatically under these variables , $0 has the command, $1 stores the argument 1, and so on

and with echo cmd , the backslash(\) is treated normally by default just as any other character
but if we use "echo -e", then backslash interpretation of escapes is enabled.

$? stores the exit status of last command used. 0 means cmd executed normally.
we can print it on screen by using : echo $?
a great use of this mentioned in this article, it has a program which checks whether the user is registered user in the system or not.
this is the link to the article
http://www.cyberciti.biz/faq/shell-how-to-determine-the-exit-status-of-linux-and-unix-command/

so with my voyage to the kernel, from now.

we can send all the useless output by sending it to /dev/null, instead of default terminal
so we can : echo "who" > /dev/null
where nothing is printed on screen

the main thing to remember with if or while, if the cmd in the 'if' condition is executed , then the block of if is executed, if cmd execution failed, the block code in 'if' statement is not executed as well.
example:

if date
then
....
fi

this is executed

there should always be some kind of cmd or script in the condition statement.

if n
then
...
fi

this is not executed

Remember , it doesn't check the output status of the cmd, because the output status of any succesful cmd is 0, which is essentially false for other languages. so output status of cmd doesn't matter, only the succesful execution of cmd, even with 'expr 1 = 1', here output put status is 0, but the output is 1. so it is  executed.

the only exception is when we directly evaluate expression by using this

if [ ] : we use these boxes to evaluate expressions
example:

if [ var1 -eq var2 ] then

fi



For loop can be done, just like C

structure:

for  (( i = 0 ; i < 2 ; i++))
do
...
done

to print stuff in the same line as before , use : echo -n

Looks like the voyage is done
goodbye





So today with 'A voyage to Kernel' again, it's been two days since i had read another volume of this. So today i need to rejunevate my determination to complete all the volumes

By the way, i am also decided and determined to learn php and javascript to my project list
Oh man, just now, i already wasted by surfing and reading about some stupid article, i am really addicted to this news stuff. I should get rid of this obsession or distraction whatever it is.
Come on you can do it.

Now before learning this , i should say something about the usage of vi editor

excellent to use: shortcuts are

Esc+ i     to insert  new text
Esc + :w                     to save a file
Esc + :w filename     to save a file with name
Esc + :q!                  quit without saving
Esc + :wq                  save and quit
Esc + yy                    to copy a line where the cursor is staying
Esc + dd                    delete the line the cursor is staying
Esc + wd                   delete the word from the cursors position
Esc + /word               search a specific word
n                                 to continue with search

the main stuff of this experiment will be in the next post, goodbye for now

i am really nervous today , hence the inactivity. This anxiety is caused not by a facetious matter, but rather a very serious matter, my exam results. Still didn't know the result, hoping to know by tomorrow. Please god! let me pass in this exam. So i can continue to effectively achieve my goals.

I want to continue doing my projects as i had already mentioned, but there is huge elephant in the room waiting to crush me with its failure. But i am hoping from now till tomorrow, to ignore and continue doing my project. Just stop thinking about it, you can change what already happened, so engage in your  projects rather than wasting time browsing net or thinking about the results

By the way, i realized that most of my time in a day is wasted mostly due to facetious browsing without any educational or learning purposes.

Come on you can conquer this stupid monster. You are master of your life

Tuesday, May 28, 2013

learn a word a day

Today's word is facetious

it means treating serious issues with deliberately inappropriate humor
other meanings are amusing or humorous or lacking serious intent

example: I hope this grand project of mine is not a facetious one, since the previous projects were taken in a facetious manner
the method by manipulating the /etc/fstab table is system wide mounting, but for a user specific mount on command line, we can use the udisks cmd
first find partitions by

sudo fdisk -l
then use

/usr/bin/udisks --mount /dev/sda2 or anything
we can also use UUID
for this method , first find UUID by
ls -l /dev/disk/by-uuid/
then use this cmd

/usr/bin/udisks --mount /dev/disk/by-uuid/----
new idea, i am thinking of learning a word(good word) a day, try to use it as much as i can on that day.
It is really an exciting idea, but the problem is discipline which i completely lack, hence i hope i will follow this everyday. come on, you can do it.
Starting tomorrow
Another idea, try to solve hindu crossword , allocate an hour for this everyday, since there is power cut everyday, it is the ideal time to read or solve crossword puzzles. make use of the time as best as you can
first i had faced this problem a lot of times,since i had started using Linux Distro 4 years ago. But i had never bothered to solve it by using a permanent solution.
This is my first step towards execution

problem: mount ntfs or any partition from the start
my journey to the solution, after a long and tedious search i finally found a website, which had shown different methods to do it, rather than showing some narrow minded and simple way, it explained all the methods properly. So i chose the best solution as a core linux user should have, the manual way

for this i need to understand the use of this important command   fdisk

fdisk - used to view and manipulate the partition table
should use this command with root
so , the cmd is

sudo fdisk -l          to view the parition the table of all disks

this showed my partition table, then i got to know about this as well, what is the difference between hda and sda drives being shown here
hd means ide drives which parallel ATA
sda means serial ATA

SATA replaced PATA these days

since it is resolved, now

another important stuff for this is to know the device UUID, this has been used since if the device partition is changed then it will be known by a different name, hence to identify the device irrespective of the partition , UUID is used

Therefore, this is the cmd or path to know device UUID

ls -l /dev/disk/by-uuid/

this will show all the devices UUIDs in the partition table

now we have to learn about an important file /etc/fstab
this file contains the mount information which is used at boot time to mount the drives
an example is here


/dev/hda1   /media/windows   vfat   user,fmask=0111,dmask=0000   0   0

the first field is the drive
second is mount point
3 rd is filesystem type, mine ntfs, but to allow access to everyone use ntfs-3g
4th is options, need to explore this , but that is for another day
5th option is dump, later
6th is pass, which gives the order in which they are checked at boot time, linux partition is always 1

So this is the code i inserted in the /etc/fstab file

UUID=88E0876FE0876274 /media/windows-xp ntfs-3g user,fmask=0111,dmask=0000 0 0 

reboot
voila! the work is done



It all started when I was reading this book "Making ideas happen" by Scott belsky. As a person who has very less productivity this is my chance to understand and experiment with this book's guidelines or whatever you may call it to increase my productivity.

So here it is my first project

Complete all the volumes of "Voyage to kernel" , there are 24 volumes and i already completed 2 of them.
So here it is my third one today