Search Results

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

Page 46/72 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Are C++ Templates just Macros in disguise?

    - by Roddy
    I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done. Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs using #defines, if you really wanted to. This way of thinking about templates helps me understand how my code will actually work, but I feel that I must be missing the point somehow. Macros are meant evil incarnate, yet "template metaprogramming" is all the rage. So, what ARE the real distinctions? and how can templates avoid the dangers that #define leads you into, like Inscrutable compiler errors in places where you don't expect them? Code bloat? Difficulty in tracing code? Setting Debugger Breakpoints?

    Read the article

  • Setting enum values to 4-byte strings - why?

    - by psychotik
    I saw code similar to this in the Mac OS SDK: enum { kAudioFileStreamProperty_ReadyToProducePackets = 'redy', kAudioFileStreamProperty_FileFormat = 'ffmt', kAudioFileStreamProperty_DataFormat = 'dfmt', kAudioFileStreamProperty_FormatList = 'flst', kAudioFileStreamProperty_MagicCookieData = 'mgic', kAudioFileStreamProperty_AudioDataByteCount = 'bcnt', kAudioFileStreamProperty_AudioDataPacketCount = 'pcnt', kAudioFileStreamProperty_MaximumPacketSize = 'psze', kAudioFileStreamProperty_DataOffset = 'doff', kAudioFileStreamProperty_ChannelLayout = 'cmap', kAudioFileStreamProperty_PacketToFrame = 'pkfr', kAudioFileStreamProperty_FrameToPacket = 'frpk', kAudioFileStreamProperty_PacketToByte = 'pkby', kAudioFileStreamProperty_ByteToPacket = 'bypk', kAudioFileStreamProperty_PacketTableInfo = 'pnfo', kAudioFileStreamProperty_PacketSizeUpperBound = 'pkub', kAudioFileStreamProperty_AverageBytesPerPacket = 'abpp', kAudioFileStreamProperty_BitRate = 'brat' }; It's the first time I've seen this - I assume the compiler assigns the 32-bit integer equivalent of the strings to the enum values. I cannot think of a single good reason why this might be preferred over using simple integers. It looks hideous in a debugger (how do you tell which of these values corresponds to 1919247481?) and makes debugging just hard in general. So, is there any reason where assigning such strings to enum values actually makes sense.

    Read the article

  • prefix and postfix increments while comparing variables

    - by miatech
    could someone explain why this code output is not equals not equals 2 in the first if statement it seems that a = 0 b/c is a postfix increment; therefore a will not increase untile next line; however, the two a's are not equal why? and in the second if when I run the debugger the value of a is 2, but the test is false, why? public static void main (String[] args) { int a = 0; if (a++ == a++) { System.out.println("equals"); } else { System.out.println("not equals"); } if (++a == 2) { System.out.println("equals 2"); } else { System.out.println("not equals 2"); } }

    Read the article

  • xcode storyboard reverting in compile

    - by darren
    I started having some very odd behaviour in Xcode 4.5 recently. I made a change to a UITableViewController with static cells but the changes did not appear in the simulator and neither did my code changes. I removed the app from the simulator and ran clean on the project, then started again and all the changes appeared. I made another code change, ran the debugger via simulator and once again I saw my old UITableViewController values and my code changes were absent. This project is using storyboards, but I am not sure if this problem is related to just storyboards given my code changes are reverted as well. I am deeply confused here. Not even clean fixed this issue. Any thoughts or suggestions?

    Read the article

  • Mongoose 3.1.0: Why the callback in the connection.db.dropDatabase(callback) is never called?

    - by Totty
    Code: var connection = mongoose.createConnection('mongodb://localhost:9000/' + databaseName); connection.db.dropDatabase(function(err){ // never reach this point! debugger; console.log(err); console.log('-------------->Dropped database: ' + databaseName); }); If I do connection.open it says that it's already opening and no multiple calls to "open" are supported for the same connection. Even this doesn't work var conn = mongoose.createConnection('mongodb://localhost',databaseName, 9000, {}, function(){ console.log('created'); // is reached conn.db.dropDatabase(callback); // but the callback is not called anyway }); What is the problem? ("mongoose": "3.1.0") thanks

    Read the article

  • Hit external url from code-behind

    - by Steven
    I have a form on my site. The user enters their e-mail and selects a location from a dropdown. I then need to post that data to an external site by hitting a url with the user's location and e-mail in the query string. I'm doing this like so: string url = "http://www.site.com/page.aspx?location=" + location.Text + "&email=" + email.Text; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); My client says that I am not hitting their server, but when going through the debugger, I'm getting a response from their server. I also tried tracking what was happening by using Firebug, and I noticed that there was no POST made to that external site. What am I doing wrong here?

    Read the article

  • UIViewController: setToolbarItems vs navigationItem

    - by Paul Sanwald
    my application has a UIViewController subclass which is being managed by a UINavigationController. In the viewDidLoad of my UIViewController subclass, I was attempting to add a UIBarButtonItem to the toolbar like this: settingsButton = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStylePlain target:self action:@selector(viewSettings:)]; [self setToolbarItems:[NSArray arrayWithObject:settingsButton]]; this wasn't working out for me, so after some googling around, I tried this: [[self navigationItem] setRightBarButtonItem:settingsButton]; which worked out fine. from reading the UIViewController documentation, I'm still confused about why setToolbarItems wasn't working. I verified in the debugger that the button was in the toolbarItems array in the viewDidAppear method. the button itself just wasn't appearing on my toolbar. so, my question is, why didn't setToolbarItems work for me in the first code snippet? I don't have the toolbar configured in my xib for this view controller at all, if that makes a difference.

    Read the article

  • How do I disable Hot Code Replace in Eclipse

    - by Xa6faiph
    HCR is failing alot more often than not for me at the moment. It keeps popping up the "Hot Code Replace Failed" dialog, over and over and over. I know there is a checkbox to shut it up, but later on when I'm doing something else I actually want the dialog to appear. Plus I don't want hot swapping code right now anyways, I just want the debugger. So is there a setting someplace for that "do not show dialog again" checkbox, for when I want to re-enable it? Better yet, is there a way to turn HCR on and off period? BTW, as far as I can tell disabling "Build Automatically" doesn't disable it.

    Read the article

  • Javascript - Function call will not enter function body

    - by Mike S
    I have a function acting as a constructor that, when called, gets as far as the function definition in the debugger, but never to the function body. Is there a common reason this may happen that I am overlooking? Example code below: myconstructor.js function MyConstructor(optionalParam) { //this breakpoint gets hit var newobj = {}; //breakpoint never hit //code to check for null parameter //other code }; main.js var myConstructor = new MyConstructor(); There must be something I have overlooked, but I can't see what that is. Neither firefox/firebug nor VS report errors or warnings. Thanks!

    Read the article

  • How to debug lost events posted from non-GUI thread in Qt?

    - by gp
    As the subject says, I'm posting events from non-GUI thread (some GStreamer thread, to be precise). Code looks like this: GstBusSyncReply on_bus_message(GstBus* bus, GstMessage* message, gpointer data) { bool ret = QMetaObject::invokeMethod(static_cast<QObject*>(data), "stateChanged", Qt::QueuedConnection); Q_ASSERT(ret); return GST_BUS_PASS; } The problem is, stateChanged (doesn't matter whether it is a slot or signal) is not called. I've stepped into QMetaObject::invokeMethod with debugger, followed it till it called PostMessage (it is Qt 4.6.2 on Windows, by the way) – everything seemed to be OK. Object pointed to by data lives in GUI thread, I've double-checked this. How can I debug this problem? Or, better, maybe sidestep it altogether?

    Read the article

  • What workflow should I use for JavaScript editing?

    - by Patrick
    Warning: I have very little JavsScript experience. In my past programming experience, I usually have a standalone interpreter/compiler, a text editor and a command line to compile/run my software or my tests (I love test driven development). I really like it this way, since I have the feeling of being in complete control over the tools. However, editing JavaScript I need to put statements in a text file , open my web browser and click on reload. I don't feel comfortable with it, as I cannot really see what is going on (besides some alert boxes). Can you suggest me (I'm on a Mac) another workflow? Perhaps with a debugger? Is there a standalone JavaScript interpreter?

    Read the article

  • Is dynamic evaluation of xpath variable string possible using .net 2.0 xslt implementation?

    - by Crocked
    Hi, I'm trying to evaluate an xpath varable I'm building dynamically based on the position of the node. I can create the xpath string in a variable but when I select the value of this just get the string and not the node set I need. I use the following to create the xpath <xsl:variable name="xpathstring" select="normalize-space(concat(&quot;//anAttribute[@key='pos&quot;,position(),&quot;']&quot;))"/> and try to output the value with the following. <xsl:value-of select="$xpathstring"/> If I execute the xpath in my debugger I get the nodeset but in my xml output only get the xpath string which looks like this //anAttribute[@key='pos1'] I had a look at exslt dyn:evaluate which seems to enable this but this seems to be only supported by certain processors and doesn't provide a standalone implementation or at least as far as I could see (currently using the standard .net 2.0 xslt whihc is only xslt 1.0 as far as I recall) Is there anyway to handle this without changing processor? Kind Regards, Crocked

    Read the article

  • Can we execute methods / code in XCcode just like in Visual Studio?

    - by balexandre
    Visual Studio is one of the best developer IDE of all times, and now was improved with multithreading debugging and much more. My question is regarding Xcode and the ability to execute code just like we do in Visual Studio. Let's assume an object in a view and I want to run, let's say: [pickerView setHidden:YES]; in a breakpoint just to see if in that break point I could actually hide the object. I can't find any place for this in the XCode Debugger Am I missing something or I can't execute code that is not in the files already? like in Visual Studio Watch List or Immediate Window

    Read the article

  • looping through object properties in actionscript

    - by asawilliams
    I have a dynamic class that I have created public dynamic class SiteZoneFileUploadVO { public var destination:String = "sitezone"; public var siteZoneId:uint; public var fileType:String; public var fileContents:String; public function SiteZoneFileUploadVO() { } } when I try to iterate over this object's properties it only iterates the dynamically added properties. parameters.dynVar= "value"; for(var name:String in parameters) { trace(name); } Even though the object has all the properties equal to a value (ive checked this in the debugger) the only property that will be traced is dynVar. How can I iterate over all the properties and not just the dynamically added ones?

    Read the article

  • looping through object property names in actionscript

    - by asawilliams
    I have a dynamic class that I have created public dynamic class SiteZoneFileUploadVO { public var destination:String = "sitezone"; public var siteZoneId:uint; public var fileType:String; public var fileContents:String; public function SiteZoneFileUploadVO() { } } when I try to iterate over this object's property names it only iterates the dynamically added properties. parameters.dynVar= "value"; for(var name:String in parameters) { trace(name); } Even though the object has all the properties equal to a value (ive checked this in the debugger) the only property name that will be traced is dynVar. How can I iterate over all the property names and not just the dynamically added ones?

    Read the article

  • Entity Framework: Attached Entities not Saving

    - by blog
    Hello: I can't figure out why calling SaveChanges() on the following code results in no changes to the objects I attached: // delete existing user roles before re-attaching if (accountUser.AccountRoles.Count > 0) { foreach (AccountRole role in accountUser.AccountRoles.ToList()) { accountUser.AccountRoles.Remove(role); } } // get roles to add List<int> roleIDs = new List<int>(); foreach (UserRole r in this.AccountRoles) { roleIDs.Add(r.RoleID); } var roleEntities = from roles in db.AccountRoles where roleIDs.Contains(roles.id) select roles; accountUser.AccountRoles.Attach(roleEntities); db.SaveChanges(); In the debugger, I see that the correct roleEntities are being loaded, and that they are valid objects. However, if I use SQL Profiler I see no UPDATE or INSERT queries coming in, and as a result none of my attached objects are being saved.

    Read the article

  • Javascript syntax error

    - by Mel
    Hello, I'm wondering if anyone can help me with a syntax error in line 14 of this code: The debugger says expected ')' after argument list on var json = eval('(' + content ')'); I tried adding a bracket, but it doesn't seem to be working. // Tooltips for index.cfm $(document).ready(function() { $('#catalog a[href]').each(function() { $(this).qtip( { content: { url: 'components/viewgames.cfc?method=fGameDetails', data: { gameID: $(this).attr('href').match(/gameID=([0-9]+)$/)[1] }, method: 'get' }, api: { beforeContentUpdate: function(content) { var json = eval('(' + content ')'); content = $('<div />').append( $('<h1 />', { html: json.TNAME })); return content; } }, }); }); });

    Read the article

  • regular expression on replace method of js not working

    - by user950146
    why this is not working var value = arr[row][col].replace(new RegExp('"', 'g'),'""'); Error : 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; Tablet PC 2.0) Timestamp: Tue, 10 Apr 2012 11:22:01 UTC Message: Object doesn't support this property or method Line: 1041 Char: 25 Code: 0 URI: http://example.com/? Message: Object doesn't support this property or method Line: 1041 Char: 25 Code: 0 URI: http://example.com/? Message: Object doesn't support this property or method Line: 1041 Char: 25 Code: 0 URI: http://example.com/? Note: : Error copied directly from debugger of IE8

    Read the article

  • set "Image File Execution Options" will always open the named exe file as default

    - by Weixiao.Fan
    just as this link says : http://untidy.net/blog/2009/11/03/replacing-notepad-with-pn-via-image-file-execution-options/ I wanna replace Notepad.exe to Notepad2.exe using "Image File Execution Options" function by run this command reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"c:\windows\Notepad2.exe\" /z" /f but, when I run notepad, it open file c:\windows\notepad.exe in notepad2.exe as a text file by default. Is there a way to avoid that? I know using this tech Notepad.exe will as the first param passed to Notepad2.exe. but I don't know how to avoid this :(

    Read the article

  • How to track down a Blue Screen of Death triggered by an (usermode) application

    - by mhenry1384
    We have a .Net application consisting of mixed managed and unmanaged code. We have a number of reports of users getting BSOD while using our application. These blue screens happen on different versions of Windows. Mostly XP but one user claims it happens on Windows 7. Some users see it happening when doing one thing, other see it happening when doing something completely different. Of course, we cannot reproduce the problem. Needless to say, I'm stumped. A user mode application shouldn't be able to blue screen the OS so we are running into a bug in a common kernel space application, perhaps buggy antivirus software? Does anyone have any tips on how to track something like this down? We don't have access to a computer where this is happening so we wouldn't be able to hook up a kernel debugger or anything like that.

    Read the article

  • networkstream always empty!

    - by ALEX
    hey I'm writing on an Server-Client program but when my client sends something, it never reaches my server! I'm sending like this: public void Send(string s) { char[] chars = s.ToCharArray(); byte[] bytes = chars.CharToByte(); nstream.Write(bytes, 0, bytes.Length); nstream.Flush(); } and Receiving in a background thread like this void CheckIncoming(object dd) { RecievedDelegate d = (RecievedDelegate)dd; try { while (true) { List<byte> bytelist = new List<byte>(); System.Threading.Thread.Sleep(1000); int ssss; ssss = nstream.ReadByte(); if (ssss > 1) { System.Diagnostics.Debugger.Break(); } if (bytelist.Count != 0) { d.Invoke(bytelist.ToArray()); } } } catch (Exception exp) { MSGBOX("ERROR:\n" + exp.Message); } } the ssss int is never 1 whats happening here???

    Read the article

  • JQuery not working in IE7/8

    - by user1665283
    I have been given the following code to implement: <script type="text/javascript"> $(document).ready(function(){ $('.hotspots a').bind('mouseover click', function() { $this = $(this); if($('.hotspot-target').data('hotspot')!=$this.attr('href')) { $('.hotspot-target').data('hotspot', $this.attr('href')); $('.hotspot-target').fadeOut(100, function() { $('.hotspot-target').css({backgroundImage: 'url('+$this.attr('href')+')'}); $('.hotspot-target .detail').hide(); $('.hotspot-target .detail.'+$this.attr('class')).show(); $('.hotspot-target').fadeIn(100); }); } return false; }) }); </script> It works fine in FF and Chrome with no errors in the console. I also can't see any errors in the IE debugger, though I'm not so used to how that works. Is there anything obviously wrong with the above code? It's placed at the end of the page

    Read the article

  • iPhone : Primitives getters and setters

    - by Burf2000
    I feel a bit miffed at the moment, I done a few iPhone projects that use floats and ints etc and all is fine. I now using OpenGL and GLFloat[] C arrays etc and it seems unless I make methods to set / get them it crashes on the device (not the simulator). Now as these are not setup as properties (I don't think c arrays can) it kind of makes sense. However the project has been working for months without them. It seems something in the code is wiping out anything float / ints to the point that the debugger can see an assigned value but accessing it crashes the phone. As soon as I think I know something for this platform, something changes my mind lol.

    Read the article

  • why gwt-user-1.7.0 contains Servlet API classes

    - by Anton S. Kraievoy
    Does anyone know any sane reason for such bundling decision? Google engineers act wisely in most cases, so this kinda surprized me. This would cause collisions with other versions of servlet API pulled via Maven dependencies: webapp classpath will likely contain version which is bundled with GWT; container may refuse to load the GWT jar as it contains the javax.servlet package; in most cases this will likely deviate classpaths across your IDE's debugger and the really executing VM. Link to the jar in question (just so you see the same thing after unzipping as I do): http://repo1.maven.org/maven2/com/google/gwt/gwt-user/1.7.0/gwt-user-1.7.0.jar

    Read the article

  • Jumping over a While loop in Debug mode

    - by BDotA
    Here is the scenario: I put a break point at the beginning of a method that I want to debug... at first lets say there is Part1 in this method that I want to step into/over some of the codes... good... after that there is a While loop that I am NOT interested to step into/over it, I just want to tell the debugger that Hey you yourself run this loop for 10 times and just let me move to Part2 of my code which starts after this While loop , is it possible to do this with debugging options? so something like this : BreakPoint : MyMethod { Part One of the code : Ok, lets debug it While Loop : I do not care, Do not want to debug it Part Two of the code: Yes, I want to debug it too }

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >