Can someone explain to me why I cannot use document.getElementById('id').value inside of a function?
I was trying to make a simple multiplication script (im learning JS, its actually kinda fun) and realized quickly how annoying typing that whole line of code just to return a value is, so I wrote a small function:
<script type="text/jav...
Does anyone know a quick way to return the index of my array in a simple function something like this
if([appDelegate.exerciseReference containsObject:aExerciseRef.IDE])
{
//return indexofwhere the object is the same ....
}
so let's say these two are the same at the index:5 from my array it would return a 5 integer.
...
Please note that this is asking a question about constructors, not about classes which handle time.
Suppose I have a class like this:
class Time
{
protected:
unsigned int m_hour;
unsigned int m_minute;
unsigned int m_second;
public:
Time(unsigned int hour, unsigned int minute, unsigned int second);
};
While I would wa...
I ran into a very strange behaviour in some of our PHP code today. We have a class for dealing with files. It's something like this:
class AFile {
//usual constructor, set and get functions, etc.
//...
public function save() {
//do some validation
//...
if($this->upload()) { //save the file to disk
$this->upda...
So this is something that I have never tried, but I think I want to create a Metrics Dashboard in my MS Access database. So I think the first question that I need to ask is
how can I return a value to a form? If I ave aggregate queries that are top 10 total sales, how can I specify not only the query that I want the top result to come f...
I am consuming a WCF service from another company, and it is returning an object of type object. Is there a reason not to return the actual class, and return an object that must be cast into the correct form?
For example, if the web service returns an object of type OrderStatus, why would you instead return a plain old object?
Correct...
Per my other post about WCF service return values, I'm consuming a web service from another company, and when I add the service reference inside Visual Studio, the return value of the method is an object of type object.
The author of the web service showed me the code, and it actually returns a typed object.
Am I missing something, or ...
Hi,
I am using "invoke-command" to execute a script on a remote machine.
invoke-command -computername <server_name> -scriptblock {command to execute the script}
My script returns "-1" when there are any errors.
So, I wanted to ensure that script has executed successfully by checking the return code.
I tried as follows.
$code = invok...
1) object_getIvar(id object, Ivar ivar) returns an 'id' if the Ivar is an object eg. if the variabe is an NSString, presumably the id = NSString which contains the value. Is that correct? Or what do I need to do to access the value of the Ivar.
2) if the Ivar is a float/int etc. what will get returned and how do I convert it into someth...
if the variable in object_getIvar is a basic data type (eg. float, int, bool) how do I get the value as the function returns a pointer (id) according to the documentation. I've tried casting to an int, int* but when I try to get that to NSLog, I get error about an incompatible pointer type.
...
I've got object_getInstanceVariable to work as here however it seems to only work for floats, bools and ints not doubles. I do suspect I'm doing something wrong but I've been going in circles with this.
float myFloatValue;
float someFloat = 2.123f;
object_getInstanceVariable(self, "someFloat", (void*)&myFloatValue);
works, and myFloat...
Hello,
I have a simple rule in ANTLR:
title returns [ElementVector<Element> v]
@init{
$v = new ElementVector<Element>() ;
}
: '[]'
| '[' title_args {$v.add($title_args.ele);} (',' title_args {$v = $title_args.ele ;})* ']'
;
with title_args being:
title_args returns [Element ele]
: author {$ele = new Element(...
This is general programming, but if it makes a difference, I'm using objective-c. Suppose there's a method that returns a value, and also performs some actions, but you don't care about the value it returns, only the stuff that it does. Would you just call the method as if it was void? Or place the result in a variable and then delete it...
Just a quick questions, since most blogs and tutorials I found are about the very basic elements of MySQL and C#.
I am using the MySQL ADO Connector.
I have everything setup and I can retrieve data from the table. But I want to create a method that simplifies things for me. So I can set a query string (either in the method or the objec...
The code looks like below:
Clock:
public class Clock
{
public event Func<DateTime, bool> SecondChange;
public void Run()
{
for (var i = 0; i < 20; i++)
{
Thread.Sleep(1000);
if (SecondChange != null)
{
//how do I get return value for each subscriber?
...
I have a function that builds a collection of user objects from the database:
public static function GetUsersByGroup($instanceID, $groupID)
{
$col = null;
if($groupID != null)
{
$col = UserGroup::GetCollection("User" ,_DB_GET_ALL_INSTANCE_USERGROUP_MEMBERS,array ($instanceID, $groupID));
}
els...
I was a little surprised that the following code did not work as expected:
#include "stdio.h"
class RetA
{
public:
virtual void PrintMe () { printf ("Return class A\n"); }
};
class A
{
public:
virtual RetA GetValue () { return RetA (); }
};
class RetB : public RetA
{
public:
virtual void PrintMe () { printf ("Return class...
I have a static Settings class where my application can retrieve settings from. The problem is that some of these settings are strings, while others are ints or numbers. Example:
package
{
public final class Settings
{
public static function retrieve(msg:String)
{
switch (msg)
{
case "register_link":...
When the form is submitted, I'm calling a function getPosts and passing through a variable str. What I'd like to do is get the data returned from that function.
// when the form is submitted
$('form#getSome').submit(function(){
var str = $("form#getSome").serialize();
var something = getPosts(str);
* This is where I'd like to g...
When an instance method returns a value that was initialized with a convenience constructor, do I need to retain that object and then autorelease in the return so that when the convenience constructor's autorelease occurs, it doesn't remove the object.
Will this release description before the calling code and take ownership with a retai...