My First experiance with Vagrant

Posted on Sat 22 August 2015 in GeneralLeave a comment

Last week, I have faced some internet issue with my ISP. So in free time; i spent some time exploring vagrant boxes with its command line help and followed the instruction to setup the box. I have earlier tried that but that was followed using some online post and didn't remember those steps. So command line help was useful.

Setup is very easy. It will take just few minutes. I have recorded the step. Those are below:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
Microsoft Windows [Version 6.3.9600]  
(c) 2013 Microsoft Corporation. All rights reserved.

C:\\Users\\namitkewat\>vagrant box --help  
Usage: vagrant box \<subcommand\> [\<args\>]

Available subcommands:  
add  
list  
outdated  
remove  
repackage  
update

For help on any individual subcommand run \`vagrant box
\<subcommand\> -h\`

C:\\Users\\namitkewat\>vagrant box add --help  
Usage: vagrant box add [options] \<name, url, or path\>

Options:

-c, --clean Clean any temporary download files  
-f, --force Overwrite an existing box if it exists  
--insecure Do not validate SSL certificates  
--cacert FILE CA certificate for SSL download  
--capath DIR CA certificate directory for SSL download  
--cert FILE A client SSL cert, if needed  
--location-trusted Trust 'Location' header from HTTP redirects  
and use the same credentials for subsequent urls as for the initial
one  
--provider PROVIDER Provider the box should satisfy  
--box-version VERSION Constrain version of the added box

The box descriptor can be the name of a box on HashiCorp's Atlas,  
or a URL, or a local .box file, or a local .json file containing  
the catalog metadata.

The options below only apply if you're adding a box file directly,  
and not using a Vagrant server or a box structured like 'user/box':

--checksum CHECKSUM Checksum for the box  
--checksum-type TYPE Checksum type (md5, sha1, sha256)  
--name BOX Name of the box  
-h, --help Print this help

C:\\Users\\namitkewat\>vagrant box add
F:\\ubuntu-14.04-amd64-vbox.box --name ubuntu  
1404  
==\> box: Box file was not detected as metadata. Adding it directly...  
==\> box: Adding box 'ubuntu1404' (v0) for provider:  
box: Unpacking necessary files from:
file://F:/ubuntu-14.04-amd64-vbox.box  
box:  
An error occurred while downloading the remote file. The error  
message, if any, is reproduced below. Please fix this error and try  
again.

Couldn't open file /ubuntu-14.04-amd64-vbox.box

C:\\Users\\namitkewat\>F:

F:\\\>vagrant box add ubuntu-14.04-amd64-vbox.box --name ubuntu1404  
==\> box: Box file was not detected as metadata. Adding it directly...  
==\> box: Adding box 'ubuntu1404' (v0) for provider:  
box: Unpacking necessary files from:
file://F:/ubuntu-14.04-amd64-vbox.box  
box: Progress: 100% (Rate: 615M/s, Estimated time remaining: --:--:--)  
==\> box: Successfully added box 'ubuntu1404' (v0) for 'virtualbox'!

F:\\\>mkdir vagrant\_work

F:\\\>cd vagrant\_work

F:\\vagrant\_work\>mkdir ubuntu1404

F:\\vagrant\_work\>cd ubuntu1404

F:\\vagrant\_work\\ubuntu1404\>vagrant init ubuntu1404  
A \`Vagrantfile\` has been placed in this directory. You are now  
ready to \`vagrant up\` your first virtual environment! Please read  
the comments in the Vagrantfile as well as documentation on  
\`vagrantup.com\` for more information on using Vagrant.

F:\\vagrant\_work\\ubuntu1404\>dir  
Volume in drive F has no label.  
Volume Serial Number is 5AFD-1ED3

Directory of F:\\vagrant\_work\\ubuntu1404

09-08-2015 16:03 \<DIR\> .  
09-08-2015 16:03 \<DIR\> ..  
09-08-2015 16:03 3,093 Vagrantfile  
1 File(s) 3,093 bytes  
2 Dir(s) 210,471,010,304 bytes free

F:\\vagrant\_work\\ubuntu1404\>vagrant up  
Bringing machine 'default' up with 'virtualbox' provider...  
==\> default: Importing base box 'ubuntu1404'...  
==\> default: Matching MAC address for NAT networking...  
==\> default: Setting the name of the VM:
ubuntu1404\_default\_1439116510430\_18589  
==\> default: Clearing any previously set forwarded ports...  
==\> default: Clearing any previously set network interfaces...  
==\> default: Preparing network interfaces based on configuration...  
default: Adapter 1: nat  
==\> default: Forwarding ports...  
default: 22 =\> 2222 (adapter 1)  
==\> default: Booting VM...  
==\> default: Waiting for machine to boot. This may take a few
minutes...  
default: SSH address: 127.0.0.1:2222  
default: SSH username: vagrant  
default: SSH auth method: private key  
default: Warning: Connection timeout. Retrying...  
default:  
default: Vagrant insecure key detected. Vagrant will automatically
replace  
default: this with a newly generated keypair for better security.  
default:  
default: Inserting generated public key within guest...  
default: Removing insecure key from the guest if it's present...  
default: Key inserted! Disconnecting and reconnecting using new SSH
key...  
==\> default: Machine booted and ready!  
==\> default: Checking for guest additions in VM...  
==\> default: Mounting shared folders...  
default: /vagrant =\> F:/vagrant\_work/ubuntu1404

F:\\vagrant\_work\\ubuntu1404\>

installing python3.3 on Ubuntu

Posted on Tue 14 January 2014 in GeneralLeave a comment

my system is ubuntu 12.04 at Digital Ocean, and i am going to install python3.3 and pip3.3

here are few simple steps with which you can do so!

\$ apt-get install python-software-properties
\$ add-apt-repository ppa:fkrull/deadsnakes
\$ apt-get update
\$ apt-get install python3.3
\$ curl http://python-distribute.org/distribute_setup.py | python3.3
\$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python3.3

and yes. . don't forget to apply "sudo" above!!!

enjoy. .. 


recent update after xbrlfinapp.. .

Posted on Fri 22 November 2013 in XBRL • Tagged with python xbrl, xbrl, xbrl mongodb, xbrlfinappLeave a comment

After appearing my app at xbrl challenge competition; this is going to be the first major update after that event!

I have updated the app to use mongodb. MongoDB promotes rapid development.

See the output of my recent test; its a html file, exported from ipython notebook.

Click here, to see it! (save the html file and then open it in browser to view the output!!!)

Well, further testing is going on, and lets expect something big from such tiny-tiny efforts!!!!


Powers of type1 Formula at xbrlfinapp

Posted on Wed 13 March 2013 in XBRL • Tagged with type1 xbrlfinapp formula, xbrl, xbrl analytics, xbrlfinappLeave a comment

In this post i am going to explain type1 formula/array in details.

type1 formula/array is the most important, fundamental building block of xbrlfinapp.

It represent an xbrl element in terms of array.

To understand this; lets take an example:

Suppose we want to calculate "Total Assets" and in US GAAP taxonomy its id is "us-gaap_Assets". So now we will find this xbrl element in our concerned xbrl filling. And if filler has tagged values with this xbrl element, then we will fetch that value and will use that value according to our need.

Anyways, This is the easiest part!

Now hardest part: How to calculate "Total Assets" is filler hasn't provided?

So the solution is: Lets find out its part/components and return the total of all and call this total as our "Total Assets".

This concept has been implemented in type1 array.

type1 array is considering first element as a primary element and rest in the list as a component of it.

Its algorithm will first search for 1st element of input array in the filling.

If it is there then simply take its values, and move to next elements in the list and will add into the values of the first element  if it is not the element wise duplicate of first or is not the part or component of it according to US GAAP taxonomy(with resolving context, unit, item type, balance type).

And if it is not there; then its algorithm will search for the components of "Total Assets", and will sum them all, without any repetitions(means if current assets is there and its parts are also there; then algorithm will take current assets and forgot its part). After this algorithm will move to the next element of input array and will do the same for it and its returning value will be added to its previous one(with resolving everything: balance type, unit, item type).

When the iteration is over; type1 array will take the properties of first element and assign that to the final result.

Do you think that at this point our work is over? and we got what we have asked for?

My answer is: No

Up-to this, we have done nothing for extensions. But type1 array allows you to add them. Extensions are not algorithmically checked for part and its sub-part. They are filling specific. So you can add them in type1 array. algorithm will just add if it finds it to the final sum.

This was the main reason to use id's of xbrl element. Because one extension's id will differ from id other filler's. So if it is there then it will add in its final sum or will forgot it and move to the other element.

By this way; you can add huge list of elements as formula/array where 1st element will be the US-GAAP's xbrl element and others are from different fillings. If that id is present; then it will added otherwise forgot it and more to next element of input array.

Lets take real life example. I am going to consider filling that we have used in our previous post:

Its "Total Assets" is:

array2And when we have added multiple elements which are part of Total Assets, in that also the result is same as "Total Assets". type1 knows how to avoid duplicate and how to avoid sub components.

array1

Similarly we can test "Total Assets" and "Liabilities and Stockholders Equity's" total. If both are equal then returning total will be zero, because one is debit and other is credit and when we represent these two as a one; then both will eliminate each other and result will be zero.array3

In same way; We can find "Debt" as:array4

Above you can see that the debt's component: short term and long term are not present; so will return its components.

In same way "Revenues" can be find. Here xbrl element for revenues "us-gaap_Revenues" is not provided by the filler, so its component are: us-gaap_InterestExpense, us-gaap_SalesRevenueNet were filtered by the app and its result is:array5


XBRLFINAPP: XBRL financial analytics Platform - beta1.0 release

Posted on Mon 11 March 2013 in XBRL • Tagged with financial analysis, python, xbrl, xbrl analytics, xbrl fin app, xbrl financial analysis, xbrl finapp, xbrlfinappLeave a comment

Hello friends,
New updated xbrlfinapphas been released.

Now It has more capabilities and more dynamic nature. So its going to be fun; and i am sure you will enjoy analysis of xbrl financial data.

Visit xbrlfinapp at: http://xbrlfinapp.pythonanywhere.com/

xbrl financial analysis home
page

Some important updates are:

  • Formula Design: Now user can design custom formulas. For that they need to enter id of those xbrl elements. There are two types of formulas(type1 and type2). type1 formulas accepts xbrl elements in form of list/array of their ids. while type2 formulas are based on type1 formulas where you can write simple arithmetic formulas based on previously designed type1 formulas
  • login system: User has to register and login to get started with the app
  • Makeover of app: website's look and feel has been update to make user comfortable with the site

Most important of them are formula building. User can build their formulas.  In mathematics; formulas are as simple as: x=3,y=2,z=x+y;

Like this; user can write their own financial formulas.

For example:

lets download sample xbrl: NUVASIVE INC's 2012, 10-K, and upload this at xbrlfinapp.

UGT has xbrl element 'us-gaap_AssetsCurrent' for Current Assets(or in simple manner, just assume, if x=30). So lets we first create type1 formula of this by giving it a name and in input list.

current asset's type1
formula

Similarly for current liabilities we have element 'us-gaap_LiabilitiesCurrent', and we will create type1 formula(or in simple manner, just assume, if y=20) for it as:

liabilities type1
formula

So output of this operation at xbrlfinapp will be something like(if you have upload valid sec filled xbrl package) :

assets n
lia

All that was for type1 formulas. Now type2. Say we want to find out working capital; then formula for it in general is current assets - current liabilities. So in XBRLFINAPP we can write such mathematical equations in type2 formulas.

Create type2 formula of working capital as:

working capital's type2
formula

We have just wrote "currentAssets - currnetlia" as a input and give it a name 'workingCapital'(as simple as "z=x-y"). So output of this operation will be:

wc

Similarly type2 formula of current ratio can we written as:

current ratio's type2
formula

and its result will be:

currentratio

By this way; user is allowed to use "+","-" and "/" operator with "(" or ")" for writing equations.

Note:

  • type1 formulas will contain array or list of ids of xbrl elements(separated by comma) which you want to add. and these elements must have same item type. If user has added different item type elements; nothing will happen. you can also add ids of extension elements.
  • type2 formulas will contain previously formulated type1 and type2 formulas.
  • And you can't delete type1 or type2 formulas which are used in formulas which were created after it.
  • You can't modify the name or alias of formula after creating it. To modify it first delete it and then create it again with new name or alias.

One of the most important feature of xbrlfinapp is; its intelligent element discovery.

XBRLFINAPP is intelligent in terms of finding element. For example if the first xbrl element of input array of type1 formula is not present in instance then it will find its part; and return the total. for example; in this filling lets find "cash and cash equivalents". But it is not present. So xbrlfinapp will search for its component and will return total of them(by resolving itemtype, balance type, context, unit, period in background), and if additional xbrl elements has been added as input; then rest of that type1 array will be added into this total if they are the not part of first element. Part means: are they duplicate or they are part of cash or cash equivalents. It means if user has created extension then we can  add extensions here.

cash equ type1
formula

Output of this is:

cashequ

Here; output has 4 values because XBRLFINAPP with search for element in complete filling. Also; look at the filtered elements list; it has two elements; and when you look at the balance sheet; here they are:

Screen shot 2013-03-12 at 11.18.59
PM

Such type of issue was the most challenging part for me; For example; hardest question were:

1. how will you calculate current ratio if filler has not provided current assets's tag?

2. How will calculate Net Income if filler hasn't tagged it??

But now;  this question has been resolved by xbrlfinapp :)

So my formulas are now constant for all companies. I don't require to change them for companies to companies.

For more register and login xbrlfinapp; you will receive 35 formulas by defaults. you can learn from them how to create formulas based on these formulas.

Anyways; friends if you face any query/error/bug; please email me about that at "namitkewat@gmail.com".