formatting

How can I add the French trademark symbol (MD)?

℡╲_俬逩灬. 提交于 2019-12-29 07:31:34
问题 I have a report that needs to be output in either English or French (based on a field value). I have copied the text from the Word document to the SSRS package, and all French characters show as they should except MD (marque déposée). This should show similar to superscript "MD", but it shows as normal script "MD". Is there a library of French symbols that I can add, or is there a way to format it so that it "appears" right? I have tried: adding MD to a separate textbox and formatting it so

VS Code indentation for Python

元气小坏坏 提交于 2019-12-29 06:49:28
问题 How do I enable indentation in VS Code? I'm trying to learn Python (newbie in programming) and need auto-indentation. It worked with the first version I tried, but it doesn't indent after a colon ( : ) anymore. How can I configure it to automatically indent? 回答1: You can install VSCode python extension which will provide intellisense, auto-completion, code formatting, and debugging. Here is more information on the python extension, here 回答2: As said there is the python extension which now do

Why does DecimalFormat allow characters as suffix?

不想你离开。 提交于 2019-12-29 06:40:11
问题 I'm using DecimalFormat to parse / validate user input. Unfortunately it allows characters as a suffix while parsing. Example code: try { final NumberFormat numberFormat = new DecimalFormat(); System.out.println(numberFormat.parse("12abc")); System.out.println(numberFormat.parse("abc12")); } catch (final ParseException e) { System.out.println("parse exception"); } Result: 12 parse exception I would actually expect a parse exception for both of them. How can I tell DecimalFormat to not allow

VB.net: Date without time

感情迁移 提交于 2019-12-29 05:50:48
问题 How do you format the date time to just date? For example, this is what I retrieved from the database: 12/31/2008 12:00:00 AM, but I just want to show the date and no time. 回答1: Either use one of the standard date and time format strings which only specifies the date (e.g. "D" or "d"), or a custom date and time format string which only uses the date parts (e.g. "yyyy/MM/dd"). 回答2: FormatDateTime(Now, DateFormat.ShortDate) 回答3: I almost always use the standard formating ShortDateString,

Colorize parts of the title in a plot

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-29 04:33:11
问题 Is it possible to colorize parts of the title in a plot? x = 1:10 y = 1:10 plot(x, y, main="title (slope=1)") In this plot I'd like to change the color of slope=1 to red. 回答1: This is a quite simple solution to your problem: plot(x, y) title(expression("title (" * phantom("slope=1)") * ")"), col.main = "black") title(expression(phantom("title (") * "slope=1"), col.main = "red") 回答2: A solution for ggplot2 plots using the ggtext package library(ggplot2) # devtools::install_github("clauswilke

Difference between golang pointers

天涯浪子 提交于 2019-12-29 01:56:05
问题 There are 2 kinds of variables that I have. Check for the Go playground, and I don't understand why this is happening. The problem: what I get from the Models it should be a struct to use it for GORM First() function. The code: package main import ( "fmt" ) type Test struct { Test string } var Models = map[string]interface{}{ "test": newTest(), } func main() { test1 := Test{} fmt.Println("Test 1: ") fmt.Printf("%v", test1) fmt.Println() fmt.Println("Test 1 as pointer: ") fmt.Printf("%v",

EPPlus - LoadFromCollection - Text converted to number

强颜欢笑 提交于 2019-12-29 01:40:21
问题 I am writing a program in C# that needs to export a List<MyObject> into Excel and I'm using EPPlus for doing so. My challenge is that my object has a property: string Prop1 { get; set; } And, one of the values I need to export has a value that, for example, is of the form of Prop1 = "123E4" . The challenge is that the EPPlus LoadFromCollection method exports this to Excel, but Excel converts it into a number using scientific notation (Outputted value = 1.23E+06 or 1230000 ). I've tried

Best timestamp format for CSV/Excel?

强颜欢笑 提交于 2019-12-28 08:06:39
问题 I'm writing a CSV file. I need to write timestamps that are accurate at least to the second, and preferably to the millisecond. What's the best format for timestamps in a CSV file such that they can be parsed accurately and unambiguously by Excel with minimal user intervention? 回答1: For second accuracy, yyyy-MM-dd HH:mm:ss should do the trick. I believe Excel is not very good with fractions of a second (loses them when interacting with COM object IIRC). 回答2: The earlier suggestion to use

Using Python String Formatting with Lists

淺唱寂寞╮ 提交于 2019-12-28 08:06:21
问题 I construct a string s in Python 2.6.5 which will have a varying number of %s tokens, which match the number of entries in list x . I need to write out a formatted string. The following doesn't work, but indicates what I'm trying to do. In this example, there are three %s tokens and the list has three entries. s = '%s BLAH %s FOO %s BAR' x = ['1', '2', '3'] print s % (x) I'd like the output string to be: 1 BLAH 2 FOO 3 BAR 回答1: print s % tuple(x) instead of print s % (x) 回答2: You should take

apt like column output - python library

瘦欲@ 提交于 2019-12-28 06:26:32
问题 Debian's apt tool outputs results in uniform width columns. For instance, try running "aptitude search svn" .. and all names appear in the first column of the same width. Now if you resize the terminal, the column width is adjusted accordingly. Is there a Python library that enables one to do this? Note that the library has to be aware of the terminal width and take a table as input - which could be, for instance, [('rapidsvn', 'A GUI client for subversion'), ...] .. and you may also specify