Search Results

Search found 184 results on 8 pages for 'vishal kaushik'.

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

  • Help making userscript work in chrome

    - by Vishal Shah
    I've written a userscript for Gmail Pimp.my.Gmail & i'd like it to be compatible with Google Chrome too. Now i have tried a couple of things, to the best of my Javascript knowledge (which is very weak) & have been successful up-to a certain extent, though im not sure if it's the right way. Here's what i tried, to make it work in Chrome: The very first thing i found is that contentWindow.document doesn't work in chrome, so i tried contentDocument, which works. BUT i noticed one thing, checking the console messages in Firefox and Chrome, i saw that the script gets executed multiple times in Firefox whereas in Chrome it just executes once! So i had to abandon the window.addEventListener('load', init, false); line and replace it with window.setTimeout(init, 5000); and i'm not sure if this is a good idea. The other thing i tried is keeping the window.addEventListener('load', init, false); line and using window.setTimeout(init, 1000); inside init() in case the canvasframe is not found. So please do lemme know what would be the best way to make this script cross-browser compatible. Oh and im all ears for making this script better/efficient code wise (which is sure there is)

    Read the article

  • addEventListener gone after appending innerHTML

    - by Vishal Shah
    Okay, so i have the following html added to a site using javascript/greasemonkey. (just sample) *a id='abc'*HEllo*/a* *a id='xyz'*Hello*/a* (excuse me, i've had to replace the '<' '' with * since hyperlinks for new users aren't allowed!) and i've also added a click event listener for the elements. All works fine up to this point, the click event gets fired when i click the element. But... i have another function in the script, which upon a certain condition, modifies that html, ie it appends it, so it looks like: *a id='abc'*HEllo*/a* *a id='xyz'*Hello*/a* *a id='123'*Hello*/a* but when this is done, it breaks the listeners i added for the first two elements... nothing happens when i click them. if i comment out the call to the function which does the appending, it all starts working again! help please...

    Read the article

  • Web data grid of infragistic controls

    - by Vishal Srivastava
    Hi, I am working on a web project where i need to use web data grid of infragistic controls. I have problem to customise the header layout. I did not find event like InisalizeLayOut in ultrawebgrid. My problem is that i want to row in header. Please give me your valuable suggations. Thanks

    Read the article

  • jQuery custom validation for a selected radio selection

    - by Kaushik Gopal
    Hey peeps, This is my requirement: I have a bunch of radio box selections (types of workflows). If one of the radios are selected(i.e one particular type of workflow selected), I want to run a custom validation on that. This is what i tried, but it's not behaving well. Any help? jQuery part: $(document).ready(function() { // this part is to expand the child radio selection if particular parent workflow selected $("#concernedDirectorChoice").hide(); $("input[name^=workflowChoice]").change( function (){ if($(this).attr("class")=='chooseDir'){ $("#concernedDirectorChoice").show(); }else{ $("#concernedDirectorChoice").hide(); } }); // FORM VALIDATION $.validator.addMethod("dirRequired", function(value, element) { return this.optional(element) || ($("input[name^=rdDir:checked]").length); }, "That particular workflow requires a Director to be chosen. Please select Director"); $("#contExpInitiateForm").validate({ debug:true ,rules:{ RenewalNo: {required: true, number: true}, chooseDir: {dirRequired: true}, workflowChoice: {required: true} } ,errorPlacement: function(error, element) { $('.errorMessageBox').text(error.html()); } }); }); HTML form part: <!-- Pick type of workflow --> <table class="hr-table" > <tr> <td class="hr-table-label " colspan=2 >Pick Workflow Type</td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="1"> </input> </td> <td> Workflow 1 </td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="2" class="chooseDir"> </input> </td> <td> Workflow 2 (Dir selection required) </td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="3"> </input> </td> <td> Workflow 3 </td> </tr> </table> <!-- Pick Director for Workflow type 2 --> <table id="concernedDirectorChoice" name="concernedDirectorChoice" > <tr><td class="hr-table-label" colspan=2 > Choose Concerned Director</td></tr> <tr> <td><input type="radio" value='Dir1' name="rdDir" /></td> <td>Director 1</td> </tr> <tr> <td><input type="radio" value='Dir2' name="rdDir" /></td> <td>Director 2</td> </tr> <tr> <td><input type="radio" value='Dir3' name="rdDir" /></td> <td>Director 3</td> </tr> </table>

    Read the article

  • ASP.NET cached aspx page & IIS logs

    - by Vishal Seth
    Hi guys, Is there any way to find out if ASP.Net runtime has served a cached copy of ASPX page or actually went through the page life cycle? Here is my problem: I'm seeing many entries in my IIS log files that were served successfully (200 OK). I've a corresponding logging code (Log4Net API) in the Session_Start and Application_BeginRequest() events that is logging every request to my DB with more details. I'm not seeing any corresponding entries in my SQL DB for some cases that should have been created by Log4Net code. Are there any logs available to find out if a cached copy was served by .NET worker process? Moreover, if my logging code would throw an exception, won't that show up as 500 in IIS logs? The code is on Windows 2008 Server, IIS 7.

    Read the article

  • create program in c for permutation combination and showing frequency

    - by Vishal Oswal
    I have 2 strings where I have saved fixed 20 characters and these are “A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T” and same 20 char in string 2. so I will get 400 combinations of 2 character sets like AA,AB,AC,AD,AE,AF,……………AT BA,BB,BC,BD,BE,BF,…………..BT CA,CB,CC,CD,CE,CF……………CT This way we will get 400 combinations (Which program I have created successfully) but then user will put the value till 31 characters witch will be treated as 3rd string for E.g. “ABCDDAAAB” now I have to check the frequency of user input in the sequence of 12,23,34,45,56,67,78,89 (2 CHAR SET) means AB,BC,CD,DD,DA,AA,AA,AB and need to show the frequency of user input OUTPUT: AB=2 BC=1 CD=1 DD=1 DA=1 AA=2 please its urgent

    Read the article

  • 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

  • Retrieveing ALL head elements in document including iframe

    - by Vishal Shah
    I'm trying to add style elements to all ALL the head elements in a document, including those in an iframe. if i use var heads = document.getElementsByTagName('head'); It just returns the first head element and not the ones in the iframe. this is the complete code : var heads = document.getElementsByTagName("head"); var style = document.createElement("style"); style.type = "text/css"; style.appendChild(document.createTextNode(css)); for(var i=0;i<heads.length;i++) heads[i].appendChild(style); but this doesn't seem to work! am i doing something wrong here...?

    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
    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

  • 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

  • Excel File opened under Ubuntu, read by R, OpenOffice

    - by Vishal Belsare
    I have a bunch of Excel files which are updated on a daily basis on a Windows machine. I transfer them to a Ubuntu machine and want to open them there. Specifically, I want to read the files as a database under R. A couple years ago, I used ODBC under a Windows machine to open Excel files through R. Is there any way, I can do this with R under Ubuntu? I could make a database .ODB file for the corresponding XLS files using OpenOffice, but I don't know of a way to connect to a .ODB database. OpenOffice seems to have ways to connect TO databases, but no way to connect to ODB. Thanks for any potential solutions.

    Read the article

  • Create PDF from HTML page with formatting retained in PDF in ASP.Net

    - by Vishal Avhad
    I am trying to convert an HTML page to a PDF using iTextSharp.dll in ASP.Net. I am able to convert the contents to my PDF , but the problem is that the Formatting of HTML page (which is inline) get removed from my PDF created. For instance I have the following code block to be formatted from my HTML page to PDF. <table style="width:90%; float:left; background:#dddddd; padding:15px; border:1px solid #000; color:#000;"><tr><td style="text-transform:uppercase; font-size:14px;font-weight:bold;">SPECIAL DELIVERY FOR:</td></tr><tr><td style="padding-left:40px; font-size:12px; color:#4e4e4e;">Name: #CustomerName# <br /><br /><label> <b>Date: #CreatedOn# </b></label><br /> </td></tr> </table> I have to format my PDF with much more HTML codes like this. I have used the Stylesheet class also, but that was not much of help.

    Read the article

  • ASP.NET MVC Membership, Get new UserID

    - by Vishal Bharakhda
    I am trying to register a new user and also understand how to get the new userID so i can start creating my own user tables with a userID mapping to the asp.net membership user table. Below is my code: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Register(string userName, string email, string position, string password, string confirmPassword) { ViewData["PasswordLength"] = MembershipService.MinPasswordLength; ViewData["position"] = new SelectList(GetDeveloperPositionList()); if (ValidateRegistration(userName, email, position, password, confirmPassword)) { // Attempt to register the user MembershipCreateStatus createStatus = MembershipService.CreateUser(userName, password, email); if (createStatus == MembershipCreateStatus.Success) { FormsAuth.SignIn(userName, false /* createPersistentCookie */); return RedirectToAction("Index", "Home"); } else { ModelState.AddModelError("_FORM", ErrorCodeToString(createStatus)); } } // If we got this far, something failed, redisplay form return View(); } I've done some research and many sites inform me to use Membership.GetUser().ProviderUserKey; but this throws an error as Membership is NULL. I placed this line of code just above "return RedirectToAction("Index", "Home");" within the if statement. Please can someone advise me on this... Thanks in advance

    Read the article

  • how to build a website in DNN 5?

    - by vishal
    How can i develop a module containing three folders like admin,jobseeker and employer having there own functionality with user controls. Actully i want to develop a job site using DotNetNuke 5 ,how can i start ? How can i build the modules required for jobsite? Please give me your most valuable guidelines on this. Thanking you in advance.

    Read the article

  • Gujarati Font Rendering

    - by Vishal Khakhkhar
    I am having sqlite database containing gujarati words.. The sql query for the database is... BEGIN TRANSACTION; CREATE TABLE eng_guj (_id INTEGER PRIMARY KEY, eng_word , guj_word ); INSERT INTO eng_guj VALUES(1,'aardvark','??? ??????? ?????????? ?? ?????? ????? ??????.'); COMMIT; I want to display the text in textview.. but its not rendering properly.. meant Its displaying the word in gujarati like "???????" will be displayed as "??????". I already have used Typeface and different ttf fonts.

    Read the article

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