Search Results

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

Page 34/816 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Variable reference in a Groovy GString

    - by Maurits Rijk
    From the book "Groovy and Grails recipes" I'm using the following code snippet: String HelloLanguage = "def hello(language) {return \"Hello $language\"}" However, I get a compiler error "You attempted to reference a variable in the binding or an instance variable from a static context." because language can't be bound. What is wrong?

    Read the article

  • How to call popup window in asp.net mvc?

    - by Renu123
    hello i have js file for the popup window. i have used in asp.net but its not working in asp.net mvc can anyone tell me how to use this code in mvc function openUserSavedListDetailsPopUp(id) { dhtmlmodal.open('UserInfo', 'iframe', 'UserSavedListDetails.aspx?listId=' + id, '', 'width=710px,height=150px,center=1,resize=0,scrolling=0') } on page: <a href="#" onclick='openUserSavedListDetailsPopUp(<%# DataBinder.Eval(Container.DataItem, "OrderId")%>)' > hello </a> thank you in advance

    Read the article

  • Java Synchronized function

    - by leon
    Hi I have a question. In the following code, if a thread were blocked at wait statement, and another thread attempts to execute foo(), would the hello wolrd message be printed? and Why? Many Thanks synchronized foo(){ system.out.println("hello world"); ..... wait(); ..... }

    Read the article

  • Way to partialy match a Ruby string using Regexp

    - by Fabiano PS
    I'm working on 2 cases: assume I have those var: a = "hello" b = "hello-SP" b = "not_hello" 1 - Any partial matches I want to accept any string that has the var a inside, so b and c would match. 2 - Patterned match I want to match a string that has a inside, followed by '-', so b would match, c does not. I am having problem, because I always used the syntax /expression/ to define Regexp, so how dinamicaly define an RegExp on Ruby??

    Read the article

  • can't access to an extension method with UrlHelper parameter in controller! Vice versa in view have

    - by Sadegh
    why defined extension method with UrlHelper don't added in Url.EXTENSIONMETHOD when i want to use it in controller! but i have access to it in view? public static string Home(this UrlHelper helper) { return helper.RouteUrl("ABC", new { controller = "ABC", Action = "Default" }); } i haven't access: public ActionResult Default() { return Redirect(Url.Home()); } i have access in view: <a href="<%=Url.Home() %>" title="Hello">Hello</a>

    Read the article

  • Android - Display Image Caption Below Images in Gridview

    - by Tyler
    Hello - I am utilizing a version of the "Grid View" example from the Android Developers site: http://developer.android.com/resources/tutorials/views/hello-gridview.html And I would like to display a small text caption below each of the images. Can someone please give an example of how this might be accomplished (i.e. what needs to be edited)? Thanks!

    Read the article

  • Linux termios VTIME not working?

    - by San Jacinto
    We've been bashing our heads off of this one all morning. We've got some serial lines setup between an embedded linux device and an Ubuntu box. Our reads are getting screwed up because our code usually returns two (sometimes more, sometimes exactly one) message reads instead of one message read per actual message sent. Here is the code that opens the serial port. InterCharTime is set to 4. void COMBaseClass::OpenPort() { cerr<< "openning port"<< port <<"\n"; struct termios newtio; this->fd = -1; int fdTemp; fdTemp = open( port, O_RDWR | O_NOCTTY); if (fdTemp < 0) { portOpen = 0; cerr<<"problem openning "<< port <<". Retrying"<<endl; usleep(1000000); return; } newtio.c_cflag = BaudRate | CS8 | CLOCAL | CREAD ;//| StopBits; newtio.c_iflag = IGNPAR; newtio.c_oflag = 0; /* set input mode (non-canonical, no echo,...) */ newtio.c_lflag = 0; newtio.c_cc[VTIME] = InterCharTime; /* inter-character timer in .1 secs */ newtio.c_cc[VMIN] = readBufferSize; /* blocking read until 1 char received */ tcflush(fdTemp, TCIFLUSH); tcsetattr(fdTemp,TCSANOW,&newtio); this->fd = fdTemp; portOpen = 1; } The other end is configured similarly for communication, and has one small section of particular iterest: while (1) { sprintf(out, "\r\nHello world %lu", ++ulCount); puts(out); WritePort((BYTE *)out, strlen(out)+1); sleep(2); } //while Now, when I run a read thread on the receiving machine, "hello world" is usually broken up over a couple messages. Here is some sample output: 1: Hello 2: world 1 3: Hello 4: world 2 5: Hello 6: world 3 where number followed by a colon is one message recieved. Can you see any error we are making? Thank you. Edit: For clarity, please view section 3.2 of this resource href="http://www.faqs.org/docs/Linux-HOWTO/Serial-Programming-HOWTO.html. To my understanding, with a VTIME of a couple seconds (meaning vtime is set anywhere between 10 and 50, trial-and-error), and a VMIN of 1, there should be no reason that the message is broken up over two separate messages.

    Read the article

  • Countin g words in a html page with php

    - by turbod
    How can I counting the numbers of words in a text when begin the text in the linktext? I must count the text of the title and alt attributes. Example: <div> Hello something open.<img src="somethin.jpg" alt="hello"> <a href="open.php" title="open">click</a> lorem ipsum <a href="open.php">here></a> the output: click 6 here 9

    Read the article

  • Use HTTP PUT to create new cache (ehCache) running on the same Tomcat?

    - by socal_javaguy
    I am trying to send a HTTP PUT (in order to create a new cache and populate it with my generated JSON) to ehCache using my webservice which is on the same local tomcat instance. Am new to RESTful Web Services and am using JDK 1.6, Tomcat 7, ehCache, and JSON. I have my POJOs defined like this: Person POJO: import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Person { private String firstName; private String lastName; private List<House> houses; // Getters & Setters } House POJO: import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class House { private String address; private String city; private String state; // Getters & Setters } Using a PersonUtil class, I hardcoded the POJOs as follows: public class PersonUtil { public static Person getPerson() { Person person = new Person(); person.setFirstName("John"); person.setLastName("Doe"); List<House> houses = new ArrayList<House>(); House house = new House(); house.setAddress("1234 Elm Street"); house.setCity("Anytown"); house.setState("Maine"); houses.add(house); person.setHouses(houses); return person; } } Am able to create a JSON response per a GET request: @Path("") public class MyWebService{ @GET @Produces(MediaType.APPLICATION_JSON) public Person getPerson() { return PersonUtil.getPerson(); } } When deploying the war to tomcat and pointing the browser to http://localhost:8080/personservice/ Generated JSON: { "firstName" : "John", "lastName" : "Doe", "houses": [ { "address" : "1234 Elmstreet", "city" : "Anytown", "state" : "Maine" } ] } So far, so good, however, I have a different app which is running on the same tomcat instance (and has support for REST): http://localhost:8080/ehcache/rest/ While tomcat is running, I can issue a PUT like this: echo "Hello World" | curl -S -T - http://localhost:8080/ehcache/rest/hello/1 When I "GET" it like this: curl http://localhost:8080/ehcache/rest/hello/1 Will yield: Hello World What I need to do is create a POST which will put my entire Person generated JSON and create a new cache: http://localhost:8080/ehcache/rest/person And when I do a "GET" on this previous URL, it should look like this: { "firstName" : "John", "lastName" : "Doe", "houses": [ { "address" : "1234 Elmstreet", "city" : "Anytown", "state" : "Maine" } ] } So, far, this is what my PUT looks like: @PUT @Path("/ehcache/rest/person") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response createCache() { ResponseBuilder response = Response.ok(PersonUtil.getPerson(), MediaType.APPLICATION_JSON); return response.build(); } Question(s): (1) Is this the correct way to write the PUT? (2) What should I write inside the createCache() method to have it PUT my generated JSON into: http://localhost:8080/ehcache/rest/person (3) What would the command line CURL comment look like to use the PUT? Thanks for taking the time to read this...

    Read the article

  • drawRect:rect how to call this method , I am using to draw a string

    - by user338322
    -(void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific); CGContextSetTextPosition(context,80,80); CGContextShowText(context, "hello", 6); //not even this works CGContextShowTextAtPoint(context, 1,1, "hello", 6); } I want to kn ow how to call above method, i have paste above code in the implemntation file simply, but dont know why its not called when i execute the project, can some one

    Read the article

  • editing a string using BufferedReader in Java

    - by pbs
    Exception handling aside, I'm using the following to input a line of text in Java: BufferedReader strin = new BufferedReader(new InputStreamReader(System.in)); String txt = null; txt = strin.readLine(); However, I want to be able to edit an existing string, so that if txt were initialized to "hello" instead of null, then the readLine() would have the "hello" text in the buffer for me to edit. I can't see how to do this. Any help would be appreciated.

    Read the article

  • General question about Ruby Eigenclass/Singleton

    - by Dex
    module MyModule def my_method; 'hello'; end end class MyClass class << self include MyModule end end MyClass.my_method # => "hello I'm unsure why "include MyModule" needs to be in the eigenclass in order to be called using just MyClass. Why can't I go: X = MyClass.new X.my_method How is this type of pattern useful if I can't call it from an instance?

    Read the article

  • CodeIgniter load class into class

    - by user355510
    Hello guys, i have start working with CodeIgniter, but i can't understand one think. How do i load one class into another? $this->load->library("hello_world"); This is not working? my class - load - hello_world class class myclass { function test() { $this->load->library("hello_world"); $this->hello_world->hello(); } } Message: Undefined property: myclass::$load

    Read the article

  • Java - String Pool

    - by Gogi
    What is meant by String Pool ? What is difference between the following declarations : String s="hello"; String s=new String("hello"); Is there any difference between the Storing of this two strings by JVM ?

    Read the article

  • Add custom method to string object [closed]

    - by cru3l
    Possible Duplicate: Can I add custom methods/attributes to built-in Python types? In Ruby you can override any built-in object class with custom method, like this: class String def sayHello return self+" is saying hello!" end end puts 'JOHN'.downcase.sayHello # >>> 'john is saying hello!' How can i do that in python? Is there a normally way or just hacks?

    Read the article

  • Get values between DIV tags?

    - by Khou
    How do I get the values in between a DIV tag? Example <div id="myOutput" class="wmd-output"> <pre><code><p>hello world!</p></code></pre> </div> my output values I should get is <pre><code><p>hello world!</p></pre>

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >