separator

MYSQL - Thousands separator

限于喜欢 提交于 2019-12-04 23:03:27
I would like to know if there is a way to get a thousand separator in a SQL Query ? As i'm a bit lazy, I want to build a request which can allow me to copy/paste the result to my boss without adding this separator :D The request looks like this : SELECT COALESCE(Customer, 'TOTAL') AS "Customer", CONCAT( COUNT( SegmentId ) , ' bookings' ) AS "Nb bookings", CONCAT( REPLACE( SUM( Price ) , '.', ',' ) , ' €' ) AS "Total (€)", CONCAT( ROUND( ( SUM( Price ) / ( SELECT SUM( Price ) FROM my_db WHERE CreationDate = CURRENT_DATE( ) AND SegmentStatus = "OK" ) *100 ) , 2 ) , ' %' ) AS "PDM" FROM my_db

Why they used ; to end statements in Java/C++

放肆的年华 提交于 2019-12-04 17:03:18
Should not they have used . to end a statement. They could use -> to call a method. Was this just a oversight? Or there is some deeper going on here? Java picked the semicolon to have a syntax similar to C and C++. C++ picked it to have a syntax similar to C. And I would guess that C picked the semicolon because B, ALGOL and Pascal already used it, and there was no reason not to use an already accepted convention. craniumonempty EDIT: see https://softwareengineering.stackexchange.com/questions/139482/why-are-statements-in-many-programming-languages-terminated-by-semicolons#139485 ... so people

wrong decimal separator with NSDecimalNumber in iOS

此生再无相见时 提交于 2019-12-04 10:49:21
I tried to output the description of a decimal number with the correct decimal separator in the following way: NSString* strValue = @"9.94300"; NSDecimalNumber* decimalNumber = [NSDecimalNumber decimalNumberWithString: strValue]; NSLocale* locale = [NSLocale currentLocale]; NSLog(@"%@", [locale localeIdentifier]); NSLog(@"%@", [decimalNumber descriptionWithLocale: locale] ); The output is: de_DE 9.943 The decimal separator should be ',' instead of '.' for this locale. Where is the error? How can I output the correct decimal separator depending on the local? @TriPhoenix: Yes I'm running iOS 5.

ttk.Separator set the length/width

≡放荡痞女 提交于 2019-12-04 04:19:05
问题 How to set/change the length/width of a ttk.Separator object in Tkinter? ttk.Separator(self, orient='horizontal').grid(column=0, row=0, columnspan=2, sticky='ew') It seems that columnspan tries to do the job, but when you have multiple separators with the same columnspan, they appear to have different lengths - any idea why? Here is a simple quick ad-hoc "dirty" test example: import ttk from Tkinter import * class myTestFrame(Frame): def __init__(self): Frame.__init__(self) self.master.title(

Enhancing regex of thousands separator?

独自空忆成欢 提交于 2019-12-04 02:09:46
问题 I saw this beautiful script to add thousands separator to js numbers: function thousandSeparator(n, sep) { var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})'), sValue = n + ''; if(sep === undefined) { sep = ','; } while(sRegExp.test(sValue)) { sValue = sValue.replace(sRegExp, '$1' + sep + '$2'); } return sValue; } usage : thousandSeparator(5000000.125, '\,') //"5,000,000.125" However I'm having a trouble accepting the while loop . I was thinking to change the regex to : '(-?[0-9]+)([0-9]{3})*'

Hiding UITableView separator behind the contentView

左心房为你撑大大i 提交于 2019-12-03 19:36:14
I made a grouped UITableView in iPhone OS 3.0 that looked like the left image. The result is the right image in OS 3.1. The imageView is under the separators. I've tried to put the content view in front. The separatorStyle propriety seems ignored when the tableView is in grouped style (to draw the separator myself). Changing the separator color gives strings results. Thanks for your help! Edit: This is the code with no change made : static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[

A vertical Separator control in a Menu, Toolbar, StackPanel, etc. - Is it possible?

最后都变了- 提交于 2019-12-03 18:29:58
问题 I want to use the Separator control in a vertical way (Lets say in a horizontal StackPanel). Searching around I found this method but it doesn't use the Separator control rather it uses borders and rectangles. https://social.msdn.microsoft.com/forums/en-US/wpf/thread/eab865be-ad9b-45ed-b9d8-fc93f737b163 Is it possible to use the Separator control in a vertical way? 回答1: Also: <Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" /> 回答2: Vertical Separator <Style x:Key=

Vertical bar (|) Unicode replacement

二次信任 提交于 2019-12-03 16:25:37
We are using the vertical bar | ( | ) character as a field separator in one of our modules. so the users should not use this character in a title. If they do use it, I would like to replace it with a similar character. Is there a Unicode replacement for it? The only character that I have found and looks similar to it is broken vertical bar ¦ ( ¦ ). I do not understand what you really need. Do you need to change the separator sequence to something guaranteed not to exist in the dataset? If so, then that’s what Unicode’s 66 “non-character” code points are specifically designed for. You can use

Customizing the separator in pandas read_csv

风流意气都作罢 提交于 2019-12-03 16:05:12
问题 I am reading many different data files into various pandas dataframes. The columns in these datafiles are separated by spaces. However, for each file, the number of spaces is different (for some of them, there is only one space, for others, there are two spaces and so on). Thus, every time I import the file, I have to manually go to that file and see the number of spaces that have been used and give those many number of spaces in sep : import pandas as pd df = pd.read_csv('myfile.dat', sep =

Keep UITableView padding on header but no in separator on IOS7

南楼画角 提交于 2019-12-03 16:03:04
问题 with the transition on iOS7 the separator has 15px padding on left. I know that i can remove this padding with separator inset feature on the UITableView setting in the xib file, but i need to keep heading text with padding. How to do it? default: with custom on separator inset to 0: i need to keep separators like figure 2, but the header with "2013" like picture 1. 回答1: for Seperator you can set it via Storyboard and for header make a custom header like this - (UIView *)tableView: