Search Results

Search found 4893 results on 196 pages for 'expect'.

Page 48/196 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • Standard library function in R for finding the mode?

    - by Nick
    In statistical language R, mean() and median() are standard functions which do what you'd expect. mode() tells you the internal storage mode of the R object, not the value that occurs the most in its argument. But surely there is a standard library function that implements mode for a vector (or list).

    Read the article

  • Update array in rails action?

    - by Elliot
    Hey guys, I have the following code in an action: @user = @current_user @user.votes[1430]='up' @user.update_attributes(params[:user]) Votes is a string type, there is no default value - I just want to set it for the first time when this action occurs. Unfortunately I get this error: NoMethodError You have a nil object when you didn't expect it! The error occurred while evaluating nil.votes any ideas what I'm doing wrong?

    Read the article

  • Scala return type for tuple-functions

    - by Felix
    Hello Guys, I want to make a scala function which returns a scala tuple. I can do a function like this: def foo = (1,"hello","world") and this will work fine, but now I want to tell the compiler what I expect to be returned from the function instead of using the built in type inference (after all, I have no idea what a (1,"hello","world") is) I thought I remembered the classname being something like Tuple3[Int,String,String] but that doesnt work for me. Suggestions? :D (ps: I love stack overflow!)

    Read the article

  • Isn't objective-c function parameter syntax weird? [closed]

    - by Haoest
    Consider the following method: +(void) myMethod:(int)arg1 **argument2**(int)arg2 **argument3**(int) arg3; See how the first argument, unlike the 2nd and 3rd, doesn't have a description, giving it an impression of bad symmetry. Also you would expect the extra typing will provide named argument as you pass it in, but you still have to pass them in the correct order. Can anyone help me make sense of this?

    Read the article

  • What happens when I instantiate class in Python?

    - by Konstantin
    Could you clarify some ideas behind Python classes and class instances? Consider this: class A(): name = 'A' a = A() a.name = 'B' # point 1 (instance of class A is used here) print a.name print A.name prints: B A if instead in point 1 I use class name, output is different: A.name = 'B' # point 1 (updated, class A itself is used here) prints: B B Even if classes in Python were some kind of prototype for class instances, I'd expect already created instances to remain intact, i.e. output like this: A B Can you explain what is actually going on?

    Read the article

  • [c++] upload image to imageshack

    - by cinek1lol
    Hi. I would like to send pictures via a program written in C + + I wrote such a thing using curl.exe WinExec("C:\\curl\\curl.exe -H Expect: -F \"fileupload=@C:\\curl\\ok.jpg\" -F \"xml=yes\" -# \"http://www.imageshack.us/index.php\" -o data.txt -A \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1\" -e \"http://www.imageshack.us\"", NULL); This only works that I would like to send pictures to a variable pre-loaded char (you know what I mean? first reads the pictures into a variable and then send that variable), because now I have to specify the path to the images on disk I wanted to make this program was written in C + + using the curl library, and not the exe. I found it such a program (which some have modified) #include <stdio.h> #include <string.h> #include <iostream> #include <curl/curl.h> #include <curl/types.h> #include <curl/easy.h> int main(int argc, char *argv[]) { CURL *curl; CURLcode res; struct curl_httppost *formpost=NULL; struct curl_httppost *lastptr=NULL; struct curl_slist *headerlist=NULL; static const char buf[] = "Expect:"; curl_global_init(CURL_GLOBAL_ALL); /* Fill in the file upload field */ curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "send", CURLFORM_FILE, "nowy.jpg", CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "nowy.jpg", CURLFORM_COPYCONTENTS, "nowy.jpg", CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, "send", CURLFORM_END); curl = curl_easy_init(); headerlist = curl_slist_append(headerlist, buf); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://www.imageshack.us/index.php"); if ( (argc == 2) && (!strcmp(argv[1], "xml=yes")) ) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); res = curl_easy_perform(curl); curl_easy_cleanup(curl); curl_formfree(formpost); curl_slist_free_all (headerlist); } system("pause"); return 0; } I will be grateful for any help

    Read the article

  • C++: Pass array created in the function call line

    - by Jarx
    How can I achieve a result like somebody would expect it according to the following code example: // assuming: void myFunction( int* arr ); myFunction( [ 123, 456, 789 ] ); // as syntactical sugar for... int values[] = { 123, 456, 789 }; myFunction( values ); The syntax I thought would work spit out a compile error. How can I define an argument array directly in the line where the function is called?

    Read the article

  • Can the Windows Phone 7 Series emulator be made to run XP?

    - by sweeney
    Well thats all there is to it...is this possible? I understand that officially it's not supported but has anyone figured it out? I have some work to do where XP would be the preferred platform. I would expect that users of the actual device are not required to use Windows 7 so it stands to reason that this can be done. Any poitners in the right direction would be greatly appreciated. Thanks, brian

    Read the article

  • Application lifetime in ASP.NET

    - by fearofawhackplanet
    This should be a simple question but I haven't managed to find the answer on google. I would like to know, in terms an idiot can understand, exactly what application lifetime means in ASP.NET (and therefore when you can expect application start and end events to run). I assumed it would be when you run and stop the app in IIS, but I've read things that suggest it's related to number of requests.

    Read the article

  • As3 split strangeness

    - by coulix
    Hello coders, Super simple example: var Path:String="E:\SWF Security\Acess Current Path\Access SWF URL.swf" var Path1:Array = Path.split("\\") // Split using the backslash as delimiter (No limit the number of returned tokens) trace(Path1) What do you expect path1 to be ? E: ? No its E:SWF SecurityAcess Current PathAccess SWF URL.swf and i have no idea why.

    Read the article

  • Borland problem: typing

    - by b3y4z1d
    When I type in Borland C++,it types over the line,not on a new one.That means that every time I press enter,it doesn't give me a fresh,new,empty line in which to type but goes to the one underneath. And there when I try to type I expect the symbols,numbers and letters to move as I add text behind them in the line,but the new symbols keep overwriting the old ones.Sort of deleting them and replacing them with the new characters as I type. Could it be some kinda option I've activated unvoluntarily?

    Read the article

  • value of c define changes unexpectedly

    - by NomeN
    I have a lot of #define's in my code. Now a weird problem has crept up. I have this: #define _ImmSign 010100 (I'm trying to simulate a binary number) Obviously, I expect the number to become 10100. But when I use the number it has changed into 4160. What is happening here? And how do I stop it?

    Read the article

  • Why is "int + string" possible in statically-typed C# but not in dynamically-typed Python?

    - by Salvador Dali
    While studying C# I found it really strange, that dynamically typed Python will rise an error in the following code: i = 5 print i + " " whereas statically typed C# will normally proceed the similar code: int i = 5; Console.Write(i + " "); I would expect other way around (in python I would be able to do this without any casting, but C# would require me to cast int to string or string to int). Just to highlight, I am not asking what language is better, I am curious what was the reason behind implementing the language this way.

    Read the article

  • grails mockFor closure wierdness

    - by hvgotcodes
    Right, so when I set up my mock using the testing plugin's mockFor method, I expect a method that returns null. If I do myControl.demand.theMethod {return null} in the debugger, the value that I set the 'theMethod' call result to is some closure in the debugger. If I do myControl.demand.theMethod {->return null} the value is null, as expected. I dont understand the difference....

    Read the article

  • What needs to be passed to an editor from a keyboard app to move the cursor one char left?

    - by yno
    What key code does an Android editor app expect the keyboard app to send when it is going to be interpreted as a left arrow? In other words, what is the keyboard program supposed to send to its calling program (some kind of editor) if the user intends to move the cursor one char to the left? A related issue: what do the minus values for the "android:codes" attribute mean? () Any pointers to these issues will be appreciated.

    Read the article

  • how to delete all files in a folder, but not the folder itself?

    - by Frost Li
    I try to delete all files including subdirectories in a folder: NSFileManager *deleteMgr = [NSFileManager defaultManager]; NSString *path = @"~/test/"; [deleteMgr removeItemAtPath:path error:&error]; And it deletes everything including the folder itself. But what I expect is an empty folder. Could anyone please help me what did I do wrong? Really thanks your help! :)

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >