FAQ Database Discussion Community

Printing a dictionary without newlines?

python,dictionary,file-io,printing,formatting
I'm trying to get the formatting right on my print-out and it's trickier than it should be. My objective is to have my code read in a dictionary, turn it to a list, sort it, then print it back out a text file looking like "String" "Float" "String" "Float" "String"...

Unfamiliar Javascript syntax/hack

html,formatting,script-tag,hacking
I'm perusing some source, and I see this <script type="text/javascript" src="script/jquery/jquery.1.7.1.js">//]]> </script> <script type="text/javascript" src="script/swfobject_modified.js">//]]> </script> There's a dozen or so dependencies in the head listed in such a fashion, what is the purpose of the //]]> after each script tag? The code looks a bit old school, and is...

XCode Formatting

xcode,formatting,keyboard-shortcuts
Is there a short cut or some quick way for Xcode to format this code: if(x==10){ if(y=100){ //Do this } } To this: if(x==10){ if(y=100){ //Do this } } Sometimes the logic of the code can get a little hard to read. I seem to spend a lot of time...

Copying lines from text file- remove formatting- Python

python,file,formatting,format
I am attempting to read text from a file, then print out the corresponding Shakespearean sonnet off of input from a user. [if the user enters 1, print sonnet 1, etc.]. The code I have below functions, however, I would like the answers to be without all the formatting 'def...

C code doesn't show in the output zero number

c++,formatting
When I'm compiling the following source code, in the output the zero doesn't correctly show. Why? I want the output text to have the following format: 01 02 03 04 05 06 07 08 not 1 2 3 4.... How can I fix this issue? #include "stdio.h" int main(int argc,...

What does this horribly ugly (yet somehow secretly beautiful) Perl code do?

perl,formatting,deobfuscation
I found this code in a Powerpoint presentation about Perl scripting and this was on a page demonstrating how ugly Perl code can get if you really wanted to make it that way. The presentation says nothing about what this code does. Honestly I am just very curious to know......

Override Conditional Formatting with Worksheet_SelectionChange

excel,vba,events,formatting
I have some code in a worksheet to highlight the row of a selected cell. However, this sheet has conditional formatting which colours some of the rows. The highlighting macro does not work on the rows where the formatting condition is being met (in the sense that the colour of...

How will I handle JSON key with dash/hypen in Retrofit?

android,parsing,formatting,retrofit
Below is an example response I got from the server. "request": { "authenticate-login": { "response": { "status": 1, "msg": "User Authorized!" } } } I have used Retrofit for a quite some time now and it's my first to encounter such issue....

format output to body of mail using powershell

email,powershell,formatting
I want to display the disk size of certain directory and file for a particular directory in a formatted output and send it as a body in the mail using powershell. I used in the powershell code but not able to save the same in a variable: C:\Users\abc\Desktop\xyz\file.bat -Name powershell...

Changing .NumberFormat based on .Value

excel,vba,formatting,format
I have to change the format of a cell to Euros based on its value. If it is between 1 and -1 then it will have three decimal places. else, it will have only one. Also the Euro symbol needs to come before the number. I'm having trouble getting the...

Auto insert a standard comment header for every “newly generated java file” in eclipse

java,eclipse,formatting
I want to add some default text to every newly generated java file, so that I don't have to add it manually every time. I've set the below configuration in eclipse: But when I create a new java file, the default comment I found is blank, like this: /** *...

Is there a specific way to input characters at the beginning of a new line?

python,string,formatting
Current I am trying to implement a way to input ">" at the beginning of each separate line in a string. An example would be: String: "Hello how are you! Python is cool!" Now that's all one big string, with a line break. But is there a function to establish...

new line for String.format works on console, but in not in email

java,string,email,formatting
This is what I set as property props.setProperty(EmailSender.MAIL_BODY, "This is an automated email.%nZip Path: %s\nAdditional Text: %s\nThank you."); and I use it as private String generateEmailBody(final EmailRequest diagnosticRequest) { final String bodyTemplate = getExistingProperty(MAIL_BODY); return String.format(bodyTemplate, diagnosticRequest.getZipFilePath(), diagnosticRequest.getTextFromCustomer()); } When I run test, I see on console as following Content-Type:...

SQl query, subquery formatting issue

sql,sql-server,formatting,result
I need someone to help me with some formatting. I have tried to get this into a Row using subqueries and UNION ALL etc with no success. It would seem to be rather easy but I am just beating my head against a wall with this. The table is laid...

Python3 Display certain number of output

python,python-3.x,formatting,format
I have a list a numbers, I want to display 10 per line, and they have to format really nice start: 1 End: 1000 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101...

formatting,latex

How do I pass an HTML document to CodeMirror as a start value?

javascript,html,xml,formatting,codemirror