pass

Simple way to pass temporary struct by value in C++?

Suppose I want to pass a temporary object into a function. Is there a way to do that in 1 line of code vs. 2, with a struct? With a class, I can do: class_func(TestClass(5, 7)); given: class TestClass { private: int a; short b; public: TestClass(int a_a, short a_b) : a(a_a), b(a_b) { } int A() const ...

Java passing value

I have three programs, first does a selenium test import com.thoughtworks.selenium.*; import java.util.regex.Pattern; import junit.framework.*; public class MyTest extends SeleneseTestCase { int flag_eco; public void setUp() throws Exception { setUp("http://www.mysite.com/", "*iexplore"); } public void testMyTest() throws Excep...

Action and confirmation - different pages, how do I pass text?

Hello. I have my integrated my site with phpbb, so you login into phpbb, and then you will be able to see my site, so I do not use normal sessions, so I do not know how to do this. My site is a design at index.php, and then I have an insert.php inside a frame. Now at my index.php, I want to receive a message, and at insert.php, I want ...

How to get the cell.textLabel.text from the selected cell in DetailViewController?

I've got a UITableView with several entrys, and these are divided up in several sections. If I click on one of the cells, a DetailViewController is accessed. In that DetailViewController, I want to use the data from the selected cell (the cell.textLabel and the cell.detailTextLabel), but I can't access these. Is there a possibility to so...

Pass img src via jquery to new div

Hi folks I am trying to create a "simple" modal type of operation. When a user clicks on an image it opens a mask over the screen (done that) and displays the image (can't do that). This is ment to be very simple, no need for galleries etc. hence just a simple effect. The code generated for the mask is $j(document).ready(function(){...

jQuery - How do you store and access an object within another object

I am trying to store an object as an attribute in another object but can't seem to access it. Is it possible? <script language="javascript"> $(document).ready(function() { //create a TestObject function TestObject() { this.testProperty = "green"; } //and an instance of it var testObject = new TestObject()...

C++ is there a difference between assignment inside a pass by value and pass by reference function?

Is there a difference between foo and bar: class A { Object __o; void foo(Object& o) { __o = o; } void bar(Object o) { __o = o; } } As I understand it, foo performs no copy operation on object o when it is called, and one copy operation for assignment. Bar performs one copy operation on object o when it is ...

Passing by reference in Java?

In C++, if you need to have 2 objects modified, you can pass by reference. How do you accomplish this in java? Assume the 2 objects are primitive types such as int. ...

Cant run application (C#) through cmd

Hey, I can't execute my application through cmd, when the application is trying to read the argument which was sent to it (text file), it fails... When I'm trying to execute it through the IDE (vs2008), it works ok... That's what I did in the main method: static void Main(string[] args) { int choice = 0; if (args.Length == 0...

How do I pass a Range to a Sub in Word VBA?

I know this sounds simple, but seemingly it is not. If I write this in Word VBA, it always says "incompatible types" - why? And how do I make it work? Thank you very much for your help! Sub GetRange() Dim r As Range Set r = ActiveDocument.Paragraphs(5).Range ProcessRange (r) End Sub Sub ProcessRange(r As Range) Debug.Pr...

safely encode and pass a string from a html link to PHP program

What series of steps would be reqired to safely encode and pass a string from a html href using javascript to construct the link to a php program. in javascript set up URL // encodes a URI component. path = "mypgm.php?from=" + encodeURIComponent(myvar) ; in php: // get passed variables $myvar = isset($_GET['myvar']) ? ($_GET['myva...

Is it a good practice to pass struct object as parameter to a function in c++?

I tried an example live below: typedef struct point { int x; int y; } point; void cp(point p) { cout<<p.x<<endl; cout<<p.y<<endl; } int main() { point p1; p1.x=1; p1.y=2; cp(p1); } The result thats printed out is: 1 2 which is what I expected. My que...

CodeIgniter: Passing variables via URL - alternatives to using GET

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 funct...

Pass variable and its contents from workspace to GUI function in MATLAB

I have a variable in the MATLAB workspace and I want to pass the variable name and its contents to a function in my GUI. How do I achieve this task? ...

Restoring and passing data to an already running instance of a .NET application

The goal is to have an application that runs in the system tray and can either accept user input from its actual GUI (which isn't the actual issue) OR accept command line parameters (that would actually be done via a context menu in windows explorer). Now, while I'm aware that the command line parameters are not exactly possible once the...

Alternative for python's pass in php

Do you know any php statement working like python's pass ...

How to pass a reference to a string in JavaScript?

Maybe a closure is my solution? Not exactly sure how to pull it off though. The code is set up like so: var globalVar = ''; var globalVar2 = ''; function func() { if (condition) func2(globalVar) else func2(globalVar2) } In func2() I cache some HTML in a main container into the appropriate global variable that I pa...

passing data from one partial view on another on the same page

Hello, How can i pass data from one partial view on another on the same page? i want a situation where the second partial view will be refreshed once the first one sends data to it. the partial views are on the same page. thanks ...

Pass temporary object to function that takes pointer

I tried following code : #include<iostream> #include<string> using namespace std; string f1(string s) { return s="f1 called"; } void f2(string *s) { cout<<*s<<endl; } int main() { string str; f2(&f1(str)); } But this code doesn't compile. What I think is : f1 returns by value so it creates temporary, of which I am taki...

jquery hover pass variable to callback function

I am trying to remove a title attribute for a link on hover and then add it back on mouse out. I would like to pass var hoverText to the hover out... Here is the code I have. Any ideas? $(".icon a").hover(function() { $this = $(this); var hoverText = $.data(this, 'title', $this.attr('title')); $(this)...