formatting

Keep line formatting in browser with bash CGI

寵の児 提交于 2019-12-12 03:26:59
问题 I'm using this bash CGI: #!/usr/bin/sh echo "Content-type: text/html" echo "" echo `ls -al` And it produces ie: total 52 drwxrwxrwx. 2 root root 4096 Feb 2 18:34 . drwxr-xr-x. 8 root root 4096 Feb 2 17:58 .. -rw-r--r--. 1 root root 36310 Feb 2 17:45 dds.jpg -rw-rw-rw-. 1 user user 50 Feb 2 18:03 dds_panel.htm -rwxrwxrwx. 1 user user 460 Feb 2 18:34 test-cgi.cgi In a terminal they appear each neatly on a single line but in the browser they appear all on the same line. What's the best way to

SQL Server 2005 OPENROWSET insert into Excel - text to number formatting

為{幸葍}努か 提交于 2019-12-12 02:49:11
问题 So it's not a huge deal, but with Google not returning anything more recent (mostly 2007 or so) about it possibly being an Excel driver issue...I came here to ask the question as what I found as an "answer" was not acceptable without further research. My problem: Writing a dynamic OPENROWSET query clear and insert new data to send off a report to specific users - the base excel report contains some formulas in which it calculates off and sums based off the inserted data and the multiplication

How to do print formatting in Python with chunks of strings?

↘锁芯ラ 提交于 2019-12-12 02:36:36
问题 I'm having some trouble with formatting the pyramid. I've tried to use format when printing from the loop but that didn't seem to work and just breaks the program. What would be different ways to format the output. The only trouble that I am having is when I am printing 10 and up when there's double digits. What would be the best approach formatting the printing output? I've tried variety of ways but couldn't make formatting work within the loop from documentation https://docs.python.org/3.5

JavaScript date and time formatting,

ぃ、小莉子 提交于 2019-12-12 02:27:51
问题 I have read a lot of thread about the subject, but i'm not much into programming... i've made some tests but never acheive what i wanted. Here we have a html template we have to modify to suit our needs. here the code i have to edit: <p id="DATE"></p> <script> var d = new Date(); document.getElementById("DATE").innerHTML = d.toString(); </script> Its giving me the date OK...but not i the format i want... the format i want is... DD-MM-YYYY HH:MM Simple has that :) Its been a couple of hours

How to format table rows into 2 columns

六月ゝ 毕业季﹏ 提交于 2019-12-12 02:25:57
问题 Please excuse me if this question is elementary - fairly new to working with mysql. I left out the query and loop/references in the code below, because my question is on formatting the table. (I hope that info isn't needed) Right now the result of the code below is the info being displayed in one single table row that spans the width of the table, these rows continue until all data is displayed. How can I format this so instead of one long cell in one table row, I get two cells per table row?

String formating with nested dictionary

旧时模样 提交于 2019-12-12 02:22:04
问题 I'm trying to write multiple keys and associated values from a nested dictionary via string formatting. I have tried various approaches but as it is nested I don't seem to be having much luck. Is this possible? Nested Dictionary defaultdict(None, {'Devicename': {'OS': 'version', 'Name': 'name'}, 'Devicename': {'OS': 'version', 'Name': 'name'}}) Formatting Data HEADER = ''' <html> <head> <h2>Summary</h2> <tr> <td><b>Device:</b> {0}</td> </tr> <table style="width:80%"> <tr> <td><b>Name:</b> {1}

When I minimize my HTML/CSS page it squishes all the pictures and texts and ruins the formatting

空扰寡人 提交于 2019-12-12 02:13:47
问题 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="generator" content="HTML-Kit Tools HTML Tidy plugin"> <link href="layout.css" rel="stylesheet" type="text/css"> <title></title> </head> <body> <div class="square" font=10px> <p></p> </div> <div id="wrapper"> <img class="A" src="download.jpg" alt="Solar Panels"/> <img class="B" src= "wind.jpg" alt="Windmills" /> <img class="C" src= "biomass.jpg" alt="Biomass" /> <img

Converting Number format

拈花ヽ惹草 提交于 2019-12-12 02:13:14
问题 I have problem understanding the numbers produced by Matlab. What does the e mean? And how can i convert those numbers to int? This is the answer for a matrix x=[x1, x2,x3,x4,x5,x6,x7,x8] ans = 1.0e+004 * -0.0000 -0.6340 -0.3660 -0.8966 0.6340 1.0000 -0.7321 0.6340 回答1: The 1.0e+004 means 1.0*10^4 . Casting works using int32(x), depending on your target accuracy you can also use int16(x) or int64(x). Check out the documentation http://www.mathworks.de/help/techdoc/ref/int32.html Rounding is

R can't manage “General” formatted cells when reading libreoffice generated xls

江枫思渺然 提交于 2019-12-12 02:05:45
问题 I switched to libreoffice for my spreadsheets, but I noticed an error when importing an xls file modified with libreoffice inside R using the gdata package's read.xls() function. If a column is formatted as General, then once in R the cells display General instead of the right value. To fix it I need to format every column to the proper format (number, text, etc), which i'd prefer to avoid since general better manage formatting (eg. automatically display the right number of significant digits

Angular model.$viewValue not showing in input field

亡梦爱人 提交于 2019-12-12 01:59:11
问题 I previously write this [question][1], Inow I have the problem that the model.$viewValue it's not the same of the value the i see in the input box. <div amount-input-currency="" ng-model="data.amount" ></div> This is my directive (isNumeric and similar is not important that works weel): var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.data = { amount: ''}; }); app.directive('amountInputCurrency', function () { return { restrict: 'EA', require: