Tuesday, January 26, 2010

Men Eyebrow Before And After



Go-lang was thought to be the final language for system applications.
One of the things most precious instruments (not) daily use for the administration of our system is certainly the park options and flags that we can command line.
Let's see, with a simple example, what Go provides us to make our application as flexible as possible. start with flag state what we expect:

/ / var Flags
file_to_download * string;
var string * fileType;
var configShow * string;
configEdit var bool *;




/ ** * Function used to initialize
flags from command line.
* /
initFlags func () {int

file_to_download flag.String = ("d ",""," Type the name of the file");
fileType = flag.String("t","*","Kind of file you want to download:\n\t*: all\n\tmov: movie\n\tmsc: music");
configShow = flag.String("c","editor","Open the config file into chosen [editor]");
   configEdit = flag.Bool("C",false,"Edit parameters of config from inside the program.");  } 



Il package flag contiene una funzione di definizione parametro per ogni tipo di comando che desideriamo receive. All these functions but they all have the same shape. In fact receive three parameters:


The letter / letters that identify the command;
  The default behavior; 


A message to give to the operator on how the flag should be used.




Once we set the flags using the commands coming from the shell in our program:

/ ** * Main function
. From here starts the program.
* /
func main () {

    / / Initialize flags
  1. initFlags ();

  2. flag.Parse () / / Scan the list and arg sets up flags
  3. fileStr var string = "";
    typeStr var string = "";
  4. confStr var string = "";
  5. confMode var bool = false;

confStr + = * configShow;
confMode = * configEdit;

if (confMode) {
  os.Stdout.WriteString ("Config mode \\ n");} 

else {

os.Stdout.WriteString ("normal mode \\ n") ;}


if (* file_to_download == "") / / Want to download a file
{
fileStr + = "Error";
fileStr + = Newline;
os.Stdout.WriteString (fileStr)

} else {

fileStr + = * file_to_download;
fileStr + = Newline;
os.Stdout.WriteString (fileStr );}


typeStr + = * fileType;
typeStr + = Newline;
os.Stdout.WriteString (typeStr)

/ / Useless calls
giogolib.LogMessage (def.Debug, "Applying game");
}




I hope I have shown clearly how lang Go for providing the user who will use all our application the tools to adapt the software to run to their needs.


Sunday, January 24, 2010

Convert Memory Stick To Mmc




After a brief and well-deserved vacation spent in Paris is on the ground again with our struggle for freedom in software (and more).







The Italian state finally gives us an important tool that is the class action. Surely this means you are going to improve, but already today we can battle for their computers without Windows pre-installed. In this way the user is free to choose which operating system and suite of work to install.



To explore this interesting topic I recommend to give a peek at
ossblog.it
an article that has really well done;)

Thursday, January 7, 2010

Honda Civic Attach Front License Plate




See you in 2010!

Go