Imagine the following code:
void DoThis()
{
if (!isValid) return;
DoThat();
}
void DoThat() {
Console.WriteLine("DoThat()");
}
Is it OK to use a return inside a void method? Does it have any performance penalty? Or it would be better to write a code like this:
void DoThis()
{
if (isValid)
{
DoThat();
...
Hi there,
Here's an issue on retrieving returned api call data. I found that Request.Form("param2") not working.
Eg: inside .vbs script that run in a windows server, I do an api call to external script. Then the api script return a string data.
Eg: param1=baby;param2=banana;param3=haha
I found that inside .vbs, if I use request.form,...
Suppose there is a function with 1000 code of line named LongFunction, and we used it:
bool bSuccess = LongFunction();
assert(bSuccess);
Here I got an assert when debugging, and I know there is something wrong with LongFunction, so I need to find where the function meet problems and returns:
I could probably debug it step by step, i...
Basically I've got a code which should load a lot of images so I need a function to load them. The problem is that addEventListener requires a function which it will call when the event have been raised.
I need to find a way to either make the loadImage function return ONLY after the event was raised or make the function raised in addE...
Hi there,
I am using vbscript .vbs in windows scheduler.
Sample code:
objWinHttp.Open "POST", http://bla.com/blabla.asp, false
objWinHttp.Send
CallHTTP= objWinHttp.ResponseText
strRESP= CallHTTP(strURL)
WScript.Echo "after doInstallNewSite: " & strRESP
Problem: blabla.asp is handling a task that need around 1-2 minute to complete...
Hey there!
I was wondering why my php program is not returning the correct TRUE FALSE value when the class is included elsewhere
it goes something like this
source: signup.php
class signup
{
function buildProfile()
{
if($logic){
$this->success = TRUE;
}else{
$this->success = FALSE;
...
This is driving me nuts!
I have created a query. The query is written to Windows file for future connection to the remote database.
Upon the connection using cURL, my local script uses cURL to send the query. I assemble variables using build_http_query. The cURL works just fine but the query fails. Every time. mySQL complains that qu...
Hi all,
I have a class called ArionFileExtractor in a .java file of the same name.
public class ArionFileExtractor {
public String ArionFileExtractor (String fName, String startText, String endText) {
String afExtract = "";
// Extract string from fName into afExtract in code I won't show here
return afExtract;
}
Howeve...
I have one file with a form, that includes another to process that form. The file with the form calls a function in the included file to write data to the database, and then I return an $insert_id from that post so I can reference it in the output.
For example, when you fill out the form on the page, the data is sent to the db from a s...
Hi everyone!
I have the function prototype here:
extern "C" void __stdcall__declspec(dllexport) ReturnPulse(double*,double*,double*,double*,double*);
I need to write some python to access this function that is in a DLL.
I have loaded the DLL, but
each of the double* is actually pointing to a variable number of doubles (an array), and
...
Hello:
I have a simple webpage that displays the credit balance for calling cards. So far without any problems, with HTML, PHP and mysql, I was able to retrieve the balance from a data base. But I have to display the result in ANOTHER PAGE, wich looks akward because the page must reload.
Can I just load this value into a pre-drawed...
I am creating an iPhone webapp with a textbox and would like to change the return key to "search". When you click on the textbox, the keyboard pops up and the return key on the bottom right of the keyboard displays "return" by default.
However if you go to google.com on your iPhone and click on the search textbox the return key on the ...
Hello,
I'm trying to figure out the best way to handle a simple problem:
I have a simple LINQ join to two tables. I know how to return the type for one table, since it is the same as the generated dbml class. However, what if I want to return data from both tables- isn't there a way to return both and use their relationships? Do I rea...
def foo
f = Proc.new { return "return from foo from inside proc" }
f.call # control leaves foo here
return "return from foo"
end
def bar
b = Proc.new { "return from bar from inside proc" }
b.call # control leaves bar here
return "return from bar"
end
puts foo # prints "return from foo from inside proc"
puts bar # prints ...
Hi all,
The following statement...
content_tag(:li, concept.title)
...returns something like:
<li>"My big idea"</li>
The following method definition, when called, returns the same:
def list_of_concepts(part)
content_tag(:li, concept.title)
end
As does...
def list_of_concepts(part)
content_tag(:li, part.concepts.first.title)
...
Is it safe to return the pointer to a local struct in C? I mean is doing this
struct myStruct* GetStruct()
{
struct myStruct *str = (struct myStruct*)malloc(sizeof(struct myStruct));
//initialize struct members here
return str;
}
safe?
Thanks.
...
Learning JS this week.
Is it possible to use Math.random to return a random value in an array? Does that value be a string and still work?
...
a small portion of my code
swi r6,r0,LCD_ CONT
addi r10,r0,6
firstdelay:
addi r10,r10,-1
bnei r10,firstdelay
swi r0,r0,LCD_ CONT
addi r10,r0,30
seconddelay:
addi r10,r10,-1
bnei r10,seconddelay
swi r5,r0,LCD_DATA
i have to delay multiple times throughout the program but want to keep it small. id like to write ...
I am wondering about this because of scope issues. For example, consider the code
typedef struct {
int x1;/*top*/
int x2;/*bottom*/
int id;
} subline_t;
subline_t subline(int x1, int x2, int id) {
subline_t t = { x1, x2, id };
return t;
}
int main(){
subline_t line = subline(0,0,0); //is line garbage or isn't...
Funny as it can sound, I transformed my datatable data into a string which looks something
like this:
{ blocks: [
{"fromAge" : "60","fromAmount" : "0","toAge" : "64","toAmount" : "65000","color" : "red","orderNo" : "2"},
{"fromAge" : "66","fromAmount" : "0","toAge" : "72","toAmount" : "12000","color" : "red","orderNo" : "4"},
{"fromA...