Questions tagged [formatted]

81 questions
2
votes
4 answers

printing format string function and variable (python)

definition of function & variable: def secret_formula(started): jelly_beans = started * 500 jars = jelly_beans / 1000 crates = jars / 100 return jelly_beans, jars, crates start_point = 10000 / 10 print statement: print """crazy…
2
votes
1 answer

Where is Spring's @Formatted annotation?

I'm trying to define a custom formatter for my class, but I can't find the @Formatted annotation mentioned in Spring's documentation: 5.6.2 @Formatted The @Formatted annotation allows you to easily associate a Formatter implementation with one of…
protoboolean
  • 3,935
  • 4
  • 27
  • 45
2
votes
2 answers

How to read formatted data from string in matlab?

I have cell array of strings with different values: v = {'12.4B', '145.3M', '34.3M', '1.2B'}; I would like to convert them to numbers. Using sscanf function I can extract only numeric values, but what I want is to multiply the result by billion or…
Claude Monet
  • 133
  • 1
  • 1
  • 8
2
votes
1 answer

Datetime value in Excel unexpectedly changes when imported into SQL Server 2012

I have an issue with my data import from Excel to SQL Server. The datetime value being imported into the destination table is different from the datetime value in the Excel source file. With or without any formatting the value is always .003…
Archias
  • 383
  • 2
  • 8
2
votes
4 answers

C# static and non-static string variables in a formatted string as parameters

As a newbie in C#, I am trying to figure out why I have to put CardNumber as such as static in order to fit into the formatted string.... If I didn't add static string CardNumber but use string CardNumber;, the code would report an error with the…
Curly
  • 449
  • 1
  • 6
  • 14
2
votes
2 answers

Reading a formatted text file in java

I mainly program in C++ and I have been working on porting my game over to Java with Android. I ran into a short problem with some of my code. My text file is in this format: 0:1 0:0 1:1 2:2 3:3 I read it in with the fscanf function like…
Yasin Khalil
  • 59
  • 1
  • 7
2
votes
2 answers

How do I use strlen() on a formatted string?

I'd like to write a wrapper function for the mvwprint/mvwchgat ncurses functions which prints the message in the specified window and then changes its attributes. However, mvwchgat needs to know how many characters it should change - and I have no…
Uncle Dolan
  • 65
  • 1
  • 6
2
votes
5 answers

formatted output: columns

I am desperately trying to produce formatted output by using fstream: columns. There are two functions (whatever functions Func1, Func2) which produce output (write to the same file, "example.dat"): #include int main() { std::ofstream…
Pomeron
  • 119
  • 1
  • 3
  • 6
1
vote
2 answers

Formatted input from string in c++

I am making a statistics collector that reads the log of a music player and lets the user show top ten most played etc. As a noob project. A line from the log looks like: "20:42:03 start E:\ROTATION\A\Håkan Lidbo - Dammlunga.mp3" I have put this…
1
vote
1 answer

Filtering formated list with jQuery Mobile

So I have a list, formated in following way: <.ul data-role="listview" data-filter="true"> <.li> <.h2>header<./h2> <.p>description<./p> <./li> <./ul> How can I filter it only by header part? I'd be grateful for quick answer:)
Rufix
  • 201
  • 2
  • 6
  • 22
1
vote
1 answer

Binding formatted strings from XML file with data binding not working correctly

When developing with data binding to bind formatted strings directly in the XML file, the @{@string/stringName} does not work as normal attribute @string/stringName without data binding, and neither does @{String.format(@string/stringName)}. I would…
1
vote
0 answers

JAVA; Accept blank field in Text Field Integer Restriction

I have a problem here. I want to restrict my Text Field into a positive integers only. It works because I copied it from another Stack forum but the problem is that I can't remove the first character once I already inputted a number. For example: I…
1
vote
0 answers

Write formatted result from ssh2_exec on txt with php

I tried with php to write on a txt file the result of command 'df -h'. $comand = 'df -h'; $stream = ssh2_exec ( $connection, $comand ); stream_set_blocking ( $stream, true ); $stream_out = ssh2_fetch_stream ( $stream, SSH2_STREAM_STDIO…
MONS7ER
  • 11
  • 7
1
vote
1 answer

How does ios::fmtflags works in C++?How setf() works?

I am trying to understand formatted flags of ios stream. Can anyone please explain how this cout.setf(ios::hex | ios::showbase) thing works? I mean how does the or (|) operator work between the two ios formatted flags? Please pardon me for my bad…
1
vote
3 answers

Console output of strings with special characters

Is there a more or less standard way to output character strings that contain special characters, such ASCII control codes, in such a way that the output is a valid C/C++ literal string, with escape sequences ? Example of expected output:…
Yves Daoust
  • 48,767
  • 8
  • 39
  • 84