Search Results

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

Page 59/816 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • Java: global values inside a class?

    - by HH
    I want less methods. I want a common global TestClass from which I could use any of its value inside the class. import java.util.*; import java.io.*; public class TestClass { TestClass(String hello){ String hallo = hello; String halloSecond = "Saluto!"; } public static void main(String[] args) { TestClass test = new TestClass("Tjena!"); System.out.println("I want "Tjena!": " + test.hallo); TestClass testSecond = new TestClass("1"); System.out.println("I want Saluto!:" + test.halloSecond); System.out.println("I want Saluto!:" + testSecond.halloSecond); } }

    Read the article

  • c++: use a #define in printf?

    - by John
    I was wanting to use a constant of some kind for the application ID (so I can use it in printf). I had this: #define _APPID_ "Hello World!" And then the simple printf, calling it into %s (string). It put this out: simple.cpp:32: error: cannot convert ‘_IO_FILE*’ to ‘const char*’ for argument ‘1’ to ‘int printf(const char*, ...)’ What would I use to define the application ID to use in printf? I tried: static const char _APPID_[] = "Hello World"` but it didn't work, same error I think.

    Read the article

  • how could it works if function is called before it is defined in python?

    - by user2131316
    I was wondering what does if __name__ == "__main__": really do in python, I have the following code in python3: def main(): test(); def test(): print("hello world " + __name__); if __name__ == "__main__": main(); we know that we have to declare a function before we use it, so function call inside of if part works fine, the main() is defined before it is called inside of if statement, but what about the test() function, it is defined after it is called and there is no errors: def main(): test(); def test(): print("hello world " + __name__); so how could it works if the test() function is defined after it is called?

    Read the article

  • Templating Word Documents in C#

    - by NullGeo
    I was wondering if there is a library out there such that it could give me the ability to fill in word templates with custom values. For example: Following could be the content of the Word Document {Address} {PhoneNumber} Hello {Name}, How are you doing? In C# I would like to do something like this to replace all the placeholders in the Word document: using(WordDocument doc = WordDocument.Load("Mail.docx")){ var person = new {Name = "John Smith", Address="42 Wallaby Way, Sydney", PhoneNumber="555-555-5555"}; doc.Template(person); doc.Print(); } The resulting document would look like this: 42 Wallaby Way, Sydney 555-555-5555 Hello John Smith, How are you doing? Any libraries out there (preferably free) that let's me do this? Edit: I am not asking you to find anything that let's me do this. If that was the case, I would do a Google search by myself. Honestly, all I am asking is "has anybody used a library in the past to do this exact thing."

    Read the article

  • Java Applet : Nested Loops color change

    - by Bader
    Hello I have like a table to make a nested loop in Java applet , during this loop i should change the colors like the picture said. now i successed to make the table but i cannot change the colors because every time i try a forumla , it doesn't work. Here is my code int x = 63; for (int r=1; r<=10;r++) { Color C = new Color(0,10 +(x * 2),0); for (int c=0; c<=4; c++) { Color C2 = new Color(10 + (x * 2) ,0,0); g.setColor(C2); Font F = new Font("Arial",Font.BOLD, 24); g.setFont(F); g.drawString("Hello",10 + ( c * 60), r * 25 ); } } what should i do to make it work ?

    Read the article

  • How to use PHP to POST to a web page then get the results back, locally

    - by Patrick Gates
    I have a page on my web server that is PHP that is set to do this if ($_POST['post'] == true) { echo: 'hello, world'; } I want to create a page that calls to that page, posts "post" equal to "true" and then returns the value "hello, world". I have a script that works, but only if the pages are on different servers. Unfortunately, both of these pages are on the same server, so, heres my code, and I'm hoping you guys can help me, Thank you :) function post($site, $post) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$site); curl_setopt($ch, CURLOPT_FAILONERROR,1); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 15); $retValue = curl_exec($ch); curl_close($ch); return $retValue; } echo post('data.php', 'post=true');

    Read the article

  • html embeded php code not executing when hosted on iis

    - by Jack
    <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <TITLE></TITLE> </HEAD> <BODY> <?php echo '<p>Hello World</p>'; ?> </BODY> When I run the above code in browser, firefox render it like this Hello World '; ? I am doing my coding in Windows XP/IIS 5.1. I have PHP setup correctly because i have no problem running .php file. The problem seem to me that IIS can't render php code embedded inside html. Does anyone know how to fix this problem or should i switch to Apache?

    Read the article

  • How to set an ImageView and two TextviewS to have the same height?

    - by M.ES
    I've got the following layout with one ImageView and 2 TextView, I would like them all to have the same height. However, the ImageView is always taking more than half of the screen. Any help is highly apreciated. Here is the layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF" android:orientation="vertical" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.4" android:src="@drawable/sprint" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.3" android:background="#555555" android:text="@string/hello" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0.3" android:text="@string/hello" /> </LinearLayout>

    Read the article

  • Replace html tag with a certain class

    - by fire
    I am looking for suitable replacement code that allows me replace the content inside of any HTML tag that has a certain class e.g. $class = "blah"; $content = "new content"; $html = '<div class="blah">hello world</div>'; // code to replace, $html now looks like: // <div class="blah">new content</div> Bare in mind that: It wont necessarily be a div, it could be <h2 class="blah"> The class can have more than one class and still needs to be replaced e.g. <div class="foo blah green">hello world</div> I am thinking regular expressions should be able to do this, if not I am open to other suggestions such as using the DOM class (although I would rather avoid this if possible because it has to be PHP4 compatible).

    Read the article

  • Trimming byte array when converting byte array to string in Java/Scala

    - by prosseek
    Using ByteBuffer, I can convert a string into byte array: val x = ByteBuffer.allocate(10).put("Hello".getBytes()).array() > Array[Byte] = Array(104, 101, 108, 108, 111, 0, 0, 0, 0, 0) When converting the byte array into string, I can use new String(x). However, the string becomes hello?????, and I need to trim down the byte array before converting it into string. How can I do that? I use this code to trim down the zeros, but I wonder if there is simpler way. def byteArrayToString(x: Array[Byte]) = { val loc = x.indexOf(0) if (-1 == loc) new String(x) else if (0 == loc) "" else new String(x.slice(0,loc)) }

    Read the article

  • Is it possible to access JSON properties with relative syntax when using JSON defined functions?

    - by Justin Vincent
    // JavaScript JSON var myCode = { message : "Hello World", helloWorld : function() { alert(this.message); } }; myCode.helloWorld(); The above JavaScript code will alert 'undefined'. To make it work for real the code would need to look like the following... (note the literal path to myCode.message) // JavaScript JSON var myCode = { message : "Hello World", helloWorld : function() { alert(myCode.message); } }; myCode.helloWorld(); My question is... if I declare functions using json in this way, is there some "relative" way to get access to myCode.message or is it only possible to do so using the literal namespace path myCode.message?

    Read the article

  • html-embedded php code not executing when hosted on iis

    - by Jack
    <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <TITLE></TITLE> </HEAD> <BODY> <?php echo '<p>Hello World</p>'; ?> </BODY> </HTML> When I run the above code in a browser, firefox renders it like this: Hello World '; ?> I am doing my coding in Windows XP/IIS 5.1. I have PHP set up correctly because I have no problem running .php files. The problem, it seems to me, is that IIS can't render php code embedded inside html. Does anyone know how to fix this problem or should i switch to Apache?

    Read the article

  • jquery find() function not working on ie. (ie 8) not tested on others

    - by Val
    I have a tiny problem: I am trying to use the find function to get data from an external page. here is the code can some one please help me why doesnt it work on ie? index.php <div id="testing">Hello Worlds</div> jquery var txt=$('<div id="Temp"></div>').hide().appendTo('body'); var t; $('#Temp').load('index.php',null,function (t){ t = $('#Temp').find('#testing').text(); alert(t); }) Please help me... it works well on fireworks and chrome result should be to alert "Hello Worlds" instead its blank.

    Read the article

  • how to filter an id for subcategory in sql

    - by Naim Nsco
    i have create one table with A is 1,2,3 and B is 3,5,5,9,10,10 For example, i want to change from this table NP A B C 1 1 3 why not 1 1 5 weigh 1 1 5 hello 1 1 9 no way 1 1 10 now or never 1 1 10 float the boat, capt ain 1 1 12 no nelp 2 2 4 why 2 2 6 way too much 2 2 11 help 3 3 1 not now 3 3 2 not 3 3 7 milky way 3 3 7 this is stupid 3 3 8 one way To be like this:- A B C ---------- -- -------- 1 3 why not 5 weigh 5 hello 9 no way 10 now or never 10 float the boat, capt ain 12 no nelp 2 4 why 6 way too much 11 help 3 1 not now 2 not 7 milky way 7 this is stupid 8 one way How to do like that?. Anyone know about this?.

    Read the article

  • iPhone: Try to send html code to a php script (but fail)

    - by Marc-André Weibezahn
    Hello all, I am trying this for an iPhone app in Xcode: create html code for a website on the fly sending it to a php-script and getting the response with this code: NSError * error = [[[NSError alloc]init]autorelease]; NSURL * phpURL = [NSURL URLWithString: @"http://www.mydomain.com/myscript.php?mywebsite= (...websitestring...) ];NSString * myResponse = [NSString stringWithContentsOfURL:phpURL encoding:NSUTF8StringEncoding error:&error]; It does not work. It should not be a problem of the php code because when I replace the websitestring which contains the html code with "hello" or something, this is accepted. (the script then creates a file "test.html" with the content I sent.) But when I put html code in it, I always get the error: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x322ec10 {} It seems that there are some things to consider when sending code to php? Thanks in advance!

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >