the rgborhex function is returing an undefined variable:
function rgborhex($unformatedColor){
if(strpos($unformatedColor, "-") == false) { //did not find a - in the color string; is not in rgb form; convert
$rgbColor = hextorgb($unformatedColor);
$rgbColor = explode("-", $rgbColor);
return $rgbColor;
}
else { // found a - i...
Hi,
Currently I'm returning -1 in my custom functions in C if something wrong happens and 0 for success. For instance, working with a linked list and some function needs a non-empty list to work properly. If the list passed as argument is empty, I return -1 (error) and 0 if it's not empty and the function worked without a problem.
Shou...
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...
Why does the following code always return true even when an exception is thrown?
public boolean write (ArrayList<String> inputText, String locationToSave)
{
try
{
File fileDir = new File(locationToSave);
Writer out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(fileDir), "utf8"));
...
I'm doing something really dumb, and I don't see it.
I've got an object doc with a method:
-(float) currentOrient
{
return 50.5;
}
In another object, I call:
-(void) showPage
{
float rot2=0;
rot2 = [doc currentOrient] ;
NSLog(@"SP rotation is %.2f", rot2);
}
However, the output is :
SP rotation is 1112145920.0000...
I am just getting my feet wet with LINQ to SQL, and need some advice in implementing a simple scenario:
I have a method ListTagCounts that is doing an aggregate query with LINQ To SQL. I was not sure of the return type to use, so used the ToList() method and created a class just for the return type in order to get it to compile.
Schema...
I know that a command line application should return 0 on success. But are there any "standards" for what other values refer to? e.g. Invalid Arguments, etc.
Are there differences under Windows and Unix?
...
I've just come across some code that's confusing me slightly; there are really 2 variations that I'd like to clarify.
Example 1:
public String getFilepath(){
final File file = new File(this.folder, this.filename);
return file.getAbsolutePath();
}
What would be the purpose of declaring file "final"? Since Java prim...
Hello,
First of all: this is a though question, sorry for that, but I hope someone can help me!
I'm making a UIML renderer on the iPhone. UIML is a language to describe interfaces.
I want to render the XML and show the Interface on the iPhone.
To inform you bettter, i first explain what I'm doing:
<?xml version="1.0"?>
<uiml>
<in...
Ok, So I've googled this problem and I have searched stack overflow but I can't seem to find a good answer. So, I am asking the question on here that is particular to my problem. If it is an easy answer, please be nice, I am new to the language. Here is my problem:
I am trying to write a method for a C++ class that is overloading an ope...
How do i get all of the lines of "$dblink is down" into one $l_msg string?
Ideally I would like to get the error returned by oracle on failure and I cannot see a way to solve this.
my $dblinks = $l_dbh->selectcol_arrayref("select dbname from db_link");
for my $dblink (@$dblinks) {
my $l_results = eval {
my ($l_erg) = $l_dbh->s...
Hi, I've got a javascript function that draws a dialog. I'd like to have it return the value the user specifies. The problem is, the dialog is closed when a user clicks on of two buttons, which have onClick events assigned to them. The only way I know to grab these events is by assigning functions to them, which means that a return ca...
I have gone through this and this,
but the question I am asking here is that why is 0 considered a Success?
We always associate 0 with false, don't we?
...
Inside my template function I have the following code:
TypeName myFunction()
{
TypeName result;
void * storage = malloc( sizeof( TypeName ) );
/*Magic code that stores a value in the space pointed to by storage*/
result = *(TypeName *)storage;
free( storage );
return result;
}
This causes an "HEAP CORRU...
I see many methods that specify an interface as return value. Is my thought true that it means: my method can return every class type that inherits from that interface? if not please give me a good answer.
...
What is the correct way to return a Void type, when it isn't a primitive? Eg. I currently use null as below.
interface B<E>{ E method(); }
class A implements B<Void>{
public Void method(){
// do something
return null;
}
}
...
I am trying to write a simple Wordpress plugin, which updates a custom field value and increments it by one, and then echos the result which is handed back to my javascript code. For some reason, the data returned by the callback function always has an extra 0 appended to the end.
function like_post_callback() {
$clicked = $_POST['c...
I have this memory leak that has been very stubborn for the past week or so. I have a class method I use in a class called "ArchiveManager" that will unarchive a specific .dat file for me, and return an array with it's contents. Here is the method:
+(NSMutableArray *)unarchiveCustomObject
{
NSMutableArray *array = [NSMutableArray a...
Basically I'm wondering how I'm able to do what I've written in the topic. I've looked through many tutorials on AsyncTask but I can't get it to work. I have a little form (EditText) that will take what the user inputs there and make it to a url query for the application to lookup and then display the results.
What I think would seem t...
How can I retrieve the return value of a stored procedure using iBatis.NET? The below code successfully calls the stored procedure, but the QueryForObject<int> call returns 0.
SqlMap
<procedure id="MyProc" parameterMap="MyProcParameters" resultClass="int">
MyProc
</procedure>
<parameterMap id="MyProcParameters">
<parameter pr...