Search Results

Search found 8664 results on 347 pages for 'lost with coding'.

Page 32/347 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Event type property lost in IE-8

    - by Channel72
    I've noticed a strange Javascript error which only seems to happen on Internet Explorer 8. Basically, on IE-8 if you have an event handler function which captures the event object in a closure, the event "type" property seems to become invalidated from within the closure. Here's a simple code snippet which reproduces the error: <html> <head> <script type = "text/javascript"> function handleClickEvent(ev) { ev = (ev || window.event); alert(ev.type); window.setTimeout(function() { alert(ev.type); // Causes error on IE-8 }, 20); } function foo() { var query = document.getElementById("query"); query.onclick = handleClickEvent; } </script> </head> <body> <input id = "query" type = "submit"> <script type = "text/javascript"> foo(); </script> </body> </html> So basically, what happens here is that within the handleClickEvent function, we have the event object ev. We call alert(ev.type) and we see the event type is "click". So far, so good. But then when we capture the event object in a closure, and then call alert(ev.type) again from within the closure, now all of a sudden Internet Explorer 8 errors, saying "Member not found" because of the expression ev.type. It seems as though the type property of the event object is mysteriously gone after we capture the event object in a closure. I tested this code snippet on Firefox, Safari and Chrome, and none of them report an error condition. But in IE-8, the event object seems to become somehow invalidated after it's captured in the closure. Question: Why is this happening in IE-8, and is there any workaround?

    Read the article

  • Using a "take-home" coding component in interview process

    - by Jeff Sargent
    In recent interviews I have been asking candidates to code through some questions on the whiteboard. I don't feel I'm getting a clear enough picture of the candidates technical ability with this approach. Granted, the questions might not be good enough, maybe the interview needs to be longer, etc, but I'm wondering if a different approach would be better. What I'd like to try is to create a simple, working project in Visual Studio and have it checked into source control. The candidate can check that code out from home/wherever and then check back in work representing their response to the assignment that I'll provide. I'm thinking that if the window of time is short enough and the assignment clear enough then the solution will be safe enough from all-out Googling (i.e. they couldn't search for and find the entire solution online). I would then be able to review the candidates work. Has enough worked with something like this before, either to vet a candidate or as a candidate yourself? Any thoughts in general? P.S. my first StackOverflow question - hi guys and gals. EDIT: I've seen comments about asking someone to work for free - I wouldn't mind paying the person for their time.

    Read the article

  • Child window focus lost in c#

    - by jestges
    Hi I've two aspx pages ie. page1 and page2. In my Page1 I've a button and in that button click event I try to open page2 (some thing like window.open(page2)) it is working fine. Again I've another button in Page2. When I click Page2 button page1 getting focused. How to prevent this? Any idea?

    Read the article

  • Windows desktop gadget RSS Feed colour coding items

    - by padjo
    I have a desktop gadget that pulls RSS Feeds from a website. The Feed contains information about issues - ie. Priority, Time, Description. The Feed items are displayed on the desktop - however I need to colour code them according to their priority ie 1 = red etc. using the substr function - is there a better way to do this using JavaScript / HTML? At the moment I've hacked together this - but is there a more elegant solution? if (feed.item.description.substr(10,1) == "1") { document.write "<a href colour="red"" + item + ">"; else if (feed.item.description.substr(10,1) == "2") { document.write "<a href colour="yellow"" + item + ">"; else { document.write "<a href colour="green"" + item + ">";

    Read the article

  • VB.NET Syntax Coding

    - by Yiu Korochko
    I know many people ask how some of these are done, but I do not understand the context in which to use the answers, so... I'm building a code editor for a subversion of Python language, and I found a very decent way of highlighting keywords in the RichTextBox through this: bluwords.Add(KEYWORDS GO HERE) If scriptt.Text.Length > 0 Then Dim selectStart2 As Integer = scriptt.SelectionStart scriptt.Select(0, scriptt.Text.Length) scriptt.SelectionColor = Color.Black scriptt.DeselectAll() For Each oneWord As String In bluwords Dim pos As Integer = 0 Do While scriptt.Text.ToUpper.IndexOf(oneWord.ToUpper, pos) >= 0 pos = scriptt.Text.ToUpper.IndexOf(oneWord.ToUpper, pos) scriptt.Select(pos, oneWord.Length) scriptt.SelectionColor = Color.Blue pos += 1 Loop Next scriptt.SelectionStart = selectStart2 End If (scriptt is the richtextbox) But when any decent amount of code is typed (or loaded via OpenFileDialog) chunks of the code go missing, the syntax selection falls apart, and it just plain ruins it. I'm looking for a more efficient way of doing this, maybe something more like visual studio itself...because there is NO NEED to highlight all text, set it black, then redo all of the syntaxing, and the text begins to over-right if you go back to insert characters between text. Also, in this version of Python, hash (#) is used for comments on comment only lines and double hash (##) is used for comments on the same line. Now I saw that someone had asked about this exact thing, and the working answer to select to the end of the line was something like: ^\'[^\r\n]+$|''[^\r\n]+$ which I cannot seem to get into practice. I also wanted to select text between quotes and turn it turquoise, such as between the first quotation mark and the second, the text is turquoise, and the same between the 3rd and 4th etcetera... Any help is appreciated!

    Read the article

  • Lost Array After Validation Error

    - by Georges Kmeid
    I'm working on a CakePHP project and I have User, Post and Location models among others. User hasMany Location and Post belongsTo User so Location is not directly related to Post. This is my code in the Post controller: public function add() { if ($this->request->is('get')) { $this->loadModel('Location'); $this->set('locations', $this->Location->find('all', array('conditions' => array('user_id' => $this->Auth->user('id'))))); } ... } And this is my code in the posts/add view: <?php $i = 0; $j = 0; foreach ($locations as $location): $location_names[$i] = $location['Location']['name']; $i++; endforeach; echo "<select name=\"location\" onchange=\"select(this.value)\">"; echo "<option value=\"\">Select a saved location</option>"; foreach ($locations as $location): echo "<option value=\"" . $location['Location']['latitude'] . "," . $location['Location']['longitude'] . "\">" . $location_names[$j] . "</option>"; $j++; endforeach; ?> </select> If I enter a wrong value in one of the post inputs that has a validation rule in Post model, it redirects to the current add view, shows what is the validation error, but then the $locations array passed from controller to view disappears and can't use it in view and I get this error: Notice (8): Undefined variable: locations [APP\View\Posts\add.ctp, line 68]

    Read the article

  • ScheduledExecutorService throwable lost

    - by Andrey
    Hello, Consider I scheduled a Runnable for periodic execution with ScheduledExecutorService and there occurs some system Error like OutOfMemory. It will be silently swallowed. scheduler.scheduleWithFixedDelay(new Runnable() { @Override public void run() { throw new OutOfMemoryError(); // Swallowed } }, 0, delay, TimeUnit.SECONDS); Is it normal? Why doesn't it propagate to the container? What is the correct way to handle such errors? Thanks!

    Read the article

  • Lost some intellisense in VS2010

    - by maxp
    Getting to grips with Visual Studio 2010, This compiles: var x = System.Web.Security.Membership.GetUser(); And runs, however VS2010 gives no intellisense for x and reports it just as a 'local variable'. Has anyone got any ideas?

    Read the article

  • error in coding in pygame.

    - by mekasperasky
    import pygame from pygame.locals import * screen=pygame.display.set_mode() nin=pygame.image.load('/home/satyajit/Desktop/nincompoop0001.bmp') screen.blit(nin,(50,100)) according to the code i should get a screen with an image of nin on it . But I only get a black screen which doesnt go even though i press the exit button on it. how to get the image on the screen?

    Read the article

  • php troubles with coding variables

    - by user342391
    I am trying to echo certain values if the variable $cardtype == $paymentmethod = if( $cardtype == 'visa' ) echo 'VSA'; elseif ( $cardtype == 'mastercard' ) echo 'MSC'; elseif ( $cardtype == 'mastercard' ) echo 'MSC'; elseif ( $cardtype == 'maestro' ) echo 'MAE'; elseif ( $cardtype== 'amex' ) echo 'AMX'; How would I do this???

    Read the article

  • I would like some help with an autoroller im coding in javascript

    - by Ian
    I have a game that requires you to click on an object to collect prizes, but instead of giving my user carpel tunnel I want to create an autoroller. I have some code done already but I cant get it to work. If there is anyone out there that would be able to help me get this code working, it would be greatly appreciated. Thanks

    Read the article

  • Somewhat lost with jquery + php + json

    - by Luis Armando
    I am starting to use the jquery $.ajax() but I can't get back what I want to...I send this: $(function(){ $.ajax({ url: "graph_data.php", type: "POST", data: "casi=56&nada=48&nuevo=98&perfecto=100&vales=50&apenas=70&yeah=60", dataType: "json", error: function (xhr, desc, exceptionobj) { document.writeln("El error de XMLHTTPRequest dice: " + xhr.responseText); }, success: function (json) { if (json.error) { alert(json.error); return; } var output = ""; for (p in json) { output += p + " : " + json[p] + "\n"; } document.writeln("Results: \n\n" + output); } }); }); and my php is: <?php $data = $_POST['data']; function array2json($data){ $json = $data; return json_encode($json); } ?> and when I execute this I come out with: Results: just like that I used to have in the php a echo array2json statement but it just gave back gibberish...I really don't know what am I doing wrong and I've googled for about 3 hours just getting basically the same stuff. Also I don't know how to pass parameters to the "data:" in the $.ajax function in another way like getting info from the web page, can anyone please help me? Edit I did what you suggested and it prints the data now thank you very much =) however, I was wondering, how can I send the data to the "data:" part in jQuery so it takes it from let's say user input, also I was checking the php documentation and it says I'm allowed to write something like: json_encode($a,JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP) however, if I do that I get an error saying that json_encode accepts 1 parameter and I'm giving 2...any idea why? I'm using php 5.2

    Read the article

  • question for jsp coding

    - by sheetal
    I am reteriving the set of values inside a table from database in a jsp page then it is in the form of link. Now I want to click that value and move to another jsp page. How to code the program so that it can recognise that value and it can move to the next desired page. But I unable to do that. please help me....

    Read the article

  • How to Conduct an online coding competition?

    - by Alice
    I need to design a website for a programming competition event. It will be similar to TOP CODER competitions. User will be given all questions & then user submits the code, that will be running on the server and checks if it gives the correct solution or not. The first one to finish all the questions is the winner. I've no clue about how to proceed. Assume that languages that are supported are C, C++, Java.

    Read the article

  • align li tags with an auto width vs hard coding

    - by Diver Dan
    I am having trouble trying to get a group of li tags to align how I want. I have some basic html <div class="menu"> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </div>? and some css .menu { border:solid 2px red; width:520px; } ul { border:solid 1px #e5e5e5; height:40px; margin:0 auto; list-style:none; width:500px; } li{ text-align:center; display:inline; margin:10px; } I dont want to hard code li widths for each of the elements but I would like for the li elements to take up all available space with the ul element. What do I need to change to get the result I am looking for? My attempt on jsfiddle

    Read the article

  • Cart coding help

    - by user228390
    I've made a simple Javascript code for a shopping basket but now I have realised that I have made a error with making it and don't know how to fix it. What I have is Javascript file but I have also included the images source and the addtocart button as well, but What I am trying to do now is make 2 files one a .HTML file and another .JS file, but I can't get it to because when I make a button in the HTML file to call the function from the .JS file it won't work at all. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD><TITLE>shopping</TITLE> <META http-equiv=Content-Type content="text/html; charset=UTF-8"> <STYLE type=text/CSS> fieldset{width:300px} legend{font-size:24px;font-family:comic sans ms;color:#004455} </STYLE> <META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD> <BODY scroll="auto"> <div id="products"></div><hr> <div id="inCart"></div> <SCRIPT type="text/javascript"> var items=['Xbox~149.99','StuffedGizmo~19.98','GadgetyGoop~9.97']; var M='?'; var product=[]; var price=[]; var stuff=''; function wpf(product,price){var pf='<form><FIELDSET><LEGEND>'+product+'</LEGEND>'; pf+='<img src="../images/'+product+'.jpg" alt="'+product+'" ><p>price '+M+''+price+'</p> <b>Qty</b><SELECT>'; for(i=0;i<6;i++){pf+='<option value="'+i+'">'+i+'</option>'} pf+='</SELECT>'; pf+='<input type="button" value="Add to cart" onclick="cart()" /></FIELDSET></form>'; return pf } for(j=0;j<items.length;j++){ product[j]=items[j].substring(0,items[j].indexOf('~')); price[j]=items[j].substring(items[j].indexOf('~')+1,items[j].length); stuff+=''+wpf(product[j],price[j])+''; } document.getElementById('products').innerHTML=stuff; function cart(){ var order=[]; var tot=0 for(o=0,k=0;o<document.forms.length;o++){ if(document.forms[o].elements[1].value!=0){ qnty=document.forms[o].elements[1].value; order[k]=''+product[o]+'_'+qnty+'*'+price[o]+''; tot+=qnty*price[o];k++ } } document.getElementById('inCart').innerHTML=order.join('<br>')+'<h3>Total '+tot+'</h3>'; } </SCRIPT> <input type="button" value="Add to cart" onclick="cart()" /></FIELDSET></form> </BODY></HTML>

    Read the article

  • argparse coding issue

    - by Carl Skonieczny
    write a script that takes two optional boolean arguments,"--verbose‚" and ‚"--live", and two required string arguments, "base"and "pattern". Please set up the command line processing using argparse. This is the code I have so far for the question, I know I am getting close but something is not quite right. Any help is much appreciated.Thanks for all the quick useful feedback. def main(): import argparse parser = argparse.ArgumentParser(description='') parser.add_argument('base', type=str) parser.add_arguemnt('--verbose', action='store_true') parser.add_argument('pattern', type=str) parser.add_arguemnt('--live', action='store_true') args = parser.parse_args() print(args.base(args.pattern))

    Read the article

  • [Linux] Coding a GTK+ application without window manager?

    - by ShoX
    Hi, I want to code sth. that basically works like TiVo. Switch it on, you only see the menu or an output, so no underlying OS or anything else is directly visible to the user. So I want to use Linux as base. Can you suggest a good base distribution? Can I code a frontend without having a window-manager up and running? If yes, is that possible with java-gnome or what language/gui-framework combination would you suggest? If no, what's the minimal window manager that can handle fancy menus, etc? What does it take to create video-overlays over a HD-stream? Are there some libraries I should take a look at? Thanks

    Read the article

  • artisteer wp-theme metadata (date, category) lost

    - by Mattias Svensson
    I am going nuts over wordpress and artisteer. I am trying something that used to be pretty straightforward - turning on and off the display of date and post category for my posts on my blog page. I find this in content.php global $post; theme_post_wrapper( array( 'id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_page_title') ? get_the_title() : '', 'heading' => theme_get_option('theme_single_article_title_tag'), 'before' => theme_get_metadata_icons('date', 'header'), 'content' => theme_get_content() ) ); And the instruction says that all you got to do is insert or remove 'date' in the 'before' line. I've done it back and forth with my content files and nothing changes on the output. I can't find the actual code that prints it all, wordpress used to be so simple before everything was dug down 10 levels deep and you now have to look through millions of different functions to find the simplest things... As you can probably tell, I usually don't work with WP =) But this is on my table now and I haven't stayed up to date with WP for a couple of years... Any input as to where I can find the variables is appreciated... I had expected to at some point find 'posted at '.echo($date).' in category '.echo($category) or something at least remotely similar...

    Read the article

  • Python program to search for specific strings in hash values (coding help)

    - by Diego
    Trying to write a code that searches hash values for specific string's (input by user) and returns the hash if searchquery is present in that line. Doing this to kind of just learn python a bit more, but it could be a real world application used by an HR department to search a .csv resume database for specific words in each resume. I'd like this program to look through a .csv file that has three entries per line (id#;applicant name;resume text) I set it up so that it creates a hash, then created a string for the resume text hash entry, and am trying to use the .find() function to return the entire hash for each instance. What i'd like is if the word "gpa" is used as a search query and it is found in s['resumetext'] for three applicants(rows in .csv file), it prints the id, name, and resume for every row that has it.(All three applicants) As it is right now, my program prints the first row in the .csv file(print resume['id'], resume['name'], resume['resumetext']) no matter what the searchquery is, whether it's in the resumetext or not. lastly, are there better ways to doing this, by searching word documents, pdf's and .txt files in a folder for specific words using python (i've just started reading about the re module and am wondering if this may be the route, rather than putting everything in a .csv file.) def find_details(id2find): resumes_f=open("resume_data.csv") for each_line in resumes_f: s={} (s['id'], s['name'], s['resumetext']) = each_line.split(";") resumetext = str(s['resumetext']) if resumetext.find(id2find): return(s) else: print "No data matches your search query. Please try again" searchquery = raw_input("please enter your search term") resume = find_details(searchquery) if resume: print resume['id'], resume['name'], resume['resumetext']

    Read the article

  • checkbox selected value is lost after coming back to the pagei.e., viewstate value is lost with use

    - by M.Vijay bhasker
    In the left navigation i have a series of check boxes and a grid view in the page body.Grid view results changes based on the check box selection,whenever i click on the links in grid view it goes to the second page and there is a link on the page which takes me back to the first page,but the check box selected value is maintained for the first time only and if we repeat the same process for the second time and i see that the first time selection of the check box is maintained.Here the grid view is placed in update panel and the check box in the left is called using .... AsyncPostBackTrigger ControlID="cphLeftNavigation". I've tried removing the above code referring the cphLeftNavigation and i see the results are coming up correctly and the last selected check box value is being maintained correctly and i want the same functionality to be implemented with/without update panel. Can anyone let me know,what exactly should i change to implement the above mentioned functionality.

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >