Search Results

Search found 66 results on 3 pages for 'kaushik'.

Page 3/3 | < Previous Page | 1 2 3 

  • In Python, how do I search a flat file for the closest match to a particular numeric value?

    - by kaushik
    have file data of format 3.343445 1 3.54564 1 4.345535 1 2.453454 1 and so on upto 1000 lines and i have number given such as a=2.44443 for the given file i need to find the row number of the numbers in file which is most close to the given number "a" how can i do this i am presently doing by loading whole file into list and comparing each element and finding the closest one any other better faster method? my code:i need to ru this for different file each time around 20000 times so want a fast method p=os.path.join("c:/begpython/wavnk/",str(str(str(save_a[1]).replace('phone','text'))+'.pm')) x=open(p , 'r') for i in range(6): x.readline() j=0 o=[] for line in x: oj=str(str(line).rstrip('\n')).split(' ') o=o+[oj] j=j+1 temp=long(1232332) end_time=save_a[4] for i in range((j-1)): diff=float(o[i][0])-float(end_time) if diff<0: diff=diff*(-1) if temp>diff: temp=diff pm_row=i

    Read the article

  • related to list and file handling?

    - by kaushik
    i have file with contents in list form such as [1,'ab','fgf','ssd'] [2,'eb','ghf','hhsd'] [3,'ag','rtf','ssfdd'] i want to read that file line by line using f.readline and assign thn to a list so as to use it is the prog as a list for using list properties tried like k=[ ] k=f.readline() print k[1] i xpected a result to show 2nd element in the list in first line but it showed the first bit and gave o/p as '1' how to get the xpected output.. please suggest

    Read the article

  • directory and file related doubts??

    - by kaushik
    i have a directory with around 1000 files....i want to run a same code for each of these file... my code requires the file name to be inputted. i have written code to copy the information of one into other in other format... please suggest a method to copy all 1000 files one by one without need to change the file name every time and i have a field serial_num which need to be continous i.e if 1st file has upto 30 then while coping other file it should continue from 30not from 0 again require suggestion please thanks..

    Read the article

  • command line arg?

    - by kaushik
    This is a module named XYZ. def func(x) ..... ..... if __name__=="__main__": print func(sys.argv[1]) Now I have imported this module in another code and want to use the func. How can i use it? import XYZ After this, where to give the argument, and syntax on how to call it, please?

    Read the article

  • Using classes for the first time,help in debugging

    - by kaushik
    here is post my code:this is no the entire code but enough to explain my doubt.please discard any code line which u find irrelavent enter code here saving_tree={} isLeaf=False class tree: global saving_tree rootNode=None lispTree=None def __init__(self,x): file=x string=file.readlines() #print string self.lispTree=S_expression(string) self.rootNode=BinaryDecisionNode(0,'Root',self.lispTree) class BinaryDecisionNode: global saving_tree def __init__(self,ind,name,lispTree,parent=None): self.parent=parent nodes=lispTree.getNodes(ind) print nodes self.isLeaf=(nodes[0]==1) nodes=nodes[1]#Nodes are stored self.name=name self.children=[] if self.isLeaf: #Leaf Node print nodes #Set the leaf data self.attribute=nodes print "LeafNode is ",nodes else: #Set the question self.attribute=lispTree.getString(nodes[0]) self.attribute=self.attribute.split() print "Question: ",self.attribute,self.name tree={} tree={str(self.name):self.attribute} saving_tree=tree #Add the children for i in range(1,len(nodes)):#Since node 0 is a question # print "Adding child ",nodes[i]," who has ",len(nodes)-1," siblings" self.children.append(BinaryDecisionNode(nodes[i],self.name+str(i),lispTree,self)) print saving_tree i wanted to save some data in saving_tree{},which i have declared previously and want to use that saving tree in the another function outside the class.when i asked to print saving_tree it printing but,only for that instance.i want the saving_tree{} to have the data to store data of all instance and access it outside. when i asked for print saving_tree outside the class it prints empty{}.. please tell me the required modification to get my required output and use saving_tree{} outside the class..

    Read the article

  • How to specify java script files required by an angular app

    - by Vishal Kaushik
    I'm looking for a way to specify required js files by an angular app. So that, we don't need to include an array of tag for all the files which may be required by some ng-app. The main idea behind this requirement is - we might not need to load all the resources on the browser at once. Which ever ng-app gets loaded onto the screen, will fetch its dependencies on its own from the server. Is there any existing way within angularJS to achieve this goal..?

    Read the article

  • any faster alternative??

    - by kaushik
    have file data of format 3.343445 1 3.54564 1 4.345535 1 2.453454 1 and so on upto 1000 lines and i have number given such as a=2.44443 for the given file i need to find the row number of the numbers in file which is most close to the given number "a" how can i do this i am presently doing by loading whole file into list and comparing each element and finding the closest one any other better faster method?

    Read the article

  • wav file manupalation

    - by kaushik
    I want get the details of the wave such as its frames into a array of integers. Using fname.getframes we can ge the properties of the frame and save in list or anything for writing into another wav or anything,but fname.getframes gives information not in integers some thing like a "/xt/x4/0w' etc.. But i want them in integer so that would be helpful for manupation and smoothening join of 2 wav files

    Read the article

  • using python,How to cut the wav file between certain time ranges??

    - by kaushik
    How to cut the wav file between certain time ranges from multiple wav files and paste the segments together in a single wav file in continous time ?? For this i thou of a way,to store the contents of the wav file in array form and cut the segments required from the array copy thm in another file and convert it back into wav formant. but i hav no idea how to code it in python as i am a beginner in it.. plz help...any alternative methods which serve the purpose are also welcome.. Quick reply,xpected plzz.. Thanks in advance..

    Read the article

  • Websphre portal does not startup

    - by Kaushik
    When I try to start up a websphere portal server, it hangs at the line : Server WebSphere_Portal open for e-business and although it means that the server started up successfully, it is not...because in the progress bar, i stll see 'Starting.....' I have tried deleting the wstemp and temp directories but beyond that I am not sure what I can do to debug the problem. The server with the same profile starts up great from another workspace, but when I come to this workspace, it just hangs at Server WebSphere_Portal open for e-business I am using RAD 7 and portal 6.1

    Read the article

  • Uploading Files to AWS S3 from an Android App

    - by Abhishek Kaushik
    Edited 7th June,14 My Android app needs to have a feature where clients can upload their files. I want AWS S3 as my storage. Moreover i dont want to use SECRET_KEY and ACCESS_KEY_ID on client side. What is the the best way to do this. Can someone provide the working code too ? I read that i can request to AWS for a signed URL and then make client directly upload to that URL. How to achieve this ?

    Read the article

  • problem with f.readline()?

    - by kaushik
    I am reading one line at a time from a file, but at the end of each line it adds a '\n'. example: line is: 094 234 hii but my input is: 094 234 hii\n I want to read line by linem but I don't need to keep the newlines... My goal is to read a list from every line: I need ['094','234','hii'], not ['094','234','hii\n'] Any advice?

    Read the article

  • links for 2011-02-17

    - by Bob Rhubart
    ArchitectACEs - Oracle Wiki Putting a Face on the Architect ACE The Oracle ACE s listed here have identified themselves, or have been identified by fellow ACEs, as software architects. As... (tags: ping.fm) Debra's thoughts on Oracle and User Groups: I did it - I did the Fusion UX Demo Oracle ACE Director Debra Lilley shares her experience in presenting a Fusion Applications demo at RMOUG. (tags: oracle otn oracleace) The Blas from Pas: JRuby Script to Monitor a Oracle WebLogic GridLink Data Source Remotely "In WebLogic 10.3.4 release, a single data source implementation has been introduced to support Oracle RAC cluster. To simplify and consolidate its support for Oracle RAC, WebLogic Server has provided a single data source that is enhanced to support the capabilities of Oracle RAC." (tags: oracle otn weblogic) Show Notes: Bob Hensle on IT Strategies from Oracle (ArchBeat) In Part 1 Bob Hensle talked about the various documents in the IT Strategies from Oracle library. In Part 2 (now available) Bob talks about how SOA and other factors are reflected in those documents. (tags: oracle otn entarch podcast) PODCAST: Examining the state of EA and findings of recent survey | Open Group Blog A transcript of a podcast panel discussion on the findings from a study on the current state and future direction of enterprise architecture from The Open Group Conference, San Diego 2011. (tags: entarch opengroup) A Virtual Dilemma (Antony Reynolds' Blog) SOA author Anthony Reynolds shares a solution. (tags: oracle otn soa) Webcast: Live Online Forum: Oracle Security - February 24, 9:00am PT Speakers: Mary Ann Davidson, Chief Security Officer, Oracle; Tom Kyte, Senior Technical Architect, Oracle; Jeff Margolies, Partner, Security Practice, Accenture; Vipin Samar, VP, Database Security Product Development Oracle; and Nishant Kaushik, Chief Strategist, Identity and Access Management. (tags: oracle security) Obama banks on cloud, consolidation, to hold down IT costs | Computerworld NZ President Obama's fiscal 2012 budget proposal keeps IT spending almost flat compared to fiscal 2010 mostly due to the consolidation of data centers and a shift to cloud computing systems. (tags: ping.fm)

    Read the article

< Previous Page | 1 2 3