Search Results

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

Page 52/816 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • How to return JSON in a Webservice?

    - by BrunoLM
    I need a Hello World example... [WebService(Namespace = "xxxxx")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService()] public class Something : System.Web.Services.WebService { public Something() { } [WebMethod] [ScriptMethod(ResponseFormat=ResponseFormat.Json)] public string HelloWorld() { return "{Message:'hello world'}"; } } Because it generates an error {"Message":"Invalid JSON primitive: value.","StackTrace":" at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)\r\n at System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext context, JavaScriptSerializer serializer)\r\n at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"} What's wrong?

    Read the article

  • urlrewriter.net page not executed

    - by peter
    Hello, I'm having some problems with the module urlrewriter.net for ASP.NET. I have a multilingual site with a URL like this; ~/home.aspx To support languages I use this rewrite rule; <rewrite url="~/de-DE/(.*)" to="~/$1"></rewrite> Then in my code I get the de-DE part and set the right culture for the current thread. All of this works well. After I login on the website I get a message "Hello, user x" to show i'm logged in. When navigating to another page, it doesn't display this message anymore and it seems like the page comes from the cache or something with the old (not logged in) data. Also, when I attach the debugger, nothing is executed for this request. If I visit the page like ~/home.aspx instead of ~/de-DE/home.aspx, does problem does not occur. What could be the problem here? Thanks

    Read the article

  • C operating system createprozess

    - by Tyzak
    hello, i'm new at C Programming (i learned c++) i want to create a process with windows.h at first i just want to start my main programm that creates a process ( -- starts an other programm) that's my code, but it doesn't really work, i removed every unnessasery line of code but "void sleep(700)" (or "sleep (700)" for testing if the windows methods work, but i get an error, that "sleep" cant be found. #include <iostream> #include <windows.h> #include <string> using namespace std; void main() { //bool ret; //startupinfo stupinfo; //prozess_information pro2info; //Getstartupinfo (&stupinfo); //createprozess(null, "C:\\bsss10\\betriebssystemePRA1.exe", null, null, false, create_new_console, null, // null, &stupinfo, &pro2info); sleep (700); cout<< "hello"; } thanks in advance

    Read the article

  • more ruby way of gsub from array

    - by aharon
    My goal is to let there be x so that x("? world. what ? you say...", ['hello', 'do']) returns "hello world. what do you say...". I have something that works, but seems far from the "Ruby way": def x(str, arr, rep='?') i = 0 query.gsub(rep) { i+=1; arr[i-1] } end Is there a more idiomatic way of doing this? (Let me note that speed is the most important factor, of course.)

    Read the article

  • Lines Concatenation between two files.

    - by Nano HE
    file1.txt hello tom well file2.txt world jerry done How to merge file1.txt with file2.txt; then create a new file - file3.txt hello world tom jerry well done thank you for reading and reply. Attached the completed code. #!/usr/bin/perl use strict; use warnings; open(F1,"<","1.txt") or die "Cannot open file1:$!\n"; open(F2,"<","2.txt") or die "Cannot open file2:$!\n"; open (MYFILE, '>>3.txt'); while(<F1>){ chomp; chomp(my $f2=<F2>); print MYFILE $_ . $f2 ."\n"; }

    Read the article

  • JAVA Inheritance Generics and Casting.

    - by James Moore
    Hello, I have two classes which both extends Example. public class ClassA extends Example { public ClassA() { super("a", "class"); } .... } public class ClassB extends Example { public ClassB() { super("b", "class"); } .... } public class Example () { public String get(String x, String y) { return "Hello"; } } So thats all very well. So suppose we have another class called ExampleManager. With example manager I want to use a generic type and consequently return that generic type. e.g. public class ExampleManager<T extends Example> { public T getExample() { return new T("example","example"); // So what exactly goes here? } } So where I am returning my generic type how do i get this to actually work correctly and cast Example as either classA or classB? Many Thanks

    Read the article

  • add text to UITextField at desired location

    - by Ankit Sachan
    Hello, Hello, I am quite new to iphone development. I have a situation here. I have some labels which can be dragged across the screen. When any of these labels are dragged to some textfield and released over a textfields UIlabel test is assigned to that text field. Now the problem is this I want to assign the text of UILabel to some specific position in textfield according to release of textfield i.e If user releases at the beginning of text field then it should be appended at the beginning and if somewhere near end of text of textfield then it should be appendended at the end. Can you help me to fabricate this condition. Thanx in advance

    Read the article

  • Calculating the pixel size of a string with Python

    - by Aristide
    I have a Python script which needs to calculate the exact size of arbitrary strings displayed in arbitrary fonts in order to generate simple diagrams. I can easily do it with Tkinter. The problem is the results seem to depend on the version of Python and/or the system. import Tkinter as tk import tkFont root = tk.Tk() times12 = tkFont.Font(family="times",size=12) print times12.metrics("linespace"), print times12.measure("Hello world") times24 = tkFont.Font(family="times",size=24) print times24.metrics("linespace"), print times24.measure("Hello world") Python 2.5 on Mac OS X gives the actual pixel measurements: 12 57 24 116 Python 2.6.1 on Mac OS X gives: 14 58 27 115 Python 2.6.3 on Windows XP gives: 19 71 36 154 Such a need being quite common, I suspect I did something wrong. Any idea?

    Read the article

  • Using Response.Redirect() to a relative path.

    - by Bryan
    I'm working with ASP.net. My website is hosted within a subfolder test under the IIS root directory. So the url of default.aspx is http://localhost/test/Default.aspx. From default.aspx, I want to use Reponse.Redirect() with a relative path to redirect to another url within the same web site, http://localhost/test/whatever. I tried Response.Redirect("/hello"); and Response.Redirect("~/hello"); Both of them redirect to http://localhost/whatever. Note that the Redirect method use http://localhost instead of http://localhost/test/ as the base url. Any ideas? Thanks.

    Read the article

  • Visual Studio 2005 - VC++ compiler C1001 on Windows 7

    - by Fritz H
    When I try to build a simple "Hello World" C++ app on Windows 7 Beta, using Visual Studio 2005 (VC++2005) I get a rather generic error C1001 error (Internal compiler error) The compiler seems to just crash, and Windows pops up its (un)helpful This program has stopped working dialog. The file it complains about is mcp1.cpp. Has anyone come across this before? Cheers, Fritz EDIT: The code is: #include <iostream> int main(int argc, char** argv) { std::cout << "Hello!"; return 0; } EDIT 2: I have installed SP1 as well as SP1 for Vista. VS popped up a warning saying it needs SP1 for Vista, but installing it makes no difference. No ideas about what I can possibly do to fix this?

    Read the article

  • Java newbie problem: package with private access

    - by HH
    Pack.java imports pack.TestPack; but it cannot access it. I cannot understand why it cannot access the class despite the import. Error Pack.java:7: TestPack() is not public in pack.TestPack; cannot be accessed from outside package System.out.println(new TestPack().getHello()); ^ 1 error Pack.java import pack.TestPack; import java.io.*; public class Pack { public static void main(String[] args){ System.out.println(new TestPack().getHello()); } } TestPack.java package pack; import java.util.*; import java.io.*; public class TestPack { private String hello="if you see me, you ar inside class TestPack"; public String getHello(){return hello;} TestPack(){} }

    Read the article

  • How to efficently build an interpreter (lexer+parser) in C?

    - by Rizo
    I'm trying to make a meta-language for writing markup code (such as xml and html) wich can be directly embedded into C/C++ code. Here is a simple sample written in this language, I call it WDI (Web Development Interface): /* * Simple wdi/html sample source code */ #include <mySite> string name = "myName"; string toCapital(string str); html { head { title { mySiteTitle; } link(rel="stylesheet", href="style.css"); } body(id="default") { // Page content wrapper div(id="wrapper", class="some_class") { h1 { "Hello, " + toCapital(name) + "!"; } // Lists post ul(id="post_list") { for(post in posts) { li { a(href=post.getID()) { post.tilte; } } } } } } } Basically it is a C source with a user-friendly interface for html. As you can see the traditional tag-based style is substituted by C-like, with blocks delimited by curly braces. I need to build an interpreter to translate this code to html and posteriorly insert it into C, so that it can be compiled. The C part stays intact. Inside the wdi source it is not necessary to use prints, every return statement will be used for output (in printf function). The program's output will be clean html code. So, for example a heading 1 tag would be transformed like this: h1 { "Hello, " + toCapital(name) + "!"; } // would become: printf("<h1>Hello, %s!</h1>", toCapital(name)); My main goal is to create an interpreter to translate wdi source to html like this: tag(attributes) {content} = <tag attributes>content</tag> Secondly, html code returned by the interpreter has to be inserted into C code with printfs. Variables and functions that occur inside wdi should also be sorted in order to use them as printf parameters (the case of toCapital(name) in sample source). I am searching for efficient (I want to create a fast parser) way to create a lexer and parser for wdi. Already tried flex and bison, but as I am not sure if they are the best tools. Are there any good alternatives? What is the best way to create such an interpreter? Can you advise some brief literature on this issue?

    Read the article

  • Objective-C Custom extend

    - by ryanjm.mp
    I have a couple classes that have nearly identical code. Only a string or two is different between them. What I would like to do is to make them from another class that defines those functions and then uses constants or something else to define those strings that are different. I'm not sure if "___" is inheritance or extending or what. That is what I need help with. For example: objectA.m: -(void)helloWorld { NSLog("Hello %@",child.name); } objectBob.m: #define name @"Bob" objectJoe.m #define name @"Joe" (I'm not sure if it's legal to define strings, but this gets the point across) It would be ideal if objectBob.m and objectJoe.m didn't have to even define the methods, just their relationship to objectA.m. Is there any way to do something like this? If all else fails I'll just make objectA.m: -(void)helloWorld:(NSString *name) { NSLog("Hello %@",name); } And have the other files call that function (and just #import objectA.m).

    Read the article

  • Haskell: variant of `show` that doesn't wrap String and Char in quotes

    - by Joey Adams
    I'd like a variant of show (let's call it label) that acts just like show, except that it doesn't wrap Strings in " " or Chars in ' '. Examples: > label 5 "5" > label "hello" "hello" > label 'c' "c" I tried implementing this manually, but I ran into some walls. Here is what I tried: {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Label where class (Show a) => Label a where label :: a -> String instance Label [Char] where label str = str instance Label Char where label c = [c] -- Default case instance Show a => Label a where label x = show x However, because the default case's class overlaps instance Label [Char] and instance Label Char, those types don't work with the label function. Is there a library function that provides this functionality? If not, is there a workaround to get the above code to work?

    Read the article

  • remote function with pthread

    - by user311130
    Hi all, I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first). #include <pthread.h> #include "starter.h" #include "UI.h" Page* MM; Page* Disk; PCB* all_pcb_array; void* display_prompt(void *id){ printf("Hello111\n"); return NULL; } int main(int argc, char** argv) { printf("Hello\n"); pthread_t *thread = (pthread_t*) malloc (sizeof(pthread_t)); pthread_create(thread, NULL, display_prompt, NULL); printf("Hello\n"); return 1; } that works fine. However, when I move display_prompt to UI.h no "Hello111 " output is printed. anyone know how to solve that? Elad

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >