text

getchar() and counting sentences and words in C

I'm creating a program which follows certain rules to result in a count of the words, syllables, and sentences in a given text file. A sentence is a collection of words separated by whitespace that ends in a . or ! or ? However, this is also a sentence: Greetings, earthlings.. The way I've approached this program is to scan through t...

Storing messages as BLOB (Binary Large Object) or ordinary text?

What is the best way to store messaging texts in large/big web sites: BLOB or ordinary text in table or something else? Database: MySQL. ...

How to create a scrollable screen in text mode with Python

I would like to create a scrollable screen in text mode, like the one obtained when typing help(object) in the interpreter. Is there a cross-platform module I can use to easily implement this? For example: >>> def jhelp(object): >>> text = # get text for object >>> display_text(text) # display a scrollable screen. How do I do t...

Counting Syllables one char at a time [C]

I'm writing a program which reads text from a file, and determines the number of sentences, words, and syllables of that file. The trick is, it must only read one character a time, and work with that. Which means it can't just store the whole file in an array. So, with that in mind, heres how my program works: while(character != EOF) {...

Python: Retrieving only POP3 message text, no headers

I'm trying to make a Python program that retrieves only the body text of an email without passing headers or any other parameters. I'm not sure how to go about this. The goal is to be able to send basic commands to a program via message text. What I have now is this: import poplib host = "pop.gmail.com" mail = poplib.POP3_SSL(host) p...

Fix a character to text input box using javascript/jquery

I am looking for a way to 'fix' a dollar symbol $ to a text input box eg <input type="text" value="$" /> but make it not possible for the default value to be removed, so that whatever the user inputs, there is always a $ symbol 'prepending' input. Cheers ...

How to get default fonts properties on Android?

Hi there! I need to draw some text on my Canvas, and I'd really avoid hardcoding some particular text size. Is there some standard way to find a default text size (and other properties) used in the OS? So far I found only TextView.setTextAttributes(context, resId) to which I can pass R.android.attr.textAppearance. But the thing is th...

Limit number of characters

I am appending a variable from an input to a li. I want to trim the P <p class="layer' + count + '"> '+ Xia2 +'</p> text to a number of 15 characters and not trim the SPAN, witch uses the same Xia2 variabile. I can probably create 2 variabiles for this... How can this be done? I've tried several ways trying the $(this).val(text.substr(0...

Seeking algo for text diff that detects and can group similar lines

I am in the process of writing a diff text tool to compare two similar source code files. There are many such "diff" tools around, but mine shall be a little improved: If it finds a set of lines are mismatched on both sides (ie. in both files), it shall not only highlight those lines but also highlight the individual changes in these l...

draw text to center of the image using PIL

hi I have a few stings I would like to draw to imagea. the thing is that I want each string to be displayed in the middle of each image. how do I do it? or how can I know the length in pixels of a string (giving ofcourse the font)? thanks ...

Looking to change / replace an image when a text field onfocus

Hi - I am looking for a solution to replace an image with another image when you focus on a text field. There are 4 text fields and 5 images (1 image is the default image) When you focus on each of the text fields, the correct image should replace the default image.. Thanks for any guide on this ...

jQuery select text and add span to it in an paragraph

Hi, I have a function that gets the selected text, the text is selected by mouse, and add it into a variable. I want to add tags around that variable in the selected text - in that paragraph. $("p").live("mouseup",function() { selection = getSelectedText(); if(selection.length >= 3) { var $spn = $("<span></span>").html(selection).addCl...

Coldfusion convert number to text

I have a coldfusion app in which I calculate the number remaining of a certain object. So I have a integer... like 9. But I need to print it to the screen in text form.... like nine. Is there a built in function to do this? I googled and couldn't find one. ...

Padding text in listbox

Hi everyone, var a1 = "HEL"; var a2 = "HELLO"; var a3 = "LLO"; var length = a2.Length+5; listbox.Items.Add(a1.PadRight(length) +"End"); listbox.Items.Add(a2.PadRight(length) + "End"); listbox.Items.Add(a3.PadRight(length) + "End"); I have code like this to obviously pad all text...

Jquery Text is not visible in IE 7.0

The text is not getting displayed on my modal window. I do see a blank space but when i highlight it with mouse i see the text and when i click anywhere on the screen the text becomes invisible. It works in firefox, IE 6.0 and IE 8.0 but not in IE 7.0. Any suggestion is highly appreciated. ...

i need help to make a text frame

is any body knows a code to make a java text frame.,,please i need help ...

jQuery text split and join, does not wrap the first letter

Hi, I have a function that splits each letter from a span text and wrap it into an em. It works but the first letter from the span is not wrapped. How can I wrap that letter also in em? <script> jQuery(document).ready(function(){ $(".nsplit").live('click', function(){ var newSplit = $("#selectable1 span.cica").tex...

Android: dynamically setting links to text in strings.xml

I'm trying to make an app with localisation built in, but I want a way that I can create a web link within the text, the URL being defined elsewhere (for ease of maintenance). So, I have my links in res/values/strings.xml: <?xml version="1.0" encoding="utf-8"?> <resources> ... <string name="link1">http://some.link.com&lt;/string&gt...

iPhone: Reading Text From File and UISegmentedControl

First off, I'm a complete beginner. That said, I thought an ambitious longer-term project/learning experience would be to create an app that displayed daily quotes, like those cheesy day-by-day calendars our grandmothers have in their bathrooms. I want it to have two per day, each one represented by a tab in a UISegmentedControl. That...

How can I tell which unicode characters are letters (words) versus being punctation marks?

I want to detect words in text, i.e. I need to know which characters in a given text are letters, that is they can be part of a (spoken) word and which are, on the other hand, punctuation and such. For example, in the above sentence, "I", "want" and "i" and "e" are words in this regard, while spaces, "." and comma are not. The difficul...