Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 29/604 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Removing items from lists and all references to them.

    - by LiamV
    I'm facing a situation where I have dependent objects and I would like to be able to remove an object and all references to it. Say I have an object structure like the code below, with a Branch type which references two Nodes. public class Node { // Has Some Data! } public class Branch { // Contains references to Nodes public Node NodeA public Node NodeB } public class Graph { public List<Node> Nodes; public List<Branch> Branches; } If I remove a Node from the Nodes list in the Graph class, it is still possible that one or more Branch objects still contains a reference to the removed Node, thus retaining it in memory, whereas really what I would quite like would be to set any references to the removed Node to null and let the garbage collection kick in. Other than enumerating through each Branch and checking each Node reference sequentially, are there any smart ideas on how I remove references to the Node in each Branch instance AND indeed any other class which reference the removed Node?

    Read the article

  • MYSQL Inserting rows that reference main rows.

    - by Andrew M
    I'm transferring my access logs into a database. I've got two tables: urlRequests id : int(10) host : varchar(100) path: varchar(300) unique index (host, path) urlAccesses id : int(10) request : int(10) <-- reference to urlRequests row ip : int(4) query : varchar(300) time : timestamp I need to insert a row into urlAccesses for every page load, but first a row in urlRequests has to exist with the requested host and path so that urlAccesses's row can reference it. I know I can do it this way: A. check if a row exists in urlRequests B. insert a row in urlRequests if it needs it C. insert a row into urlAccesses with the urlRequests's row id referenced That's three queries for every page load if the urlRequests row doesn't exist. I'm very new to MySQL, so I'm guessing that there's a way to go about this that would be faster and use less queries.

    Read the article

  • Visual Studio 2008 Crystal Report Reference files.

    - by Jin
    Hi all, I am using Visual Studio 2008 and CR XI R2 for a web application built in silverlight. currently I am having a problem with showing a dynamic image on a crystal report. I was told that the reference file added in the project might be old version, so I replaced the reference files to be 11.5x version from 10.5x version. I removed all 10.5x dlls and then added 11.5x dlls, but I see 10.5x dlls are added instead. does anybody how to fix this problem? Please help. Thanks,

    Read the article

  • Instantiation vs. Typed reference

    - by Farstucker
    Just when I think Im starting to understand the basics, I find something that brings me right back to reality. In this case, typed reference. I found an example similar to this: class Worker { Boss boss; public void Advise(Boss pBoss) { this.boss = pBoss; } How can you reference methods within the Boss class if its not static and not instantiated? I guess my real question is whats the difference between: Boss boss; and Boss boss = new Boss(); Thank you, FS

    Read the article

  • Avoid Circular Reference in Swing GUI

    - by drhorrible
    Maybe it's not worth worrying about in this scenario, but lets say you have two classes, a JFrame with all its components, and a server-like class that handles requests from remote clients. The user is able to start and stop server objects through the GUI, and is shown various events that happen to each server object. Whether or not I use an explicit pattern (like MVC), it seems like the JFrame needs a reference to the server class (to call start and stop) and the server needs a reference to the JFrame (to notify of it of certain events). Is this a problem, or am I looking at this situation in the wrong way?

    Read the article

  • Clustered index on frequently changing reference table of one or more foreign keys

    - by Ian
    My specific concern is related to the performance of a clustered index on a reference table that has many rapid inserts and deletes. Table 1 "Collection" collection_pk int (among other fields) Table 2 "Item" item_pk int (among other fields) Reference Table "Collection_Items" collection_pk int, item_pk int (combined primary key) Because the primary key is composed of both pks, a clustered index is created and the data physically ordered in the table according to the combined keys. I have many users creating and deleting collections and adding and removing items to those collections very frequently affecting the "Collection_Items" table, and its clustered index. QUESTION PART: Since the "Collection_Items" table is so dynamic, wouldn't there be a big performance hit on constantly resorting the table rows because of the clustered index ? If yes, what should I do to minimize this ?

    Read the article

  • Libxml2: undefined reference to xmlTextReaderConstName

    - by Dmitry
    I have installed the latest libxml2-2.8.0, as usual: $ ./configure, $ make, $ make install. The $ xml2-config --cflags --libs gives this output: -I/usr/local/include/libxml2 -L/usr/local/lib -lxml2 -lm But trying to compile any example... $ gcc `xml2-config --cflags --libs` xmltest.c The linker says: /tmp/cc8ezrPl.o: In function `processNode': xmltest.c:(.text+0x19): undefined reference to `xmlTextReaderConstName' xmltest.c:(.text+0x38): undefined reference to `xmlTextReaderConstValue' ...etc. Anything I've googled can be solved by xml2-config --cflags --libs flags, or upgrading to the latest version of libxml2, or something. Unfortunately, neither works for me. What can be the steps to identify the problem? Using Ubuntu 12.04 64-bit.

    Read the article

  • Getting hold of a reference to the object created by JOptionPane static methods

    - by user548240
    Hi, I wonder if it is possible to get hold of a reference to the (JDialog?) object created by one of those static methods of JOptionPane (e.g. showMessageDialog)? I intend to modify the position where the dialog appears on the screen. More specifically, I want the dialog to appear at the top-left corner of the main app window, instead of the centre of the window by default. So having a reference to the object would enable me to use setLocation to achieve the desired effect... Any suggestion would be appreciated! Thanks!

    Read the article

  • Gaining Reference to the Dialog from Dialog content

    - by coffeeaddict
    Here's my scenario: I've got a div on Page A. When an event happens (whatever I define, a click, whatever), I do a div.Dialog, set its properties and open it The data inside is returned from an async .ajax call that grabs the data from a url and appends it to the div by calling div.html(data) inside the .ajax callback, so it's essentially loading a PageB by getting the data (content) and appending it to the div that's calling the dialog("open")...nothing special here I don't think. My question: In Page B, how do I reference the dialog so I can do some things to it? For instance in Page B's content that I received back from that .ajax call and added to the div via .html(data), there is a button and when clicked I need to close the dialog. Right now my buttons are not working because one of them closes out the dialog and the other should redirect to a new page but both do not work now because I have no reference to the dialog that it's in to manipulate it.

    Read the article

  • Dynamic reference to resource files in C#

    - by Joda
    I have an application on which I am implementing localization. I now need to dynamically reference a name in the resouce file. assume I have a resource file called Login.resx, an a number of strings: foo="hello", bar="cruel" and baz="world" normally, I will refer as: String result =Login.foo; and result=="hello"; my problem is, that at code time, I do not know if I want to refer to foo, bar or baz - I have a string that contains either "foo", "bar" or "baz". I need something like: Login["foo"]; Does anyone know if there is any way to dynamically reference a string in a resource file?

    Read the article

  • error while adding WCF service reference

    - by user1561256
    There was an error downloading . Unable to connect to the remote server No connection could be made because the target machine actively refused it Metadata contains a reference that cannot be resolved.There was no endpoint listening at that could accept the message. This is often caused by an incorrect address or SOAP action. See Inner Exception, if present, for more details. Unable to connect to the remote server No connection could be made because the target machine actively refused it. If the service is defined in the current solution, try building the solution and adding the service reference again. can pls somebody solve this.

    Read the article

  • Need to ignore property in XmlSerialization because of circular reference

    - by NestorArturo
    Have an object with a property I don't need to serialize. The type of this property generates a circular reference which I expected, so I decorated this property with everything comes to my mind: private clsDeclaracion _Declaracion; [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [System.Xml.Serialization.XmlIgnore] public clsDeclaracion Declaracion { get { return _Declaracion; } set { _Declaracion = value; } } However, the circular reference keeps firing. Tried using a public field with no luck. This is my serialization code: System.Xml.Serialization.XmlSerializer Serializador = new System.Xml.Serialization.XmlSerializer(objeto.GetType()); using (StreamWriter SW = System.IO.File.CreateText(ArchivoTemp)) { Serializador.Serialize(SW, objeto); }

    Read the article

  • How do you pass an enum by reference?

    - by Darkenor
    I have an enum with four keys I'm taking as input for an interface program and I'd like to pass the enum by value to the interface function, which has become quite long. The enum is like this: enum MYKEYS { W, S, O, L }; There's also a boolean array that I have to pass by reference, which is also a little tricky. bool key[4] = { false, false, false, false }; Does anyone know the proper syntax to pass both of these as reference in a function, similar to: function(int & anintreference);

    Read the article

  • Chrome extension: sendMessage doesn't work

    - by user3334776
    I've already read the documentation from Google on 'message passing' a few times and have probably looked at over 10 other questions with the same problem and already tried quiet a few variations of most of their "solutions" and of what I have below... This is black magic, right? Either way, here it goes. Manifest File: { "manifest_version" : 2, "name" : "Message Test", "version" : "1.0", "browser_action": { "default_popup": "popup.html" }, "background": { "scripts": ["background.js"] }, "content_scripts": [ { "matches" : ["<all_urls>"], "js": ["message-test.js"] } ] } I'm aware extensions aren't suppose to use inline JS, but I'm leaving this in so the original question can be left as it was since I still can't get the message to send from the background page, When I switch from the popup to the background, I removed the appropriate lines from the manifest.json popup.html file: <html> <head> <script> chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {greeting: "hello", theMessage: "Why isn\'t this working?"}, function(response) { console.log(response.farewell); }); }); </script> </head> <body> </body> </html> OR background.js file: chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {greeting: "hello", theMessage: "Why isn\'t this working?"}, function(response) { console.log(response.farewell); }); }); message-test.js file: var Mymessage; chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { if (message.greeting == "hello"){ Mymessage = message.theMessage; alert(Mymessage); } else{ sendResponse({}); } }); No alert(Mymessage) goes off. I'm also trying to execute this after pressing a button from a popup and having a window at a specified url, but that's a later issue. The other files can be found here except with the background.js content wrapped in an addEventListener("click"....: http://pastebin.com/KhqxLx5y AND http://pastebin.com/JaGcp6tj

    Read the article

  • CodeIgniter: Passing variables via URL - alternatives to using GET

    - by John Durrant
    I'm new to CodeIgniter and have just discovered the difficulties using the GET method of passing variables via the URL (e.g. domain.com/page.php?var1=1&var2=2). I gather that one approach is to pass the variables in the URI segments but haven't quite figured out how to do that yet as it seems to create the expectation of having a function in the controller named as the specific URI segment???? Anyway Instead of using GET I've decided to use POST by adapting a submit button (disguised as a link) with the variables in hidden input fields. I've created the following solution which seems to work fine, but am wondering whether I'm on the right track here or whether there is an easier way of passing variables via a link within CodeIgniter? I've created the following class in application/libraries/ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class C_variables { function variables_via_link($action, $link_text, $style, $link_data) { $attributes = array('style' => 'margin:0; padding:0; display: inline;'); echo form_open($action, $attributes); $attributes = array('class' => $style, 'name' => 'link'); echo form_submit($attributes, $link_text); foreach ($link_data as $key => $value){ echo form_hidden($key, $value); } echo form_close(); } } ?> With the following CSS: /* SUBMIT BUTTON AS LINK adapted from thread: http://forums.digitalpoint.com/showthread.php?t=403667 Cross browser support (apparently). */ .submit_as_link { background: transparent; border-top: 0; border-right: 0; border-bottom: 1px solid #00F; border-left: 0; color: #00F; display: inline; margin: 0; padding: 0; cursor: hand /* Added to show hand when hovering */ } *:first-child+html .submit_as_link { /* hack needed for IE 7 */ border-bottom: 0; text-decoration: underline; } * html .submit_as_link { /* hack needed for IE 5/6 */ border-bottom: 0; text-decoration: underline; } Link then created using the following code in the VIEW: <?php $link = new C_variables; $link_data=array('var1' => 1, 'var2' => 2); $link ->variables_via_link('destination_page', 'here is a link!', 'submit_as_link', $link_data); ?> Thanks for your help...

    Read the article

  • Passing input hidden params through urllib2 POST request

    - by ramrajedotcom
    I need to make POST request to CAS SSO server login page, and CAS login page has few input hidden params which are dynamically populated through java. I don't know how to read these hidden param values from response and pass in to CAS server. Without passing these hidden params I am not able to login. Does any one how to read input hidden param values from urllib2 response? Thanks in advance!

    Read the article

  • Passing parameters from android to .Net Web Service

    - by benjamin schultz
    I have an Android application that uses kSoap in connecting to my web services. This particular one is passing in a string value as a parameter, then my web service will use that parameter to query my database via a stored procedure. Problem is, I know how to pass the parameter from android, but I don't know how to retrieve it in my .Net(vb) web service and use it. Anyone have any code examples or a link to a tutorial to help me out? Thanks!

    Read the article

  • passing argument 1 from incompatible pointer type

    - by Andrew
    Why does this code...: NSDictionary *testDictionary = [NSDictionary dictionaryWithObjectsAndKeys:kABOtherLabel, @"other", kABWorkLabel, @"work", nil]; throw this warning: warning: passing argument 1 of 'dictionaryWithObjectsAndKeys' from incompatible pointer type Incidentally, the code works as expected, but I don't like leaving warnings un-delt-with. I assume it doesn't like that I'm storing a constant in a dictionary. Well, where can I store it then? Should I just place (void *) before every constant?

    Read the article

  • How to declare NSString constants for passing to NSNotificationCenter

    - by synic
    I've got the following in my .h file: #ifndef _BALANCE_NOTIFICATION #define _BALANCE NOTIFICATION const NSString *BalanceUpdateNotification #endif and the following in my .m file: const NSString *BalanceUpdateNotification = @"BalanceUpdateNotification"; I'm using this with the following codes: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateBalance:) name:BalanceUpdateNotification object:nil]; and [[NSNotificatoinCenter defaultCenter] postNotificationName:BalanceUpdateNotificatoin object:self userInfo:nil]; Which works, but it gives me a warning: Passing argument 1 of 'postNotificationName:object:userInfo' discards qualifiers from pointer target type So, I can cast it to (NSString *), but I'm wondering what the proper way to do this is.

    Read the article

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