FAQ Database Discussion Community


CSS table cell inputs not taking full width

html,css,formatting
I have a snippet in my project that involves laying out a grid for a form using CSS tables. However, I am having trouble making it work where it does not take up the full width as I would expect. .full_width { width: 100% } .table { display: table; }...

Retaining original table formatting after a 'pagebreak'

excel,excel-vba,table,formatting,page-break
So here's the finished product, a statement of accounts with a working statement table, and an ageing analysis: Everything works great. It basically populates itself row by row with data from another table. Here is the sample code: j = 21 'First row on the statement of accounts workbook For...

Get wordpress formatted post content without including wordpress functions

php,wordpress,formatting
I'm creating a script that gets the content and meta of wordpress posts for an app, doing queries directly on the database because it's way faster than including the wp functions. However the problem is that the post content is saved into the db without formatting. I know that I...

Engineering notation with Haskell

haskell,floating-point,formatting,floating-point-precision,scientific-notation
Is there a existing Haskell function which provide an engineering notation formatting (as String)? If not, I read that printf can be extended by adding an instance to PrintfArg. Do you believe this is a good solution ? By engineering notation, I mean an exponent notation whose exponent is a...

How can you use a variable name inside a Python format specifier

python,formatting
Is it possible to use a variable inside of a Python string formatting specifier? I have tried: display_width = 50 print('\n{:^display_width}'.format('some text here')) but get a ValueError: Invalid format specifier. I have also tried display_width = str(50) however, just entering print('\n{:^50}'.format('some text here')) works just fine....

Trying to copy Formatting in all cells from one Excell sheet into another specifically keeping fill and text color using VBA

excel,excel-vba,formatting,copy-paste
I have a working VBA script that copies exactly what I need except formatting. I at least need it to copy Fill and Text color. Here is my current code. Private Sub Workbook_Open() Application.DisplayAlerts = False Cells.Select Range("A1").Activate Selection.ClearContents Selection.UnMerge Selection.ClearContents Range("A1").Select Workbooks.Open Filename:= _ "Photo\Studio\\DAILY_REPORT_BACKUPS\DIGI_Review_Terry.xlsm" Range("A1:XFD70").Select Range("A1:XFD70").Activate Selection.Copy ActiveWindow.Close...

Need help in writing this multiplication code

c,formatting,output,multiplication,spaces
I need to show process of multiplication in output.for ex:- inputs are two numbers(say 325 and 4405) the output would be:- 325 *4405 ----- 1625 0 1300 1300 ------- 1431625 NOTE:-number of spaces should be minimum. I don't need the exact code. Just tell me which property or way I...

Represent a buffer efficiently as unicode string

c++,windows,string,unicode,formatting
I have a random buffer. I need to encode it to a unicode string (utf16 LE. as used by windows wide-char specification) so it can be used as PWSTR. For example when calling to StringCchPrintfW A possible solution can be to use base64. But in order to make it a...

Powershell script to send email with list of files in a folder - formatting issue

email,powershell,formatting
thank you for taking the time to look at my question. I have a Powershell script that checks for files in a folder and sends an email if any files are older than 3 hours. The only problem is, I can't seem to get the formatting right when trying to...

Bifurcate a string, removing the middle of the string instead of end

c#,.net,string,formatting
I want something similar to this question I found lead me to this answer on another question where I tried to convert it from php to c# my attempt to convert it... failed very badly: private string trimString(string str, int maxCharacters = 16) { int textLength = str.Length; return str.Substring(maxCharacters/2,...

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

javascript,html,xml,formatting,codemirror
I have an HTML document stored in a string as follows : var htmlAsString = "<!DOCTYPE html><html><head>........"; I try to initialise my CodeMirror editor with the above HTML document as follows : var cm = CodeMirror($('#some-div')[0], { value: htmlAsString, mode: "htmlmixed", autofocus: true, lineNumbers: true }); However, all that does...

Use formatting tags in XML

html,xml,xslt,tags,formatting
Below is the source code for XML and XSLT file, the output that I am getting is "Bold Text Italics Text" the bold and italics formatting tags are ignored. How can I adjust this code to make sure ALL tags are applied and my output text is in bold/italic? XML...

MariaDB formatting view code

