Search Results

Search found 5222 results on 209 pages for 'characters'.

Page 62/209 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • more efficient way to pickle a string

    - by gatoatigrado
    The pickle module seems to use string escape characters when pickling; this becomes inefficient e.g. on numpy arrays. Consider the following z = numpy.zeros(1000, numpy.uint8) len(z.dumps()) len(cPickle.dumps(z.dumps())) The lengths are 1133 characters and 4249 characters respectively. z.dumps() reveals something like "\x00\x00" (actual zeros in string), but pickle seems to be using the string's repr() function, yielding "'\x00\x00'" (zeros being ascii zeros). i.e. ("0" in z.dumps() == False) and ("0" in cPickle.dumps(z.dumps()) == True)

    Read the article

  • What is the most efficient way to encode an arbitrary GUID into readable ASCII (33-127)?

    - by mark
    Dear ladies and sirs. The standard string representation of GUID takes about 36 characters. Which is very nice, but also really wasteful. I am wondering, how to encode it in the shortest possible way using all the ASCII characters in the range 33-127. The naive implementation produces 22 characters, simply because 128 bits / 6 bits yields 22. Huffman encoding is my second best, the only question is how to choose the codes.... Any more ideas? Thanks. P.S. The encoding must be lossless, of course.

    Read the article

  • Java document parsing over internet using POST

    - by Travis
    I've looked all around and decided to make my own library for accessing the EVE API. Requests are sent to a server address such as /account/Characters.xml.aspx. Characters.xml.aspx requires two item be submitted in POST and then it returns an XML file. So far I have this but it does not work, probably becuase I am using GET instead of POST: //Get the API data DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); String url = "http://api.eveonline.com/account/Characters.xml.aspx?userID="+ userID+"?apiKey="+key; Document doc = builder.parse(url); How would I go about being able to parst an XML file that is generated by submitting variables in POST?

    Read the article

  • producing a typewriter-like effect

    - by Tony Ennis
    Android newb here. Please use small words :-) I'd like to simulate typewriter output on my Android. The output being displayed is generated by a game and is somewhat freeform. The effect I want to see individual characters appear at a rate of about 6 characters a second. When a 'carriage return' is seen, I'd like to insert a delay then resume typing on the left. What are some suggestions on views? Would the view of choice for this be a TextView? Even that seems like overkill for this read-only coarsely scrolling output. I saw something on this thread about an AsyncTask. That looks useful. Perhaps my game will write to some manner of buffer, and a subclass of AsyncTask will pull characters out every .15 seconds or so, add them to the TextView, then invalidate() the TextView? Sound like a plan?

    Read the article

  • jquery form validate not allow space for username field?

    - by python
    I have used http://bassistance.de/jquery-plugins/jquery-plugin-validation/ my form validate : $("#form_person").validate({ rules: { username: { required: true, minlength: 2, maxlength:15 }, password: { required: true, minlength: 2 }, confirm_password: { required: true, minlength: 2, equalTo: "#password" }, email: { required: true, email: true } }, messages: { username: { required: "Please enter a username", maxlength:"max length 15 digits", minlength: "Your username must consist of at least 2 characters" }, password: { required: "Please provide a password", minlength: "Your password must be at least 5 characters long" }, confirm_password: { required: "Please provide a confirm password", minlength: "Your password must be at least 5 characters long", equalTo: "Please enter the same password as above" } }); Anybody help me to validate not allow space on username? thanks

    Read the article

  • How to encode 'á' to '&#225' with C# ?? (UTF8)

    - by Llorens Marti
    Hi all I'm trying to write an XML file with UTF-8 encode, and the original string can have invalid characters like 'á', so, i need to change these invalid characters to a valid ones. I know that there is an encoding method that take, for example, character 'á' and transform it to group of characters 'á'. I am trying to achive this with C#but i have no succes on it. I am using Encoding.UTF8 functions but i only end with the sema character (i.e: á) or a '?' character. So, do you know with is the correct way to achive this character change with C# ?? Thanks for your time and help :) LLORENS

    Read the article

  • How to split strings at specific intervals to arrays in javascript

    - by t3st
    how to split strings at specific interveals to arrays in javascript for example: split this string into 4 characters (including space and characters) this is an example should be split,numbers(123),space,characters also included to this ------> 1st array is ------> 2nd array an ------> 3rd array exam ------> 4th array ple ------> 5th array shou ------> 6th array ............ etc till..... ..ed ------> last array

    Read the article

  • 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

  • Storing apostrophes, exclamation marks, etc. in mysql database

    - by rein
    I changed from latin1 to utf8. Although all sorts of text was displaying fine I noticed non-english characters were stored in the database as weird symbols. I spent a day trying to fix that and finally now non-english characters display as non-english characters in the database and display the same on the browser. However I noticed that I see apostrophes stored as &#39; and exclamation marks stored as &#33;. Is this normal, or should they be appearing as ' and ! in the database instead? If so, what would I need to do in order to fix that?

    Read the article

  • Regular Expression: Allow letters, numbers, and spaces (with at least one letter or number)

    - by makeee
    I'm currently using this regex ^[A-Z0-9 _]*$ to accept letters, numbers, spaces and underscores. I need to modify it to require at least one number or letter somewhere in the string. Any help would be appreciated! This would be for validating usernames for my website. I'd actually like to support as many characters as I can, but just want to ensure that I prevent code injection and that characters will display fine for all users. So I'm definately open to regex validation suggestions that would support a wider set of characters.

    Read the article

  • Replacing elements within a string in R

    - by Maureen
    Hi, I have a row in a data frame in R that is made up of sequences of undetermined length of 0s 1s and 2s as characters. So "01", "010", "201", "102", "00012"... things like this. I'd like to find a way to determine if the last character in the string is NUMERICALLY the largest. It's important that I keep the row in the data frame as characters for other purposes. So basically I want to take substr(x, nchar(x), nchar(x)) and determine if it, as a number, is the largest of the numbers in the character string. I'm super lost as to how to do this, since I'm not all that familiar with regular expressions and I have to back and forth between treating elements as characters and numbers. Thanks in advance. ~Maureen

    Read the article

  • how to put a value to an array when a checkbox is checked? c#?

    - by Jan Darren Noroña
    I am making a random character generator, i have 2 forms, form1 and form2, on my form2 i have the checkboxes there, so if the user checked checkbox1, on my form1 it will only display 1 character, now if the user check all 5 checkboxes, my form1 will generate 5 characters. i have a button on form1 that will trigger an event on generating random characters. characters: '+','-','*','/','%' how will my code be? I am using WINDOWS FORMS APPLICATION. pics here: form1: http://i49.tinypic.com/30bzos8.png form2: http://i50.tinypic.com/k00ndt.png char[] select = new char[] { '+' , '-' , '*' , '/', '%' }; var rand = new Random(); char num = select[rand.Next(5)];

    Read the article

  • Need help with displaying the message correctly in the pole display always starting at the beginning

    - by SA
    Hi, I am using an HP RS232 pole display with the following setting: Char type: USA/Europe (default) Command mode: EPSON (default) Baud rate: 9600, n , 8, 1 (default?) Passthru None (Default) Here's the code using System.IO.Ports; private SerialPort port; port = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One); port.Handshake = Handshake.None; Port.WriteLine("Welocome to something something"); It has 2 lines consisting of 20 characters each with a total of 40 characters. I have no control how and where the characters get displayed. I would like it to always begin on line 1 position 1 but as I said earlier how would I be able to do that. The same program if I run again and again it moves a character to the left. I have set it to accept ASCII char set and so I am able to type as is visble in the Writeline message

    Read the article

  • Japanese character stored in SQL Server DB using ASP page that assumed it as ISO-8859-1 encoding

    - by Vishal Seth
    We have a legacy ASP based product that allowed the UI and Data languages of user groups to be configured according to their locations. CodePage and CharSet in ASP pages collecting data was set accordingly. I've noticed few instances in the SQL Server DB where users posted Japanese characters in the ASP page that assumes the oncoming stream to be of ISO-8859-1/Western and as a result, the data in the SQL table has gobbled up. While upgrading the client to our new product, I want to back-convert those "garbage" Japanese (in some instances Chinese) characters back to their actual form. Can I create some utility ASP page that would go through such data values and "fix" the wrongly-encoded strings and store everything back as utf-8 strings? In any case, I don't want to affect my French/Spanish/English characters that might be there as well.

    Read the article

  • Are there any Visual Studio add-ins for true 'smart tabs'?

    - by Eye of Hell
    Hello. 'Smart Tabs' concept allows to automatically insert tab character for block indentation and space characters for in-block formatting. It's described here. Unfortunately, Visual Studio's 'smart tabs' option in text editor settings just indents text on enter press. Same name, completely different and near useless thing :). So, maybe someone knows of a visual studio addin that can change how 'tab' key work so it will insert tab characters and space characters according to rules mentioned above? Any hints are welcome. Update: I need it for C++. According to comments, ReSharper can do something like this, but only for Basic and C#.

    Read the article

  • jquery text area length count?

    - by Nimesh
    Hi All, I have a text area field where i need to provide information about the word count when the user enters some text in the field. Length of the field is supposed to be 500 Characters. Initialy it must show min characters:100 | 0 of 500 // 0 of 500 must be in red color and once the user enters come character need to update the count as well. Once the user reaches the count say the min character 100, i need to display min characters:100 | 100 of 500 // 100 of 500 must be in green color. How can i do this?? is there any plugin for the same??? let me know your thoughts on this.

    Read the article

  • PHP reporting error. DB verify how to?

    - by iamfab
    Error reporting Notice: Undefined variable: random_chars in wamp\www\php_sandbox\idgen.php on line 21 Call Stack: # Time Memory Function Location 1 0.0045 678928 {main}( ) ..\idgen.php:0 GPB7446 How do I fix this error? Using this code like an automatic unique id generator. How do I connect to DB to verify code is truly unique before allowing it to be assigned to a user creating a new account? Thanks <?php $characters = array( "A","B","E","F","G","H","J","K","M","N","P","R","S","T","W","X","Y","Z"); $keys = array(); while(count($keys) < 3) { $x = mt_rand(0, count($characters)-1); if(!in_array($x, $keys)) { $keys[] = $x; } } foreach($keys as $key){ $random_chars .= $characters[$key];} $randNum = rand(2327,9987); $randLet = rand(2327,9987); echo $random_chars . $randNum; ?>

    Read the article

  • Character encoding problem in my website.

    - by vikyboss
    I own a website that was recently moved to a different server, now I can see some weird characters. Initially the website was coded with UTF-8 encoding. The weird characters disappears if I change the View Character encoding to Western(8859-1) in my browser. Therefore, I changed the source of the website to use this Western one, but still I can see the weird characters and they doesn't seem to disappear. Can anyone help me with this. Thanks in advance.

    Read the article

  • Are where any Visual Studio addings for true 'smart tabs'?

    - by Eye of Hell
    Hello. 'Smart Tabs' concept allows to automatically insert tab character for block indentation and space characters for in-block formatting. It's described here. Unfortunately, Visual Studio's 'smart tabs' option in text editor settings just indents text on enter press. Same name, completely different and near useless thing :). So, maybe someone knows of a visual studio addin that can change how 'tab' key work so it will insert tab characters and space characters according to rules mentioned above? Any hints are welcome.

    Read the article

  • How to remove [^a-z\s] in C++

    - by Steven
    So far I have: int SimplifyText(char chars[], int length) { //To lower for(int i=0; i<length; i++) { chars[i] = tolower(chars[i]); } This function simplifies the text in the first argument which is an array containing the number of characters as given in the second argument The requirements are: tolower all remove all non-alpha characters replace multiple whitespace by one blank. Any leading whitespace at the beginning of the array should be removed completely. The resulting number of characters should be returned as the value of the function. And the annoying part: Another array cannot appear in the function Cannot use strings, only char arrays. Cannot using G++'s extension for setting an array size using a variable. Oh and can't use regex :) I'm stuck with this, any help would be great. :)

    Read the article

  • Simple HTML form with POST to SQL function encoding problem?

    - by Spoonk
    Hi again, I have a simple html form that submits information with POST function. But when information contains a Cyrillic characters, in table in MySql there becomes азазаза symbols instead of text. The table is on utf-8_general_ci, the site is on UTF-8 encoding. I visualize the result from this table with $query = " SELECT ".$db->nameQuote('ingredients')." FROM ".$db->nameQuote('other')." ORDER by id DESC "; $db->setQuery($query); $ingredients = $db->loadResult(); I cant understand how to tell the form to send chyrillic characters correct. Or where is the problem at all? How to fetch this characters correctly? Or how to send them correctly?

    Read the article

  • Visual Website Optimizer and Code Igniter

    - by absentx
    We are trying to integrate visual website optimizer into a site of ours that uses Code Igniter. The problem is when we go into the VWO control panel to look at stats and previews nothing seems to be working. In the previews panel, all of them come up as code igniter error pages that say "The URI you submitted has disallowed characters." I have researched some solutions to this and have tried changing the regex in system/config to allow more characters, all characters etc and I am still having the problem. Any known issues or problems trying to integrate VWO and Code Igniter? This definitely seems to be a url issue but I can't nail it down.

    Read the article

  • How to remove strings of certain lengths

    - by Macosx Iam
    So I have this array, and I want to delete strings that are 2 or 4 characters in length (strings that contain 2 or 4 characters). I am doing this method, and it doesn't work, even though logically, it SHOULD work. public static void main(String[] args) { ArrayList<String> list = new ArrayList<String>(); list.add("This"); list.add("is"); list.add("a"); list.add("test"); for (int i=0; i<list.size(); i++) { if(list.get(i).length()==2 || list.get(i).length()==4) { list.remove(i); } } } I'd like to stick to this method of doing it. Can you please give me some suggestions as to how to correct this code? The output of this code when I run it is: [is, a] Even though I want the output to be [a] because "is" is 2 characters long.

    Read the article

  • Setting an attribute in Jquery not working

    - by Probocop
    Hi, I have the following function which limits the amount of characters you can enter into a text area. What's meant to happen is, if the text length is higher than the text limit, set an attribute of disabled="disabled" on the submit button, but it isn't getting set, my function code is as follows: function limitChars(textid, limit, infodiv) { var text = $('#'+textid).val(); var textlength = text.length; if(textlength > limit) { $('#' + infodiv).html('You cannot write more then '+limit+' characters!'); $('input#submit').attr('disabled', 'disabled'); } else { $('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.'); } } Any ideas?

    Read the article

  • Removing a character from JSONObject?

    - by RandomlyKnighted
    My JSONObject has some random characters contained within the string so I'm trying to remove them. I've tried this but with no luck. String result = s.substring(1, s.length() - 2); JSONObject json_data = new JSONObject(result); if (json_data.has("[")) { json_data.remove("["); } if (json_data.has("]")) { json_data.remove("]"); } if (json_data.has(",")) { json_data.remove(","); } It's still not removing the characters from the JSONObject. Am I checking the JSONObject for the characters incorrectly?

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >