illegal-characters

Select multiple columns with dplyr::select() with numbers as names

时间秒杀一切 提交于 2019-11-30 13:56:36
Let's say I have the following data frame: a <- runif(10) dd <- as.data.frame(t(a)) names(dd) <- c("ID", "a", "a2", "b", "b2", "f", "XXX", "1", "4", "8") In dplyr , there is a nice way to select a number of columns. For example, to select the columns between column a and column f , I can use dd %>% dplyr::select(a:f) In my problem, the columns of the last part of the data frame may vary, yet they always have as name a number between 1 and 99. However, I can not seem to be able to do the same trick as above: > dd %>% select(1:99) Error: Position must be between 0 and n > dd %>% select("1":"99")

Illegal Character error: '\\u200b'

陌路散爱 提交于 2019-11-29 06:12:49
I'm making an Asteroid Field for an Asteroid Game in my Object Oriented Programming class and I am receiving an illegal character error: '\u200b'. The issue seems to be happening on line 12. (The line between import java.awt.Point; and public class Asteroid extends PolyBlob) /* * University of Central Florida * COP3330 - Spring 2016 * Author: Aundray Ortiz */ package asteroidfield; import java.util.Random; import blobzx.PolyBlob; import blobzx.BlobUtils; import java.awt.Point; ​ public class Asteroid extends PolyBlob { private static final Random random = new Random(); public Asteroid(int a,

Valid characters for URI schemes?

喜欢而已 提交于 2019-11-29 02:58:58
I was thinking about Registering an Application to a URL Protocol and I'd like to know, what characters are allowed in a scheme? Some examples: h323 (has numbers) h323:[<user>@]<host>[:<port>][;<parameters>] z39.50r (has a . as well) z39.50r://<host>[:<port>]/<database>?<docid>[;esn=<elementset>][;rs=<recordsyntax>] paparazzi:http (has a : ) paparazzi:http:[//<host>[:[<port>][<transport>]]/ So, what characters can I fancy using? Can we have... @:TwitterUser #:HashTag $:CapitalStock ?:ID-10T ...etc., as desired, or characters in the scheme are restricted by standard? According to RFC 2396 ,

XML (de)serialization invalid string inconsistent in c#?

蹲街弑〆低调 提交于 2019-11-28 18:54:30
In C# (.net 4.0 and 4.5 / vs2010 and vs12) when I serialize an object containing a string having an illegal character using XMLSerializer, no error is thrown. However, when I deserialize that result, an "invalid character" error is thrown. // add to XML Items items = new Items(); items.Item = "\v hello world"; // contains "illegal" character \v // variables System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(Items)); string tmpFile = Path.GetTempFileName(); // serialize using (FileStream tmpFileStream = new FileStream(tmpFile, FileMode.Open,

Replace chars if not match

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 06:50:33
I'm looking for a regular expression that removes illegal characters. But I don't know what the characters will be. For example: In a process, I want my string to match ([a-zA-Z0-9/-]*) . So I would like to replace all characters that don't match the regexp above. That would be: [^a-zA-Z0-9/-]+ [^ ] at the start of a character class negates it - it matches characters not in the class. See also: Character Classes Michael Freidgeim Thanks to Kobi 's answer I've created a helper method to strips unaccepted characters . The allowed pattern should be in Regex format, expect them wrapped in square

Valid characters for URI schemes?

孤人 提交于 2019-11-27 17:14:51
问题 I was thinking about Registering an Application to a URL Protocol and I'd like to know, what characters are allowed in a scheme? Some examples: h323 (has numbers) h323:[<user>@]<host>[:<port>][;<parameters>] z39.50r (has a . as well) z39.50r://<host>[:<port>]/<database>?<docid>[;esn=<elementset>][;rs=<recordsyntax>] paparazzi:http (has a : ) paparazzi:http:[//<host>[:[<port>][<transport>]]/ So, what characters can I fancy using? Can we have... @:TwitterUser #:HashTag $:CapitalStock ?:ID-10T .

XML (de)serialization invalid string inconsistent in c#?

烂漫一生 提交于 2019-11-27 11:58:55
问题 In C# (.net 4.0 and 4.5 / vs2010 and vs12) when I serialize an object containing a string having an illegal character using XMLSerializer, no error is thrown. However, when I deserialize that result, an "invalid character" error is thrown. // add to XML Items items = new Items(); items.Item = "\v hello world"; // contains "illegal" character \v // variables System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(Items)); string tmpFile = Path

Specifying column names in a data.frame changes spaces to “.”

帅比萌擦擦* 提交于 2019-11-27 09:11:24
Let's say I have a data.frame, like so: x <- c(1:10,1:10,1:10,1:10,1:10,1:10,1:10,1:10,1:10,1:10) df <- data.frame("Label 1"=x,"Label 2"=rnorm(100)) head(df,3) returns: Label.1 Label.2 1 1 1.9825458 2 2 -0.4515584 3 3 0.6397516 How do I get R to stop automagically replacing the space with a period in the column name? ie, "Label 1" instead of "Label.1". You don't. With the space you desire the format would not satisfy the requirements for an identifier that come to play when you use df$column.1 -- that could not cope with a space. So see the make.names() function for details or an example: >

Illegal Character error: '\u200b'

て烟熏妆下的殇ゞ 提交于 2019-11-27 03:14:13
问题 I'm making an Asteroid Field for an Asteroid Game in my Object Oriented Programming class and I am receiving an illegal character error: '\u200b'. The issue seems to be happening on line 12. (The line between import java.awt.Point; and public class Asteroid extends PolyBlob) /* * University of Central Florida * COP3330 - Spring 2016 * Author: Aundray Ortiz */ package asteroidfield; import java.util.Random; import blobzx.PolyBlob; import blobzx.BlobUtils; import java.awt.Point; ​ public class

Replace chars if not match

て烟熏妆下的殇ゞ 提交于 2019-11-27 01:31:24
问题 I'm looking for a regular expression that removes illegal characters. But I don't know what the characters will be. For example: In a process, I want my string to match ([a-zA-Z0-9/-]*) . So I would like to replace all characters that don't match the regexp above. 回答1: That would be: [^a-zA-Z0-9/-]+ [^ ] at the start of a character class negates it - it matches characters not in the class. See also: Character Classes 回答2: Thanks to Kobi's answer I've created a helper method to strips