Search Results

Search found 201 results on 9 pages for 'ankur kaushik'.

Page 3/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Stack Overflow like Watermarks in Forms

    - by Kaushik Gopal
    Hey people, I remember seeing a tutorial somewhere that talks of how to style your input forms in a more "usable" way. Essentially, you have a placeholder value and when you enter the input, it hides the hint so to speak. Now, just to be clear: I don't want the hint (placeholder value text) to disappear onFocus, but rather to go lighter when I first start typing something. Good e.gs: Check out the forms on Aardvark http://vark.com/. This is exactly how I wish to have my input forms. Our very own stackoverflow. When you try to ask a question, on clicking inside any input form, it doesn't hide the text right away. You see your cursor as well as the hint. but when you start to type, it hides the hint(I would prefer having it go to a much lighter shade rather than hiding all together, like above example). I remember very clearly reading a tutorial somewhere on the interwebz with this exact requirement, but darn forgot to bookmark it. Any suggestions/links?

    Read the article

  • any faster alternative??

    - by kaushik
    I have to read a file from a particular line number and i know the line number say "n": i have been thinking of two choice: 1)for i in range(n) fname.readline() k=readline() print k 2)i=0 for line in fname: dictionary[i]=line i=i+1 but i want to know faster alternative as i might have to perform this on different files 20000 times. is there is any other better alternatives?? thanking u

    Read the article

  • any faster alternative??

    - by kaushik
    cost=0 for i in range(12): cost=cost+math.pow(float(float(q[i])-float(w[i])),2) cost=(math.sqrt(cost)) Any faster alternative to this? i am need to improve my entire code so trying to improve each statements performance. thanking u

    Read the article

  • How to join two wav file using python??

    - by kaushik
    I am using python programming language,I want to join to wav file one at the end of other wav file? I have a Question in the forum which suggest how to merge two wav file i.e add the contents of one wav file at certain offset,but i want to join two wav file at the end of each other... And also i had a prob playing the my own wav file,using winsound module..I was able to play the sound but using the time.sleep for certain time before playin any windows sound,disadvantage wit this is if i wanted to play a sound longer thn time.sleep(N),N sec also,the windows sound wil jst overlap after N sec play the winsound nd stop.. Can anyone help??please kindly suggest to how to solve these prob... Thanks in advance

    Read the article

  • how to speed up the code??

    - by kaushik
    in my program i have a method which requires about 4 files to be open each time it is called,as i require to take some data.all this data from the file i have been storing in list for manupalation. I approximatily need to call this method about 10,000 times.which is making my program very slow? any method for handling this files in a better ways and is storing the whole data in list time consuming what is better alternatives for list? I can give some code,but my previous question was closed as that only confused everyone as it is a part of big program and need to be explained completely to understand,so i am not giving any code,please suggest ways thinking this as a general question... thanks in advance

    Read the article

  • how to speed up the code??

    - by kaushik
    i have very huge code about 600 lines plus. cant post the whole thing here. but a particular code snippet is taking so much time,leading to problems. here i post that part of code please tell me what to do speed up the processing.. please suggest the part which may be the reason and measure to improve them if this small part of code is understandable. using_data={} def join_cost(a , b): global using_data #print a #print b save_a=[] save_b=[] print 1 #for i in range(len(m)): #if str(m[i][0])==str(a): save_a=database_index[a] #for i in range(len(m)): # if str(m[i][0])==str(b): #print 'save_a',save_a #print 'save_b',save_b print 2 save_b=database_index[b] using_data[save_a[0]]=save_a s=str(save_a[1]).replace('phone','text') s=str(s)+'.pm' p=os.path.join("c:/begpython/wavnk/",s) x=open(p , 'r') print 3 for i in range(6): x.readline() k2='a' j=0 o=[] while k2 is not '': k2=x.readline() k2=k2.rstrip('\n') oj=k2.split(' ') o=o+[oj] #print o[j] j=j+1 #print j #print o[2][0] temp=long(1232332) end_time=save_a[4] #print end_time k=(j-1) for i in range(k): diff=float(o[i][0])-float(end_time) if diff<0: diff=diff*(-1) if temp>diff: temp=diff pm_row=i #print pm_row #print temp #print o[pm_row] #pm_row=3 q=[] print 4 l=str(p).replace('.pm','.mcep') z=open(l ,'r') for i in range(pm_row): z.readline() k3=z.readline() k3=k3.rstrip('\n') q=k3.split(' ') #print q print 5 s=str(save_b[1]).replace('phone','text') s=str(s)+'.pm' p=os.path.join("c:/begpython/wavnk/",s) x=open(p , 'r') for i in range(6): x.readline() k2='a' j=0 o=[] while k2 is not '': k2=x.readline() k2=k2.rstrip('\n') oj=k2.split(' ') o=o+[oj] #print o[j] j=j+1 #print j #print o[2][0] temp=long(1232332) strt_time=save_b[3] #print strt_time k=(j-1) for i in range(k): diff=float(o[i][0])-float(strt_time) if diff<0: diff=diff*(-1) if temp>diff: temp=diff pm_row=i #print pm_row #print temp #print o[pm_row] #pm_row=3 w=[] l=str(p).replace('.pm','.mcep') z=open(l ,'r') for i in range(pm_row): z.readline() k3=z.readline() k3=k3.rstrip('\n') w=k3.split(' ') #print w cost=0 for i in range(12): #print q[i] #print w[i] h=float(q[i])-float(w[i]) cost=cost+math.pow(h,2) j_cost=math.sqrt(cost) #print cost return j_cost def target_cost(a , b): a=(b+1)*3 b=(a+1)*2 t_cost=(a+b)*5/2 return t_cost r1='shht:ra_77' r2='grx_18' g=[] nodes=[] nodes=nodes+[[r1]] for i in range(len(y_in_db_format)): g=y_in_db_format[i] #print g #print g[0] g.remove(str(g[0])) nodes=nodes+[g] nodes=nodes+[[r2]] print nodes print "lenght of nodes",len(nodes) lists=[] #lists=lists+[r1] for i in range(len(nodes)): for j in range(len(nodes[i])): lists=lists+[nodes[i][j]] #lists=lists+[r2] print lists distance={} for i in range(len(lists)): if i==0: distance[str(lists[i])]=0 else: distance[str(lists[i])]=long(123231223) #print distance group_dist=[] infinity=long(123232323) for i in range(len(nodes)): distances=[] for j in range(len(nodes[i])): #distances=[] if i==0: distances=distances+[[nodes[i][j], 0]] else: distances=distances+[[nodes[i][j],infinity]] group_dist=group_dist+[distances] #print distances print "group_distances",group_dist #print "check",group_dist[0][0][1] #costs={} #for i in range(len(lists)): #if i==0: # costs[str(lists[i])]=1 #else: # costs[str(lists[i])]=get_selfcost(lists[i]) path=[] for i in range(len(nodes)): mini=[] if i!=(len(nodes)-1): #temp=long(123234324) #Now calculate the cost between the current node and each of its neighbour for k in range(len(nodes[(i+1)])): for j in range(len(nodes[i])): current=nodes[i][j] #print "current_node",current j_distance=join_cost( current , nodes[i+1][k]) #t_distance=target_cost( current , nodes[i+1][k]) t_distance=34 #print distance #print "distance between current and neighbours",distance total_distance=(.5*(float(group_dist[i][j][1])+float(j_distance))+.5*(float(t_distance))) #print "total distance between the intial_nodes and current neighbour",total_distance if int(group_dist[i+1][k][1]) > int(total_distance): group_dist[i+1][k][1]=total_distance #print "updated distance",group_dist[i+1][k][1] a=current #print "the neighbour",nodes[i+1][k],"updated the value",a mini=mini+[[str(nodes[i+1][k]),a]] print mini

    Read the article

  • Build a decision tree for classification of large amount data,using python?

    - by kaushik
    Hi,i am working for speech synthesis.In this i have a large number of pronunciation for each phone i.e alphabet and need to classify them according to few feature such as segment size(int) and alphabet itself(string) into a smaller set suitable for that particular context. For this purpose,i have decided to use decision tree for classification.the data to be parsed is in the S expression format.eg:((question)(LEFTNODE)(RIGHTNODE)). i hav idea for building decision tree for normal buit in type such as list..looking for suggestion for implementation for S expression.. kindly help.. Thanks in advance.. Note:this question may look similar to my prev post,srry if cant giv multiple post.already edited it many times so though of wirting new question instead of editing again

    Read the article

  • jquery function call with parameters

    - by Kaushik Gopal
    Hi a newb question: I have a table with a bunch of buttons like so: <tr class="hr-table-cell" > <td>REcord 1</td> <td> <INPUT type="button" value="Approve" onclick="" /> <INPUT type="button" value="Reject" onclick="" /> <INPUT type="button" value="Delete" onclick="fnDeletePpAppl(222445,704);" /> </td> </tr> <tr class="hr-table-cell" > <td>REcord 1</td> <td align="center" class="hr-table-bottom-blue-border" valign="middle"> <INPUT type="button" value="Approve" onclick="" /> <INPUT type="button" value="Reject" onclick="" /> <INPUT type="button" value="Delete" onclick="fnDeletePpAppl(237760,776);" /> </td> </tr> I have my jquery like so: <script type="text/javascript"> // JQUERY stuff $(document).ready(function(){ function fnDeletePpAppl(empno, applno) { alert('Entering here'); $("form").get(0).empno.value = empno; $("form").get(0).applNo.value = applno; $("form").get(0).listPageAction.value = "delete"; $("form").get(0).action.value = "pprelreqlist.do"; $("form").get(0).submit(); } }); This doesn't seem to work.I thought this means, the function is ready only after the dom is ready. After the dom is ready and i click the button, why is not recognizing the function declaration within the .ready() function? However if i use the function directly: <script type="text/javascript"> function fnDeletePpAppl(empno, applno) { alert('Entering here'); $("form").get(0).empno.value = empno; $("form").get(0).applNo.value = applno; $("form").get(0).listPageAction.value = "delete"; $("form").get(0).action.value = "pprelreqlist.do"; $("form").get(0).submit(); } This works. I want to get my fundamentals straight here... If i do the declaration without the .ready() , does that mean i'm using plain vanilla jscript? If i were to do this with the document.ready - the usual jquery declaration way, what would i have to change to make it work? I understand there are much better ways to do this like binding with buttons etc, but I want to know why this particular way doesn't seem to be working. Thanks. Cheers. K

    Read the article

  • to overcome type error?

    - by kaushik
    i have a file of this format: 3.334 1 2.345 1 1.453 1 3.343 1 and so on but in middle at times in file there are few number which are not in float format and i receive type msg when i run them performation some operation.. I want to give a condition that: if(not in float format): continue else: perform operation please tell me how to put the condtion

    Read the article

  • Oracle curcular join sometimes give duplicates, but sometimes does not

    - by Kaushik
    By mistake I wrote a query like this: select * from a,b,c where a.col=b.col and b.col2=c.col2 and c.col3=a.col4 So there is a circular join here. Now the thing is sometimes this query returns duplicate result, sometimes it returns unique(correct) results. I am trying to understand why it does not give duplicate results always. Also if circular joins are not allowed, how come Oracle does not throw an error. EDIT: This is the actual query. After reading ti carefully, I am not sure anymore if this is a circular join or not.It does not seem so...but why I get duplicates only sometime? select * from a,b,c,d where a.col=b.col and b.col=c.col and c.col2=d.col2 and d.col2 =a.col2

    Read the article

  • javascript :Object doesn't support this property or method

    - by Kaushik
    In my jsp page, I have in the tag, the following code: <script type="text/javascript" src="<%=request.getContextPath()%>/static/js/common/common.js"></script> <script type="text/javascript"> // Function for Suppressing the JS Error function silentErrorHandler() {return true;} window.onerror=silentErrorHandler; </script> If there is some javascript executing on the jsp page after this, then I guess silentErrorHandler() will have no effect. i.e. the error will still show on page. IS this correct? Because the error is showing and am not sure why. The second part of the question is this: The error is Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; AskTbFXTV5/5.9.1.14019) Timestamp: Fri, 7 Jan 2011 21:26:23 UTC Message: Object doesn't support this property or method Line: 613 Char: 1 Code: 0 URI: http://localhost:9080/Claris/static/js/common/common.js And finally, line 613 states document.captureEvents(Event.MOUSEUP); There is error on IE8. Runs fine on Mozilla and IE7. Any suggestions will be very helpful

    Read the article

  • problem with list return type??

    - by kaushik
    my list has value such as m=[['na','1','2']['ka','31','45']['ra','3','5'] d=0 r=2 t=m[d][r] print t # this is givin number i.e 2 Now when I use this value u=[] u=m[t] I am getting an err msg saying type error list does take str values... i want to use like this how can i convert that t into a integer?? please suggest.. thanks..

    Read the article

  • traverse a binary decison tree using python?

    - by kaushik
    how to traverse a binary decision tree using python language. given a tree,i want know how can we travesre from root to required leaf the feature of the required leaf are given in an dictionary form assume and have to traverse from root to leaf answering the questions at each node with the details given in feature list.. the decision tree node has format ((question)(left tree)(right tree)) while traversing it should answer question at each node and an choose left or right and traverse till leaf?

    Read the article

  • oracle using index even though there is no filter criteeria specified

    - by Kaushik
    In this query: SELECT WTTEMPLATE.TEMPLATEuID, MAX (WTTRX.VALUEDATE) AS template_last_use_date FROM wttemplate, wttrx WHERE WTTEMPLATE.TEMPLATEID = WTTRX.TEMPLATEID(+) AND WTTEMPLATE.CUSTID = WTTRX.CUSTID GROUP BY WTTEMPLATE.TEMPLATEuID The explain plan shows:index fast full scan using indexes on WTTEMPLATE.TEMPLATEID and (WTTRX.TEMPLATEID,WTTRX.CUSTID). My question is this: I have not specified any filter criteria , so how can it use indexes? It should do full scan...right?

    Read the article

  • indexing for faster search of lists in a file??

    - by kaushik
    i have a file having around 1 lakh lists and have a another file with again a list of around an average of 50.. I want to compare 2nd item of list in second file with the 2nd element of 1st file and repeat this for each of the 50 lists in 2nd file and get the result of all the matching element. I have written the code for all this,but this is taking a lot of time as it need to check the whole the 1lakh list some 50 times..i want to improve the speed... please tell me how can i do this.... i cant not post my code as it is part of big code and will be difficult to infer anything from that... please tell what can be done to improve the speed?? thank u,

    Read the article

  • index error:list out of range

    - by kaushik
    from string import Template from string import Formatter import pickle f=open("C:/begpython/text2.txt",'r') p='C:/begpython/text2.txt' f1=open("C:/begpython/text3.txt",'w') m=[] i=0 k='a' while k is not '': k=f.readline() mi=k.split(' ') m=m+[mi] i=i+1 print m[1] f1.write(str(m[3])) f1.write(str(m[4])) x=[] j=0 while j<i: k=j-1 l=j+1 if j==0 or j==i: j=j+1 else: xj=[] xj=xj+[j] xj=xj+[m[j][2]] xj=xj+[m[k][2]] xj=xj+[m[l][2]] xj=xj+[p] x=x+[xj] j=j+1 f1.write(','.join(x)) f.close() f1.close() It say line 33,xj=xj+m[l][2] has index error,list out of range please help thanks in advance

    Read the article

  • 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

  • how to speed up code??

    - by kaushik
    i want to speed my code compilation..I have searched the internet and heard that psyco is a very tool to improve the speed.i have searched but could get a site for download. i have installed any additional libraries or modules till date in my python.. can psyco user,tell where we can download the psyco and its installation and using procedures?? i use windows vista and python 2.6 does this work on this ??

    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

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >