character

Reversing every character in a file

I'm in a little trouble here. Can anyone help me implement a solution that reverses every byte so 0xAB becomes 0xBA but not so "abcd" becomes "dcba". I need it so AB CD EF becomes BA DC FE. Preferably in C or C++ but it doesn't really matter provided it can run. So far, I've implemented a UBER CRAPPY solution that doesn't even work (a...

How do I convert C/C++ string with escape character to a plain (raw) string

The function prototype would be: string f (string s); or char* f (char* s); f would transform a string represented by printable ascii char into a raw string. and it would behaves as in the following examples: f("AAA") = "AAA" f("AA\n") = "AA+line_feed" i.e the input string is 4 char long (+ NULL), the output is 3 char long(+NUL...

How can I get a Unicode character's code?

Let's say I have this: char registered = '®'; or an umlaut, or whatever unicode character. How could I get its code? ...

Is it possible to get Character after "Shift" has been pressed, without pressing shift?

Is it possible to get the Character if "Shift" was Pressed, ie. if i press "1" I get the "1" character, but if I hold down "Shift" it becomes "!" - all without the quotes of course. I want to to something like this programatically. There was a method where you could just add to the ASCII code however this option is not suitable as it won...

how to check the character count of a file in python

Hi ! I have a python code which reads many files. but some files are extremely large due to which i have errors coming in other codes. i want a way in which i can check for the character count of the files so that i avoid reading those extremely large files. Thanks. ...

Add a character each x characters in Ruby

I would like to brake a long word in my Ruby on Rails string (something like <wbr> in HTML). Is it possible to tell Ruby "add character x in string y each z characters"? ...

What are some common character encodings that a text editor should support?

I have a text editor that can load ASCII and Unicode files. It automatically detects the encoding by looking for the BOM at the beginning of the file and/or searching the first 256 bytes for characters > 0x7f. What other encodings should be supported, and what characteristics would make that encoding easy to auto-detect? ...

RTF Trademark character (&trade;)

I am trying to represent the trademark character in an RTF document. In HTML, I can use the entity &trade;, which generates the character . This does not work in RTF. I have also tried &#U153; but that does not work either. Any ideas on how to do this? ...

C++ strcpy non-constant expression as array bound

Hi I turned back to C++ after a long time in C#, PHP and other stuff and I found something strange: temp.name = new char[strlen(name) + strlen(r.name) + 1]; this compiles temp.name = (char *)malloc(sizeof(char[strlen(name) + strlen(r.name) + 1])); this doesn't (temp.name is a char *) The compiler error is error C2540: n...

Changing font properties to alter the spacing between characters in a string?

Does anyone know how i am able (if possible) to change the character spacing of a string or textbox output? One possibility is by creating a custom font, but i am unsure if there is a property in one of the overloads that will allow me to change character spacing?! Any response would be great, thanks in advance guys! ...

Character.getNumericValue() issue

I'm probably missing out something, but why the two numeric values are equal to -1? System.out.println(Character.getNumericValue(Character.MAX_VALUE)); System.out.println(Character.getNumericValue(Character.MIN_VALUE)); returns: -1 -1 ...

Convert CharCode to Char?

What I need ok I googled this and there are many tutorials on how to get the charCode from the character but I cant seem to find out how to get the character from the charcode. Basically I am I am listening for the KeyDown event on a TextInput. I prevent the char from being typed via event.preventDefault(); Later I need to add the te...

SEO issue red characters in source code? &gt; Why? Syntax highlighting? browser source code?

SEO issue red characters Hi all I'm building webstes using dreamweaver, but when I look at the source code it is red for &quot; characters. I'm told anything appearing in red puts off Google's seo. Does anyone know why this appears in red? For example when I view code source on the site i get the gt; in red <a href="miss-sold-mortgag...

Trouble selecting an item in a SELECT box with jQuery with a quot

I am having a hidden form with a list which I need to select an option from when a user wants to view this form. I was using var assignee = 'persons name'; jQuery('#edit-form' option[value='+option+']:first').attr("selected", "selected"); I tried doing this, but this is not working as the value in the option tag is not specified with t...

What's the alternate character combination for the double quote characater in C/C++?

I've not had the Kernighan and Ritchie C reference in years, but I remember that there was a page in there that talked about how to enter characters that were unavailable to you. (WAY back in the day, some keyboards lacked characters like ", ~, etc.) To be clear, let me give an example. I'm not looking for a way to get quotes in strin...

How to decode character pressed from jQuery's keydown()'s event handler

I need to figure out which character was typed into a text field from within the handler that is called by jQuery's keydown function. key.which gives me only the keycode, but I need to figure out which ASCII character key represents. How do I do this? ...

Binary to character matrix help

FYI: This is a practice homework exercise. I've been working on it, but now I'm stuck. Any tips/help would be appreciated. I've been staring at it a while and no progress has been made. Summarized question: Nine coins are place in a 3x3 matrix with some face up and some face down. Heads = 0 and tails = 1. Each state can also be represen...

String and character mapping question for the guru's out there....

Here's a problem thats got me stumped (solution wise): Given a str S, apply character mappings Cm = {a=(m,o,p),d=(q,u),...} and print out all possible combinations using C or C++. The string can be any length, and the number of character mappings varies, and there won't be any mappings that map to another map (thus avoiding circular d...

Rotate with screen object ?

Actually i am doing a project for my university Witch is i have to Analysis a game so i found a problem which is character rotated has problem so i recommend to use the mouse what other suggestion i can use for example add object on screen so need to know if i add object on screen why this will be improve the game and what other docum...

String to Arrays conversion

When this is valid: string s4 = "H e l l o"; string[] arr = s4.Split(new char[] { ' ' }); foreach (string c in arr) { System.Console.Write(c); } Why This is invalid string s4 = "H e l l o"; char[] arr = s4.Split(new char[] { ' ' }); foreach (char c in arr) { System.Console.Write(c); } Cant We build a C...