formatting

Angular2 PrimeNG Conditional row Formatting

我与影子孤独终老i 提交于 2019-12-12 11:18:06
问题 I have an Angular2 app using PrimeNG components. I am attempting to make it so that when a field is of a certain value, the row in a DataTable is coloured a particular colour. I have another field which contains a colour value to use for the row highlight but cannot work out how to get it to work. My Model is as follows (very simplified): export class RepackRequest{ AdhereToLeadTime: boolean; LeadTimeRemaining: string; constructor() { var today = new Date(); if(this.AdhereToLeadTime){ var

Linux Bash - Date Format

本秂侑毒 提交于 2019-12-12 11:14:58
问题 My date format is yyyy-mm-dd-hh:mm:ss How do I check my input? It should be something like this: #!/bin/bash read -p "Date (format yy-mm-dd-HH-MM-SS): " input check=$(date +"%Y-%m-%d-%H:%M:%S") if [ $input -eq $check ]; do echo "Right!" else echo "False!" fi But that doesn't check the date It compares my input with the real date. Best Regards Vince 回答1: Edited apr 2016! See further (stronger method) Original post Try: #!/bin/bash read -p "Date (format yyyy-mm-dd): " input check=$(date +%F) if

Best way XML File handling bullet point •

白昼怎懂夜的黑 提交于 2019-12-12 11:10:18
问题 For an XML file I am creating I have data that contains a bullet • what is the best method for handling this in xml data? It opens in an XML editor and reads fine, but I cannot import the file via SSIS, I get an error regarding this point. <xmldata>• Bullet</xmldata> Renders fine, but cannot import with SSIS. 回答1: The data you have received is not well-formed XML. It may have < and > in it, but it is not XML. The program that generated it is broken and needs to be fixed. In particular, is the

The origin of sprintf-style string formatting

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 10:49:44
问题 The string formatting concept found in sprintf can be found in almost any language today (you know, smothering a string with %s %d %f etc. and providing a list of variables to fill their places) . Which langugage was it originally that had a library function or language construct which offered this functionality? Please specify some kind of source reference to confirm your claim, so that we avoid pure speculation or guessing. Regards Robert 回答1: Wikipedia has a pretty thorough history. It

how can I copy a conditional formatting in Excel 2010 to other cells, which is based on a other cells content?

喜欢而已 提交于 2019-12-12 10:42:49
问题 I need to copy a formula based conditional formatting to other cells but i have to change the formula for every single cell condition. how can I do a copy of this condition so that the formula changes accordingly as well? in cells, when copy cells with formula referring to other cells, then excel will change the referring cells accordingly. But I don't know how to do the same in conditional formatting so that I don't need to change my conditional formula manually: condition: =K21+$F22 (the

Why does the compiler claim that a generic doesn't implement `Display` even though it should?

帅比萌擦擦* 提交于 2019-12-12 10:33:19
问题 I'm building a library that implements string joins; that is, printing all the elements of a container separated by a separator. My basic design looks like this: use std::fmt; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Join<Container, Sep> { container: Container, sep: Sep, } impl<Container, Sep> fmt::Display for Join<Container, Sep> where for<'a> &'a Container: IntoIterator, for<'a> <&'a Container as IntoIterator>::Item: fmt::Display, Sep: fmt::Display, { fn fmt(&self, f: &mut fmt:

How to format an output in Python?

丶灬走出姿态 提交于 2019-12-12 10:12:33
问题 I am having difficulty in formatting some code in Python: My code is here: keys = ['(Lag)=(\d+\.?\d*)','\t','(Autocorrelation Index): (\d+\.?\d*)', '(Autocorrelation Index): (\d+\.?\d*)', '(Semivariance): (\d+\.?\d*)'] import re string1 = ''.join(open("dummy.txt").readlines()) found = [] for key in keys: found.extend(re.findall(key, string1)) for result in found: print '%s = %s' % (result[0],result[1]) raw_input() So far, I am getting this output: Lag = 1 Lag = 2 Lag = 3 Autocorrelation Index

Create a computed column based on another column in MySQL

大城市里の小女人 提交于 2019-12-12 10:08:37
问题 I have a 2 columns in my table: a varchar(8) and an int . I want to auto-increment the int column and when I do, I want to copy the value into the varchar(8) column , but pad it with 0's until it is 8 characters long, so for example, if the int column was incremented to 3 , the varchar(8) column would contain '00000003' . My two questions are, what happens when the varchar(8) column gets to '99999999' because I don't want to have duplicates? How would I do this in MySQL? If my values can be

Current Culture is wrong in WinRT

荒凉一梦 提交于 2019-12-12 09:56:51
问题 I am trying to format the datetime value using Current Culture in WinRT. But CurrentCulture property not seems to respect the System Culture. I tried the following two properties, System.Globalization.CultureInfo.CurrentCulture.DisplayName System.Globalization.CultureInfo.CurrentUICulture.DisplayName Both gives English (United States) even though I change the region in Control Panel. But this works perfectly fine for WPF. What am I doing wrong? 回答1: WinRT uses APIs exposed in Windows

VB6 Date data type: precision and formatting

我是研究僧i 提交于 2019-12-12 09:44:01
问题 How precise is the VB6 Date data type (by way of fractions of a second)? How to format it to show fractions of a second? I'm revisiting VB6 after many years absence, and for the life of me can't remember the things I used to know. I considered putting a memory-leak tag on this, because my memory leaked (hur hur hur). I found this API call afterwards, and it seems to work: Declare Sub GetSystemTime Lib "kernel32.dll" (lpSystemTime As SystemTime) Public Type SystemTime Year As Integer Month As