mysql,linux,view,formatting,mariadb
When i save view on mariadb on debian(6) I lose comments and formatting of code. What is this feature of mariadb? How turn if off? On windows instance all comments and formats are stored. Both instances is MariaDB 10.0.17. Managed with Heidi 9.1 from Windows. Edit 1. Semi solved. LOAD_FILE...

Wrong column filtering for date column

javascript,sorting,formatting,filtering,tablesorter
I use tablesorter to sort columns. But I found the following issue: As you can see the second row doesn't have 16. This table also have the external search field and search result equals 1 if I type 16, thus second row doesn't show. But it lools like a tablesorter...

Adding a trailing 0 to my 0.1, 0.2 values, but not to my 0.25 values

java,formatting
I have a double value that is pulled in from an external method call. When a 0.6 value comes through, I want it to be changed into 0.60, but I don't wan't to put "0" at the end of my string or else it will make my 0.65 values 0.650....

Matplotlib shows superfluous microsecond precision on x axis ticks

datetime,matplotlib,formatting,decimal,ticker
I would like to plot some data as a function of time. I have used matplotlib and datetime, and it works well except for the x axis ticks. The time interval is about an hour, and there are ticks every 10 minutes. However, the ticks do show, for example, 17:50,...

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....

Can this be done with formatting strings alone?

c#,.net,vb.net,formatting,string-formatting
I think I've found something that can't be done with formatting strings alone: I'm needing a string that would allow me to format a double to show no decimals and so that: Numbers are thousand separated 0 shows a dash Negative numbers are shown between parentheses 0.5 is rounded to...

highlight “partial” duplicates across entire sheet in Google Sheets using conditional formatting

formatting,duplicates,conditional,highlight,partial
Im trying to highlight partial duplicates in google sheets using conditional formatting. I need to highlight duplicates across multiple columns and rows in any matching cells. so far I'm using this... =countif(INDIRECT({"C2:Z18"}),C2)>1 Which works to a degree, but it only highlights exact matches. I need to find a way to...

How can I print decimal places, up-to the point there are not two repeating zeros?

java,floating-point,formatting
I would like to change the below output 5250.000000000000 5512.500000000000 5788.125000000001 6077.531250000001 6381.407812500002 6700.478203125002 7035.502113281253 7387.277218945315 7756.641079892581 8144.47313388721 To the below output. 5250.0 5512.5 5788.125 6077.53125 6381.4078125 6700.478203125 7035.50211328125 7387.277218945313 7756.641079892578 8144.473133887207 So it appears the logic I need, is to only print decimal places if there is less than...

MySql datatype versus PHP formatting whilst not losing numeric sorting capabilities

php,mysql,types,formatting
See http://pdga-europe.com/standings-2015/ It's probably the simplest question you've seen in a while, but I'm stumped. I am importing an XLS sheet to MySql database, and most data is integers, but some (really, only some) are fractions (at an exact .5) Data type gets set to DECIMAL (4,1) by PHPMyAdmin, and...

How to convert html code to a string that replaces the newlines with \n and tabs with \t

javascript,html,string,formatting,markup
Is there an easy way to convert HTML code, that is structured in a certain way, to a single string (that can then be used in a Javascript variable). The new lines and tabs in the html code need to be converted to \n and \t so that the formatting...

How to serialize a custom formatted time to/from xml in Go?

xml,go,formatting,date-formatting
When serializing a datetime to/from xml how do I make it use a custom time format?

MySQL formatting query - Setting column Results as a Table header

mysql,table,formatting
I am trying to create a report in MySQL to output number of Traded Shares, by Client and by Market. I have got the results I want (using multiple tables), but need to change the output table so that the results from one column become the header of another, and...

Formatting large numbers in C#

c#,.net,unity3d,formatting
I am using Unity to make an "Incremental Game" also known as an "Idle Game" and I am trying to format large numbers. For example, when gold gets to say 1000 or more, it will display as Gold: 1k instead of Gold: 1000. using UnityEngine; using System.Collections; public class Click...

Is there analog of fmt:formatNumber in velocity like in jsp?

jsp,formatting,velocity,template-engine
Now I am migrating my jsp to velocity template. I cannot find solution how to migrate following code line: <fmt:formatNumber minFractionDigits='2' value='${campaign.budget div 100}'/> Does velocity can something like this?...

