Search Results

Search found 328 results on 14 pages for 'samuel clay'.

Page 11/14 | < Previous Page | 7 8 9 10 11 12 13 14  | Next Page >

  • Returning C++ objects from Windows DLL

    - by R Samuel Klatchko
    Due to how Microsoft implements the heap in their non-DLL versions of the runtime, returning a C++ object from a DLL can cause problems: // dll.h DLL_EXPORT std::string somefunc(); and: // app.c - not part of DLL but in the main executable void doit() { std::string str(somefunc()); } The above code runs fine provided both the DLL and the EXE are built with the Multi-threaded DLL runtime library. But if the DLL and EXE are built without the DLL runtime library (either the single or multi-threaded versions), the code above fails (with a debug runtime, the code aborts immediately due to the assertion _CrtIsValidHeapPointer(pUserData) failing; with a non-debug runtime the heap gets corrupted and the program eventually fails elsewhere). Two questions: Is there a way to solve this other then requiring that all code use the DLL runtime? For people who distribute their libraries to third parties, how do you handle this? Do you not use C++ objects in your API? Do you require users of your library to use the DLL runtime? Something else?

    Read the article

  • Are folks using the VB6 "Common Controls Replacement Project" controls? Any caveats or showstoppers?

    - by Clay Nichols
    I'm considering using the VB6 Common Controls Replacement Project controls and would like to see what other's experiences with them are. Specifically: What do you need to distribute with them? (I assume just the .OCX file) Do I need to register the .ocx file or just include in the app directory? Do these controls depend on any other ocx's? (There is mention, for example in the Progress Bar replacement that it is using COMCTL32.DLL but the .DEP file does not list that DLL. Are they at least as robust as the controls they replace?

    Read the article

  • Do you ever make a code change and just test rather than trying to fully understand the change you'v

    - by Clay Nichols
    I'm working in a 12 year old code base which I have been the only developer on. There are times that I'll make a a very small change based on an intuition (or quantum leap in logic ;-). Usually I try to deconstruct that change and make sure I read thoroughly the code. However sometimes, (more and more these days) I just test and make sure it had the effect I wanted. (I'm a pretty thorough tester and would test even if I read the code). This works for me and we have surprisingly (compared to most software I see) few bugs escape into the wild. But what I'm wondering is whether this is just the "art" side of coding. Yes, in an ideal world you would exhaustively read every bit of code that your change modified, but I in practice, if you're confident that it only affects a small section of code, is this a common practice? I can obviously see where this would be a disastrous approach in the hands of a poor programmer. But then, I've seen programmers who ostensibly are reading the code and break stuff left and right (in their own code based which only they have been working on).

    Read the article

  • how to structure code that uses std::rel_ops

    - by R Samuel Klatchko
    I was working on some code and wanted to make use of std::rel_ops. From what I can tell, you need to do using std::rel_ops to your source code to make use of them. But I'm not sure where the best place to put that is. Let's say I have a header file with a class that only defines the minimal operator== and operator<: // foo.h class foo { public: bool operator==(const foo &other) const; bool operator<(const foo &other) const; }; I'm not sure where to put using std::rel_ops. If I leave it out of the foo.h, then every user of foo.h needs to know the implementation detail that foo is not defining all the operators itself. But putting using std::rel_ops inside foo.h breaks the rule of thumb about not having a using in a header file. How do other people resolve this issue?

    Read the article

  • Any benefits of using Windows Communication Foundation/ Web Services vs. a simple .aspx page for s

    - by Clay Nichols
    I'm working on a VB6 app that will do some very simple communication with a web server (passing value and getting back an anwer. Low bandwith and infrequent use). Someone suggested using WCF or Web Services. I'm wondering what the advantages are vs. just posting to an ASPX page like: Myserver.com/Functions.ASP?FunctionName=GetValue?UserName=BubbGump and returning some simple, easy to parse text, like one value per line.

    Read the article

  • user specifc maven settings in repository

    - by Samuel
    http://maven.apache.org/settings.html As per documentation the user specific settings can be either copied to the .m2 folder or under the maven installation. If a developer changes a machine or gets a new user id, such properties have to be copied manually to these newer machines. Would it be possible to store user specific setting information in the repository itself (say SVN) and somehow have the mvn scripts load it on startup.

    Read the article

  • how to selectively filter items in a collection

    - by Samuel
    I use the following snippet to filter the list of selected users, where isSelected is a boolean variable. Is there a simpler way (helper function) to populate the selectedUsers collection instead of writing the following lines of code. List<User> selectedUsers = new ArrayList<User>(0); for (User user : this.getUsers()) { if (user.isSelected()) { selectedUsers.add(user.getId()); } }

    Read the article

  • strstr whole string match

    - by clay
    I'm trying to match the whole string and not just part of it. For instance, if the needle is 2, I would like to match just the string 2 and not 20, 02, or 22 or anything related. I'm using strstr as: #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { FILE *file; char l[BUFSIZ]; int linenumber = 1; char term[6] = "2"; file = fopen(argv[1], "r"); if(file != NULL) { while(fgets(l, sizeof(l), file)){ if(strstr(l, term) != NULL) { printf("Search Term Found at %d!\n", linenumber); } ++linenumber; } } else { perror(argv[1]); } fclose(file); return 0; }

    Read the article

  • Getting full path for Windows Service

    - by Samuel Kim
    How can I find out the folder where the windows service .exe file is installed dynamically? Path.GetFullPath(relativePath); returns a path based on C:\WINDOWS\system32 directory. However, the XmlDocument.Load(string filename) method appears to be working against relative path inside the directory where the service .exe file is installed to.

    Read the article

  • VB6 code for Reading/Writing Windows Registry values

    - by Clay Nichols
    I'm looking for a good example of reading and writing to the Windows Registry using VB6. Yes, I know there are lots of mediocre examples. I spent an hour googling and testing. Some were incredibly complex, others had only some of the functions, and almost none of it had been vetted in any way (voted on). Since Stack Overflow is intended to the canonical location for answers to programming questions, it seems reasonable to post it here.

    Read the article

  • Problems with Backbone.Model callback and THIS

    - by Rev. Samuel
    I'm building a simple weather widget. The current weather conditions are read out of the National Weather Service xml file and then I want to parse and store the relevant data in the model but the callback for the $.ajax won't connect (the way I'm doing it). var Weather = Backbone.Model.extend({ initialize: function(){ _.bindAll( this, 'update', 'startLoop', 'stopLoop' ); this.startLoop(); }, startLoop: function(){ this.update(); this.interval = window.setInterval( _.bind( this.update, this ), 1000 * 60 * 60 ); }, stopLoop: function(){ this.interval = window.clearInterval( this.interval ); }, store: function( data ){ this.set({ icon : $( data ).find( 'icon_url_name' ).text() }); }, update: function(){ $.ajax({ type: 'GET', url: 'xml/KROC.xml', datatype: 'xml' }) .done( function( data ) { var that = this; that.store( $( data ).find( 'current_observation' )[ 0 ] ); }); } }); var weather = new Weather(); The data is read correctly but I can't get the done function of the call back to call the store function. (I would be happy if the "done" would just parse and then do "this.set". Thanks in advance for your help.

    Read the article

  • user height and weight in sql

    - by Samuel
    We are planning to capture a user's height and weight and am looking for ideas on representing them in sql. I have the following questions in mind weight can be expressed in kilograms and grams and height in meters and centimeters, so should I capture them as a BigDecimal with an appropriate precision and scale or capture them as vanilla strings and do the manipulation in the user interface. Note: I am planning to capture the kilograms and grams separately in the user interface. should the metric of measurement be part of the sql (i.e. the end user might want to view this information in pounds, inches according to his preference) OR Should I just support kilograms / meters in the database and do the conversion while showing this in the user interface

    Read the article

  • How to undelete from the SVN Repository

    - by Clay Nichols
    I accidentally deleted a major folder inside of the Tortoise-SVN Repro Browser. The working folder is unaffected. What is the recommended way to reverse that? Do I just Revert back to the previous version? Or do I need to do a Checkout to that previous version into a new folder and delete the old folder?

    Read the article

  • Is there a way to extract the message from a JavaScript dialog in Chrome?

    - by Samuel
    I’ve been working on an extension for automating tests in Chrome, and I came across an obscure issue with JavaScript dialogs. The message shown in the dialog can’t be readily retrieved/copied. I’ve used the GetWindowText and InternalGetWindowText functions, but they only return the title of the dialog and the text from the buttons, not the actual message itself. I even looked at programs that extract text from forms, but no luck. So does anyone know of a way to retrieve the text from these JavaScript dialogs in Chrome?

    Read the article

  • Suggestions/pointers for Post/Get to an .ASP (or .ASPX) page from a desktop app

    - by Clay Nichols
    I'm planning to have a desktop app interact with some .ASP or .ASPX pages on a server. I've only done a little bit with .asp pages and I'm thinking I'd just Post or Get a URL with some variables: MySite.com/Functions.asp?FunctionName=?Paramater1=somevalue?Parameter2=... I'm wondering if there is any better way to go about this? Am I missing something? Is there perhaps a better way to go about this?

    Read the article

  • How to enforce lazy loading of entities on certain conditions

    - by Samuel
    We have an JPA @Entity class (say User) which has a @ManyToOne reference (say Address) loaded using the EAGER option which in turn loads it's own @ManyToOne fields (say Country) in a EAGER fashion. We use the EntityQuery interface to count the list of User's based on a search criteria, during such a load all the @ManyToOne fields which have been marked as EAGER get loaded. But in order to perform a EntityQuery.resultCount(), I actually don't need to load the @ManyToOne fields. Is there a way to prevent loading of the EAGER fields in such cases so that we can avoid the unnecessary joins?

    Read the article

  • Which is the best java driver for mongodb access?

    - by Samuel
    I have no experience with MongoDB and we are trying to port a JPA application to be based on MongoDB. There are 3 drivers mentioned for porting java here. Which driver would be the easiest to use for converting my existing JPA application? Would it be morphia, mungbean or daybreak. Would prefer some practical experiences with users who have gone through this path before.

    Read the article

  • How to find the class object of Java generic type?

    - by Samuel Yung
    Assume I have a generic type P which is an Enum, that is <P extends Enum<P>>, and I want to get the Enum value from a string, for example: String foo = "foo"; P fooEnum = Enum.valueOf(P.class, foo); This will get a compile error because P.class is invalid. So what can I do in order to make the above code work?

    Read the article

  • Accessing property of object vs variable in javascript

    - by Samuel
    Why when I try to access a variable that don't exist, javascript throw an exception but when I try to access a property that don't exist in an object, javascript returns an undefined object? For example, this case returns an undefined object: function Foo(){ console.log(this.bar); } Foo(); But, in this other example, javascript throw an exception: function Foo(){ console.log(bar); } Foo(); ReferenceError: bar is not defined

    Read the article

  • Can anyone tell why Wordpress is adding this p tag?

    - by Elliott Samuel Lemberger
    Here's the page: http://www.gammagoochee.com/media/ WP is adding a p tag on line 55 between the end of my header and the beginning of my post content. I am using Raw HTML Pro, and the post starts with content surrounded by [raw] tags. There is no content between the last tag in my header, and the beginning of my post. This doesn't happen on my other site pages, and the only difference is that this page is using a template, but the template is the same in this part of the page. All the template does differently than the other site pages is add a sidebar. Anyone have any ideas whatsoever why WP is adding this p tag, and/or how I can prevent it? Thanks so much!

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14  | Next Page >