Script : Merging two file lines using python

I had two file containing some information per line. I wanted to merge the line from file one and line form file two as a single line and print on the console. 
I came up with below  script to do that. It takes the input as two file and print the output as merge of two files data per line.


import sys
def merge_files(argv):
f1 = open(argv[0], "r")
f2 = open(argv[1], "r")
lines1 = f1.readlines()
lines2 = f2.readlines()
count = 0
for line in lines1:
line =  line.rstrip() + lines2[count].rstrip()
print line
count = count + 1

if __name__ == "__main__":
    merge_files(sys.argv[1:])


Save the above code to file in python file.  Now you just have to execute the on command line as "python <filename>.py   file1 file2".


Error : NS_ERROR_FACTORY_NOT_REGISTERED The VirtualBox COM server is not running or failed to start.

If you are facing issue with VirtualBox version 4.3.12 on Mac/Linux and above as posted below, most likely your tmp permissions are not correct.

ERROR: failed to create a session object!
ERROR: code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available)
Most likely, the VirtualBox COM server is not running or failed to start.

Update the /tmp directory permissions for the user which is trying to use the VirtualBox with the below command and it should resolve the issue.

chmod 1777 /tmp

Error : LNK2001 :unresolved external symbol __CrtDbgReportW

Building a Microsoft Visual C++ project you may get error "LNK2001: unresolved external symbol __CrtDbgReportW".

If you have recently changed the VS runtime, check if the runtime library settings (under C++ -> code generation settings ) are same for the project and all the libs you are linking to.

If there is a single project rebuilding should solve the error.

Caching is a technique used to store frequently accessed data in a temporary storage layer to improve system performance and reduce latency....