numeric

Convert exponential format into numeric format in XSLT

旧城冷巷雨未停 提交于 2019-12-08 09:45:49
问题 I have to convert within my XSLT number in exponential format ( i.e: 1,2345E7 ) into numeric ( i.e: 12340000 ). What would the a XSLT function to achieve this. 回答1: I haven't tried it, but this implementation claims to do what you ask: http://www.orm-designer.com/article/xslt-convert-scientific-notation-to-decimal-number 回答2: XSLT 2.0 accepts exponential notation for numbers on input, XSLT 1.0 does not. So the answer rather depends which version you are using (I suspect you are using 1.0,

Asp.net textbox in Android phone with numeric keyboard selected by default

烈酒焚心 提交于 2019-12-08 08:19:36
问题 We are developing a regular asp.net website (no Textviews), for one of the text boxes I need the textbox to open a numeric keyboard by default, is there a way to achieve this? Below code works perfectly for iPhone / iPad but does not default to numeric keyboard for Android. <asp:TextBox runat="server" type="number" pattern="\d*" onKeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}" /> Adroid version : 2.2.1 EDIT : When I use an HTML input box with type="number" it works

How can I perform SQL ORDER BY exposure, focal and iso (in numeric not string)

倾然丶 夕夏残阳落幕 提交于 2019-12-08 05:40:30
问题 The columns for Exposure, Focal, and Iso are not being sorted properly. It seems like they are all being interpreted as strings and sorted as such. For example, if I sort Exposure down, the values can look like this: 1/800, 1/800, 1/800, 1/80, 1/675, 1/640, 1/60, 1/500 If I sort the Focal, it can look like this: 1.4, 1.4, 1.4, 14.0, 14.0, 1.3, 13.0, 1.2, 1.2, 12.0, 1.0, 10.0 and if I sort by ISO, it can look like this: 800, 800, 800, 80, 80, 640, 640, 60, 500, 500, 50 EDIT: My other question

How to test if the first three characters in a string are letters or numbers in r?

落花浮王杯 提交于 2019-12-08 05:09:28
The example of the dataset I have is given below, note that I have more than two columns in the total dataset. ID X 1 MJF34 2 GA249D 3 DEW235R 4 4SDFR3 5 DAS3 I want to test whether the first three characters in X are letters, if they are then I want to replace that value to show only the first three letters. If the first three characters aren't letters then I want to replace those values with "FR". Hence the result would be as follows. ID X 1 MJF 2 FR 3 DEW 4 FR 5 DAS Currently X is a character data type. Thanks in advance for any help. I would try: x <- substr(dt$X, 1, 3) dt$X <- ifelse

How to set an initial value for two dependent input values (Slider and Numeric) in shiny?

假如想象 提交于 2019-12-08 04:20:03
问题 I have achieved to define two interconnected or mutually dependent input in my shiny app. Right now, my problem is to set a specific initial value for these slider and numeric inputs. It seems that they always start with the minimum value, even I don't now exactly why. How can I indicate a unique starting point or an initial value for these input parameters? I have attached a simplified part of my app in order to provide you a reproducible version of my problem here: " ui.R " library(shiny)

Turkish Identity Number Verification in Swift

那年仲夏 提交于 2019-12-07 22:41:16
问题 How can I make sure that the given text is Turkish Identity Number? I have seen js version here and phthon version here Turkish Identity Verification is not checks only if its numeric, it has some other functions too. Let me be more clear, It is numeric and has 11 digits. For example Let assume that first 9 digits are represented by d, and the last ones represented by c: Identity Number = d1 d2 d3 d4 d5 d6 d7 d8 d9 c1 c2 10th digit must be, c1 = ( (d1 + d3 + d5 + d7 + d9) * 7 - (d2 + d4 + d6

how to check if a string column in pyspark dataframe is all numeric

拈花ヽ惹草 提交于 2019-12-07 21:07:49
问题 I have a PySpark Dataframe with a column of strings . How can I check which rows in it are Numeric. I could not find any function in PySpark's official documentation - values = [('25q36',),('75647',),('13864',),('8758K',),('07645',)] df = sqlContext.createDataFrame(values,['ID',]) df.show() +-----+ | ID| +-----+ |25q36| |75647| |13864| |8758K| |07645| +-----+ In Python, there is a function .isDigit() which returns True or False if the string contains just numbers or not. Expected DataFrame -

base::chol() slows down when matrix contains many small entries

一个人想着一个人 提交于 2019-12-07 18:14:31
问题 I've noticed that base::chol() severely slows down when the matrix contains many small elements. Here is an example: ## disable openMP library(RhpcBLASctl); blas_set_num_threads(1); omp_set_num_threads(1) Baseline : create positive definite matrix and get timing for chol() . loc <- expand.grid(1:60, 1:50) covmat1 <- exp(-as.matrix(dist(loc))) mean(c(covmat1)) # [1] 0.002076862 system.time(chol1 <- chol(covmat1)) # user system elapsed # 0.313 0.024 0.337 Increase small values : create covmat2

PostgreSQL数值类型--浮点类型和序列

天大地大妈咪最大 提交于 2019-12-07 15:53:34
PostgreSQL包括整数类型和浮点数类型。 整数类型包括3种,分别是smallint、int和bigint。别名分别是int2、int(int4)和int8.常用数据类型是int(integer)。 浮点类型分为精确浮点数类型numeric和不精确浮点数类型real(单精度浮点数据类型)和 double precision(双精度浮点数据类型)。 精确浮点数类型可以用numeric(precision, scale)表示。 精度(precision)必须是正值,标度(scale)为零或正值。类型numeric和decimal等价,都符合SQL标准。 numeric不带精度和标度,则系统使用任意精度,不会超过数据库系统储存范围。创建表显示声明精度最大值为1000。 numeric(precision, 0)等价于numeric(precision)。 ---不限定精度和标度 postgres=# create table testdecimal(id int,testvalue decimal); CREATE TABLE postgres=# insert into testdecimal values(1,777777777.77777777); INSERT 0 1 postgres=# insert into testdecimal values(1,777777777

Making matrix numeric and name orders

天涯浪子 提交于 2019-12-07 14:24:34
问题 I have the following data: yvar <- c(1:150) replication <- c( rep(c(rep(1, 10), rep(2,10), rep(3,10)),5)) genotypes <- c(rep(paste("G", 1:10, sep= ""), 15)) environments <- c(rep(paste("E",5:1, sep = ""), each = 30)) mydf1 <- data.frame (yvar, replication, genotypes, environments) mydf1$replication <- as.factor(mydf1$replication) I want to summarize data: mydf = data.frame(aggregate (yvar ~ genotypes + environments, data = mydf1, mean)) Now create a matrix, hopefully numeric, matm is not !