Search Results

Search found 3177 results on 128 pages for 'david murrant'.

Page 106/128 | < Previous Page | 102 103 104 105 106 107 108 109 110 111 112 113  | Next Page >

  • C# Passing objects and list of objects by reference

    - by David Liddle
    I have a delegate that modifies an object. I pass an object to the delegate from a calling method, however the calling method does not pickup these changes. The same code works if I pass a List as the object. I thought all objects were passed by reference so any modifications would be reflected in the calling method? I can modify my code to pass a ref object to the delegate but am wondering why this is necessary? public class Binder { protected delegate int MyBinder<T>(object reader, T myObject); public void BindIt<T>(object reader, T myObject) { //m_binders is a hashtable of binder objects MyBinder<T> binder = m_binders["test"] as MyBinder<T>; int i = binder(reader, myObject); } } public class MyObjectBinder { public MyObjectBinder() { m_delegates["test"] = new MyBinder<MyObject>(BindMyObject); } private int BindMyObject(object reader, MyObject obj) { //make changes to obj in here } } ///calling method in some other class public void CallingMethod() { MyObject obj = new MyObject(); MyBinder binder = new MyBinder(); binder.BindIt(myReader, obj); //don't worry about myReader //obj should show reflected changes }

    Read the article

  • Access to and availability of private member functions in C++

    - by David
    I am wandering the desert of my brain. I'm trying to write something like the following: class MyClass { // Peripherally Related Stuff public: void TakeAnAction(int oneThing, int anotherThing) { switch(oneThing){ case THING_A: TakeThisActionWith(anotherThing); break; //cases THINGS_NOT_A: }; }; private: void TakeThisActionWith(int thing) { string outcome = new string; outcome = LookUpOutcome(thing); // Do some stuff based on outcome return; } string LookUpOutcome(int key) { string oc = new string; oc = MyPrivateMap[key]; return oc; } map<int, string> MyPrivateMap; Then in the .cc file where I am actually using these things, while compiling the TakeAnAction section, it [CC, the solaris compiler] throws an an error: 'The function LookUpOutcome must have a prototype' and bombs out. In my header file, I have declared 'string LookUpOutcome(int key);' in the private section of the class. I have tried all sorts of variations. I tried to use 'this' for a little while, and it gave me 'Can only use this in non-static member function.' Sadly, I haven't declared anything static and these are all, putatively, member functions. I tried it [on TakeAnAction and LookUp] when I got the error, but I got something like, 'Can't access MyPrivateMap from LookUp'. MyPrivateMap could be made public and I could refer to it directly, I guess, but my sensibility says that is not the right way to go about this [that means that namespace scoped helper functions are out, I think]. I also guess I could just inline the lookup and subsequent other stuff, but my line-o-meter goes on tilt. I'm trying desperately not to kludge it.

    Read the article

  • populating a gridview with a button's click event

    - by david padi
    hi I have a page that has two dropdownlists(one for the locations, and the other for departments), an employee search textbox and a button. On the other page, I have a gridview. Now, what i want to archieve is that when a user types an employee's name in the textbox control, selects a location from the location dropdownlist, and a department from the departments dropdownlist, and click the button(search), the gridview on the other page must show the reqiured information of a SINGLE employee. Only one row must show. I have created a database for the employees. I know how to do this with the autopostback but i have not tried it using a button's click. NB: the gridview should show only one row of a selected employee. I'm using ASP.NET VB Your help will high apprecaited.

    Read the article

  • Continue Drupal processing after page send.

    - by David
    I need to do some additional processing after a Drupal page has been sent. I know I could fire a background shell command, but I need the current Drupal execution context to be maintained. I've spent a lot of time looking, but I can't find any documentation in this regard. This is surprising because it must surely be a common requirement. The only real idea I have is to fire up Drupal (again) via a shell command (exec, etc) and supply it with a pseudo path which would invoke the continued processing. But this seems unnecessarily complex/wasteful. Any pointers greatly appreciated, tks.

    Read the article

  • How facebook extracts the right thumbnail of a link?

    - by David
    Hi, I'm wondering how facebook extracts the right picture of the article from a link? they ignore any icons, ads images, or other not related images, & they gives you the right image? What technique/method they use? because i've tried to extract all images using a php regex but how to find the right one? Thanks

    Read the article

  • draw a curve Sketchup using ruby

    - by David
    Below are some point 3d 15.733798,20.019757,23.006311 15.733798,19.847666,23.006311 15.723798,19.847666,23.006311 15.723798,20.019757,23.006311 15.733798,20.019757,23.006311 and this is a vector 0.0,0.0,-0.1 Is it possible to draw a curve from the information above in sketchup? Thank you

    Read the article

  • C++ hook process and show status

    - by David
    Ok so I am learning C++ slowly. I am familiar with all the console syntax and everything, but now I'm moving on to windows programming. Now what im trying to do, is create a DLL that I inject into a process, so it's hooked in. All I want the C++ application to do, is have text in it, that says "Hooked" if it's successfully injected, and an error if something wrong happened. Or even if I can do it without a DLL, Just open an executable, and when the certain process I'm trying to hook is opened, the status is changed to "Hooked". Also I have a safaribooksonline.com account so if there is any good reads you would recommend, just write it down. thanks

    Read the article

  • iPhone SDK File Handler with iOS 4 Background Processes

    - by David Higgins
    The "application:applicationDidFinishLaunchingWithOptions:" message does not get called when an application is sitting in the background in iOS 4, and I'm trying to figure out how to be notified when the application is brought back into the foreground by another application. My application registers itself as a handler for certain file types, and Safari and other supported applications allow passing the files over to my app. This works great if the app is closed before I try to use it, but fails otherwise. In my application:applicationDidFinishLaunchingWithOptions: I have: NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey]; if([url isFileURL]) { } [self.window makeKeyAndVisible]; return YES; As stated already, this works great so far for starting the app when it's not sitting in the background - but when I switch back over to Safari or Mail and try to open a new file that is supported, my application wakes up from the background and becomes active again but I can't see any "withOptions" overrides for application:applicationWillEnterForeground: or any way to identify what was passed in when it enters the foreground. What would be the appropriate way to receive these "open file notifications" when the application is in the background?

    Read the article

  • Regular Expression Program

    - by david robers
    Hi I have the following text: SMWABCCA ABCCAEZZRHM NABCCAYJG XABCCA ABCCADK ABCCASKIYRH ABCCAKY PQABCCAK ABCCAKQ This method takes a regex in out by the user and SHOULD print out the Strings it applies to but seems to print out something completely different: private void matchIt(String regex) { Pattern p = Pattern.compile(regex); Matcher m = null; boolean found = false; for(int i = 0; i < data.length; i++){ m = p.matcher(data[i]); if(m.find()){ out.println(data[i]); found = true; } } if(!found){ out.println("Pattern Not Found"); } } When inputting "[C]" It outputs: SMWABCCA ABCCAEZZRHM NABCCAYJG XABCCA ABCCADK ABCCASKIYRH ABCCAKY PQABCCAK ABCCAKQ Any ideas why? I think I'm using m.find() improperly...

    Read the article

  • how to check if a data exist on a table using hibernate

    - by David
    im using hibernate with my jsp page and mySQL ,how can i do that select * from student wher userName = *** with HQL and how i chek if that username exist in 'Student' table ? in my sql i use that ResultSet resultat = statement.executeQuery(); if (resultat.next()) { ....} i try this Session hibernateSession = MyDB.HibernateUtil.currentSession(); hibernateSession.find("select xxx from Etudinat where p.Nom=xxxx"); thats give an exception so how can i do that ? i have a login form send me a username and password i want to chek if that username exist in the table Student to set the user on a session what is the safty way to do that

    Read the article

  • How to change word recognition in vim spell?

    - by David
    I like that vim 7.0 supports spell checking via :set spell, and I like that it by default only checks comments and text strings in my C code. But I wanted to find a way to change the behavior so that vim will know that when I write words containing underscores, I don't want that word spell checked. The problem is that I often will refer to variable or function names in my comments, and so right now vim thinks that each piece of text that isn't a complete correct word is a spelling error. Eg. /* The variable proj_abc_ptr is used in function do_func_stuff' */ Most of the time, the pieces seperated by underscores are complete words, but other times they are abbreviations that I would prefer not to add to a word list. Is there any global way to tell vim to include _'s as part of the word when spell checking?

    Read the article

  • illigal start of type error (java).

    - by David
    here is the relevent code snippet: public static Rand searchCount (int[] x) { int a ; int b ; int c ; int d ; int f ; int g ; int h ; int i ; int j ; Rand countA = new Rand () ; for (int l= 0; l<x.length; l++) { if (x[l] = 0) a++ ; else if (x[l] = 1) b++ ; } } return countA ; } (Rand is the name of the class that this method is in) when compiling it get this error message: Rand.java:77: illegal start of type return countA ; ^ what's going wrong here? what does this error message mean?

    Read the article

  • AllowSetForegroundWindow & SetForegroundWindow: NPAPI plug-in wants to allow a desktop application with no success

    - by David Robert Jones
    Here it's what I have: a web browser plug-in written in C++ and a Windows application written in C#. They communicate through a named pipe. The plug-in instructs the C# application to open a file (suppose that the file is a .txt and it opens in Notepad). Once the C# application is given the command, it opens the file but Notepad doesn't show in the foreground, which isn't acceptable, I must open Notepad in the foreground. I modified the C# application so that it calls the SetForegroundWindow function. This time Notepad didn't open in the foreground, but the taskbar flashes. After reading the documentation for SetForegroundWindow and many articles I think that now I understand what the problem is: the C# application can't bring Notepad to the foreground because it wasn't the the foreground process, the browser was (?). After reading this: "A process that can set the foreground window can enable another process to set the foreground window by calling the AllowSetForegroundWindow function." I decided to modify the plug-in. This time the plug-in calls the AllowSetForegroundWindow function passing ASFW_ANY as a parameter (I know, ASFW_ANY could be risky, but I wanted to make sure that AllowSetForegroundWindow would do it). After I did the modification to the plug-in I tested it and it worked! (Opera 12.02). Then I tested it on Internet Explorer and it worked too. But the problem came when I tested it in Firefox and Chrome. The C# application didn't have the ability to bring Notepad to the foreground. I noticed that for those browsers the AllowSetForegroundWindow function was returning false. So I started investigating and I come to the conclusion that maybe it's because the plugin container that Firefox uses. An idea came to my mind: it worked in Opera 12.02, but they don't have a plugin container, although they did in Opera 12.00. So I downloaded Opera 12.00, I did the test and it failed, which makes me conclude that the plugin container is the culprit. The question is: how can I give to the C# application the ability to set foreground? I don't know how to continue, and I think that I tried all the legitimate ways. The AllowSetForegroundWindow & SetForegroundWindow seems to not apply here.

    Read the article

  • enable TCP in SQL server 2005 express edition

    - by david
    Hello, sorry for answer but how to enable TCP in SQL server 2005 express edition? I used configuration manager, find network configuration/protocols and there enabled TCP, after that I have restarted sql server service and tried installation of problematic software again (software which told me that TCP is not enabled) but I have the same problem :-(

    Read the article

  • How to avoid lost calls to an external JS file before loading it.

    - by David
    Hi, My issue is that multiple websites are going to include my JS file and when calling something like this: <script src="..."></script> hello.say("yay"); there going to be a race issue so sometimes it could make it sometimes not. i know that i can solve that easily by putting every function in a window.onload but that wouldn't be clean as i've seen other websites magically solve that like google analytics: .. Calling google analytics JS.. <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); <-- this an object ! pageTracker._trackPageview(); } catch(err) {} </script> How to do that?

    Read the article

  • MySQL Integer vs DateTime index

    - by David Kuridža
    Let me start by saying I have looked at many similar questions asked, but all of them relate to Timestamp and DateTime field type without indexing. At least that is my understanding. As we all know, there are certain advantages when it comes to DateTime. Putting them aside for a minute, and assuming table's engine is InnoDB with 10+ million records, which query would perform faster when criteria is based on: DateTime with index int with index In other words, it is better to store date and time as DateTime or UNIX timestamp in int? Keep in mind there is no need for any built-in MySQL functions to be used.

    Read the article

  • syntax problem crating a method that returns an object (java)

    - by David
    I'm trying to create a method that will sum two timeO objects and return a new TimeO object called sum. Here is the relevant code snippet: public static TimeO add (TimeO t1, TimeO t2) { TimeO sum = new TimeO ; ... } When i try to compile it i get this error message: TimeO.java:15: '(' or '[' expected TimeO sum = new TimeO ; ^ 1 error i cant think of any reason why it would want me to open a set of parenthasies or brackets here but its possible that i dont' quite understand the syntax. Whats going wrong here?

    Read the article

  • Java: "cannot find symbol" error of a String[] defined within a while-loop

    - by David
    Here's the relevant code: public static String[] runTeams (String CPUcolor) { boolean z = false ; //String[] a = new String[6] ; boolean CPU = false ; while (z == false) { while (CPU==false) { String[] a = assignTeams () ; printOrder (a) ; for (int i = 1; i<a.length; i++) { if (a[i].equals(CPUcolor)) CPU = true ; } if (CPU==false) { System.out.println ("ERROR YOU NEED TO INCLUDE THE COLOR OF THE CPU IN THE TURN ORDER") ; } } System.out.println ("is this turn order correct? (Y/N)") ; String s = getIns () ; while (!((s.equals ("y")) || (s.equals ("Y")) || (s.equals ("n")) || (s.equals ("N")))) { System.out.println ("try again") ; s = getIns () ; } if (s.equals ("y") || s.equals ("Y") ) z = true ; } return a ; } the error i get is: Risk.java:416: cannot find symbol symbol : variable a location: class Risk return a ; ^ Why did i get this error? It seems that a is clearly defined in the line String[] a = assignTeams () ; and if anything is used by the lineprintOrder (a) ;` it seems to me that if the symbol a really couldn't be found then the compiler should blow up there and not at the return statment. (also the method assignTeams returns an array of Strings.)

    Read the article

  • Is it possible to *optionally* override a theme in Drupal 6?

    - by David Semeria
    I want to override the theming of only one (custom) menu. I can do this with phptemplate_menu_tree() but - of course - it overrides the rendering of all menus. I've tried returning FALSE (an obvious technique IMO) if the menu is not the specific one I want to override - but this doesn't cause the overridden theme function to be called. My only alternative (when the menu is anything other than the specific one) is to call the overridden function from within phptemplate_menu_tree() - but this seems to defeat the whole point of the override system, since the default rendering function will be hard-coded therein. I hope the explanation is clear, and any help is greatly appreciated - tks.

    Read the article

  • Virtualmin domain name registration php

    - by David Maitland
    in a PHP web page i need to run this following command to create a new domain: virtualmin create-domain --domain DOMAIN --pass PASS --plan 'Standard Package' --limits-from-plan --features-from-plan This is usually executed in a shell but i don't know how to do it from a web page and also i need to take the domain string and pass string from a web form. Can anyone help with the PHP code as my skills are basic and i have already tried a few things that just don't work. Thanks.

    Read the article

  • How to assemble a WAV file, C# preferred?!

    - by David
    Hi guys! I'm doing an educational project in which 1) I record voice commands on a separate device and after appropriate processing etc... 2) I send 16-bit samples encapsulated in UDP packets over Ethernet to the PC. After receiving the packets and "extracting" data (samples) from them, I need to assemble the samples to a WAV file. Any example code? Any suggestions? Thank you in advance!

    Read the article

< Previous Page | 102 103 104 105 106 107 108 109 110 111 112 113  | Next Page >