TypeError: unsupported operand type(s) for %: 'int' and 'tuple' [closed]

python,formatting,raspberry-pi
On a Raspberry Pi, I've set it up so that it's monitoring ASCII serial input from the user, which it then parses and populates a matrix with the parsed data. But when I try to do something with the data: for i in range(1,7): if matrixA[i][1]>0: print "sending DO_Fire (pin...

How to set font-weight of a column text to bold based on another column value in Telerik Grid

telerik,formatting,conditional,client-templates
I have a Telerik grid in which based on whether my IsTrue value is true or false, I need to set the font-weight of Name text in only that particular row to bold. I tried the following but I seem to be missing something. columns.Bound(d => d.IsTrue).Width(0).HtmlAttributes(new { id="hdnIsTrue", style...

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...

Regain an original fractional numeric value that Excel has transformed to a date value

excel,date,formatting,numeric
I have an Excel workbook that contains numeric values and some of them have been transformed by Excel auto format feature into the date values. I do not know the original numeric values and neither do I have access to the .txt version of that file. Is there a way...

How to format the values of a model in Marionette Backbone View before rendering?

view,formatting,typescript,rendering,marionette
If you implement the onBeforeRender method the is no way to access the model values in order to format them temporarily Ideally you would want to format the values just before rendering without changing the model values of course! How to do it?...

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...

SSRS Average Time in Minutes and then Format to HH MM

sql,stored-procedures,reporting-services,formatting
I've seen a lot of questions about average time in SSRS but I'm pretty new to this and none of these questions address my specific need so any help would be appreciated. I have a duration field (Fields!Duration1.Value) which is pulling in a duration in minutes (example: 170). In my...

Formatting number in European format with two decimals

javascript,formatting,locale,culture
Trying to format a number to two decimals format in European culture. So that comma is decimal separator and space thousands separator. In example 213245 should be formatted as 213 245,00 How can I do that? 213245.toFixed(2).toLocaleString(); gives 213245.00 but it should be 213 245,00 however 213245.toLocaleString() gives 213 245...

Reformatting Dictionary output in python

python,csv,formatting,ordereddictionary
I have an OrderedDict and I've exported it to a csv but I want it to be formatted differently. My code for reading, sorting, and making the dictionary: from collections import defaultdict, OrderedDict counts = defaultdict(lambda: {"User": 0, "Equipment": 0, "Neither": 0}) with open('sorterexample.csv', 'rb') as fh: reader = csv.reader(fh,...

How to write a large amount of columns in a formatted file

formatting,fortran,fortran90
I'm trying to write a code in fortran90 that allows me to create lets say 20 columns (f10.6) with one space between them in to the "output file". When I try to create file just with the 4 columns it works, but when I try to format a file with...

How to convert a Rational into a “pretty” String?

haskell,formatting,rational
I want to display some Rational values in their decimal expansion. That is, instead of displaying 3 % 4, I would rather display 0.75. I'd like this function to be of type Int -> Rational -> String. The first Int is to specify the maximum number of decimal places, since...

Customised Style not showing in pages

c#,wpf,xaml,formatting
I've been working on this for a while and hit a hump that I cannot solve. The custom style I have works for some elements and not others. For instance, it works for the fonts, and will even format the button fonts, when I've only stipulated the TextBlock fonts. Most...

TextField formatting (padding) issue in Titanium Android

android,formatting,textfield,titanium-mobile,titanium-android
I am facing the issue of formatting a simple textfield in Titanium Android. Problem : I am not able to view the text field input value that I enter. If I print the logs its getting entered but not visible. In some devices I get cut-off text. Below is my...

Selecting parameters in String.format() [duplicate]

java,formatting
This question already has an answer here: Java Equivalent to .NET's String.Format 5 answers In C# you can specify which parameter is used for a formatted string with para 2: {2}. This allows for using parameters in arbitrary places and multiple times. Is there a way to do this...

C++: Re-use line printed to console [duplicate]

c++,terminal,console,formatting,output
This question already has an answer here: How to rollback lines from cout? 3 answers Edit: Thanks to user mah's comment, I found what I was looking for. I want to rollback the line, see this question. I always print information to the console using std::cout and std::endl, but...

Change font color for a row when the value is one specific value

formatting,ssrs-2008,bids
I'm trying to change the font color on complete row when a value. I found the question and answer for changing the font color on a particular cell on another post here. This was part of the other answer: =IIF(Fields!Registrations.Value <> Previous(Fields!Registrations.Value), "Black", "Blue") but it won't do what I...

Excel - Conditional Formatting using time arguments

excel,date,formatting,formula,conditional-statements
Looking to change the fill of a cell based upon the amount of time between the current date (TODAY), an entered value detailing when something was done historically and a set period from that historical date of either 6months or 1year. E.g. I have a date of 12/04/2015 entered as...

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 can I style this php with divs?

php,html,css,formatting
So I'm trying to style this php with divs but it's not behaving how I'd like. I would like each thumbnail to have the catalog number appear under it. What's the best way to do this? I'm not super clear on how php and css interact yet. $records = $result->getRecords();...

Formating data in HTTP POST request with PHP

php,http,post,data,formatting
I'm using an API which gives an example of how they want the data of the POST request I'm about to make to be formatted. This is their example: un=chris& key=xxxx& origin=plot& platform=lisp& args=[[0, 1, 2], [3, 4, 5], [1, 2, 3], [6, 6, 5]]& kwargs={"filename": "plot from api", "fileopt":...

How do I convert a double into an n-character string using exponential notation?

java,string,formatting,double
I have found this vise-versa many times on SO, but never like I want it. I want to convert a double into a string that takes up exactly n characters. If n is, for example, 6, then 1,000,123.456 would become 1.00E6 -1,000,123.456 would become 1.0E-6 1.2345678 would become 1.2345 1,000,000,000,000...

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...

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...

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......

Getting a key error while using a dict with TEMPLATE.format()

python,string,python-3.x,dictionary,formatting
At a loss on this. I'm getting a key error but I can't figure out why as the key referenced looks like it's in the dict. Any help? TEMPLATE = "{ticker:6s}:{shares:3d} x {price:8.2f} = {value:8.2f}" report = [] stock = {'ticker': 'AAPL', 'price': 128.75, 'value': 2575.0, 'shares': 20} report.append(TEMPLATE.format(stock)) This...

Insert Excel row using format from row below, not above

c#,excel,formatting,add-on
I need to insert a row into an existing Excel worksheet using C# but keep the existing formatting. The default behaviour in Excel is to use the formatting of the row above, which in some cases is what I don't want as this could be different. I am sure I...

Format datetime axis in highcharts?

datetime,highcharts,formatting,axis-labels
http://jsfiddle.net/LLExL/4537/ Can anyone please help with this date time axis formatting on highcharts. I want Xaxis to show month only once unless the new month begins. Like 29 April 30 1 May 2 3 4 5 Any help would be highly appreciated ...

How to apply scales::percent or scales::percent_format() to prop.table in R to format numbers as percentages

r,formatting,plyr,percentage,crosstab
Consider the following example: tab <- table(mtcars$vs, mtcars$cyl, dnn = c("vs", "cylinder")) prop.table(tab) # cylinder # vs 4 6 8 # 0 0.03125 0.09375 0.43750 # 1 0.31250 0.12500 0.00000 round(prop.table(tab)*100, 1) # cylinder # vs 4 6 8 # 0 3.1 9.4 43.8 # 1 31.2 12.5 0.0 Desired...

String Formatting/Template/Regular Expressions

python,regex,string,pandas,formatting
I have a string format let's say where A = alphanumeric and N = Integer so the template is "AAAAAA-NNNN" now the user sometimes will ommit the dash, and sometimes the "NNNN" is only three digits in which case I need it to pad a 0. The first digit of...

Python's Multiplication Function

python,formatting,multiplication,presentation
In python I found a multiplication solution very useful for the software I am writing. Problem is when using the software, user is asked a question (i.e 8x2) but it prints a command-type line (i.e 14). This is not so user friendly and I would like to display it in...

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...

How to .write() two items, a zero and an iterator in Python?

python,csv,formatting,conditional-statements,writing
I may have a simple formatting question here - I would like to do something like hrOut.write('0',i) in order to add/preface a zero to 'i' which is a timestamp, but I don't know the correct syntax. My code is below. Thank you all. hrIn = open('HrsInput.csv') hrOut = open('HrsOutput.csv', 'wt')...

Use DateTime format in a class but restrict time tokens

c#,parsing,datetime,formatting
I have a peculiar problem I want to solve. I have written a MonthYear class which essentially maintains a DateTime object behind the scenes and only allows methods/properties for month and year portion of the DateTime. Everything is working fine. Now I have another requirement. I want to allow anyone...

OpenOffice Calc displays only 9 numbers after decimal points, how to show more

formatting,openoffice-calc,formulas,libreoffice-calc
I am in a situation of dealing with numbers when there is need to display the numbers as is on the excel sheet. Currently 37.6172080480001 is being displayed as 37.617208048 Seems like the sheet by default only displays 9 digits after the decimal points. How can that be updated to...

Python 2.7 Etree/lxml minimizing [duplicate]

python,xsd,formatting,lxml
This question already has an answer here: Close a tag with no text in lxml 3 answers Im using lxml/Etree to parse and write to XSD documents. I have the basic structure tree = ET.parse('file.xsd') # do stuff tree.write('output.xsd') But tags get minimized in some instances, for example: <Cars>...

Hide leading 0 on CAST SELECT output either in MySQL or PHP

php,mysql,casting,formatting,decimal
Morning, I currently have a SELECT statement calculating the PCT for a sports table: SELECT team , COUNT(*) as played , SUM(win) as wins , SUM(loss) as lost , SUM(draw) as draws , SUM(SelfScore) as ptsfor , SUM(OpponentScore) as ptsagainst , SUM((win*2 + draw)- loss) as score , CAST(SUM(win +...

Altering XML file format in C#

c#,xml,formatting
I have a program in Visual Studio which gives the output in an XML file. It looks like so: <?xml version="1.0" encoding="utf-8"?> <leaCEDS> <district> <leaID>01</leaID> <name>Alachua</name> <organizationType>LEA</organizationType> <streetLine1>620 E University Ave</streetLine1> <city>Gainesville</city> <stateProvince>FL</stateProvince> <postalCode>326015448</postalCode> <county>Alachua</county>...

List git branches in directory using bash with formatting

git,bash,shell,ubuntu,formatting
I wants to list git branches in a set of directories using bash. Now I just want to format the branch name differently if it's "master". In other words, if the branch is 'master' I want to display it in Blue or any other color....

Why is my file output overwritten?

c,file,struct,formatting
My program takes user input and stores it in an array of Records that I've defined as a structure: struct Record. The user input is are the fields of the struct. Everything complies error free, but it seems I can't get the formatting correct. My program keeps asking for user...

Display a table in MATLAB

matlab,formatting
I am trying to display a table with two columns and 86 rows. Instead of outputting the rows, the size is stated. Is there a way to change this? I am new to MATLAB and am coming from a background in C/C++ so I may just be approaching this all...

Is it possible to format a Textbox for currency just in ASP NET?

asp.net,textbox,formatting,currency
I have this textbox that should show currency values to 2 decimal numbers. I would like to do using the "Text" property of textboxes. Is that possible? <asp:TextBox ID="txtImponibile" runat="server" Width="120px" Enabled="False" ></asp:TextBox> Thanks....

How to prefix values when templating them with rivets?

javascript,formatting,rivets.js
I am working with the rivets.js library to template data into my application. I am stuck at a kind of a formatting issue. How do I format values while templating them? For example I have to template the user's photo location inside the image tag and I am getting the...

Modifying formatters in Haskell's formatting library

haskell,formatting
I'm using Chris Done's formatting library (specifically formatting-6.0.0). I'm finding it difficult to construct a `higher order' function which maps a formatter to a list formatter, performing a custom action on the resultant list of Builders: list :: ([Builder] -> Builder) -> Format r (a -> r) -> Format r...

Show Results' line numbers using grep

linux,bash,grep,formatting,line
how i can show the result of my grep command with incremental numbers before them , i'm not talking about using -n or -nr to show where is my string located in that files. i'm talking about something like this : grep foo *.* result should be like this :...

Get text from Gtk3 TextView/TextBuffer with formatting tags included in Python

python,formatting,gtk3
I'm working on a Python 3 project that uses the Gtk3 TextView/TextBuffer to get a user's input, and I've got it working to where I can have the user typing in rich text and able to format it as Bold/Italic/Underline/Combination of these. However, I'm stuck on trying to figure out...

Formatting long-form survey data in R

r,table,formatting,reshape,long-form
We asked 3 people two or three yes-no questions. Let me denote these 3 people by 101,102,103 the questions by "A", "B","C" and the responses by 0, 1. The result is q<-data.frame(response=c(0,0,1,0,0,1,1), qstn=c("A","B","A","B","A","B","C"), person=c(101,101,102,102,103,103,103)) We need to convert this table to the following format person|qustionA|questionB|questionC 101 | 0 | 0...

Populate DataGridView Column With a Double forcing to 2 Decimal Places, with Sort

vb.net,sorting,datagridview,formatting
Sorry for the weird title but I didn't know how to phrase it any better. I'm trying to populate a column on my DataGridView with a number that has 2 decimal places. To do this I'm using Dim _Size as Double = 1.2345 DataGridView1.Item(0, 0).Value = Format(_Size, "0.00") This populates...

Show number sign at the right side of number using cell formatting

excel,formatting,excel-formula,worksheet-function,conditional-formatting
I need to create formatting for numbers while keeping their actual value: If a negative is number entered, the minus sign needs to appear on the right-hand side of the number. If a positive number is entered, the plus sign needs to be on the right-hand side of the number...

Making LaTex Lists Wrap

formatting,latex
So I have the following LaTex list, and many like it in a paper I'm translating: \begin{enumerate} \item If $\mathfrak{E}$ and $\mathfrak{B}$ with the arguments $x, y, z$ a solution of the Maxwell's equations (1), then through the components $\mathfrak{E}_x, \mathfrak{E}_y, \mathfrak{-E}_z, \mathfrak{-B}_x, \mathfrak{-B}_y, \mathfrak{B}_z$, with the arguments $x, y,...

Simple and clean java float to string conversion

java,string,floating-point,formatting,type-conversion
This is a very simple question, but I'm amazed on how difficult it has been to answer. Even the documentation didn't give a clear and straight answer. You see, I'm simply trying to convert a simple float to a string such that the result only has one decimal digit. For...

How to format code so while loop is triggered C

c,while-loop,formatting,boolean-logic
So I have two while loops. The outer most one does not loop back the way I want it to. I first tried: #define true 1 #define false 0 But then set it to what I did below. My problem is that when I run the program, it terminates after...

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...

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:...

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"...

Excel formatting with Java Apache POI

java,excel,formatting,apache-poi
I have an excel file in the following format: I would like to restructure this format and have it outputted in the following format: The sections are repeating and can appear in any order but they will have either format. The 'Check' column is sometimes merged across rows as shown...

Proper Formatting in a listbox

vb.net,listbox,formatting
I'm trying to format my listbox so that it looks neat when its in use. I want to add dollar signs to my numbers, and left align them. Any help would be appreciated. They currently look really sloppy. Dim salesTotal As Double customerListBox.Items.Add("Customer: " & " " & "Total Sale:...

Delphi 7: Formatting changes after using delete procedure

delphi,formatting,string-formatting,richedit
I was working on my text editor, which I have completed, but I still have this one problem I'm trying to solve. My problem is, that I want to delete specific symbols on the end of lines, which were created by pressing the speedbutton (button is down). So when I...

Specifying styles for portions of a PyYAML dump (II): sequences

python,formatting,yaml
This is a follow up question to Specifying styles for portions of a PyYAML dump: Consider following code contaning as input manually formatted YAML data. I am modifying the YAML data, but would like to keep edges on single lines in the written YAML file. import yaml st2 = yaml.load("""...

How to make string paragraph easier to read for source code

powershell,formatting
I'm writing a script in PowerShell and it will display a long message. Basically, I'm trying to figure out how the break the string into multiple lines, yet it will still display as a single line. $paragraph = "This is a test to create a single-lined string, but it doesn't...

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,...

Google Sheets - propagate column date formatting to new rows

google-apps-script,formatting,google-spreadsheet,rows,propagation
The date format in the column is not propagating to new rows, whenever new rows are being added to the bottom of the sheet. The column formatting is not automatically applied - this in regards to date, currency format, alignment etc.

How to dynamically set currency symbol in Excel custom format?

excel,formatting,format
The figures in my spreadsheet use the following custom formatting: €#,###.##,, "M" So figures are expressed in millions with 2 decimal places prefixed by the euro symbol and followed by M for millions. My workbook will need to be converted to other currencies and I don't want to have to...

How to configure Eclipse Formatter to add this. in front of class members

java,eclipse,formatting
How can I configure the Eclipse Formatter to add this. in front of every class member use? I can't find this in the Formatter configuration and Google does not give me reasonable answer. I need this: public class Foo { private int bar; public void methodUsingBar(){ bar = 1; }...

Use XSLT to convert date time to full words

xml,date,xslt,time,formatting
I am just starting to learn XSLT and am hoping to convert some XML time and date data so that it is fully spelled out. While I have seen methods to have the date information output as words (12 to December) I don't see anything that allows be to convert...

Scala: Better way for String Formatting to PhoneNumber and using Java's MessageFormat

scala,formatting,messageformat
I'm looking for a better way to better implement the following: I have imported import java.text.MessageFormat to set the format I would like. val szphoneFrmt holds the format I would like. val szInitialString is set to the value I pulled from the database. val szWorkString breaks up the string via...

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: /** *...

Erlang: strange output formatting

xml,file,formatting,erlang,output
Windows 7 x64, Erlang-OTP 17. I wrote simple module like this: -module (somequery). -export ([fbquery/2]). fbquery(P1,P2) -> inets:start(), ssl:start(), token = "78a8shd67tyajsndweiu03hr83h19j", Encoded = {"Authorization","Basic " ++ base64:encode_to_string(lists:append([token,":",""]))}, ContentType = "application/xml", Headers = [Encoded, {"Content-Type",ContentType}], Options = [{body_format,binary}], {ok, File}=file:read_file(P1), Res = httpc:request(post, {"https://datapi.com/api/xml4-8", Headers, ContentType, File}, [], Options),...

Add blank row to MySQL query results based upon change in column value

mysql,sql,formatting
If I have a typical MySQL query such as: SELECT CommentNo, CreatedDate, CreatedTime, Text FROM Comment The results will be displayed in a simple table. But is it possible to have MySQL format the output so that a blank line can be inserted into the results based upon a change...

Javadoc formatting hyperlinks

java,formatting,javadoc
I can't seem to find out how to format my javadoc to show to show up with links to String rather than the whole path. I've gone through several different guides with no luck. I was hoping to make it look more in line with how documents at oracle look....

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...

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...

DateTimeFormatter auto-corrects invalid (syntactically possible) calendar date

java,parsing,date,formatting,java-time
Java DateTimeFormatter throws an exception for when you try a date that goes outside of a possible range, for example: DateTimeFormatter dtf = DateTimeFormatter.ofPattern("M/d/yyyy"); String dateString = "12/32/2015"; LocalDate ld = LocalDate.parse(dateString, dtf); will throw: Exception in thread "main" java.time.format.DateTimeParseException: Text '12/32/2015' could not be parsed: Invalid value for DayOfMonth...

Replacing section of python string with a designated variable

python,string,formatting
Currently I'm working on a message that I'd like to include multiple changing variables. Now I'm not exactly sure whether I explained that right, therefore here's an example: """ Hello world! %s %(what goes here?) """.format() Basically I'd like to apply another "%s", though I don't know how to do...

why is my string not in fixed size?

java,string,formatting,string-formatting
I try to print strings with padding (table like): StringBuilder sb = new StringBuilder(); sb.append(String.format("%1$15s", "bulk name")); sb.append(String.format(" | ")); sb.append(String.format("%1$15s", "baseline")); sb.append(String.format(" | ")); sb.append(String.format("%1$15s", "current")); sb.append(String.format(" | ")); sb.append("\n"); for (int i = 0; i < baseLine.tillOneSecondBulks.size(); i++) { sb.append(String.format("%1$15s", baseLine.tillOneSecondBulks.get(i).bulkName)); sb.append(String.format(" | "));...