text-formatting

JSTL/JSP EL (Expression Language) in a non JSP (standalone) context

倾然丶 夕夏残阳落幕 提交于 2019-12-17 09:31:47
问题 Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)? I would expect to be able to instantiate a an object of some sort, give it a template along the lines of Dear ${customer.firstName}. You order will be dispatched on ${order.estimatedDispatchDate} provide it with a context which would include a value dictionary of parameter objects (in this case an object of type Customer with a name 'customer',

Printing with “\t” (tabs) does not result in aligned columns

寵の児 提交于 2019-12-17 03:04:29
问题 I have a very weird problem. After writing this: for (File f : currentFile.listFiles()) { if (f.isDirectory()){ System.out.println(f.getName()+"\t"+"Dir\t"+Command.getpremission(f)+"\t"+f.getTotalSpace()); } else{ System.out.println(f.getName()+"\t"+"File\t"+Command.getpremission(f)+"\t"+f.getTotalSpace()); } I see this printed: see.txt File rw 267642728448 see1.txt File rw 267642728456 see2.txt File rw 267642728448 Why is there a problem with the tabs? 回答1: Building on this question, I use

How to read excel cell and retain or detect its format in Python

谁说胖子不能爱 提交于 2019-12-12 08:55:11
问题 I am given the an excel file which contains some text formatting. Some can be bold , some italic , some are supercase 1 , and some other formats (but not as many as the three mentioned). Examples: Ku'lah 2 ku.lah v ; definition : some def; usage : some usage; He'lahsa 2 he.lah.sa n ; definition : some def; usage : some usage; And so on Now, since this cell is to be made as dictionary ( real , human, dictionary) database entry, I would like to retain the format of the cell, as it will be

How to perform a selective extraction of text highlighted in yellow from an MS Word document?

大憨熊 提交于 2019-12-12 02:17:15
问题 I am trying to write a VB script that extracts all text passages highlighted in yellow from a given MS Word document. My code seems >>almost<< to be working ... but I have not been able to restrict the text export to sections highlighted in yellow only. Please note the script has to be selective for highlight colour in case the document contains highlights in several colours. Sub FindHighlightedText() 'Get current working directory. Dim pwd As String pwd = ActiveDocument.Path Dim Name As

How to create a Custom text formatter for Cloudwatch?

蓝咒 提交于 2019-12-10 19:36:12
问题 I don't understand how to create a custom text formatter for Amazon Cloudwatch as mentioned: var formatter = new MyCustomTextFormatter(); I am trying to write Serilog logs to Amazon CloudWatch instead of the local hard disk. To do that I am following this repo: https://github.com/Cimpress-MCP/serilog-sinks-awscloudwatch private readonly ITextFormatter textFormatter; public ILoggerFactory ConfigureLogger() { LoggerFactory factory = new LoggerFactory(); var logGroupName = "myLoggrouName"; var

Export the Eclipse XML Formatting Rules?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 04:23:01
问题 Is there a way to export the settings defined in Window > Preferences Dialog under XML > XML Files > Editor in Eclipse 3.5 Galileo (Java EE Package)? And where do Eclipse stores these settings? Now i got an eclipse_xml_format.epf with the following content /instance/org.eclipse.wst.xml.core/lineWidth=120 /instance/org.eclipse.wst.xml.core/indentationChar=space /instance/org.eclipse.wst.xml.core/indentationSize=4 But i can't import this file! 回答1: The file recording those XML settings is:

Selective coloring on dynamic TextBlock content in WPF

风流意气都作罢 提交于 2019-12-08 08:14:48
问题 For selective coloring of static content the following suggestion works fine : Is it possible to seletively color a wrapping TextBlock in Silverlight/WPF However my content will be generated at runtime. For ex. if the Content generated is : "A Quick Brown Fox" Then I need they string "Brown" to be in color Brown and "Fox" to be in color Red The Keyword-Color list is fixed and available to me at runtime. I have looked at the Advanced TextFormatting page on MSDN, but it is too complicated for

How to “append” html text to text area in flex and flex mobile project to display sprite and text formatting

元气小坏坏 提交于 2019-12-08 07:06:24
问题 I'm playing around with a messaging type of application. Does anyone know how, or of any tutorials on to "appending" html text to text areas in flex and flex mobile projects? And specifically how I could take that and basically "append" a sprite inline to the text when i need to? Something simple like: Username: some text right here! So, Anyone have any experience "appending" sprites or simple text formatting? Thanks I'm realy stumped on how to solve these issues! EDIT: Based on an answer

How to read output from linux process status (ps) command in R?

徘徊边缘 提交于 2019-12-07 06:00:56
问题 here is the data.txt: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 2280 728 ? Ss 20:44 0:00 init [2] root 2 0.0 0.0 0 0 ? S 20:44 0:00 [kthreadd] root 202 0.0 0.0 0 0 ? S< 20:44 0:00 [ext4-dio-unwri root 334 0.0 0.1 2916 1452 ? Ss 20:44 0:00 udevd --daemon how to read the data into a data.frame? 1.can not to decide separator the last field is a problem, space can not be the separator, init [2] ,udevd --daemon are the one field,can not be separated by space . 2.no

Displaying a block of text with an oversized initial letter in a UITextView

眉间皱痕 提交于 2019-12-06 04:22:19
Is there any way to provide this kind of effect in a UITextView ? If not, then how can I achieve this effect? Having the same requirement, I created a UIView subclass that draws text with a drop cap. The text is drawn using core text, and as @CodaFi suggested the drop cap is drawn in a separate core text frame. The full implementation of the class: https://gist.github.com/4596476 The meat of it looks something like this: - (void)drawRect:(CGRect)rect { // Create attributed strings NSAttributedString *bodyText = [[NSAttributedString alloc] initWithString:[self.text substringWithRange