return

wpf how to return a value with dispatcher.invoke

Hi! Anyone knows how to return a value from Dispatcher.Invoke in WPF? I want to return the selected index for a combobox. Thanks! ...

Iphone NsMutableArray Count

I have a struct SystemStruct *sharedStruct = [SystemStruct sharedSystemStruct]; implemented as a singleton, to share 3 Arrays. the problem is that when i try to count the array's objects the system crash. es: This code Crash: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { SystemStruct *Sha...

wget return downloaded filename

I'm using wget in a php script and need to get the name of the file downloaded. For example, if I try <?php system('/usr/bin/wget -q --directory-prefix="./downloads/" http://www.google.com/'); ?> I will get a file called index.html in the downloads directory. EDIT: The page will not always be google though, the target may be an im...

PHP omits a return.

Hi, when a carriage return follows a closing php tag, php doesn't print it. How can I change this? Thanks a lot ...

how do I assign a variable to a returned response in jQuery

I wanted to assign a returned value (just text) to a variable in jQuery. I wrote this: var hm=22; $.ajax({ type: "GET", url: "ajax_check_match.php", dataType: "text", success:callback }); function callback(data, status) { //...

Is this c# return statement good/bad in terms of performance?

My static method returns the following concatenated string like this return (Sb.ToString() + " " + ds.Tables[1].Rows[0].ItemArray[0].ToString() + " " + ds.Tables[2].Rows[0].ItemArray[0].ToString()); Is this a good/bad practise or should i use stringbuilder for it.... ...

onSubmit returning false is not working

I'm completely confused ... I'd swear this was working yesterday ... I woke up this morning and all my forms stopped to work in my project. All the forms have a "onsubmit" to a function that returns false since it's an ajax call, so the form is never sent. After a lot of tests, I simplified the question to this piece of code: <html> <...

Ret Failure with SDL using FASM on Win32

I'm using SDL with FASM, and have code that's minimally like the following: format ELF extrn _SDL_Init extrn _SDL_SetVideoMode extrn _SDL_Quit extrn _exit SDL_INIT_VIDEO equ 0x00000020 section '.text' public _SDL_main _SDL_main: ccall _SDL_Init, SDL_INIT_VIDEO ccall _SDL_SetVideoMode, 640, 480, 32, 0 ccall _SDL_Quit...

return a js file from asp.net mvc controller

Hi all fellow programmer I'd like to have a separate js file for each MVC set I have in my application /Controllers/ -TestController.cs /Models/ /Views/ /Test/ -Index.aspx -script.js And I'd like to include the js in the Index.aspx by <script type="text/javascript" src="<%=UriHelper.GetBaseUrl()%>/Test/Js"></...

creating and returning an array from a method

howdy, i currently have a method that checks what is around the centre item in a 3x3 grid, if what is in the 8 adjacent positions is containing what i am checking for i want to mark that square on an array with length 7 as being 1. to do this i need to create and return an array in my method, is it possible to do this? ...

How can I get and handle a return codes in a C program if sftp fails to put the file in a sftp server?

How can we get and handle the sftp return codes in a C program if sftp fails to put the file in a server? We need to transfer the files again if sftp fails to put it in the sftp server. ...

iPhone keyboard's return key will move curser to next textfield

Hello Fellow Koder ••• I have a TableViewController that is using a grouped Style and has two(2) sections. The first section has 4 rows and the second section has 3 rows. I have placed a UILabel and a UITextField in each cell, and have a custom method(textFieldDone:) to handle the cursor movement to the next text field when the return ...

What to Return? Error String, Bool with Error String Out, or Void with Exception

I spend most of my time in C# and am trying to figure out which is the best practice for handling an exception and cleanly return an error message from a called method back to the calling method. For example, here is some ActiveDirectory authentication code. Please imagine this Method as part of a Class (and not just a standalone funct...

Returning in a static initializer

Hello, This isn't valid code: public class MyClass { private static boolean yesNo = false; static { if (yesNo) { System.out.println("Yes"); return; // The return statement is the problem } System.exit(0); } } This is a stupid example, but in a static class const...

Return value from nested function in Javascript

I have a function that is set up as follows function mainFunction() { function subFunction() { var str = "foo"; return str; } } var test = mainFunction(); alert(test); To my logic, that alert should return 'foo', but instead it returns undefined. What am I doing wrong? UPDATE: Here's my actual co...

Return reference from class to this.

Hi, I have the following member of class foo. foo &foo::bar() { return this; } But I am getting compiler errors. What stupid thing am I doing wrong? Compiler error (gcc): error: invalid initialization of non-const reference of type 'foo&' from a temporary of type 'foo* const' ...

How do I exit from a function?

i know that in vb.net you can just do Exit Sub but i would like to know how do i exit a click event in a button? here's my code: private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "") { //exit this event } } ...

Return variable in function from method callback data in same function

How do I return the latlon variable for codeAddress function. return latlon doesn't work, probably because of scope but I am unsure how to make it work. function codeAddress(addr) { if (geocoder) { geocoder.geocode({ 'address': addr}, function(results, status) { if (status == google.maps.Geocoder...

Python: "inline" block / condition to return a char?

Sorry for the vague question. I would like to create a string that uses a plural if count > 1. For that, I would like have an "inline" condition that returns 's' to concatenate to my noun. print "The plural of plural is plural{0}. {1}".format( {'s' if count > 1}, "Isnt't it!?") ...

Enumerable.Empty<T>() equivalent for IQueryable

When a method returns IEnumerable<T> and I do not have anything to return, we can use Enumerable.Empty<T>(). Is there an equivalent to the above for a method returning IQueryable<T> ...