Questions tagged [formatted]

81 questions
57
votes
7 answers

Nicely formatting output to console, specifying number of tabs

I am generating a script that is outputting information to the console. The information is some kind of statistic with a value. So much like a hash. So one value's name may be 8 characters long and another is 3. when I am looping through outputting…
user130532
22
votes
5 answers

node and express send json formatted

I'm trying to send formatted json with express. Here is my code: var app = express(); app.get('/', function (req, res) { users.find({}).toArray(function(err, results){ // I have try both res.send(JSON.stringify(results, null, 4)); //…
BoumTAC
  • 2,675
  • 3
  • 21
  • 37
19
votes
4 answers

The easiest way to read formatted input in C++?

Is there any way to read a formatted string like this, for example :48754+7812=Abcs. Let's say I have three stringz X,Y and Z, and I want X = 48754 Y = 7812 Z = Abcs The size of the two numbers and the length of the string may vary, so I dont want…
Loers Antario
  • 1,341
  • 4
  • 15
  • 23
9
votes
4 answers

Android strings.xml resource - arabic language and dynamic formatted strings

Hello I have a question about arabic formatting how should I properly format this strings, it seems i can't manage this: تحميل %1$s… تم تحميل الكلمات. %1$d/%2$d! This is in sublime text 2 - but i think that there is Left-to-Right…
Michał Ziobro
  • 7,390
  • 6
  • 50
  • 99
9
votes
1 answer

Create a computed observable for formatted values for a bunch of variables

I have 3 observable variables in view-model, and want to output to formatted value. However, I don't want to write computed method for each of them since they are identical. What is the best way to reuse the code? Thanks. The code I am going to…
Gary Zi
  • 95
  • 1
  • 6
5
votes
1 answer

Usage of this next_combination code

Currently I am trying to generate combinations from a vector that contains some integers. For now I want it to print out all of the combinations that are of length to_generate. I found this code at combination and permutation in C++ that uses…
shuttle87
  • 14,785
  • 9
  • 69
  • 104
5
votes
3 answers

Formatting output with printf: truncating or padding

I would like to produce the following output: > Avril Stewart 99 54 > Sally Kinghorn 170 60 > John Young 195 120 > Yutte Schim... 250 40 As you can see, names shorter than 14 characters are padded with spaces. Names longer than 15 characters…
Dave Smith
  • 77
  • 2
  • 6
5
votes
3 answers

Formatted printing in Java

I have this code: public String toString(Day day) { String s = day.getDayName() + " " + day.toString(); return s; } This is Day class's toString method: public String toString() { String s = ""; for (Slot slot: slots) s…
bobby
  • 51
  • 1
  • 2
4
votes
3 answers

C# How can I paste formatted text from clipboard to the RichTextBox

I added context menu to the richboxtext with only one function "paste". What code will paste my clipboard content (e.g. copied from Microsoft Word) to the richboxtext form? I tried with: private void PasteToolStripMenuItem_Click_1(object sender,…
user1188235
  • 45
  • 1
  • 1
  • 3
4
votes
2 answers

Write statement cannot produce new lines within user-defined formatted I/O procedures for derived type

I want to implement the user-defined I/O procedures for the derived types in my Fortran code. However, write statements within those procedures cannot produce new lines between two sequential write statements. The derived type and procedures are…
Rubin
  • 323
  • 1
  • 9
4
votes
1 answer

Improve Fortran formatted I/O with a large number of small files

Lets assume I have the following requirements for writing monitor files from a simulation: A large number of individual files has to be written, typically in the order of 10000 The files must be human-readable, i.e. formatted I/O Periodically, a…
MechEng
  • 331
  • 1
  • 11
4
votes
0 answers

jquery geocomplete formatted address and street number

I'm using this jQuery script: http://ubilabs.github.io/geocomplete/ When autocompletion is done, the formatted address will include the street number or not, depending on the user input but both entries will generate a success result. Is it possible…
Baylock
  • 1,116
  • 4
  • 23
  • 47
4
votes
3 answers

iPhone: Problems with Formatted String (Objective C)

I need help. How come this does not work: NSProcessInfo *process = [NSProcessInfo processInfo]; NSString *processName = [process processName]; int processId = [process processIdentifier]; NSString *processString = [NSString…
Devoted
  • 90,341
  • 41
  • 85
  • 110
3
votes
2 answers

JAXB generates unformatted XML using XMLEventWriter

I'm using JAXB in order to generate XML files, and due to a business need I'm currently writing it to the middle of some other XML file using XMLEventWriter: marshaller.marshal(jaxbElement, xmlEventWriter); And currently setting some properties…
plemos
  • 31
  • 1
  • 2
3
votes
1 answer

Formatted text in QTreeWidgetItem

I need to create QTreeWidgetItems which have support for formatted texts, such as: MyCreatedType - INTEGER(1) (ie: the line above should have a "normal" part : MyCreatedType and a "formatted" part (INTEGER(1) in our case). Any idea how to accomplish…
Ferenc Deak
  • 30,889
  • 14
  • 82
  • 151
1
2 3 4 5 6