Search Results

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

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

  • Debug.Assert seems not to work in Mono

    - by Jan-Willem
    Consider the following C# program: using System; using System.Diagnostics; namespace Test { class MainClass { public static void Main (string[] args) { Debug.Assert(false); Debug.Fail("fail!"); Console.WriteLine ("Hello World!"); } } } When compiling this using: dmcs -debug -d:DEBUG Main.cs and then running it with: mono --debug Main.exe the assertion and fail seem to be ignored. The output is just: Hello World! I checked other related questions on StackOverflow, but I could not find a solution. In particular the solution give in Mono - Debug.Assert does not work does not work. (UPDATE: the update solution does work, see below comments.) I use Mono 2.1.5-1 on Ubuntu 11.10.

    Read the article

  • javascript welcoming msgbox problem

    - by shouq
    hey... i'm doing my html and javascript class project and i want to have a msgbox welcoming the visitor asking for his name and then a welcoming msgbox shows up saying "hello (the name added)" i know how to do that but my only problem is that if i pressed back and went to the homepage of my website again, the msg will show up again asking for my name is there anyway to prevent this from happening? seriously don't want the visitor to wite his name each time he goes to the home page please help this is the code i'm using: <script> response = window.prompt("Welcome!","Please enter your name"); window.alert("hello " + response); </script> please help

    Read the article

  • PHP Changing Class Variables Outside of Class

    - by Jamie Bicknell
    Apologies for the wording on this question, I'm having difficulties explaining what I'm after, but hopefully it makes sense. Let's say I have a class, and I wish to pass a variable through one of it's methods, then I have another method which outputs this variable. That's all fine, but what I'm after is that if I update the variable which was originally passed, and do this outside the class methods, it should be reflected in the class. I've created a very basic example: class Test { private $var = ''; function setVar($input) { $this->var = $input; } function getVar() { echo 'Var = ' . $this->var . '<br />'; } } If I run $test = new Test(); $string = 'Howdy'; $test->setVar($string); $test->getVar(); I get Var = Howdy However, this is the flow I would like: $test = new Test(); $test->setVar($string); $string = 'Hello'; $test->getVar(); $string = 'Goodbye'; $test->getVar(); Expected output to be Var = Hello Var = Goodbye I don't know what the correct naming of this would be, and I've tried using references to the original variable but no luck. I've come across this in the past, with the PDO prepared statements, see Example #2 $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (?, ?)"); $stmt->bindParam(1, $name); $stmt->bindParam(2, $value); // insert one row $name = 'one'; $value = 1; $stmt->execute(); // insert another row with different values $name = 'two'; $value = 2; $stmt->execute(); I know I can change the variable to public and do the following, but it isn't quite the same as how the PDO class handles it, and I'm really looking to mimic that behaviour. $test = new Test(); $test->setVar($string); $test->var = 'Hello'; $test->getVar(); $test->var = 'Goodbye'; $test->getVar(); Any help, ideas, pointers, or advice would be greatly appreciated, thanks.

    Read the article

  • parsing Two-dimensional array in c

    - by gitter78
    I'm trying to parse an array that looks like the one below: char *arr[][2] = { { "1", "Purple" }, { "2", "Blue" }, { "22", "Red" }, ... }; I was thinking having a loop as: char *func(char *a){ for(i = 0; i<sizeof(arr)/sizeof(arr[0]);i++){ if(strstr(a,arr[i][0])!=NULL) return arr[i][1]; } } char *out; const char *hello = "this is my 2 string"; out = func(hello); In this case, I'm trying to get the second value based on the first one: Purple, Blue Red, etc.. The question is how would go in parsing this and instead of printing out the value, return the value. UPDATE/FIXED: It has been fixed above. Thanks

    Read the article

  • does webapp has 'elseif' or 'elif' in template tags..

    - by zjm1126
    my code is : Hello!~~~ {% if user %} <p>Logged in as {{ user.first_name }} {{ user.last_name }}.</p> {% elif openid_user%} <p>Hello, {{openid_user.nickname}}! Do you want to <a href="{{openid_logout_url}}">Log out?</p> {% else %} <p><a href="/login?redirect={{ current_url }}">google Log in</a>.</p> <p><a href="/twitter">twitter Log in</a>.</p> <p><a href="/facebook">facebook Log in</a>.</p> <p><a href="{{openid_login_url}}">openid Log in</a>.</p> <iframe src="/_openid/login?continue=/"></iframe> {% endif %} the error is : TemplateSyntaxError: Invalid block tag: 'elif' does not webapp has a 'else if ' ? thanks

    Read the article

  • Would this jQuery is.(":hidden") work?

    - by AtiKuSDesign
    Hi guys, I'm playing around with the 'is' filter in jQuery and I am currently without the opportunity to use a testing server. What I want to know is...would this work to display both hello and goodbye? $(document).ready(function(){ if ($("p").is(':visible')) { $(this).css('display','block'); } }); <p>hello</p> <p style="display:none">goodbye</p> Basically what I want to do is run an action on something when it is visible but not run it when it isn't. Thanks guys

    Read the article

  • Why would you precede the main() function in C with a data type?

    - by Milktrader
    Many are familiar with the hello world program in C #include <stdio.h> main () { printf ("hello world"); return 0; } Why do some precede the main () function with int as in: int main() Also, I've seen the word 'void' entered inside the () as in: int main(void) It seems like extra typing for nothing, but maybe it's a best practice that pays dividends in other situations? Also, why precede main() with an int if you're returning a character string? If anything, one would expect: char main(void) I'm also foggy about why we return 0 at the end of the function.

    Read the article

  • C#: Convert array to use in params with additional parameters

    - by user1805759
    I have a method that takes params. Inside the method another variable shall be added to the output: private void ParamsTest(params object[] objs) { var foo = "hello"; // Invalid: Interpretes objs as single array parameter: Console.WriteLine("{0}, {1}, {2}", foo, objs); } When I call ParamsTest("Hi", "Ho"); I would like to see the output. hello Hi Ho What do I need to do? I can copy foo and objs into a new array and pass that array to WriteLine but is there a more elegant way to force objs to behave as params again? Kind of objs.ToParams()?

    Read the article

  • actionscript 2.0 input text box

    - by user1769760
    So, here's what I'm trying to do, and I, frankly, believe it should be obvious, but I can't figure it out. I am creating a very simple Artificial Intelligence simulation. And in this simulation there's an input box at the bottom of the screen (called "input" exactly). "input" has a variable in its properties that is called "inbox" (exactly). Using a key listener the script calls up a function when the enter button is pressed. This function has 2 if statements and an else statement which dictate the responses of the AI (named "nistra"). The problem is this, When I type in what I want to say, and hit enter, it always uses the second response ("lockpick" in the code below). I have tried variations on the code but I still don't see the solution. I believe the problem is that the "typein" variable holds all the format information from the text box as well as the variable, but I could be wrong, that information is in here as well, underneath the code itself. Any help I can get would be greatly appreciated. var typein = ""; //copies the text from inbox into here, this is what nistra responds to var inbox = ""; //this is where the text from the input text box goes var respond = ""; //nistra's responses go here my_listener = new Object(); // key listener my_listener.onKeyDown = function() { if(Key.isDown(13)) //enter button pressed { typein = inbox; // moves inbox into typein nistraresponse(); // calles nistra's responses } //code = Key.getCode(); //trace ("Key pressed = " + code); } Key.addListener(my_listener); // key listener ends here nistraresponse = function() // nistra's responses { trace(typein); // trace out what "typein" holds if(typein = "Hello") // if you type in "Hello" { respond = "Hello, How are you?"; } if(typein = "lockpick") // if you type in "lockpick" { respond = "Affirmative"; } else // anything else { respond = "I do not understand the command, please rephrase"; } cntxtID = setInterval(clearnistra, 5000); // calls the function that clears out nistra's response box so that her responses don't just sit there } clearnistra = function() // clears her respond box { respond = ""; clearInterval(cntxtID); } // "typein" traces out the following <TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="Times New Roman" SIZE="20" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">test</FONT></P></TEXTFORMAT>

    Read the article

  • Is there anyway to write the following as a C/C++ macro?

    - by anon
    my_macro << 1 << "hello world" << blah->getValue() << std::endl; should expand into: std::ostringstream oss; oss << 1 << "hello world" << blah->getValue() << std::endl; ThreadSafeLogging(oss.str()); Thanks! EDIT: the accepted answer is awesome. Can we upvote 8 more times and win this responder a badge? (The answer only needs 6 more upvotes). 4 more votes to go from 21 to 25. 3 more. :-) Victory. :-)

    Read the article

  • Best practice question

    - by sid_com
    Hello! Which version would you prefer? #!/usr/bin/env perl use warnings; use strict; use 5.010; my $p = 7; # 33 my $prompt = ' : '; my $key = 'very important text'; my $value = 'Hello, World!'; my $length = length $key . $prompt; $p -= $length; Option 1: $key = $key . ' ' x $p . $prompt; Option 2: if ( $p > 0 ) { $key = $key . ' ' x $p . $prompt; } else { $key = $key . $prompt; } say "$key$value"

    Read the article

  • Check if NSMutableArray contains text from textfield

    - by Polo Swelsen
    I want to check if the text inserted in a textfield is also in my NSMutableArray. So let's say my NSMutableArray has these objects: "Hey, Hello, No, Yes". Then when a user enters the text: "Hello" i want there to appear a UIAlertView. I now have the following: for (int slt = 0; slt < [zouten count]; slt++) { if (zout.text = [zouten objectAtIndex:slt]) { alert = [[UIAlertView alloc]initWithTitle:@"Goedzo!" message:[NSString stringWithFormat:@"Je hebt een zout gevonden"] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; } } [alert show]; But somehow the message appears with every word. what am i doing wrong?

    Read the article

  • Why isn't this simple program working?

    - by user1445478
    I'm writing a very basic program that aims for the text view to display the phrase "Hello" after a button is pressed on the screen. However, I can't get this program to work; every time I run it, it says that the application has stopped unexpectedly. This is the program I wrote: public class EtudeActivityActivity extends Activity{ TextView tvResponse; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final TextView tvResponse = (TextView) findViewById (R.id.tvResponse); } public void updateTV(View v) { tvResponse.setText("Hello"); } } Also, I inserted an android:onClick = "updateTV" into my main.xml file for the button. Thanks for any help!

    Read the article

  • making a programming language

    - by None
    I was wondering which way would create a faster programming language, because I have tried both. Writing code that takes the text, splits it by whitespace or newlines or something, then processes each line and has a dictionary for variables. Or writing code that takes text and converts it to another programming language. This is an example of how a very simple version of the first way would be programmed in python: def run(code): text = code.split(";") for t in text: if t == "hello": print "hi" second: def run(code): rcode = "" text = code.split(";") for t in text: if t == "hello": rcode += "print 'hi'"

    Read the article

  • PHP & bash; Linux; Compile my own function

    - by flienteen
    Hi. I would like to make my own program but I have no idea how.. for example I want to make a typical 'Hello $user' program. So.. +-- hi ¦   +-- hi.sh ¦   +-- hi_to.sh hi.sh #!/bin/bash ~/hi/hi_to.sh $1 hi_to.sh #!/usr/bin/php <?php echo "\nHellO ".$argv[1]."\n"; ?> Run it in terminal: me:~/hi ? ./hi.sh User HellO User and my question is: how to compile all this files into one bash program?

    Read the article

  • How to launch new Firefox window with multiple tabs using Python

    - by newbie py
    Hi, I want to create a MSWindows Python program that would launch a new Firefox window with multiple tabs each time it is run. For example if I want to search "hello", a new window pops out (even if a Firefox window is already open) and then launches a Google and Bing tabs searching for "hello". If I change the keyword to "world", a new browser pops out again with Google and Bing tabs searching for "world". I've looked at the webbrowser module but couldn't get it to: 1. Launch a new browser when a browser is already open: e.g. webbrowser.open('http://www.google.com',new=1) will instead open a new tab 2. Launch multiple tabs simultaneously in the same window Appreciate the help. Thanks.

    Read the article

  • How do I insert format str and don't remove the matched regular expression in input string in boost:

    - by Yadollah
    I want to put space between punctuations and other words in a sentence. But boost::regex_replace() replaces the punctuation with space, and I want to keep a punctuation in the sentence! for example in this code the output should be "Hello . hi , " regex e1("[.,]"); std::basic_string<char> str = "Hello.hi,"; std::basic_string<char> fmt = " "; cout<<regex_replace(str, e1, fmt)<<endl; Can you help me?

    Read the article

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