format

Using XSLT, how do I increase the value of the 'format' attribute of an <xsl:number> (e.g. 'a'+1 = 'b')?

一笑奈何 提交于 2019-12-11 05:34:25
问题 There are 2321 occurrences of the character 'a' in the element contents of my source XML file. I have succeeded in obtaining this number, but I can only do it for the 'a' character. I need to obtain the occurrences for all the letters of the alphabet. See code: This is used to print out a TextBlock element: <xsl:template name="get-textblock"> <xsl:param name="letter-one"/> <xsl:param name="letter-two"/> <xsl:param name="letter-one-f"/> <xsl:param name="letter-two-f"/> <xsl:if test="$letter

Are R objects dumped using `dump` readable cross-platform?

浪尽此生 提交于 2019-12-11 05:20:30
问题 I am considering replacing some uses of save , which exports .Rdata files, with dump , which produces text representations of R objects. Is it safe to assume that files created using dump will be readable by R installed on different operating systems (e.g. linux, mac, windows)? 回答1: Even those from save() are readable on all platforms -- I would stick with that format if your goal is cross-platform use rather than cross-application use (in which case you need a format read by all applications

error and output issues for python matrix?

懵懂的女人 提交于 2019-12-11 05:09:49
问题 I am building a function that takes a list made up of lists (ex: [['a'],['b'],['c']] ) and outputs it as a table. I cannot use pretty table because I need a specific output (ex | a | b | ) with the lines and the spaces exactly alike. Here is my function: def show_table(table): if table is None: table=[] new_table="" for row in range(table): for val in row: new_table+= ("| "+val+" ") new_table+= "|\n" return new_table.strip("\n") I keep getting the error: show_table([['a'],['b'],['c']])

Format date in jquery- from Sat Mar 03 2012 14:16:05 GMT+0530 to 03/03/2012

怎甘沉沦 提交于 2019-12-11 05:07:00
问题 How can I format this date? <li>Sat Mar 03 2012 14:16:05 GMT+0530 (India Standard Time)</li> I used new date() function to get date in this li. I want date like this 03/03/2012 回答1: function dateFormat(){ var d = new Date(); date = d.getDate(); date = date < 10 ? "0"+date : date; mon = d.getMonth()+1; mon = mon < 10 ? "0"+mon : mon; year = d.getFullYear() return (date+"/"+mon+"/"+year); } dateFormat(); 回答2: All you need to do is tell the date function to format the date to the kind of output

string formatting and printing

五迷三道 提交于 2019-12-11 05:04:36
问题 I am trying to align values. I wonder why this happen : string value = ""; value += string.Format("{0,-10}", "value"); value += string.Format("{0,5}", "value"); value += Environment.NewLine; value += string.Format("{0,-8}", "val"); value += string.Format("{0,7}", "value"); Print(value); If i check value before i "Print" it is correct. The result is: value value val value As they should be, but when i print "value" to my printer then they get like this : value value val value I really cant

Format date string into highcharts

丶灬走出姿态 提交于 2019-12-11 04:57:45
问题 I've been trying to insert min and max string dates into my highcharts graph as follows: var formatted_startDate = startDate.replace(/-/g, ","); var formatted_endDate = endDate.replace(/-/g, ","); //Format now is "yyyy,mm,dd" options = { chart: { renderTo: 'container', type: 'bar' }, xAxis: { type: "datetime", dateTimeLabelFormats: { day: '%m-%d' }, tickInterval: 24 * 3600 * 1000, min: Date.UTC(formatted_startDate), max: Date.UTC(formatted_endDate) }, Clearly the above won't work because I'm

Java, How to change GMT time to local time?

雨燕双飞 提交于 2019-12-11 04:54:57
问题 Server sends me time like this: 2012-06-08 17:00:00 +0100 I need to change it like HH:MM based on local time. For example this time is what time at Japan, India, US and etc. How can I do this? Thanks 回答1: Option 1: using java.util.Date / Calendar : First you need to parse the value to a Date , then reformat it in the format and time zone you're interested in: SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z", Locale.US); Date date = inputFormat.parse(inputText); //

How to change the interior colorindex of a conditionally formatted cell

﹥>﹥吖頭↗ 提交于 2019-12-11 04:44:26
问题 If a cell is conditionally formatted I can't simply change the interior color index by cells(row , col).interior.colorindex = 6 I tried this but the format of the cell is lost val = wRes.Cells(i, p) wRes.Cells(i, p).Clear wRes.Cells(i, p).Interior.ColorIndex = 6 wRes.Cells(i, p) = val like certain cells have dates and other have numbers in "00,000" this format are lost. 回答1: Use, wRes.Cells(i, p).FormatConditions.Delete ... to reshape the Applies to: range of existing Conditional Formatting

how do I convert DAQ-derived mxd file format to csv?

帅比萌擦擦* 提交于 2019-12-11 04:43:33
问题 Background: I was given a pile of yokagawa "mxd" files without documentation or description, and told "convert it". I have looked for documentation and found none. The OEM doesn't seem to "do" reproducibility in the sense of a "code book". (link) I have looked for online code for converters and found none. National Instruments has a connector, but only if I use latest/greatest LabVIEW (link). I don't have that version. The only compatible suffix is from ArcGIS, but why would DAQ use a format

How to loop scanf_s() until success?

夙愿已清 提交于 2019-12-11 04:38:15
问题 #include <stdio.h> int main(){ float x,y; printf("Enter 2 numbers: \n"); scanf_s("%f %f", &x, &y); if (getchar() == '\n') { printf("Division: %f\n", x / y); printf("Product: %f\n", x * y); printf("Sum: %f\n", x + y); printf("Difference: %f\n", x - y); } else { printf("no Float-Value!"); } getchar(); return 0; } we need to get a loop in so if we enter the wrong format the program should ask again to enter two numbers 回答1: The best way of checking the validity of the input is to check the