formatting

How to convert a string 3.0103E-7 to 0.00000030103 in Java?

How to convert a string 0E-11 to 0.00000000000 in Java? I want to display the number in non scientific notations. I've tried looking at the number formatter in Java, however I need to specific the exact number of decimals I want but I will not always know. I simply want the number of decimal places as specificed by my original number. ...

python String Formatting Operations

Faulty code: pos_1 = 234 pos_n = 12890 min_width = len(str(pos_n)) # is there a better way for this? # How can I use min_width as the minimal width of the two conversion specifiers? # I don't understand the Python documentation on this :( raw_str = '... from %(pos1)0*d to %(posn)0*d ...' % {'pos1':pos_1, 'posn': pos_n} Required outpu...

Are there any standards for markup like the one that SO site uses?

I will like to design/develop a formatting markup for an application that we are developing. Is there any standard on this like what StackOverflow uses when writing each question description. ...

What function is meant to format/substitute {0} {1} parameters in an string in Grails/Groovy?

I'm just getting started with Groovy/Grails I noticed the error messages you get when you validate a form look like this: Property [{0}] of class [{1}] cannot be blank For example this code to dump the errors to the console s.errors.allErrors.each { println it.defaultMessage } Now, it.arguments ...

Xml to text with formatting

Hi friends...I am having a lot of problem. I need the solution very urgent..please help me So i am having a xml file as: <Order> <EP> <Name>Generation Date</Name> <Value>2009-08-04+05:30</Value> </EP> <EP> <Name>NoOfRecords</Name> <Value>100</Value> </EP> <OrderLineItems> <OrderLineItem OrderDateTime="2007-01-01T17:0...

How I can set a date string from twitter to a NSDATE

The date you get back from twitter is in this format Fri Aug 07 12:40:04 +0000 2009. I am able to assign the value to a NSDate without issue. However, when I attempt to use NSDateFormatter, I get a nil returned to me. What am I missing? NSDate *createdAt = [messageData objectForKey:@"created_at"]; NSDateFormatter *format = [[NSDateFor...

Aptana auto format

I'm trying out Aptana (standalone version) for PHP editing. Like its parent Eclipse, it has a lot of settings for code formatting. Unlike Eclipse, it doesn't seem to have an option for actually doing code formatting automatically or even by manual trigger. Is there a nonobvious option for this that I'm missing? ...

How to format a number with padding in Erlang

I need to pad the output of an integer to a given length. For example, with a length of 4 digits, the output of the integer 4 is "0004" instead of "4". How can I do this in Erlang? ...

Winforms RichtextBox Bold/Italic/Underline Formatting issue

Hi there, As you can tell from the title, Im having a bit of issue regarding assigning and removing format styles to and from selected text in the RichTexBox control. I know how to make text individually Bold/Italic/Underline, but not a combination of these. I know of ways that can achieve this character by character, but this would se...

Why does string.Format come in several flavors?

.NET provides four very similar versions of String.Format(...) (excluding the one that takes an IFormatProvider argument): Format(String, Object) Replaces one or more format items in a specified string with the string representation of a specified object. Format(String, Object, Object) Replaces the format item in a specified string with...

bash string to date

Hi! Is there an opportunity to convert a string into a date in bash? For example: I have a time format: "%Y-%m-%dS%H:%M:%S". An example of such string is "2009-06-24S12:34:56". I need to convert this string into a date (unix timestamp) in bash. How can I do this? ...

Is there a way to convert a .obj file from Lightwave 3D to .h file for OpenGL ES in iPhone?

I am looking for a way to convert a .obj file of Lightwave 3D to a .h file for iPhone. I looked around and has seen several scripts that can generate .h files for you, but all of them cannot understand Lightwave 3D .obj format. If anyone appears to know some sort of methods that can translate lightwave 3d .obj files to .h file, please sh...

What Data Format is this?

Does anyone know what format this data is? PFNsaWRlT3V0bGluZT4KICA8U0lQIHVpZD0iNTM3M0E2OTEtNkQ5Ri01N0E3LUI5M0ItRjZCOThDQjQwMEM5IiBpZD0iRjg1MDBDNzctOUQ0Ni1BODI5LUE0MDEtRjZCOThDQTAxNTdFIiB1dklEPSJhNjAzNjU4Mi0yMzdiLTQzNDktOWNkOS03MzViZjVmZDAxNTYiLz4KICA8U0lQIHVpZD0iRkU4Qzg5RTAtREMxQy00MUVBLTNBQzctMDQzM0JENEQyMUVCIiBpZD0iODQyNjRFNkYtOEZDRS0...

IText Lines Per Page?

I have used IText(Sharp) to make PDFs from raster images but have never used IText to build text based PDF's. In this new scenario, I have N words of ASCII text that I need to add as text pages to a new PDF. Each page should be 8.5 x 11, .5 margins, using some monospaced font. Is IText(Sharp) smart enough to automatically apply line...

How might I format an alist in common lisp?

I'm beginning to write me some Common Lisp and am just getting the hang of consing things together and formatting them. Let's suppose I have an alist, like this: (defvar *map* '((0 . "zero") (1 . "one") (2 . "two"))) How do I format it like this? 0: zero 1: one 2: two I was thinking something like (format t "~{~{~a: ~a~}~%~}" *map...

How to turn off JSLint indentation warnings?

I find that JSLint produces lots of warnings of the form: Expected 'foo' to have an indentation at X instead at Y. The JSLint options documentation describes an indent option that recognizes a numerical value representing the amount of space for each level of indentation. This option allows me to say things like use 2 spaces per level...

What are the C# "formatting" standards?

In C#(.NET), what are the regular "formatting" standards? For instance, for parameter names, so far I noticed camelCase with no prefix, is that right? For object names, camelCase and no prefix either, right? For namespaces, classes, functions and properties, first letter of the word is capitalized and there is no prefix, is this right ...

wpf string formatting NOT numbers or dates

This should have a simple solution, but I can't seem to find it. I want to do something like the following, where I have a data binding with a string format. The field is a text field, and I'd like to display it with a suffix (but not change the underlying data). <Label Name="field" Content="{Binding obj.field, StringFormat=\{0\} suff...

ie7 inserts line break after / before form tag

I'm sure someone has noticed this before but I can't seem to find a solution. In IE7 before and after form tags IE inserts line breaks. This is no good! Sample code below... Solutions? Ideas? <html> <body> <div id="pageContent" style="border:1px solid black; background-color:orange;"> <form> content bad <...

Delphi Function to Display Number of Bytes as Windows Does

This is a simple one (I think). Is there a system built in function, or a function that someone has created that can be called from Delphi, that will display a number of bytes (e.g. a filesize), the way Windows displays in a file's Properties box? e.g. This is how Windows property box displays various sizes: 539 bytes (539 bytes) 35....