format

When does format actually print in Common Lisp?

左心房为你撑大大i 提交于 2020-01-14 08:36:47
问题 I have the following Common Lisp code: (defun micro-read-eval-print () (format t "Micro > ") (let ((form (read-line))))) When I run it, I get the following: CL-USER> (micro-read-eval-print) (m-quote a) Micro > NIL Note that I typed in "(m-quote a)", while the Lisp interpreter output "Micro > NIL". Now, I would have expected these events to happen in the reverse order. I would have expected "Micro > " to have been printed first since the format statement comes first. Why isn't it printed first

Shiny Bookmarking is not Working If I Changed the Formatting of Numeric Input

一笑奈何 提交于 2020-01-14 04:08:28
问题 I want to design an app using Shiny that allows users to bookmark the input values. However, I found that if I changed the input format of the numericInput , bookmarking will not work. Based on this link (https://beta.rstudioconnect.com/barbara/format-numbers/) to format the input of a numericInput . I created a js file called number_format.js and stored the file in the directory www . The code is as follows. $(document).ready(function() { // Helper function to guarantee cross-browser

Shiny Bookmarking is not Working If I Changed the Formatting of Numeric Input

橙三吉。 提交于 2020-01-14 04:08:28
问题 I want to design an app using Shiny that allows users to bookmark the input values. However, I found that if I changed the input format of the numericInput , bookmarking will not work. Based on this link (https://beta.rstudioconnect.com/barbara/format-numbers/) to format the input of a numericInput . I created a js file called number_format.js and stored the file in the directory www . The code is as follows. $(document).ready(function() { // Helper function to guarantee cross-browser

Matlab output - Space padding?

穿精又带淫゛_ 提交于 2020-01-13 19:56:40
问题 I'm trying to output a Matrix: M = [1 20 3; 22 3 24; 100 150 2]; Using: for i=1:3 fprintf('%f\t%f\t%f\n', M(i), M(i+length(M)), M(i+length(M)*2)); end And the output is turning out something like: 1 20 3 22 3 24 100 150 2 Which is obviously not great. How can I get it so the front of integers are padded with spaces? Like so: 1 20 3 22 3 24 100 150 2 Any ideas? Thanks! 回答1: You can use string formatting to allocate specific number of characters per displayed number. For example fprintf('% 5d\n

How do I avoid URL globbing with PHP cURL?

╄→尐↘猪︶ㄣ 提交于 2020-01-13 18:22:28
问题 I have a url (slightly modified) like so: https://ssl.site.com/certificate/123/moo.shoo?type=456&domain=$GH$%2fdodo%20[10%3a47%3a11%3a3316] It doesn't work the way I intend it to when passed straight through to PHP cURL because of the brackets. I managed to run the same URL successfully in the command line like so: curl -g "https://ssl.site.com/certificate/123/moo.shoo?type=456&domain=$GH$%2fdodo%20[10%3a47%3a11%3a3316]" Is there an option (similar to -g, for disabling globbing) that I can

Formatting XmlGregorianCalendar timezone issue

左心房为你撑大大i 提交于 2020-01-13 16:54:32
问题 I need to format java XmlGregorianCalendar to "yyMMdd" string. My implementation: XMLGregorianCalendar date = getDate(); //getting the date if (date != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); LOG.debug("Parsing date..."); LOG.debug("XML Date: " + date); LOG.debug("XML Date timezone: " + date.getTimezone()); GregorianCalendar gc = date.toGregorianCalendar(); LOG.debug("Gregorian calendar: " + gc.toString()); LOG.debug("Gregorian calendar timezone id: " + gc.getTimeZone()

How to convert a string to a numeric in autohotkey?

眉间皱痕 提交于 2020-01-13 16:29:31
问题 FormatTime, CurrentMinute , , m assigns the current minute to variable %CurrentMinute% , and its value is a string, not a numeric. I wanna do some calculations on the value of %CurrentMinute% , so how could I convert it to numeric? Thanks for any help in advance! 回答1: AutoHotkey automatically converts numbers and strings as needed. FormatTime, CurrentMinute,, m NextMinute := CurrentMinute + 1 来源: https://stackoverflow.com/questions/13106275/how-to-convert-a-string-to-a-numeric-in-autohotkey

convert array into .txt file [duplicate]

本小妞迷上赌 提交于 2020-01-13 11:45:09
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Convert array into csv Hi, How to convert array into .txt file? This is my array: Array ( [OrderList_RetrieveByContactResult] => Array ( [OrderDetails] => Array ( [0] => Array ( [entityId] => 156456 [orderId] => 110631 [orderName] => testing2 [statusTypeId] => 15656 [countryCode] => AU [orderType] => 2 [invoiceNumber] => 1001 [invoiceDate] => 2010-10-19T00:00:00 [userID_AssignedTo] => 245454 [shippingAmount] =>

How to set customize currency in java?

一曲冷凌霜 提交于 2020-01-13 08:30:35
问题 I tried to make manual currency. Here is my code DecimalFormat df = new DecimalFormat(); DecimalFormatSymbols dfs = new DecimalFormatSymbols(); dfs.setCurrencySymbol("$"); dfs.setGroupingSeparator('.'); dfs.setDecimalSeparator('.'); df.setDecimalFormatSymbols(dfs); System.out.println(df.format(3333454)); Program output is 3.333.454 Why the currency symbol I set didn't appear? 回答1: Try this: NumberFormat df = NumberFormat.getCurrencyInstance(); DecimalFormatSymbols dfs = new

Java double to string with specific precision

六眼飞鱼酱① 提交于 2020-01-13 07:54:07
问题 I would like to convert double into String . I want it to have as few digits as possible and maximally 6. So I found String.format("%.6f", d) which converts my 100.0 into 100.000000 . Max precision works correctly, but I would like it to be converted to 100 (minimum precision). Have you got any idea what method is working like that? 回答1: Use DecimalFormat : new DecimalFormat("#.0#####").format(d) . This will produce numbers with 1 to 6 decimal digits. Since DecimalFormat will use the symbols