Search Results

Search found 1788 results on 72 pages for 'debugger'.

Page 60/72 | < Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >

  • Debugging scripts loaded with GroovyShell (in eclipse)

    - by MSh
    I am working with eclipse and groovy plug in. I am building a test harness to debug and test groovy scripts. The scripts are really simple but long, most of them just if/else/return. I figured out that I can call them using GroovyShell and Bindings to pass in the values. The problem is that, while I can call the script and get the results just fine, I CAN NOT step in there with the debugger. Breakpoints in those scripts are not active. Is there a way to debug the scripts? Maybe I should use something other than GroovyShell? I really don't want to modify the scripts by wrapping them into functions, and then calling those functions from my test classes. That's how I am using Binding and GroovyShell: def binding = new Binding(); binding.lineList = [list1]; binding.count = 5; def shell = new GroovyShell(binding); def result = shell.evaluate(new File("src/Rules/checkLimit.groovy"));

    Read the article

  • Can't add or remove object from NSMutableSet

    - by Dan Ray
    Check it: - (IBAction)toggleFavorite { DataManager *data = [DataManager sharedDataManager]; NSMutableSet *favorites = data.favorites; if (thisEvent.isFavorite == YES) { NSLog(@"Toggling off"); thisEvent.isFavorite = NO; [favorites removeObject:thisEvent.guid]; [favoriteIcon setImage:[UIImage imageNamed:@"notFavorite.png"] forState:UIControlStateNormal]; } else { NSLog(@"Toggling on, adding %@", thisEvent.guid); thisEvent.isFavorite = YES; [favorites addObject:thisEvent.guid]; [favoriteIcon setImage:[UIImage imageNamed:@"isFavorite.png"] forState:UIControlStateNormal]; } NSLog(@"favorites array now contains %d members", [favorites count]); } This is fired from a custom UIButton. The UI part works great--toggles the image used for the button, and I can see from other stuff that the thisEvent.isFavorite BOOL is toggling happily. I can also see in the debugger that I'm getting my DataManager singleton. But here's my NSLog: 2010-05-13 08:24:32.946 MyApp[924:207] Toggling on, adding 05db685f65e2 2010-05-13 08:24:32.947 MyApp[924:207] favorites array now contains 0 members 2010-05-13 08:24:33.666 MyApp[924:207] Toggling off 2010-05-13 08:24:33.666 MyApp[924:207] favorites array now contains 0 members 2010-05-13 08:24:34.060 MyApp[924:207] Toggling on, adding 05db685f65e2 2010-05-13 08:24:34.061 MyApp[924:207] favorites array now contains 0 members 2010-05-13 08:24:34.296 MyApp[924:207] Toggling off 2010-05-13 08:24:34.297 MyApp[924:207] favorites array now contains 0 members Worst part is, this USED to work, and I don't know what I did to break it.

    Read the article

  • ASP.NET DynamicData: Whats happening during an update?

    - by Jens A.
    I am using ASP.NET DynamicData (based on LINQ to SQL) on my site for basic scaffolding. On one table I have added additional properties, that are not stored in the table, but are retrieved from somewhere else. (Profile information for a user account, in this case). They are displayed just fine, but when editing these values and pressing "Update", they are not changed. Here's what the properties look like, the table is the standard aspnet_Users table: public String Address { get { UserProfile profile = UserProfile.GetUserProfile(UserName); return profile.Address; } set { UserProfile profile = UserProfile.GetUserProfile(UserName); profile.Address = value; profile.Save(); } } When I fired up the debugger, I've noticed that for each update the set accessor is called three times. Once with the new value, but on a newly created instance of user, then once with the old value, again on an new instance, and finally with the old value on the existing instance. Wondering a bit, I checked with the properties created by the designer, and they, too, are called three times in (almost) the same fashion. The only difference is, that the last call contains the new value for the property. I am a bit stumped here. Why three times, and why are my new properties behaving differently? I'd be grateful for any help on that matter! =)

    Read the article

  • C# generics with MVVM, pulling the T out of <T>

    - by bufferz
    My Model is a generic class that contains a (for example) Value property which can be int, float, string, bool, etc. So naturally this class is represented something like Model<T>. For the sake of collections Model<T> implements the interface IModel, although IModel is itself empty of any content. My ViewModel contains and instance of Model<T> and it is passed in through ViewModel's constructor. I still want to know what T is in ViewModel, so when I expose Model to the View I know the datatype of Model's buried Value property. The class for ViewModel ends up looking like the following: class ViewModel<T> { private Model<T> _model; public ViewModel(Model<T> model) { ....blah.... } public T ModelsValue {get; set; } } This works fine, but is limited. So now I need to expose a collection of IModels with varying Ts to my View, so I'm trying to set up an ObservableCollection of new ViewModel<T>s to a changing list of IModels. The problem is, I can't figure out how to get T from Model<T> from IModel to construct ViewModel<T>(Model<T>) at runtime. In the VS2010 debugger I can mouseover any IModel object and see its full Model<int> for example at runtime so I know the data is in there. Any ideas?

    Read the article

  • Why does a MFC application behaves mysteriously in encrypted hard drive environment.

    - by MauriceL
    I'm working on a bug where I have an MFC application that does weird things when installed in when Sophos Safeguard hard drive encryption is installed. I'm sorry to be so vague here, but I'm writing this away from the office so this is all from my (poor) memory. Three things I've noticed: AfxGetResourceHandle() doesn't return a consistent resource handle. There is a single case where we try to load a string resource, and for some reason, the resource handle that we get from this method is different to all the other stings. Can't construct a CDocumentTemplate. There is a trace error which I cant seem to recall. Will edit and post when I'm in tomorrow. This behaviour appears to manifest in a Visual Studio 2005 version of the project, but not a Visual Studio 2008 version. Unfortunately moving to the 2008 version is not an option. The bug is not always reproducable if I step through with a debugger. Also, bringing up debug message boxes changes the behaviuor, which leads me to think that either there is some kind of race condition going on with the way MFC events are being handled, but I'm not sure how I'll ever know for sure, or even what I can do about it if I did. I think there's some underlying reason that the app is behaving weirdly, but what I've posted are more symptoms. Can anyone think of what I should check for? I've run Windows update on the test environment to ensure everything was up to date, and I've examined the process in procmon to see if the disk encryption stuff was getting in the way and conflicting with files - it didn't appear to be, but it does appear to be involved in some way as our app accesses Sophos related paths in the temp directory.

    Read the article

  • My iPhone app ran fine in simulator but crashed in device (iPod touch 3.1.2) test, I got the followi

    - by Mickey Shine
    I was running myapp on an iPod touch and I noticed it missed some libraries. Is that the reason? [Session started at 2010-03-19 15:57:04 +0800.] GNU gdb 6.3.50-20050815 (Apple version gdb-1128) (Fri Dec 18 10:08:53 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys007 Loading program into debugger… Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-237-78 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none run Running… [Switching to thread 11779] [Switching to thread 11779] sharedlibrary apply-load-rules all (gdb) continue warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found). 2010-03-19 15:57:18.892 myapp[2338:207] MS:Notice: Installing: com.yourcompany.myapp [myapp] (478.52) 2010-03-19 15:57:19.145 myapp[2338:207] MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/Backgrounder.dylib warning: Unable to read symbols for "/Library/MobileSubstrate/DynamicLibraries/Backgrounder.dylib" (file not found). warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/usr/lib/libsubstrate.dylib" (file not found). MS:Warning: message not found [myappAppDelegate applicationWillResignActive:] MS:Warning: message not found [myappAppDelegate applicationDidBecomeActive:] 2010-03-19 15:57:19.550 myapp[2338:207] in FirstViewController 2010-03-19 15:57:20.344 myapp[2338:207] in load table view 2010-03-19 15:57:20.478 myapp[2338:207] in loading splash view 2010-03-19 15:57:22.793 myapp[2338:207] in set interface Program received signal: “0”. warning: check_safe_call: could not restore current frame

    Read the article

  • How to read/write from erlang to a named pipe ?

    - by cstar
    I need my erlang application to read and write through a named pipe. Opening the named pipe as a file will fail with eisdir. I wrote the following module, but it is fragile and feels wrong in many ways. Also it fails on reading after a while. Is there a way to make it more ... elegant ? -module(port_forwarder). -export([start/2, forwarder/2]). -include("logger.hrl"). start(From, To)-> spawn(fun() -> forwarder(From, To) end). forwarder(FromFile, ToFile) -> To = open_port({spawn,"/bin/cat > " ++ ToFifo}, [binary, out, eof,{packet, 4}]), From = open_port({spawn,"/bin/cat " ++ FromFifo}, [binary, in, eof, {packet, 4}]), forwarder(From, To, nil). forwarder(From, To, Pid) -> receive {Manager, {command, Bin}} -> ?ERROR("Sending : ~p", [Bin]), To ! {self(), {command, Bin}}, forwarder(From, To, Manager); {From ,{data,Data}} -> Pid ! {self(), {data, Data}}, forwarder(From, To, Pid); E -> ?ERROR("Quitting, first message not understood : ~p", [E]) end. As you may have noticed, it's mimicking the port format in what it accepts or returns. I want it to replace a C code that will be reading the other ends of the pipes and being launched from the debugger.

    Read the article

  • Unknown reason for code executing the way it does in python

    - by Jasper
    Hi I am a beginner programmer, using python on Mac. I created a function as a part of a game which receives the player's input for the main character's name. The code is: import time def newGameStep2(): print ' ****************************************** ' print '\nStep2\t\t\t\tCharacter Name' print '\nChoose a name for your character. This cannot\n be changed during the game. Note that there\n are limitations upon the name.' print '\nLimitations:\n\tYou cannot use:\n\tCommander\n\tLieutenant\n\tMajor\n\t\tas these are reserved.\n All unusual capitalisations will be removed.\n There is a two-word-limit on names.' newStep2Choice = raw_input('>>>') newStep2Choice = newStep2Choice.lower() if 'commander' in newStep2Choice or 'lieutenant' in newStep2Choice or 'major' in newStep2Choice: print 'You cannot use the terms \'commander\', \'lieutenant\' or \'major\' in the name. They are reserved.\n' print time.sleep(2) newGameStep2() else: newStep2Choice = newStep2Choice.split(' ') newStep2Choice = [newStep2Choice[0].capitalize(), newStep2Choice[1].capitalize()] newStep2Choice = ' ' .join(newStep2Choice) return newStep2Choice myVar = newGameStep2() print myVar When I was testing, I inputted 'major a', and when it asked me to input another name, i inputted 'a b'. However, when it returned the output of the function, it returns 'major a'. I went through this with a debugger, yet I still can't seem to find where the problem occurred. Thanks for any help, Jasper

    Read the article

  • Adding to the DOM via Prototype works in Chrome but not Firefox?

    - by zaczap
    I've been working on some Javascript code to add rows to a table dynamically (a small task management system) and it works perfectly in Chrome but not in Firefox. Code in question: var task = new Element('tr', {id:arg}); task.innerHTML = "<td class='notes'>asd</td><td class='check'>*</td>"; //task.innerHTML = "<td class='notes'>&nbsp;</td><td class='check'><input type='checkbox' onclick=\"javascript:complete('"+task.id+"')\" /></td><td class='description'>asd</td><td class='start'>&nbsp;</td><td class='due'></td>"; $('tasks').insert(task); // the commented line above is what the code was originally that does work in chrome When I look at the HTML model in the Firefox debugger, all that is added is: <tr id="arg"><td>asd*</td></tr> Figuring that Chrome might be better at interpreting innerHTML into DOM elements than Firefox, I changed the code to make td elements and add them to my tr element but that didn't improve the situation at all.

    Read the article

  • MySQLDB query not returning all rows

    - by RBK
    I am trying to do a simple fetch using MySQLDB in Python. I have 2 tables(Accounts & Products). I have to look up Accounts table, get acc_id from it & query the Products table using it. The Products tables has more than 10 rows. But when I run this code it randomly returns between 0 & 6 rows each time I run it. Here's the code snippet: # Set up connection con = mdb.connect('db.xxxxx.com', 'user', 'password', 'mydb') # Create cursor cur = con.cursor() # Execute query cur.execute("SELECT acc_id FROM Accounts WHERE ext_acc = '%s'" % account_num ) # account_num is alpha-numberic and is got from preceding part of the program # A tuple is returned, so get the 0th item from it acc_id = cur.fetchone()[0] print "account_id = ", acc_id # Close the cursor - I was not sure if I can reuse it cur.close() # Reopen the cursor cur = con.cursor() # Second query cur.execute("SELECT * FROM Products WHERE account_id = %d" % acc_id) keys = cur.fetchall() print cur.rowcount # This prints incorrect row count for key in keys: # Does not print all rows. Tried to directly print keys instead of iterating - same result :( print key # Closing the cursor & connection cur.close() con.close() The weird part is, I tried to step through the code using a debugger(PyDev on Eclipse) and it correctly gets all rows(both the value stored in the variable 'keys' as well as console output are correct). I am sure my DB has correct data since I ran the same SQL on MySQL console & got the correct result. Just to be sure I was not improperly closing the connection, I tried using with con instead of manually closing the connection and it's the same result. I did RTFM but I couldn't find much in it to help me with this issue. Where am I going wrong? Thank you. EDIT: I noticed another weird thing now. In the line cur.execute("SELECT * FROM Products WHERE account_id = %d" % acc_id), I hard-coded the acc_id value, i.e made it cur.execute("SELECT * FROM Products WHERE account_id = %d" % 322) and it returns all rows

    Read the article

  • My website keeps crashing IE, can't debug

    - by Ninja rhino
    I have a website that suddenly started to crash internet explorer. The website loads and starts executing javascript but somewhere in there the machinery explodes. I don't even get a script error, it just crashes. I've tried to manually step through every single line of js with the built in debugger but then of course the problem doesn't occur. If i choose to debug the application when it crashes i see the following message. Unhandled exception at 0x6c5dedf5 in iexplore.exe: 0xC0000005: Access violation reading location 0x00000090. The top 5 items in the call stack looks like this VGX.dll!6c5dedf5() [Frames below may be incorrect and/or missing, no symbols loaded for VGX.dll] VGX.dll!6c594d70() VGX.dll!6c594f63() VGX.dll!6c595350() VGX.dll!6c58f5e3() mshtml.dll!6f88dd17() VGX.dll seems to be part of the vml renderer and i am in fact using VML. I'm not suprised because i've had so many problems with vml, attributes has to be set in specific order, sometimes you cant set attributes when you have elements attached to the dom or vice versa (everything undocumented btw) but then the problems can usually be reproduced when debugging but not now :( The problem also occurs in no plugin-mode. Is there a better approach than trial and error to solve this? Edit: Adding a console outputting every suspect modification to the DOM made the problem only occur sometimes. (the console is also implemented in javascript on the same page, i'm able to see the output even after a crash as the window is still visible) Apparently it seems to be some kind of race condition. I managed to track it down even further, and it seems to occur when you remove an object from the DOM too quickly after it's just been added. (most likely only for vml-elements with some special attribute, didn't try further) And it can't be fixed by adding a dead loop in front of removeChild(pretty bad solution anyway), the page has to be rendered by the browser once after the addChild before you can call removeChild. sigh

    Read the article

  • Jquery conditionals, window locations, and viewdata. Oh my!

    - by John Stuart
    I have one last thing left on a project and its a doozy. Not only is this my first web application, but its the first app i used Jquery, CSS and MVC. I have no idea on how to proceed with this. What i am trying to do is: In my controller, a waste item is validated, and based on the results one of these things can happen. The validation is completed, nothing bad happens, which sets ViewData["FailedWasteId"] to -9999. Its a new waste item and the validation did not pass, which sets ViewData["FailedWasteId"] to 0. Its an existing waste item and the validation did not pass, which sets ViewData["FailedWasteId"] to the id of the waste item. This ViewData["FailedWasteId"] is set on page load using <%=Html.Hidden("wFailId", int.Parse(ViewData["WasteFailID"].ToString()))%> When the validations do not pass, then the page zooms (by window.location) to an invisible div, opens the invisible div etc. Hopefully my intentions are clear with this poor attempt at jquery. The new waste div is and the existing item divs are dynamically generated (this i know works) " So my question here is... Help? I cant even get the data to parse correctly, nor can i even get the conditionals to work. And since this happens after post, i cant get firebug to help my step through the debugger, as the script isnt loaded yet. $(document).ready(function () { var wasteId = parseInt($('#wFailId').text()); if (wasteId == -9999) { //No Issue } else if (wasteId < 0) { //Waste not saved to database } else if (wasteId == 0) { //New Waste window.location = '#0'; $('.editPanel').hide(); $('#GeneratedWasteGrid:first').before(newRow); $('.editPanel').appendTo('#edit-panel-row').slideDown('slow'); } else if (wasteId > 0) { //Waste saved to database } });

    Read the article

  • My iPhone app runs fine in simulator but quit in device (iPod touch 3.1.2) test, I got the following

    - by Mickey Shine
    I was running myapp on an iPod touch and I noticed it missed some libraries. Is that the reason? [Session started at 2010-03-19 15:57:04 +0800.] GNU gdb 6.3.50-20050815 (Apple version gdb-1128) (Fri Dec 18 10:08:53 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys007 Loading program into debugger… Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-237-78 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none run Running… [Switching to thread 11779] [Switching to thread 11779] sharedlibrary apply-load-rules all (gdb) continue warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found). 2010-03-19 15:57:18.892 myapp[2338:207] MS:Notice: Installing: com.yourcompany.myapp [myapp] (478.52) 2010-03-19 15:57:19.145 myapp[2338:207] MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/Backgrounder.dylib warning: Unable to read symbols for "/Library/MobileSubstrate/DynamicLibraries/Backgrounder.dylib" (file not found). warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/usr/lib/libsubstrate.dylib" (file not found). MS:Warning: message not found [myappAppDelegate applicationWillResignActive:] MS:Warning: message not found [myappAppDelegate applicationDidBecomeActive:] 2010-03-19 15:57:19.550 myapp[2338:207] in FirstViewController 2010-03-19 15:57:20.344 myapp[2338:207] in load table view 2010-03-19 15:57:20.478 myapp[2338:207] in loading splash view 2010-03-19 15:57:22.793 myapp[2338:207] in set interface Program received signal: “0”. warning: check_safe_call: could not restore current frame

    Read the article

  • Output error in comparing characters from two strings

    - by Andrew Martin
    I'm stuck with my a piece of code I'm creating. My IDE is Eclipse and when I use its debugging feature, to trace what's happening on each line, it outputs perfectly. However, when I click the "run" project, it just outputs a blank screen: public static void compareInterests(Client[] clientDetails) { int interests = 0; for (int p = 0; p < numberOfClients; p++) { for (int q = 0; q < numberOfClients; q++) { String a = clientDetails[p].getClientInterests(); String b = clientDetails[q].getClientInterests(); int count = 0; while (count < a.length()) { if (a.charAt(count) == b.charAt(count)) interests++; count++; } if ((interests >= 3) && (clientDetails[p].getClientName() != clientDetails[q].getClientName())) System.out.print (clientDetails[p].getClientName() + " is compatible with " + clientDetails[q].getClientName()); interests = 0; } } } The code is designed to import an object array which contains information on a client's name and a client's interests. The client's interests are stored in the format "01010", where each 1 means they are interested in that activity, each 0 means they are not. My code compares each character of every client's string with every other client's string and outputs the results for all client's that don't have the same name and have three or more interests in common. When I run this code through Java's debugger, it outputs fine - but when I click run project or compile, I just get a blank screen. Any ideas?

    Read the article

  • Java Socket - how to catch Exception of BufferedReader.readline()

    - by Hasan Tahsin
    I have a Thread (let's say T1) which reads data from socket: public void run() { while (running) { try { BufferedReader reader = new BufferedReader( new InputStreamReader(socket.getInputStream()) ); String input = reader.readLine(); } catch (IOException e) { e.printStackTrace(); } } } Another Thread (lets say T2) try to finish the program in one of its method. Therefore T2 does the following: T1.running = false; socket.close(); Here is this scenario for which i couldn't find a solution: T1 is active and waiting for some input to read i.e. blocking. context switching T2 is active and sets running to false, closes the socket context switching because T1 was blocking and T2 closed the socket, T1 throws an Exception. What i want is to catch this SocketException. i can't put a try/catch(SocketException) in T1.run(). So how can i catch it in T1's running-method? If it's not possible to catch it in T1's running, then how can i catch it elsewhere? PS: "Another question about the Thread Debugging" Normally when i debug the code step by step, i lose the 'active running line' on a context switch. Let's say i'm in line 20 of T1, context switch happens, let's assume the program continues from the 30.line of T2, but the debugger does not go/show to the 30.line of T2, instead the 'active running line' vanishes. So i lose the control over the code. I use Eclipse for Java and Visual Studio for C#. So what is the best way to track the code while debugging on a context switch ?

    Read the article

  • showDialog in Activity not displaying dialog

    - by Mohit Deshpande
    Here is my code: public class TasksList extends ListActivity { ... private static final int COLUMNS_DIALOG = 7; private static final int ORDER_DIALOG = 8; ... /** * @see android.app.Activity#onCreateDialog(int) */ @Override protected Dialog onCreateDialog(int id) { Dialog dialog; final String[] columns; Cursor c = managedQuery(Tasks.CONTENT_URI, null, null, null, null); columns = c.getColumnNames(); final String[] order = { "Ascending", "Descending" }; switch (id) { case COLUMNS_DIALOG: AlertDialog.Builder columnDialog = new AlertDialog.Builder(this); columnDialog.setSingleChoiceItems(columns, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { bundle.putString("column", columns[which]); } }); dialog = columnDialog.create(); case ORDER_DIALOG: AlertDialog.Builder orderDialog = new AlertDialog.Builder(this); orderDialog.setSingleChoiceItems(order, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String orderS; if (order[which].equalsIgnoreCase("Ascending")) orderS = "ASC"; else orderS = "DESC"; bundle.putString("order", orderS); } }); dialog = orderDialog.create(); default: dialog = null; } return dialog; } /** * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem) */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case SORT_MENU: showDialog(COLUMNS_DIALOG); showDialog(ORDER_DIALOG); String orderBy = bundle.getString("column") + bundle.getString("order"); Cursor tasks = managedQuery(Tasks.CONTENT_URI, projection, null, null, orderBy); adapter = new TasksAdapter(this, tasks); getListView().setAdapter(adapter); break; case FILTER_MENU: break; } return false; } The showDialog doesn't display the dialog. I used the Debugger and it does executes these statements, but the dialog doesn't show. }

    Read the article

  • In Safari, using jQuery a Form Input Text Field does not receive focus after alert is displayed. Why

    - by Rob
    I have an ASPX web form. I use jQuery to simply my Javascript. I use a Javascript validation script to validate each of the form fields' values. If an error occurs, I popup an alert with an error message. Then I transfer focus to the underlying element. Here are examples I have tried. Using jQuery: var Form_FieldDef = function(name) { this.name = name; this.SetFocus = function() { $('#' + this.name)[0].focus(); } this.Validate = function() { var isvalid = true; if ( $.trim($('#' + this.name).val()) == '') { alert("Your entry is empty"); this.SetFocus(); isvalid = false; } return isvalid; } } This works on IE7, IE8, Opera, Chrome, and Firefox. It does not work on Safari 4 on PC. I don't have a Mac. So I changed the SetFocus method to this. this.SetFocus = function() { var fld = document.getElementById(this.name); if (fld != null) fld.focus(); } This works on IE7, IE8, Opera, Chrome, and Firefox. It does not work on Safari 4 on PC. I stepped through the code with VS 2008 debugger, and I'm calling the focus method on the underlying element.

    Read the article

  • Checkbox not working properly for IE with jquery

    - by wildanjel
    Hi, I am trying using several asp.net checkboxes on a page, disabling them accordingly. <asp:CheckBox ID='chkMenuItem' runat='server' CssClass='HiddenText' Text='Test' onclick='<%#String.Format("checkChild({0});", Eval("id")) %>' /> on javascript, I am using the following code function checkChild(id) { for (i = 0; i < $("input[id*=hdnParentMenuItemID]").length; i++) { if ($('input[id*=hdnParentMenuItemID]')[i].value.split(':')[0] == id) { var childID = $('input[id*=hdnParentMenuItemID]')[i].value.split(':')[1]; if ($("#" + childID).attr("disabled")) //$("#" + childID).attr('disabled', ''); $("#" + childID).removeAttr("disabled"); else $("#" + childID).attr('disabled', true); } } } Now is the checkboxes are disabled once the page is loaded, the removeAttr section doesn't work. I tried to step through the debugger and the logic works perfectly fine. If the checkboxes aren't disabled on page load, the code works fine. I tried replacing disabled 'attributes' with 'checked' to see if the other attributes work fine and it works perfectly fine. I tried $("#" + childID).attr('disabled', ''); but it didnt work either. Note: It works perfect on FF and Chrome but doesnt work in IE. Thanks,

    Read the article

  • Getting array of Values of Textboxes with the same class

    - by nCdy
    I setup custom CSS class for array of dynamic TextBoxes (inputs as HTML) so... now I need to get array of it : <input type="text" style="width: 50px;" class="DynamicTB" id="ctl00_ContentPlaceHolder1_GridView1_ctl02_id" readonly="readonly" value="1" name="ctl00$ContentPlaceHolder1$GridView1$ctl02$id"> sure client don't really knows the count of inputs. That's why I use class and here is what I'm trying to make : $.each( { id : $("input.DynamicTB").css("value") }, function(id){ CallPageMethod("SelectBook", success, fail, "id",id); }); I'm not sure if this $("input.DynamicTB").css("value") will works correct :( but How can I transfer whole array of values to SelectBook Method ? My javascript is bad and my debugger don't show me javascript errors but it just doesn't works because of something wrong with each. And ... finally I just need to get array of values of dynamic textboxes and transfer them to server side ... mt [WebMethode] can't see server side :( [Web.Services.WebMethod] public static SelectBook(id : array) : string { id } And sure I have no idea how can I use jQuery .live and binding here.

    Read the article

  • how to make custom ROMs for lesser-known Android devices (i.e., WellcoM A69)

    - by gonzobrains
    Hi, I have a WellcoM A69 Android phone I would like to start hacking. I bought it in Thailand (I think WellcoM is a Thai company). However, the docs don't explain how to get a recovery menu or anything like that. I would like to figure out how to make custom ROMs for it, because it doesn't have any Google Experience apps and I also want to change the boot screen. How can I go about doing this? If I can't do this, I want to at least be able to use the device in the Eclipse debugger. I select the debugging option under applications but the device still isn't recognized. Is this something that can be disabled by the manufacturer? In any case, I would like to re-enable it if a custom ROM can allow this. If this cannot be done at all, please at least point me in the direction of where I can start writing/building my own ROMs for the G1? I figured that would be a good starting point for learning. Thanks, Jeff

    Read the article

  • The page at [ Page URL ] could not be reached. (Urgent)

    - by Danial Sabagh
    I want to add the like button on my website, but it does not work because whenever I click on Like button it says: The page at could not be reached. You can also check the url to see the error: My Facebook page Here is what I did to use the code: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#"> <head> <meta property="og:title" content="ALEXA BEAUTY" /> <meta property="og:type" content="company" /> <meta property="og:url" content="http://alexasalon.co.uk/" /> <meta property="og:image" content="http://alexasalon.co.uk/images/logo.png" /> <meta property="og:site_name" content="ALEXA BEAUTY" /> <meta property="fb:admins" content="100002556535323" /> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=220687968005095"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div> <fb:like href="http://www.facebook.com/pages/Alexa-Beauty/205401152839187" send="true" width="450" show_faces="false" font="lucida grande"></fb:like> </div> Is the code wrong? Is the page URL correct? I checked the website on Object Debugger and seems there is no error, check link please. I really do not know what is wrong? Does anyone know?!

    Read the article

  • Google Anlytics event not firing

    - by yar1
    I am not getting and event data in GA. I installed Google Analytics Debugger Chrome extension and I see nothing happening (same goes when looking at Network panel in developer tools). I Googled it and read many (many) other answers and it looks like I'm doing things right. Page views, etc. are registering correctly... I have this code as the last thing before my closing tag: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-MYREALCODE', 'mybna.net'); ga('send', 'pageview'); var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-MYREALCODE']); _gaq.push(['_trackPageview']); </script> My event handlers are done using jQuery, all inside an external js file, loaded before the closing tag. For example: $(function () { $('#show-less').click(function (e) { pbr.showHideMore(e); _gaq.push(['_trackEvent', 'ShowMore', 'Hide', 'top button']); }); }); Any ideas anyone?

    Read the article

  • Why won't my code segfault on Windows 7?

    - by Trevor
    This is an unusual question to ask but here goes: In my code, I accidentally dereference NULL somewhere. But instead of the application crashing with a segfault, it seems to stop execution of the current function and just return control back to the UI. This makes debugging difficult because I would normally like to be alerted to the crash so I can attach a debugger. What could be causing this? Specifically, my code is an ODBC Driver (ie. a DLL). My test application is ODBC Test (odbct32w.exe) which allows me to explicitly call the ODBC API functions in my DLL. When I call one of the functions which has a known segfault, instead of crashing the application, ODBC Test simply returns control to the UI without printing the result of the function call. I can then call any function in my driver again. I do know that technically the application calls the ODBC driver manager which loads and calls the functions in my driver. But that is beside the point as my segfault (or whatever is happening) causes the driver manager function to not return either (as evidenced by the application not printing a result). One of my co-workers with a similar machine experiences this same problem while another does not but we have not been able to determine any specific differences.

    Read the article

  • System.Threading.Timer won't trigger

    - by mijatovic
    Hello guys, I am new here... I have one question, if somebody can help me. It is about timers (System.Threading.Timer). I want to break inevitable recursion: I have two columns in datarow and they are mutually dependant (price_without_VAT and price_with_VAT). Setting one of them will definitely cause StackOverflowException. So here's the idea: bool flag = true; void Reset(object state) { flag = true; } Now, wrap the method for changing value of one of the columns: { if(flag) { flag = false; System.Threading.Timer tmr = new System.Threading.Timer(new System.Threading.TimerCallback(Reset), null, 10, System.Threading.Timeout.Infinite); datarow.other_column = value; } } datarow.other_column.value line will immediately trigger the above method, but there will be no recursion because flag is false. In 10 ms flag should be back to true, and everything is back to normal. Now, when i follow the code in DEBUGGER, everything works fine, but when I start app NORMALLY Reset function simply will not trigger, flag is stuck to false forever and everything false apart. I play around with due_time parameter but nothing seems to help. Any ideas?

    Read the article

  • Huge burst of memory in c# service, what could be the cause?

    - by Daniel
    I'm working on a c# service application and i have this problem where out of no where and for no obvious reason, the memory for the process will climb from 150mb to almost 2gb in about 5 seconds and then back to 150mb. But nothing in our system should be using any where near that amount of memory (so its probably a bug somewhere). It might be a tight while true loop somewhere but the cpu usage at the time was very low so i thought i'd look for other ideas. Now the weirder thing is when i compile the service for 64bit, the same massive burst will occur except it exceeded 10gb of ram (paging most of it) and it just caused lots of problems with the computer and everything running on it. After a while it shuts down but it looks like windows is still willing to give it more memory. Would you have any ideas or tools that i can use in order to find this? Yes it has lots of logging however nothing in the logs stand out as to why this is happening. I can run the service in a console app mode, so my next test was going to be running it in visual studio debugger and see if i can find anything. It only happens occasionally but usually about 10-20 minutes after startup. On 32bit mode it cleans up and continues on like normally. 64bit mode it crashes after a while and uses stupid amounts of memory. But i'm really stumped as to why this is happening!!!

    Read the article

< Previous Page | 56 57 58 59 60 61 62 63 64 65 66 67  | Next Page >