Busy. Please wait.
or

show password
Forgot Password?

Don't have an account?  Sign up 
or

Username is available taken
show password

why


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
We do not share your email address with others. It is only used to allow you to reset your password. For details read our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

Remove ads
Don't know
Know
remaining cards
Save
0:01
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the "Know" box, the DOWN ARROW key to move the card to the "Don't know" box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

"Know" box contains:
Time elapsed:
Retries:
restart all cards




share
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

Programming

Interview Questions

QuestionAnswer
Perl: What is a reference Hash? Contains the pointer to the actual hash
Perl: Why do you use a reference Hash? Speed
Perl "=>" Fat Comma
Hash Key Pair relationship Keys - all caps and even Values - odd Length of hash list must be even
Why do you have to put a 1 at the end of a perl5 module? 1 in the end of module means that module returns true to use/require statements. It can be used to tell if module initialization is successfull. Otherwise use/require will fail.
Perl output $| = 1 $| = 1; # perform flush after each write to STDOUT
interation loop
datastruture : look up hash
What is polymorphism? "many shapes" an overloaded function: Base class and derived classed.
Python: open a file foo = open("ionservers.txt","r")
Python: print a file for name in foo: print name
Python: Chomp .strip('\n')
Python:system import os testvalue = os.system("cat /proc/cpuinfo")
Python:add function def spacecheck():
Python: class class spacecheck: def __init__(self,data):
Python :__init__() Python uses class to create objects. Every defined class has a special method called __init__(), which allows you to control how objects are initialized.
Python : popen print (bad) nom = os.popen('whoami',"r") for line in nom: username = line
Python: search if re.search('%',line): print 'We found the %'
Python:split print line.split() snaptest = line.split()
Python:Accessing a list print snaptest[3]
Python:Strip (like chop in Perl) print snapvalue.strip("%")
Python close file foo.close()
Python continue (skip)loop interaction if re.search('vol',line): continue
BASH:while (command line) while read p;do echo `host $p`; done
BASH:for loop (command line) for i in *; do echo $i; done
Python: print arguements import sys if re.search('data',sys.argv[1]):
python:exit sys.exit(1)
python: check argvs if len(sys.argv) < 2: sys.exit('Usage: %s takes an arguement: logfiles or data' % sys.argv[0])
Python regex 0-9 [0-9]
python covert str to int int(snapcompare)
boilerplate code or boilerplate the sections of code that have to be included in many places with little or no alteration.the programmer must write a lot of code to do minimal jobs
Python : popen print (good) username = os.popen('whoami',"r").read()
Python:operators computes the value of 5 squared 5**2
Python: Color text start = "\033[1;31m" end = "\033[0;0m"
Python: arguement import sys sys.argv[1]
python:print all keywords import keyword print (keyword.kwlist)
python: string input = input()
Python:Get the name from the user value = input("Please enter your name") print (value)
Python:Get the numbers age = eval(input("Enter your age ")) future_age = age + 10 print (future_age)
Python:eval() eval( ) function to convert the string into a number
modulus % This operator gives you the remainder after doing division. This means that 7 % 2 will give you 1
Python: string repetition print ("and over " * 3)
Python: print up to the last character in the array print (s[4:])
Python: Is there a way to use two different print statements and still get the output on the same line value1 = 1 value2 = 2 print(value1, end=" ") print(value2, end=" ")
Python:List prod = ['xstm1045pap' ,'xstm1046pap' ,'xstm3098pap', 'xstm1030pap' ]
Python: one liner python -c "print unichr(234)"
python:one liner variable python -c "import os; tmp =os.popen('df -h .','r').read();print tmp"
python write to a file foo =open("capacity.log","a") foo.write(tmp)
python: join log = ",".join([usqtree1.location,tmp.strip()])
python:split and join formatted = ','.join(tmp.strip().split())
python: log file log = ",".join([time.strftime("%I%M%m%d%Y"), swissqtree2.location,formatted,"\n"]) foo.write(log)
python ssh linux popen tmp = os.popen("ssh -q " + swissqtree2.host + " df -h " + swissqtree2.ref_mount + " |awk -F \" \" \'NR==3 {print}\'").read()
Python: Find all modules help(“modules”)
Python: get functions from a modules import Numeric help(Numeric) dir(Numeric)
python define an array ION2 = list() logfile = list()
python apprend an array logfile.append([stamp,region,path, float(used) / float(size)])
python : with is a block of code
python type(data) tells data structure
f.readline() reads all the data from the file object
python length len(data)
{} curly braces are the bat signal for dictionaries
dictionary get value dictionary[key]
add to dictionary dictionary[new key] = new value
Test dictionary entry "Key" in Dictionary
import random [simulate a six side die roll] random.randint(1,6)
cards = ["jack", "queen","king","ace"] random.choice(cards)
websites in python django
python analysis matplotlib
class greeter(object): class inherits from a base class called object
def hello(self): print("Hello") function inside the class
def hello(self): always for provide self as a first arguement. self is a pointer back to a class.
def goodbye(self): print("Goodbe") new function inside a the class. Always provide self pointer.
create an instance of a class g = Geeter() # g is an instance of greeter
g.hello() g.goodbye()
initalizer function get called everytime a new instance of the object is created def __init__(self,name): self.name = name
def hello(self): print("Hello " + self.name) g = Greeter("Jessica")
class Die(object): def roll(self): return random.randint(1,6)
python print w/o /n print line.strip()
python: array to string ds_host = ''.join(host)
python get rid of duplicate elements host_list = filter(None,host_list)
python - enumerate A new built-in function, enumerate(), will make certain loops a bit clearer. enumerate(thing), where thing is either an iterator or a sequence, returns a iterator that will return (0, thing[0]), (1, thing[1]), (2, thing[2]), and so forth.
Python - Create Dictionary dictionary ={}
Python populate dictionary for item in pointer: dictionary [item.strip('\n')] = 0
Print dictionary (basic) print dictionary
python, split mod = item.strip("\n").split(",") print mod[0]
dict print for x in binref: print x+','+binref[x]
dict sort if mod[0] in binref: binref[mod[0]] = mod[1]
type cast hosts = str(hosts)
os.system() does not return output back to python. Its just prints to stdout
vi (turn off color ) :syntax off
python date import datetime print today.strftime('%b %d')
os.popen results = os.popen(string).read()
python: file is empty if len(data) == 0 :
python: do nothing pass
readlink <path> 15.10.16.00
Created by: topbeagle