character

default values/modifiers in postgres?

I've problem with default modifiers on postgres 8.4. (I think version is its not important) I've debian ubuntu. When Im creating migrations on rails AR: class CreateUserMails < ActiveRecord::Migration def self.up create_table :user_mails do |t| t.string :title, :limit=> 128, :default=> '' t.string :place, :limit=> ...

Character Input In Objective-C

Hello, I'm learning Objective-C using GNUstep, but i searched at Google for some example of character input using Objective-C, like scanf in C and cin at C++, but i didn't found, someone can help me? Thanks. ...

Count occurrences of a char in plain text file

Is there any way under linux/terminal to count, how many times the char f occurs in a plain text file? ...

C# - Count string length and replace each character with another

How can I count the number of characters within a string and create another string with the same number of characters but replace all of them with a single character such as "*"? Thank you. ...

What's the different between ` and ' in programming, such as MySQL and shells

phpMySQL use backticks ` to surround column names, and I've just see people use backticks in shell scripts. Is that the same if they use ' ? ...

How to replace escape characters in Regular expression?

Hello everyone, Once again I have hit the wall. How to replace escape characters using regular expressions? If tab character (\t) occures more than twice, I want to replace those two or more occurances by single \t. For example if \t\t\t comes, then I want to replace it with \t only. How to do this? I am facing one more problem regard...

Conversion of a character to asterisk

Hi, i had been to an interview for the post of webdeveloper/HTML developer . There he asked me a question, the ques was.... there is a textbox and a button when i enter any character into the textbox it must be converted into a asterisk sign(i.e "*")once the characters are entered now on clicking the button all the signs must be conve...

charAt() or substring? Which is faster?

I want to go through each character in a String and pass each character of the String as a String to another function. String s = "abcdefg"; for(int i = 0; i < s.length(); i++){ newFunction(s.substring(i, i+1));} or String s = "abcdefg"; for(int i = 0; i < s.length(); i++){ newFunction(Character.toString(s.charAt(i)));} Th...

Specify a character value as an offset from a constant in Java

I am looking to get a random letter using something like char ch = 'A' + randomNumber ; // randomNumber is int from 0 to 25 But that gives "loss of precision" compilation error (same if randomNumber is only a byte). I guess with Unicode the above is a gross oversimplification. But how should I do it ? This works but seems a bit clum...

Replace characters in C#

I have a requirement. I have a text which can contain any characters. a) I have to retain only Alphanumeric characters b) If the word "The" is found with a space prefixed or suffixed with the word, that needs to be removed. e.g. CASE 1: Input: The Company Pvt Ltd. Output: Company Pvt Ltd But Input: TheCompany Pvt Ltd....

problem with valueOf(), converting a char to Character in Java

Hello, I'm trying to convert a char to Character before it gets pushed on a stack but get a "cannot find symbol error", I don't see what the problem might be. This is how I pass the char to the stack: stack.push(valueOf(in)); Where 'in' is a char. ...

Are ASCII characters always encoded the same way in all character encodings?

In ASCII, the character < is encoded as a single-byte character 0x3C, what I'd like to know is that is there a character set where < is encoded differently? I tried UTF-8, it's the same. I tried GB2312 and it's the same... Another question, are all ASCII characters the same in all character sets? ...

Difference between using character pointers and character arrays

Basic question. char new_str[]=""; char * newstr; If I have to concatenate some data into it or use string functions like strcat/substr/strcpy, what's the difference between the two? I understand I have to allocate memory to the char * approach (Line #2). I'm not really sure how though. And const char * and string literals are the ...

Avoid printing unicode replacement character in Java

In Java, why does Character.toString((char) 65533) print out this symbol: � ? I have a Java program which prints these characters all over the place. Its a big program. Any ideas on what I can do to avoid this? ...

Chinese character in Url problem with Java

I cut and pasted the following line in to my Firefox url field : http://www.baidu.com/s?wd=你 This line was generated by my Java program. The last Chinese char in the Firefox field sometimes became : %C4%E3 [ Correct ] Other times it became this : %E4%BD%A0 [ Incorrect ] I tried to cut and paste the url into IE. In the url field it ...

using Visual C++ code in Borland c++

hi, I was using C to display a sentence in three lines. The piece of code which worked successfully in VC++ is giving an unexpected output in Borland C++. The ouptut is a charcter array of size n. In the output I could receive more than n characters for the array. How can I avoid this? ...

How to decode a text string encoded in the ISDB (ARIB) Transport streams?

Hi, How to decode a text string encoded in the ISDB (ARIB) Transport streams? Some encoding technique is specified in Chapter 7 of Part 2 (Mono media Coding) of ARIB STD-B24 Version 5.2 (Volume 1) specification. But I am not sure whether this encoding is different from other standard Japanese character encoding techniques, like EUC-JP...

How to create a function and call it on event.

Hello, I've included code for my textbox/textarea counter I put together. (hope it doesn't get mangled in my post...) The script works quite well, however I know my code is ridiculously bloated due to my inexperience with jquery and javascript. I was hoping someone could show me how to take the repetitive code (//event one thru five) ...

significance of negative values of type char in C

chars in 'C' are used to represent characters. Numbers representing characters in all code pages are always positive. What is the use of having signed characters?? Are negative values contained in chars used only as integral values in a smaller integral data-type than int and short?? Do they have no other interpretation??(like positiv...

Struts2 request character encoding

Hello, I'm using Struts2. When I send 'special' characters like ä or ã through a form, the actions that receive it display those characters differently (like à + a little square). I know that I have an encoding problem, but I was unable to find where the request encoding can be configured for Struts2. Can anyone please help me ? Bes...