I am using ckeditor to compose the emails, I am using the html generated by it to send the html emails ad i also need the text version also, So having both html and plain text version in emails will avoid the spam.
What is the way to get the text from ckeditor html code in java.
This is quite simple JavaScript call:
CKEDITOR.instances.yourEditorInstance.getData()
Returns:
<h1>Apollo 11</h1>
<p><b>Apollo 11</b> was the spaceflight that landed the first humans, Americans Neil Armstrong and Buzz Aldrin, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p>
However:
CKEDITOR.instances.yourEditorInstance.editable().getText()
Returns:
Apollo 11
Apollo 11 was the spaceflight that landed the first humans, Americans Neil Armstrong and Buzz Aldrin, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.
Related
I am currently experimenting with Google's STT engine for the german language. I am looking to capture full dates from an utterance. This works fine as long as I utter the month as a word (September, October..) "Erster Januar 1980" is transcribed correctly.
In german it is common to not say the name of the month, but just the ordinal number of the month like "Erster Erster Neunzehnhundertachtzig", where the first word is the day, the second the month followed by the year. Uttering this, the google engine returns only garbage. I have also tried it with MS Azure and it works fine.
My question is now: Has anyone else stumbled over this, and maybe has a hint how to work around this problem? I have already tried to add a SpeechContext $FULLDATE but it does not make a difference.
Cheers
S
Update 2022
A new Dynamic Class Token $OOV_CLASS_FULLDATE has been introduced and it is available for de-DE, de-AT and de-CH language codes.
I would like to reformat the content of the text file using Scala such as for the given sample file:
"good service"
Tom Martin (USA) 17th October 2015
4
Hi my name is
Tom.
I love boardgames.
Aircraft TXT-102
"not bad"
M Muller (Canada) 22nd September 2015
6
Hi
I
like
boardgames.
Aircraft TXT-101
Type Of Customer Couple Leisure
Cabin Flown FirstClass
Route IND to CHI
Date Flown September 2015
Seat Comfort 12345
Cabin Staff Service 12345
.
.
Gets reformated to this:
"good service"
Tom Martin (USA) 17th October 2015
4
Hi my name is Tom. I love boardgames.
Aircraft TXT-102
"not bad"
M Muller (Canada) 22nd September 2015
6
Hi I like boardgames.
Aircraft TXT-101
Type Of Customer Couple Leisure
Cabin Flown FirstClass
Route IND to CHI
Date Flown September 2015
Seat Comfort 12345
Cabin Staff Service 12345
.
.
I have identified the pattern of my file, which is: This multi-line string comes between a digit and word separated by tabs.
For example, first block's multi line content comes between 4 and Aircraft TXT-102. Second block's multi line content comes between 6 and Aircraft TXT-101 Also, blocks are delimited by two new lines.
I know of Pattern matching using regex can help but I do not know how to handle this on file.
What I'd do, in pseudocode:
while more lines available {
lines_so_far = read input until a number is seen
output(lines_so_far)
lines_to_join = read input until "Aircraft" is seen
output(joined lines_to_join)
}
A regexp for a line consisting of only a number is ^\d+$; for a line starting with "Airline", ^Airline .*. The convenience method to look at is takeWhile.
I've been searching around without any luck for an MSDN or any other official specification which describes how 2 digit years are interpreted in a date format textbox. That is, when data is manually entered into a textbox on a form, with the format sent to short date. (My current locale defines dates as yyyy/MM/dd)
A few random observations (conversion from entered date)
29/12/31 --> 2029/12/31
30/1/1 --> 1930/01/01
So far it makes sense, the range for 2 digit dates is 1930 to 2029. Then as we go on,
1/2/32 --> 1932/01/02 (interpreted as M/d/yy)
15/2/28 --> 2015/02/28 (interpreted as yy/M/dd)
15/2/29 --> 2029/02/15 (interpreted as M/d/yy)
2/28/16 --> 2016/02/28 (interpreted as M/dd/yy)
2/29/15 --> 2029/02/15 (interpreted as M/yy/dd)
It tries to twist about invalid dates so that they are valid in some format, but seem to ignore the system locale setting for dates. Only the ones that are invalid in any format (like 0/0/1) seem to generate an error. Is this behavior documented somewhere?
(I only want to refer the end user to this documentation, I have no problem with the actual behavior)
The 29/30 split was settled this way with Access 2.0 as of 1999-12-17 in the Acc2Date.exe Readme File as part of the last Y2K update:
Introduction
The Acc2Date.exe file contains three updated files that modify the way
Microsoft Access 2.0 interprets two-digit years. By default, Access
2.0 interprets all dates that are entered by the user or imported from a text file to fall within the 1900s. After you apply the updated
files, Access 2.0 will treat two-digit dates that are imported from
text in the following manner:
00 to 29 - resolve to the years 2000 to 2029 30 to 99 - resolve
to the years 1930 to 1999
Years that are entered into object property sheets, the query design
grid, or expressions in Access modules will be interpreted based on a
100-year sliding date window as defined in the Win.ini on the computer
that is running Access 2.0.
The Acc2Date.exe file contains the following files:
File name Version Description
---------------------------------------------------------------------
MSABC200.DLL 2.03 The Updated Access Basic file
MSAJT200.DLL 2.50.2825 The Updated Access Jet Engine Library file
MSAJU200.DLL 2.50.2819 The Updated Access Jet Utilities file
Readme.txt n/a This readme file
For more information about the specific issues solved by this update,
see the following articles in the Microsoft Knowledge Base:
Article ID: Q75455
Title : ACC2: Years between 00 and 29 Are Interpreted as 1900 to 1929
That article can be found here as KB75455 (delayed page load):
ACC2: Years Between 00 and 29 Are Interpreted as 1900 to 1929
As for the 2/29/15 is not accepted here where system default is dd-mm-yyyy, so there are limits to how much creativity Access/VBA puts into interpreting date expressions.
I'm successfully setting a date-picker with an initial date from a plist, but I see some unwanted blue values in the month, day, and year components, presumably corresponding to current date. So if today is April 18, 2010 and initial date being set is March 19, 2008, it looks like this (bold represents the blue):
January 17 2006
February 18 2007
------------------------------
March 19 2008
------------------------------
April 20 2009
May 21 2010
First question is: How do I get rid of the blue?
And second question: Ideally, how do I get it to look like this?
January 17 2006
February 18 2007
------------------------------
March 19 2008
------------------------------
April 20 2009
May 21 2010
Third question, totally unrelated and not as important: How could I have gotten the above to show in blue rather than bold? I see blue in code snippets all the time.
Matt
Sadly, I do not believe it's possible to suppress the coloring of the current date components in blue. You could always file a feature request for this functionality.
As a last resort, you could implement your own (or Google for "generic date picker" - someone has already done this).
I think the code sample formatter automagically makes things blue that it thinks are keywords, like:
UIDatePicker* myPicker;
I didn't tell it to make that blue, it just is.
Today is April 25, 2009 which in US format is abbreviated month-day-year, so today is 04-25-09. This line
> CurrentTime().toString("%m-%d-%y")
should print "04-25-09". Instead it prints "05-25-09". Why is that? According to the docs CurrentTime() returns a TimeStamp instance. TimeStamp has a toString() method which accepts a date/time format as a parameter, which is supposed to be in
strftime format. Is there something wrong with my understanding of the code? I am using Falcon 0.8.14.2("Vulture") on Windows Vista (64-bit)
2: http://linux.die.net/man/3/strftime strftime format
I also posted this question on the Falcon Google Group. Apparently, this is an issue with Falcon itself and is fixed in version 0.9.1. Version 0.9.1 will be officially released in a week or two according to the response I received from Giancarlo Niccolai, the inventor of the Falcon programming language.