Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11

    Default Re: How many years do you have in the IT Industry? Submit & Apply now!


    Haven't selected anyone yet from Istorya.net.. H1B filing is due this week for 2009. We'll encourange people to consider a US consulting job in the future maybe we can start screening applicants for 201o.. so please send your resume or give us a link on your profile in any job site and make sure you leave us your email address so that we can keep in touch with you no need for a contact number we will not call and bother anyone. Thanks

  2. #12

    Default Re: How many years do you have in the IT Industry? Submit & Apply now!

    Sent you a PM.

    Here my solution in Python:
    Code:
    import sys, string
    
    def printf(fmt, *args): sys.stdout.write(fmt % args)
    
    def getnum(prompt):
    	num = 0
    	while num==0:
    		printf(prompt)
    		try:
    			num = int(sys.stdin.readline())
    		except:
    			num = 0
    	return num
    
    class area:
    
    	houses = []
    	rows = 0
    	cols = 0
    	vrow = 0
    	vcol = 0
    	
    	def __init__(self,n,m):
    	
    		self.cols = n
    		self.rows = m
    		
    		self.vcol = n
    		self.vrow = m
    		
    		for h in range(0, self.rows):
    			self.houses.append([])
    			
    			for k in range(0, self.cols):
    				self.houses[h].append(1)
    
    	def print_row_divider(self):
    		for i in range(0, self.cols):
    			if (i % 3) == 0:
    				printf("+---")
    			else:
    				printf("--")
    		printf("+\n")
    
    
    	def show(self):
    
    		for h in range(0, self.rows):
    			
    			if h % 2 == 0:
    				self.print_row_divider()
    				
    			if h % 2 == 1:
    				printf("\n")
    			
    			for k in range(0, self.cols):
    				if k % 3 == 0: 
    					printf("| ")
    				
    				if k==self.vcol and h==self.vrow:
    					printf("V ")
    				else:
    					printf("%d ", self.houses[h][k])
    				
    			printf("|\n")
    
    		if self.rows % 2 == 1:
    			printf("\n")
    		
    		self.print_row_divider()
    	
    	def toggle(self, row, col):
    		try: 
    			if (self.houses[row][col]):
    				self.houses[row][col] = 0
    			else:
    				self.houses[row][col] = 1
    		except:
    			pass
    	
    		
    	def visit(self, h):
    		self.vrow = (h - 1) / self.cols
    		self.vcol = (h - 1) % self.cols
    		#printf("Visit: %d %d\n", self.vrow, self.vcol)
    		
    		#toggle across the street
    		if self.vrow % 2==0:
    			self.toggle(self.vrow+1, self.vcol)
    			
    		#boundary
    		if self.vrow % 2==0:
    			self.toggle(self.vrow, self.vcol+1)
    			self.toggle(self.vrow, self.vcol+2)
    		if self.vrow % 2==1:
    			self.toggle(self.vrow, self.vcol)
    			self.toggle(self.vrow, self.vcol+2)
    		if self.vrow % 2==2:
    			self.toggle(self.vrow, self.vcol)
    			self.toggle(self.vrow, self.vcol+1)
    		
    		
    
    n = getnum("Enter grid length (n):")
    m = getnum("Enter grid width (m):")
    
    h = area(n,m)
    h.show()
    
    while 1:
    	printf("\nChoice: M-manual visit, F-read from file, X-exit ->");
    	try:
    		z = sys.stdin.readline()
    		z = string.strip(string.upper(z))
    	except:
    		z = " "
    
    	if z=="X": 
    		break
    		
    	elif z=="M":
    	
    		while 1:
    
    			printf("\n")
    			printf("House to visit:")
    	
    			try:
    				v = int(sys.stdin.readline())
    			except:
    				break
    	
    			h.visit(v)
    			h.show()
    	
    	elif z=="F":
    		
    		while 1:
    			printf("Filename:")
    
    			try:
    				fn = string.strip(sys.stdin.readline())
    
    				if fn=="": break
    				
    				fz = open(fn,"r")
    
    				for line in fz:
    					hna = string.split(line)
    					for hn in hna:
    						try:
    							i = int(hn)
    							printf("Visit house number %d\n", i)
    							h.visit(i)
    							h.show()
    							printf("\n\n")
    						except:
    							pass
    				break;
    			except:
    				pass

  3.    Advertisement

Page 2 of 2 FirstFirst 12

Similar Threads

 
  1. How many years are you employed in your present company?
    By Scott Bernard in forum Career Center
    Replies: 68
    Last Post: 03-07-2012, 10:44 PM
  2. How many hours do you spend w/ the computer everyday?
    By janix in forum General Discussions
    Replies: 456
    Last Post: 01-31-2012, 01:42 AM
  3. How much time do you spend in the Forum?
    By skadiboy in forum General Discussions
    Replies: 168
    Last Post: 06-26-2010, 03:57 AM
  4. How many hours do you spend at the gym?
    By slakker in forum Fitness & Health
    Replies: 24
    Last Post: 12-17-2009, 02:32 PM
  5. How many year did you rent in this world?
    By dricoy in forum General Discussions
    Replies: 9
    Last Post: 04-02-2009, 11:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top