Search Results

Search found 13366 results on 535 pages for 'non ascii'.

Page 5/535 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Understanding Node.js and concept of non-blocking I/O

    - by Saif Bechan
    Recently I became interested in using Node.js to tackle some of the parts of my web-application. I love the part that its full JavaScript and its very light weight so no use anymore to call an JavaScript-PHP call but a lighter JavaScript-JavaScript call. I however do not understand all the concepts explained. Basic concepts Now in the presentation for Node.js Ryan Dahl talks about non-blocking IO and why this is the way we need to create our programs. I can understand the theoretical concept. You just don't wait for a response, you go ahead and do other things. You make a callback for the response, and when the response arrives millions of clock-cycles later, you can fire that. If you have not already I recommend to watch this presentation. It is very easy to follow and pretty detailed. There are some nice concepts explained on how to write your code in a good manner. There are also some examples given and I am going to work with the basic example given. Examples The way we do thing now: puts("Enter your name: "); var name = gets(); puts("Name: " + name); Now the problem with this is that the code is halted at line 1. It blocks your code. The way we need to do things according to node puts("Enter your name: "); gets(function (name) { puts("Name: " + name); }); Now with this your program does not halt, because the input is a function within the output. So the programs continues to work without halting. Questions Now the basic question I have is how does this work in real-life situations. I am talking here for the use in web-applications. The application I am writing does I/O, bit is still does it in am blocking matter. I think that most of the time, if not all, you need to block, because you have to wait on what the response is you have to work with. When you need to get some information from the database, most of the time this data needs to be verified before you can further with the code. Example 1 If you take a login for example. You have to wait for the database to response to return, because you can not do anything else. I can't see a way around this without blocking. Example 2 Going back to the basic example. The use just request something from a database which does not need any verification. You still have to block because you don't have anything to do more. I can not come up with a single example where you want to do other things while you wait for the response to return. Possible answers I have read that this frees up recourses. When you program like this it takes less CPU or memory usage. So this non-blocking IO is ONLY meant to free up recourses and does not have any other practical use. Not that this is not a huge plus, freeing up recourses is always good. Yet I fail to see this as a good solution. because in both of the above examples, the program has to wait for the response of the user. Whether this is inside a function, or just inline, in my opinion there is a program that wait for input. Resources I looked at I have looked at some recourses before I posted this question. They talk a lot about the theoretical concept, which is quite clear. Yet i fail to see some real-life examples where this is makes a huge difference. Stackoverflow: What is in simple words blocking IO and non-blocking IO? Blocking IO vs non-blocking IO; looking for good articles tidy code for asynchronous IO Other recources: Wikipedia: Asynchronous I/O Introduction to non-blocking I/O The C10K problem

    Read the article

  • Push Notification in non english languages

    - by jmall
    Hello, I have implemented successfully this code: http://stackoverflow.com/questions/1020762/does-anyone-know-how-to-write-an-apple-push-notification-provider-in-c It works great. But I have a question, can anybody help me how to send non english messages like Hebrew Or Arabic? If the string contains any non english characters, it is not sent. Thank you

    Read the article

  • Can non-IT people learn and take advantage of regular expressions? [closed]

    - by user1598390
    Often times, not-IT people has to deal with massive text data, clean it, filter it, modify it. Often times normal office tools like Excel lack the tools to make complex search and replace operations on text. Could this people benefit from regexps ? Can regexp be taught to them ? Are regular expressions the exclusive domain of programmers and unix/linux technicians ? Can they be learned by non-IT people, given regexps are not a programming language? Is this a valid or achievable goal to make some users regexp-literate through appopriate training ? Have you have any experiences on this issue? and if so, have it been successful ?

    Read the article

  • C#.NET Forms programing - Modal and Non-Modal forms problem

    - by Povilas
    Hello, I have a problem with modality of the forms under C#.NET. Let's say I have main form #0 (see the image below). This form represents main application form, where user can perform various operations. However, from time to time, there is a need to open additional non-modal form to perform additional main application functionality supporting tasks. Let's say this is form #1 in the image. On this #1 form there might be opened few additional modal forms on top of each other (#2 form in the image), and at the end, there is a progress dialog showing a long operation progress and status, which might take from few minutes up to few hours. The problem is that the main form #0 is not responsive until you close all modal forms (#2 in the image). I need that the main form #0 would be operational in this situation. However, if you open a non-modal form in form #2, you can operate with both modal #2 form and newly created non modal form. I need the same behavior between the main form #0 and form #1 with all its child forms. Is it possible? Or am I doing something wrong? Maybe there is some kind of workaround, I really would not like to change all ShowDialog calls to ShowDialog... Thanks, Povilas

    Read the article

  • WinForms programing - Modal and Non-Modal forms problem

    - by Povilas
    I have a problem with modality of the forms under C#.NET. Let's say I have main form #0 (see the image below). This form represents main application form, where user can perform various operations. However, from time to time, there is a need to open additional non-modal form to perform additional main application functionality supporting tasks. Let's say this is form #1 in the image. On this #1 form there might be opened few additional modal forms on top of each other (#2 form in the image), and at the end, there is a progress dialog showing a long operation progress and status, which might take from few minutes up to few hours. The problem is that the main form #0 is not responsive until you close all modal forms (#2 in the image). I need that the main form #0 would be operational in this situation. However, if you open a non-modal form in form #2, you can operate with both modal #2 form and newly created non modal form. I need the same behavior between the main form #0 and form #1 with all its child forms. Is it possible? Or am I doing something wrong? Maybe there is some kind of workaround, I really would not like to change all ShowDialog calls to ShowDialog...

    Read the article

  • Improve Performance of char.IsWhiteSpace for ASCII inputs in .NET 3.5

    - by Tanzim Saqib
    IsNullOrWhiteSpace is a new method introduced in string class in .NET 4.0. While this is a very useful method in string based processing, I attempted to implement it in .NET 3.5 using char.IsWhiteSpace() . I have found significant performance penalty using this method which I replaced later on, with my version. The following code takes about 20.6074219 seconds in my machine whereas my implementation of char.IsWhiteSpace takes about 1/4 less time 15.8271485 seconds only. In many scenarios ex. string...(read more)

    Read the article

  • How can I translate Linux keycodes from /dev/input/event* to ASCII in Perl?

    - by Bogdan Constantinescu
    I'm writing a Perl script that reads data from the infamous /dev/input/event* and I didn't find a way to translate the key codes generated by the kernel into ASCII. I'm talking about the linux key codes in this table here and I can't seem to find something that would help me translate them without hardcoding an array into the script. Am I missing something? I'd like to skip the array part because it doesn't seem to be a good practice, so any idea? :)

    Read the article

  • Non Blocking Keyboard on WinCE accessing the virtual keyboard

    - by Jan H.
    Hello Guys, I am desperately looking for a solution that enables me to read keyboard events in a non blocking way. These Keyboard events are generated by a VIRTUAL KEYBOARD that comes with the WinCE device. I have a console application running in C++, where the user is asked to navigate via 'ESC', 'U' and other characters through the menu. I first tried to use fread and stdin and realised that it is blocking call and waits for a carriage return. Then I tried to hook up to the windows message WM_KEYUP, but I never recieve this windows message. Furthermore I tried to use QtGUI together with the event QKeyEvent, but I never recieve any event. I wonder if it is in general possible to recieve non-blocking keyboard events on a WinCE device. I would be glad if you have any suggestions! Cheers, Jan

    Read the article

  • Convert non-breaking spaces to spaces in Ruby

    - by CoolAJ86
    I have cases where user-entered data from an html textarea or input is sometimes sent with \u00a0 (non-breaking spaces) instead of spaces when encoded as utf-8 json. I believe that to be a bug in Firefox, as I know that the user isn't intentionally putting in non-breaking spaces instead of spaces. There are also two bugs in Ruby, one of which can be used to combat the other. For whatever reason \s doesn't match \u00a0 However [^[:print:]] (which definitely should not match) and \xC2\xA0 both will match, but I consider those to be less-than-ideal ways to deal with the issue. Are there other recommendations for getting around this issue?

    Read the article

  • Dectect ASCII codes for asian double byte / cyrillic character sets?

    - by jfroom
    Is it possible to detect if an ascii character belongs to Asian double byte or Cyrillic character sets? Perhaps specific code ranges? I've googled, but not finding anything at first glance. There's an RSS feed I'm tapping into that has the locale set as 'en-gb'. But there are some Asian double byte characters in the feed itself - which I need to handle differently. Just not sure how to detect it since the meta locale data is incorrect. I do not have access to correct the public feed.

    Read the article

  • How to convert an ASCII HEX character to it's value (0-15)?

    - by philcolbourn
    I am writing a string parser and the thought occurred to me that there might be some really interesting ways to convert an ASCII hexadecimal character [0-9A-Fa-f] to it's numeric value. What are the quickest, shortest, most elegant or most obscure ways to convert [0-9A-Fa-f] to it's value between 0 and 15? Assume, if you like, that the character is a valid hex character. I have no chance so I'll have a go at the most boring. ( c <= '9' ) ? ( c - '0' ) : ( (c | '\x60') - 'a' + 10 )

    Read the article

  • Do you use ASCII art to decorate your code?

    - by CiNN
    Do you use ASCII art to decorate your code? .-"""-. ' \ |,. ,-. | |()L( ()| | license goes here |,' `".| | |.___.',| ` .j `--"' ` `. / ' ' \ / / ` `. / / ` . / / l | . , | | ,"`. .| | _.' ``. o | `..-'l | `.`, | `. | `. __.j ) |__ |--""___| ,-' `"--...,+"""" `._,.-' mh www /n n\ /\ |/^\| / \ warning notes | , | ^||^ \_/ || _U_ || /` `''-----'P3 / |. .|''-----"|| \'| | || \| | || E | || /#####\ || /#####\ || ||| || ||| || ||| || ||| gem || molom Ll /~~~\/~~\/~~~\/~~~\/~~\/~~~\ /~~~\/~~\/~~~\/~~~\/~~\/~~~\ | /\/ /\/ /\ || /\/ /\/ /\ | | /\ \/\ \/\ || /\ \/\ \/\ | \ \/ /\/ /\/ /\ \/ /\/ /\/ / function name \ \/\ \/\ \/ /\ \/\ \/\ \/ / \ \/\ \/\ \/ \ \/\ \/\ \/ \/ /\/ /\/ / \/ /\/ /\/ / ,_/\ \/\ \/\ \__/\ \/\ \/\ \______________________/ /\/ /\/ /\__/ /\/ /\/ /\_, (__/\__/\__/\____/\__/\__/\________________________/\__/\__/\____/\__/\__/\__)

    Read the article

  • How can I write a null ASCII character (nul) to a file with a Windows batch script?

    - by Matthew Murdoch
    I'm attempting to write an ASCII null character (nul) to a file from a Windows batch script without success. I initially tried using echo like this: echo <Alt+2+5+6> which seems like it should work (typing <Alt+2+5+6> in the command window does write a null character - or ^@ as it appears), but echo then outputs: More? and hangs until I press <Return>. As an alternative I tried using: copy con tmp.txt >nul <Alt+2+5+6><Ctrl+Z> which does exactly what I need, but only if I type it manually in the command window. If I run it from a batch file it hangs until I press <Ctrl+Z> but even then the output file is created but remains empty. I really want the batch file to stand alone without requiring (for example) a separate file containing a null character which can be copied when needed.

    Read the article

  • Is it advisable to have non-ascii characters in the URL?

    - by Ravi Gummadi
    We are currently working on a I18N project. I was just wondering what are the complications of having the non-ascii characters in the URL. If its not, what are the alternatives to deal with this problem? EDIT (in response to Maxym's answer): The site is going to be local to specific country and I need not worry about the world wide public accessing this site. I understand that from usability point of view, It is really annoying. What are the other technical problem associated with this?

    Read the article

  • How to setup an ascii text-only printer in OS X

    - by mc23646266
    Is it possible to setup a printer equivalent to the Windows 'generic ascii text-only printer' in Mac OS X. I cannot find anything about it within the current cups drivers docs. But I think there has been one in the early days, isn't it? The goal is to print to a file with generic ascii only.

    Read the article

  • Hex characters in varchar() is actually ascii. Need to decode it.

    - by csauve
    This is such an edge-case of a question, I'd be surprised if there is an easy way to do this. I have a MS SQL DB with a field of type varchar(255). It contains a hex string which is actually a Guid when you decode it using an ascii decoder. I know that sounds REALLY weird but here's an example: The contents of the field: "38353334373838622D393030302D343732392D383436622D383161336634396339663931" What it actually represents: "8534788b-9000-4729-846b-81a3f49c9f91" I need a way to decode this, and just change the contents of the field to the actual guid it represents. I need to do this in T-SQL, I cannot use .Net (which if I could, that is remarkably simple).

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >