formatting

What Free SQL Formatting Tools exist? [closed]

落爺英雄遲暮 提交于 2019-12-17 22:35:14
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I want to beautify the SQL Queries I write. What free tools exist that allow for SQL query formatting? 回答1: PoorMansTSqlFormatter is a

How do I set up VSCode to put curly braces on a new line?

…衆ロ難τιáo~ 提交于 2019-12-17 22:27:02
问题 Let's say I type in the following code and format it. if (condition) { /* Hello! */ } If this is C# code, it is formatted like this: if (condition) { // Hello! } If it is JavaScript, VSCode formats it like this: if (condition) { // Hello! } So how can I use the first formatting style (curly braces on new lines) for all languages? I can't find a setting or something similar. Suggestions? 回答1: Follow the steps below to make Visual Studio Code format opening curly braces on a new line for Java

MATLAB m-file help formatting

二次信任 提交于 2019-12-17 21:57:09
问题 I could not find what formatting available to write help for your own MATLAB function. Very little information is available in official documentation. Do you know about any other formatting that can be visible with Help Browser (not with help function)? As it is for built-in functions. How to format headings (like Syntax, Description, Examples)? Are bullets, tables possible? Or may be it should be a separate file? I've tried text markup as used for PUBLISH and HTML, didn't work. I found only

How to pad Fortran floating point output with leading zeros?

怎甘沉沦 提交于 2019-12-17 20:57:45
问题 I have some floating point numbers that I need to output from a Fortran program. Let's say the maximum number could be 999.9999 and they are all non-negative. I need zero-padding in front of all numbers less than 100. For instance, if I have 25.6893782, 245.354567, and 1.2345678, I need to print them out in a form something like 025.6894 245.3546 001.2346 How can I do this? It would be fairly easy with the T edit descriptor if I knew that, for instance, all numbers would be between 10 and 99,

Can't find the error: VLOOKUP not returning the value

白昼怎懂夜的黑 提交于 2019-12-17 20:38:19
问题 I am working with an excel file and I am trying to "map" some values with the vLookUp function. The first parameter of the vLookUp function is giving me headaches: The function works with certains values (typed by hand in a text format)...but doesnt work with pre-generated values (the sames ones...but generated from an ERP system..). I checked to make sure that I was looking for "same nature" values ( text vs text ) ...but I can't find out why the first 3 values (typed by hand) are fine...

What's the best way to format a phone number in Python?

一笑奈何 提交于 2019-12-17 20:04:04
问题 If all I have is a string of 10 or more digits, how can I format this as a phone number? Some trivial examples: 555-5555 555-555-5555 1-800-555-5555 I know those aren't the only ways to format them, and it's very likely I'll leave things out if I do it myself. Is there a python library or a standard way of formatting phone numbers? 回答1: for library: phonenumbers (pypi, source) Python version of Google's common library for parsing, formatting, storing and validating international phone numbers

Formatting Complex Numbers

ⅰ亾dé卋堺 提交于 2019-12-17 19:37:31
问题 For a project in one of my classes we have to output numbers up to five decimal places.It is possible that the output will be a complex number and I am unable to figure out how to output a complex number with five decimal places. For floats I know it is just: print "%0.5f"%variable_name Is there something similar for complex numbers? 回答1: For questions like this, the Python documentation should be your first stop. Specifically, have a look at the section on string formatting. It lists all the

Unexpected java SimpleDateFormat parse exception

核能气质少年 提交于 2019-12-17 19:36:58
问题 I can't understand why this few lines Date submissionT; SimpleDateFormat tempDate = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy"); public time_print(String time) { try { submissionT=tempDate.parse(time); } catch (Exception e) { System.out.println(e.toString() + ", " + time); } } Cause exceptions and print out java.text.ParseException: Unparseable date: "Tue Mar 31 06:09:00 CEST 2009", Tue Mar 31 06:09:00 CEST 2009 ... while the "unparsable" time is compliant with the format string i've

Django: How to format a DateField's date representation?

廉价感情. 提交于 2019-12-17 18:17:51
问题 I have a form with a DateField. The existing date value is formatted to render like this: 2009-10-03 How can I format that so that it look like this: 03.10.2009 I found a widget which renders it like this, but validation doesn't allow the values I enter then. 回答1: To display initial field value properly formatted, use DateInput widget. To customize validation, use input_formats keyword argument of DateField. Why do you need both format and input_formats ? format - The format in which this

Generate fixed length Strings filled with whitespaces

ぃ、小莉子 提交于 2019-12-17 17:34:01
问题 I need to produce fixed length string to generate a character position based file. The missing characters must be filled with space character. As an example, the field CITY has a fixed length of 15 characters. For the inputs "Chicago" and "Rio de Janeiro" the outputs are " Chicago" " Rio de Janeiro" . 回答1: Since Java 1.5 we can use the method java.lang.String.format(String, Object...) and use printf like format. The format string "%1$15s" do the job. Where 1$ indicates the argument index, s