Search Results

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

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

  • Using Python simplejson for transmitting JSON to another server results in unicode encoding problems

    - by Mark
    Hi there, I'm encoding a string with Python's simplejson library with special characters: hello testing spécißl characters plusses: +++++ special chars :œ?´®†¥¨ˆøp“ß?ƒ©??°¬O˜çv?˜µ== However, when I encode it and transmit it to the other machine (using POST), it turns out like this: {'message': ['{"body": "hello testing sp\\u00e9ci\\u00dfl characters\\n\\nplusses: \\n\\nspecial chars :\\u0153\\u2211\\u00b4\\u00ae\\u2020\\u00a5\\u00a8\\u02c6\\u00f8\\u03c0\\u201c\\u00df\\u2202\\u0192\\u00a9\\u02d9\\u2206\\u02da\\u00ac\\u03a9\\u2248\\u00e7\\u221a\\u222b\\u02dc\\u00b5\\u2264\\u2265"}']} The + signs are completely stripped and the rest are in this unicode(?) format. My code for this is: data = {'body': data_string} data_encoded = json.dumps(data) Any ideas? Thanks! Edit: I've tried using json.dumps(data, ensure_ascii=False) but it results in a UnicodeError ordinal not in range error.

    Read the article

  • What is the use of reflection in Java/C# etc

    - by zengr
    I was just curious, why should we use reflection in the first place? // Without reflection Foo foo = new Foo(); foo.hello(); // With reflection Class cls = Class.forName("Foo"); Object foo = cls.newInstance(); Method method = cls.getMethod("hello", null); method.invoke(foo, null); We can simply create an object and call the class's method, but why do the same using forName, newInstance and getMthod functions? To make everything dynamic?

    Read the article

  • Retain Delimiters when Splitting String

    - by JoeC
    Edit: OK, I can't read, thanks to Col. Shrapnel for the help. If anyone comes here looking for the same thing to be answered... print_r(preg_split('/([\!|\?|\.|\!\?])/', $string, null, PREG_SPLIT_DELIM_CAPTURE)); Is there any way to split a string on a set of delimiters, and retain the position and character(s) of the delimiter after the split? For example, using delimiters of ! ? . !? turning this: $string = 'Hello. A question? How strange! Maybe even surreal!? Who knows.'; into this array('Hello', '.', 'A question', '?', 'How strange', '!', 'Maybe even surreal', '!?', 'Who knows', '.'); Currently I'm trying to use print_r(preg_split('/([\!|\?|\.|\!\?])/', $string)); to capture the delimiters as a subpattern, but I'm not having much luck.

    Read the article

  • Mootools periodical funcion and time rewind

    - by hsz
    Hello ! I have some function taht is caller periodically: var func = function() { alert('Hello world!'); }; func.periodical(5000); This function is also called with click event: $('element').addEvent('click', function(){ func(); }); The timer starts and counts 2500msec, then I click $('element'), func() is executed and I want right now to reset the timer that func() will not be called in next 2500msec but in following 5000msec. How to do that ?

    Read the article

  • <noscript> not working in Opera 11?

    - by cappuccino
    I am testing my noscript tags which display content when javascript is disabled, this works in Safari, Chrome, Firefox, Camino, IE6, IE7, IE8, IE9, basically everything but Opera (I'm running version 11, not sure if its isolated to that version). In Opera 11 nothing is displayed... is the noscript tag not supported? and what is the alternative? Nothing surprising: <noscript>Please enable JavaScript.</noscript> Located between the body tags. <html> <body> <script>alert('Hello World');</script> <noscript>Hello World!</noscript> </body> </html>

    Read the article

  • string manipulations in C

    - by Vivek27
    Following are some basic questions that I have with respect to strings in C. If string literals are stored in read-only data segment and cannot be changed after initialisation, then what is the difference between the following two initialisations. char *string = "Hello world"; const char *string = "Hello world"; When we dynamically allocate memory for strings, I see the following allocation is capable enough to hold a string of arbitary length.Though this allocation work, I undersand/beleive that it is always good practice to allocate the actual size of actual string rather than the size of data type.Please guide on proper usage of dynamic allocation for strings. char *string = (char *)malloc(sizeof(char));

    Read the article

  • Zend + Wamp = Cant use curl/fput for a url locally

    - by bluedaniel
    Ive got a page in Zend all set up that will for now just echo "Hello", this address is at http://dev.local/hello and works when visiting in the browser. However when I try to use curl or file_get_contents from a script in my zend 'public' folder I get a 500 Internal error message. UPDATE Its failing because my application tries to set the langauge based on the browsers default language, when using headers like I have below, how do I add this locale? "User-Agent: XXXXXXX/2.0\r\n" . "Accept: */*\r\n" . "Accept-Charset: utf-8;\r\n" .

    Read the article

  • PODS + WP Theme

    - by Sharath
    So I managed to setup pods and create my custom tables. Now I want to revamp my theme so that it pulls data from the POD table. Doesn't seem to be working... This is what I did.. I have a Pod called 'project_type' with a name (string) and a code (string) field. Have also added 3 entries via the admin system. I made a copy of the default wordpress plugin and renamed it to myTheme and activated it. Inside index.php of myTheme, I removed all the default code.. and have just the POD specific code as shown below. <?php echo "Hello World"; $p = new Pod('project_type'); echo $p->getTotalRows(); ?> However, when I reload my page, only Hello World shows up? A bit new to Wordpress so kindly advice.

    Read the article

  • How can I create or assign a method to temp (WindowAdapter)?

    - by Doug Hauf
    I want to create an instance of the WindowAdapter and put my method for windowClosing in it and then sent the temp into the f.addWindowListener(temp) can this be done. Java will not let me create an instance of WindowAdapter like below. WindowAdapter temp = new WindowAdapter(); <-- Does not compile How could this be done? Code: public static void main(String args[]) { setLookFeel(); JFrame f = new JFrame("Hello World Printer..."); WindowAdapter temp; f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); JButton printButton = new JButton("Print Hello World"); printButton.addActionListener(new HelloWorldPrinter()); f.add("Center", printButton); f.pack(); f.setVisible(true); }

    Read the article

  • PHP unserialize fails with non-encoded characters?

    - by FFish
    $ser = 'a:2:{i:0;s:5:"héllö";i:1;s:5:"wörld";}'; // fails $ser2 = 'a:2:{i:0;s:5:"hello";i:1;s:5:"world";}'; // works $out = unserialize($ser); $out2 = unserialize($ser2); print_r($out); print_r($out2); echo "<hr>"; But why? Should I encode before serialzing than? How? I am using Javascript to write the serialized string to a hidden field, than PHP's $_POST In JS I have something like: function writeImgData() { var caption_arr = new Array(); $('.album img').each(function(index) { caption_arr.push($(this).attr('alt')); }); $("#hidden-field").attr("value", serializeArray(caption_arr)); };

    Read the article

  • help me to understand viewstate

    - by EquinoX
    I was just reading this article here to understand about how view state and ASP.NET page cycle works. I just don't understand this part here: If this were the case, then in step 3 the Label's Text property would be assigned to "Hello, World!" in the instantiation stage, but would not be reassigned to "Goodbye, Everyone!" in the load view state stage. Therefore, from the end user's perspective, the Label's Text property would be "Goodbye, Everyone!" in step 2, but would seemingly be reset to its original value ("Hello, World!") in step 3, after clicking the Empty Postback button. This paragraph is after the three step 1, step 2, step 3 boxes. Why wouldn't the label's text property be reassigned to "Goodbye, Everyone" in the load view state?

    Read the article

  • Basic help needed with pointers (double indirection)

    - by sbsp
    Hi, i asked some time ago on an account i cant remember how to manipulate basic pointers and someone gave me a really good demo for example char *ptr = "hello" (hello = a char array) so now *ptr is pointing at h ptr++ = moves the ptr to point at the next element, to get its value i do *ptr and that gives me e ok so far i hope :D but now i need to manipulate a char **ptr and was wondering how I do this in a way that mimmicks the effects of a 2d array? some basic tips would be much appreciated as I need to do an assignment that has a **ptr to imitate a 2d array and without knowing how it does this first means I cant even solve it on paper (for example, how do you dereference a **ptr, how do you get [x][y] values etc) thanks

    Read the article

  • JSON from jQuery to PHP

    - by enfix
    I need to pass a JSON object from $.post() jQuery function to PHP page. I tried this plugin jquery-json, but don't work: //include jquery.js and jquery.json.js $(document).ready(function(){ var data = new Object(); data.hello = "Hello"; data.world = "World"; var datajson = $.toJSON(data); $.post('file.php', {data: datajson}, function(res){ alert(res); }); }); And file.php has this simple line: <? var_dump(son_decode($_REQUEST['data'], true)); ?> What's the problem ?

    Read the article

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