Search Results

Search found 1456 results on 59 pages for 'adam jimenez'.

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

  • LPVOID not recognized in C++/CLI

    - by Adam Haile
    I'm trying to use the following code to convert a native string to a managed string in C++\CLI: System::String^ NativeToDotNet( const std::string& input ) { return System::Runtime::InteropServices::Marshal::PtrToStringAnsi( (static_cast<LPVOID>)( input.c_str() ) ); } I originally found the code here: But when I try to build it throws the error: syntax error : identifier 'LPVOID' Any idea how to fix this?

    Read the article

  • Is it possible to write a class that interacts with controls on my WPF form?

    - by Adam S
    Hi all, I'm trying to write a class that I can use to interact with a group of similar controls in my wpf application. I have hit a few roadblocks and now I am wondering if this is a poor approach to begin with. I want to do this primarily to make my code more manageable - I have to interact with around 200 - 300 controls with my code, and it could get very tricky to have all my code in the main window class. Here's something I'd like to be able to do: class ProcControl { private CheckBox * [] Boxes = new CheckBox[10]; ProcControl() { //set boxes 0-9 to point to the actual checkboxes } //provides mass checking/unchecking functionality public void Refactor(CheckBox box) { //see what box it is int box_index = 0; while (Boxes[box_index] != box) { box_index++; } } } This doesn't work as it is right now. I have not figured out how to get my Boxes[] array to point to the actual checkboxes on my form, so I can't interact with them yet. Is it even possible to make an array that points to a bunch of controls so that I may process their properties in a nice manner? Why can't I access the controls at all from inside my class?

    Read the article

  • Input array is longer than the number of columns in this table

    - by Adam
    I've recently started to use SQLite and began to integrate it into a C# project I'm working on. However, randomly my project will throw the exception: Input array is longer than the number of columns in this table I'm having a hard time trying the trace the problem because it seems to be thrown on a random basis. DataTable table = new DataTable(); //exception is thrown here table = Global.db.ExecuteQuery("SELECT * FROM vm_manager"); Some of the data that gets returned from this query is as follows: http://i.imgur.com/9rlLN.png If anyone has any advice, I'd be grateful. EDIT: I'm unable to show the execute query function as it resides inside a dll from the following sql lite wrapper http://www.codeproject.com/KB/database/cs_sqlitewrapper.aspx

    Read the article

  • Select only items in a specific DIV using HtmlAgilityPack

    - by Adam Haile
    I'm trying to use the HtmlAgilityPack to pull all of the links from a page that are contained within a div declared as <div class='content'> However, when I use the code below I simply get ALL links on the entire page. This doesn't really make sense to me since I am calling SelectNodes from the sub-node I selected earlier (which when viewed in the debugger only shows the HTML from that specific div). So, it's like it's going back to the very root node every time I call SelectNodes. The code I use is below: HtmlWeb hw = new HtmlWeb(); HtmlDocument doc = hw.Load(@"http://example.com"); HtmlNode node = doc.DocumentNode.SelectSingleNode("//div[@class='content']"); foreach(HtmlNode link in node.SelectNodes("//a[@href]")) { Console.WriteLine(link.Value); } Is this the expected behavior? And if so, how do I get it to do what I'm expecting?

    Read the article

  • Implementing a Mutex Lock in C

    - by Adam
    I'm trying to make a really mutex in C and for some reason I'm getting cases where two threads are getting the lock at the same time, which shouldn't be possible. Any ideas why it's not working? void mutexLock(mutex_t *mutexlock, pid_t owner) { int failure; while(mutexlock->mx_state == 0 || failure || mutexlock->mx_owner != owner) { failure = 1; if (mutexlock->mx_state == 0) { asm( "test:" "movl $0x01,%%eax\n\t" // move 1 to eax "xchg %%eax,%0\n\t" // try to set the lock bit "mov %%eax,%1\n\t" // export our result to a test var "test %%eax,%%eax\n\t" "jnz test\n\t" :"=r"(mutexlock->mx_state),"=r"(failure) :"r"(mutexlock->mx_state) :"%eax" ); } if (failure == 0) { mutexlock->mx_owner = owner; //test to see if we got the lock bit } } }

    Read the article

  • What's the point of Mono on Windows

    - by Adam Haile
    This may be a dumb question...but I was just looking into the Mono project and they have a section about installing Mono on Windows. But, since Windows obviously already has the .NET runtime can anyone tell me what exactly is the point of having Mono for Windows? Does it help with cross platform development or something?

    Read the article

  • Rails How to get all the grandchildren of an ojbect.

    - by adam
    I have 3 models User has_many :quetions has_many :corrections end Question has_one :correction belongs_to :user end Correction belongs_to :user belongs_to :question So if user Bob asks a question then user Terry can check it and if its wrong offer a correction. Lets stay with bob and assume he as kindly corrected 5 other users, i.e and lets assume he has been lucky to get 3 corrections from other users. I want to be able to do something like this @bob.corrections_offered = 5 correction objects @bob.corrections_received = 3 correction objects the first one is easy as its really just @bob.corrections under the hood. But i dont know how to implement the latter one. Can anyone help?

    Read the article

  • How should I implement lazy session creation in PHP?

    - by Adam Franco
    By default, PHP's session handling mechanisms set a session cookie header and store a session even if there is no data in the session. If no data is set in the session then I don't want a Set-Cookie header sent to the client in the response and I don't want an empty session record stored on the server. If data is added to $_SESSION, then the normal behavior should continue. My goal is to implement lazy session creation behavior of the sort that Drupal 7 and Pressflow where no session is stored (or session cookie header sent) unless data is added to the $_SESSION array during application execution. The point of this behavior is to allow reverse proxies such as Varnish to cache and serve anonymous traffic while letting authenticated requests pass through to Apache/PHP. Varnish (or another proxy-server) is configured to pass through any requests without cookies, assuming correctly that if a cookie exists then the request is for a particular client. I have ported the session handling code from Pressflow that uses session_set_save_handler() and overrides the implementation of session_write() to check for data in the $_SESSION array before saving and will write this up as library and add an answer here if this is the best/only route to take. My Question: While I can implement a fully custom session_set_save_handler() system, is there an easier way to get this lazy session creation behavior in a relatively generic way that would be transparent to most applications?

    Read the article

  • Rounded corners?

    - by adam
    When converting PSD's into html or even html5 and css, how much more difficult is it to round the corners and make those corners consistent across all browsers especially IE. Assuming the corners were rounded with code not images.

    Read the article

  • google maps api v2 - tens of thousands of markers

    - by Adam
    Hello, my problem is with XXk (aka XX000) markers, atm I have 7k markers and will be more, and more, problem is in marker database, because atm this is 4MB (link to my DB http://tinyurl.com/ybau9ce) and problem is, how load that fast? for example DOWNLOAD only this what are show now, DOWNLOAD because load I have with ClusterMarker and problem is not with java but with download that database I think...

    Read the article

  • iPhone Text entry with completion and DONE button (not search)

    - by Adam Jack
    Using iPhone SDK 3.0, I wish to allow text entry with (optional) completion options that appear as typing is occurring, i.e. also allowing freeformat entry. As such I am using a UISearchBar (which has the text change events) and a UISearchDisplayController to present options. The problems is I want the DONE button to say DONE and not SEARCH, however I cannot find a way to set that. Clearly I feel I am missing something, or Interface Builder of the SDK API would have some property to set. I have seen other apps (in the store) that have achieved the result I want (free format entry, completion, DONE button) so maybe there is an alternative approach I am missing. Thanks in advance for any pointers.

    Read the article

  • NSOpenGLView resize on window resize

    - by ADAM
    I have a class called ModelView which inherits from NSOpenGLView. When my program runs i attach the ModelView as follows to the main window. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application ModelView *glView; NSRect glViewRect = CGRectMake(0.0f, 0.0f, window.frame.size.width, window.frame.size.height); glView = [[ModelView alloc] initWithFrame: glViewRect]; [[window contentView] addSubview:glView]; } In my ModelView class i have a reshape function which is firing every time the window resizes - (void)reshape { [super setNeedsDisplay:YES]; [[self openGLContext] update]; NSLog(@"reshap function called"); } I want to get the main window width so i can resize the ModelView but i cant find how to get the window width from the ModelView class I am reasonably new to cocoa/objective-c Any help appreciated

    Read the article

  • Storing ASP.Net MVC Views in the Database

    - by Adam Albrecht
    For an ASP.Net MVC application, I'm interested in storing some views and/or partial views in the database so that a few semi-technical users can do some basic view logic. Does anyone have any tips or lessons from experience on doing this? I know Phil Haack wrote a blog post on this about a year ago. He used IronRuby for scripting his views, (which would be fine for me). He created a quick proof-of-concept, but I can't find any other information on the topic. Any ideas, thoughts, tips, etc would be appreciated. Thanks!

    Read the article

  • IVsEditorAdaptersFactoryService.CreateVsTextViewAdapter throws an object null reference

    - by Adam Driscoll
    I'm trying to create a IVsTextViewAdpater with the IVsEditorAdaptersFactoryService but when I call CreateVsTextViewAdapter it throws an object null reference: var editorFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>(); var serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)this; var view = editorFactory.CreateVsTextViewAdapter(serviceProvider); 'this' is a Microsoft.VisualStudio.Shell.Package implementation. Any ideas?

    Read the article

  • Handling incremental Data Modeling Changes in Functional Programming

    - by Adam Gent
    Most of the problems I have to solve in my job as a developer have to do with data modeling. For example in a OOP Web Application world I often have to change the data properties that are in a object to meet new requirements. If I'm lucky I don't even need to programmatically add new "behavior" code (functions,methods). Instead I can declarative add validation and even UI options by annotating the property (Java). In Functional Programming it seems that adding new data properties requires lots of code changes because of pattern matching and data constructors (Haskell, ML). How do I minimize this problem? This seems to be a recognized problem as Xavier Leroy states nicely on page 24 of "Objects and Classes vs. Modules" - To summarize for those that don't have a PostScript viewer it basically says FP languages are better than OOP languages for adding new behavior over data objects but OOP languages are better for adding new data objects/properties. Are there any design pattern used in FP languages to help mitigate this problem? I have read Phillip Wadler's recommendation of using Monads to help this modularity problem but I'm not sure I understand how?

    Read the article

  • Get content of XML node using c#

    - by Adam S
    Hi all, simple question but I've been dinking around with it for an hour and it's really starting to frustrate me. I have XML that looks like this: <TimelineInfo> <PreTrialEd>Not Started</PreTrialEd> <Ambassador>Problem</Ambassador> <PsychEval>Completed</PsychEval> </TimelineInfo> And all I want to do is use C# to get the string stored between <Ambassador> and </Ambassador>. So far I have: XmlDocument doc = new XmlDocument(); doc.Load("C:\\test.xml"); XmlNode x = doc.SelectSingleNode("/TimelineInfo/Ambassador"); which selects the note just fine, now how in the world do I get the content in there?

    Read the article

  • Placing a library part using the Revit Api

    - by ADAM
    I am using the revit api to import a family symbol. The code below is working however it loads the family into revit, and then you have to manually drag it from the familys tree or insert using the relevant family tool. Document document = commandData.Application.ActiveDocument; document.LoadFamilySymbol(fileName, name, out gotSymbol); How do i get it to the point where it is asking the user where they want it placed? (similar to when you click "load into project" when you are editing a family) so they dont have to drag it from the familys tree

    Read the article

  • WPF Binding Collection To ComboBox and Selecting an item

    - by Adam Driscoll
    I've been knocking my head against this for some time now. I'm not really sure why it isn't working. I'm still pretty new to this whole WPF business. Here's my XAML for the combobox <ComboBox Width="200" SelectedValuePath="Type.FullName" SelectedItem="{Binding Path=Type}" Name="cmoBox" > </ComboBox> Here's what populates the ComboBox (myAssembly is a class I created with a list of possible types) cmoBox.ItemsSource = myAssembly.PossibleTypes; I set the DataContext in a parent element of the ComboBox in the code behind like this: groupBox.DataContext = listBox.SelectedItem; I want the binding to select the correct "possible type" from the combo box. It doesn't select anything. I have tried SelectedValue and SelectedItem. When I changed the DisplayMemberPath of the ComboBox to a different property it changed what was displayed so I know it's not completely broken. Any ideas???

    Read the article

  • Help with a Join in Rails 3

    - by Adam Albrecht
    I have the following models: class Event < ActiveRecord::Base has_many :action_items end class ActionItem < ActiveRecord::Base belongs_to :event belongs_to :action_item_type end class ActionItemType < ActiveRecord::Base has_many :action_items end And what I want to do is, for a given event, find all the action items that have an action item type with a name of "foo" (for example). So I think the SQL would go something like this: SELECT * FROM action_items a INNER JOIN action_item_types t ON a.action_item_type_id = t.id WHERE a.event_id = 1 AND t.name = "foo" Can anybody help me translate this into a nice active record query? (Rails 3 - Arel) Thanks!

    Read the article

  • python dict update diff

    - by adam
    Does python have any sort of built in functionality of notifying what dictionary elements changed upon dict update? For example I am looking for some functionality like this: >>> a = {'a':'hamburger', 'b':'fries', 'c':'coke'} >>> b = {'b':'fries', 'c':'pepsi', 'd':'ice cream'} >>> a.diff(b) {'c':'pepsi', 'd':'ice cream'} >>> a.update(b) >>> a {'a':'hamburger', 'b':'fries', 'c':'pepsi', 'd':'ice cream'} I am looking to get a dictionary of the changed values as shown in the result of a.diff(b)

    Read the article

  • Rails - How do I write this string condition as an array condition

    - by adam
    named_scope :correct, :include => :correction, :conditions => "checked_at IS NOT NULL AND corrections.id IS NULL" On a side note I have googled loads and looked through books but i cant seem to find a list of all the various types of conditions you can use and how they differ when implenting them as strings, arrays or hashes. Is there a list of the syntax anywhere?

    Read the article

  • Rails - Associations - Automatically setting an association_id for a model which has 2 belongs_to

    - by adam
    I have 3 models class User < ... belongs_to :language has_many :posts end class Post < ... belongs_to :user belongs_to :language end class Language < ... has_many :users has_many :posts end Im going to be creating lots of posts via users and at the same time I have to also specify the language the post was written in, which is always the language associatd with the user i.e. @user.posts.create(:text => "blah", :language_id => @user.language_id) That's fine but the way I set the language doesn't sit well with me. The language will always be that of the users so is there a 'best-practice' way of doing this? I know a little about callbacks and association extensions but not sure of any pitfalls.

    Read the article

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