Search Results

Search found 20383 results on 816 pages for 'hello there'.

Page 20/816 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Common Lisp's equivalent of \r inside the format function?

    - by liszt
    Basically, I'd like to do the following, only using Common Lisp instead of Python: print("Hello world.\r\n") I can do this, but it only outputs the #\newline character and skips #\return: (format t "Hello world.~%") I believe I could accomplish this using an outside argument, like this: (format t "Hello world.~C~%" #\return) But is seems awkward to me. Surely I can somehow embed #\return into the very format string, like I can #\newline? Yeah ehh, I'm nitpicking. Thanks for any help!

    Read the article

  • Removing quotation marks in JSONObject

    - by Spike Williams
    I'm using the net.sf.json.JSONObject to create some data to be sent to a front end application, and I don't like the ways ts adding quotation marks to every field name. For example: myString = new JSONObject().put("JSON", "Hello, World!").toString(); produces the string {"JSON": "Hello, World"}. What I want it to return is {JSON: "Hello, World"} - without quotes around "JSON". What do I have to do to make that happen?

    Read the article

  • Replace method doesn't work properly

    - by John Smith
    Hello I have a string and when i try to use replace method in for loop it doesn't work String phrase="hello friend"; String[] wordds=phrase.split(" "); String newPhrase="sup friendhello weirdo"; for (int g=0;g<2;g++) { finalPhrase+=newPhrase.replace(wordds[g],"");} } System.out.println(finalPhrase) It prints out "sup hello weirdo" and i expect it to print "sup weirdo". What am i doing wrong?

    Read the article

  • Ruby proc vs lambda in initialize()

    - by Jimmy Chu
    I found out this morning that proc.new works in a class initialize method, but not lambda. Concretely, I mean: class TestClass attr_reader :proc, :lambda def initialize @proc = Proc.new {puts "Hello from Proc"} @lambda = lambda {puts "Hello from lambda"} end end c = TestClass.new c.proc.call c.lambda.call In the above case, the result will be: Hello from Proc test.rb:14:in `<main>': undefined method `call' for nil:NilClass (NoMethodError) Why is that? Thanks!

    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

  • Why cant Git merge file changes with a modified parent/master.

    - by Andy
    I have a file with one line in it. I create a branch and add a second line to the same file. Save and commit to the branch. I switch back to the master. And add a different, second line to the file. Save and commit to the master. So there's now 3 unique lines in total. If I now try and merge the branch back to the master, it suffers a merge conflict. Why cant Git simple merge each line, one after the other? My attempt at merge behaves something like this: PS D:\dev\testing\test1> git merge newbranch Auto-merging hello.txt CONFLICT (content): Merge conflict in hello.txt Automatic merge failed; fix conflicts and then commit the result. PS D:\dev\testing\test1> git diff diff --cc hello.txt index 726eeaf,e48d31a..0000000 --- a/hello.txt +++ b/hello.txt @@@ -1,2 -1,2 +1,6 @@@ This is the first line. - New line added by master. -Added a line in newbranch. ++<<<<<<< HEAD ++New line added by master. ++======= ++Added a line in newbranch. ++>>>>>>> newbranch Is there a way to make it slot lines in automatically, one after the other?

    Read the article

  • Get the common prefix substring through Regex

    - by Dreampuf
    like this text = " \t hello there\n \t how are you?\n \t HHHH" hello there how are you? HHHH Could I get the common prefix substring through regex? I try to In [36]: re.findall(r"(?m)(?:(^[ \t]+).+[\n\r]+\1)", " \t hello there\n \t how are you?\n \t HHHH") Out[36]: [' \t '] But apparently that common prefix substring is ' \t ' I want use for dedent function like python textwrap module.

    Read the article

  • C++ game loop example

    - by David
    Can someone write up a source for a program that just has a "game loop", which just keeps looping until you press Esc, and the program shows a basic image. Heres the source I have right now but I have to use SDL_Delay(2000); to keep the program alive for 2 seconds, during which the program is frozen. #include "SDL.h" int main(int argc, char* args[]) { SDL_Surface* hello = NULL; SDL_Surface* screen = NULL; SDL_Init(SDL_INIT_EVERYTHING); screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); hello = SDL_LoadBMP("hello.bmp"); SDL_BlitSurface(hello, NULL, screen, NULL); SDL_Flip(screen); SDL_Delay(2000); SDL_FreeSurface(hello); SDL_Quit(); return 0; } I just want the program to be open until I press Esc. I know how the loop works, I just don't know if I implement inside the main() function, or outside of it. I've tried both, and both times it failed. If you could help me out that would be great :P

    Read the article

  • C#: how to construct strings

    - by Craig Johnston
    Which of these will achieve the correct result: (1) int X = 23; string str = "HELLO" + X.ToString() + "WORLD"; (2) int X = 23; string str = "HELLO" + X + "WORLD"; (3) int X = 23; string str = "HELLO" + (string)X + "WORLD"; EDIT: The 'correct' result is to output: HELLO23WORLD

    Read the article

  • multiple inheritance

    - by hitech
    when we say "a member declated as protected is accessible to any class imediately derived from it" what does this mean. in the follwing example get_number function can be accessible by the result class , as per the statement it sould only be accessile to test class. class student { protected: int roll_number; public: void get_number(int){ cout<< "hello"; } void put_number(void) {cout<< "hello"; } }; class test : public student { protected : float sub1; float sub2; public: void get_marks(float, float) {cout<< "hello"; roll_number = 10; } void put_marks(void) {cout<< "hello"; cout << "roll_number = " << roll_number ; } }; class result :public test { float total; public: void display(){cout<< "hello"; roll_number = 10; } }; int main() { result student; student.get_marks(2.2, 2.2); student.put_marks(); return 0; } i changed the code as per the first statement the protected variable roll_number not be accessible upto the result class ?

    Read the article

  • How can I have a newline in a string in sh?

    - by juannavarroperez
    This STR="Hello\nWorld" echo $STR produces as output Hello\nWorld instead of Hello World What should I do to have a newline in a string? I'm aware of echo -e, but I'm no sending the string to echo, the string will be used as an argument by another command that doesn't know how to interpret \n as a newline.

    Read the article

  • grep options (unix)

    - by lego69
    hello everyone, can You explain please, can grep pick rows if at least one element from the list appeared, for exmaple grep "hello world" file1 grep must give me all rows which have or word hello or world or both of them, thanks in advance

    Read the article

  • GCC fatal error: stdio.h: No such file or directory

    - by user2615799
    I'm trying to compile a program in C on OS X 10.9 with GCC 4.9 (experimental). For some reason, I'm getting the following error at compile time: gcc: fatal error: stdio.h: No such file or directory I then tried a simple Hello World program: #include <stdio.h> int main(int *argc, const char *argv[]) { printf("Hello, world!"); return 0; } Again, upon running gcc -o ~/hello ~/hello.c, I got the same error. I'm using an experimental version of gcc, but it seems implausible that there would be a release which generated errors upon importing stdio. What could be causing this issue, and how can it be fixed?

    Read the article

  • Get the value of a selected java field in a eclipse view.

    - by user325489
    Hi, I making a eclipse view that is working with selected elements from other views. Let say I have opened a java file in the editor that has the following fields in it: private String world = " world!" private String hello = "hello" + world; When I select "hello" in the Outline view I'm able to get IFiled selection and I have access to it's properties, but what i need is the true value of the field ("hello world!"). Any idea how can I do that? Thanks.

    Read the article

  • Maybe This is dead-simple stupid question, but how PHP translate our code ?

    - by justjoe
    i got this code ` // // prints out "Hello World!" // hello_world(); //First call function hello_world() { echo "Hello World!<br/>\n"; } hello_world(); //second call ?>` Both of 'hello_world' call will print out the same result. It's easily to understand why the second call will be output 'Hello world', but how the first call output the same where it's been call before the initiation of the function hello_world itself ?enter code here

    Read the article

  • [Javascript] Split string by HTML entities?

    - by user366124
    Hello, My string contain a lot of HTML entities, like this &#x22;Hello&nbsp;&lt;everybody&gt;&#x22;&nbsp;there And I want to split it by HTML entities into this : Hello everybody there Can anybody suggest me a way to do this please? May be using Regex? Thanks so much.

    Read the article

  • PHP - Class Inherit problem

    - by TatMing
    I have A.php and B.php A.php <?php error_reporting(E_ALL); ini_set("display_errors",1); class myClass { function hello() { return 'hello'; } } ?> B.php <?php error_reporting(E_ALL); ini_set("display_errors",1); require_once('/A.php'); $a = new myClass(); testing(); function testing() { echo $a ->hello(); } ?> B.php inherits A.php , if i run B.php,but it show "Fatal error: Call to a member function hello() on a non-object." So the question is simple, how can i correct this ,but "$a = new myClass();" is not inside the function, since in .NET world can do this, i believe PHP also possible. And one more question is, what is the modify of function in A.php ,if i have not state private/public/protected???

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >