search for: hex2numeric

Displaying 2 results from an estimated 2 matches for "hex2numeric".

2005 Apr 14
0
Finding an available port for server socket
...t;- 0 os <- as.vector(Sys.info()["sysname"]) if(os == "Linux"){ hexTcp <- system("cat /proc/net/tcp | awk '{print $2}'", intern = T) hexUdp <- system("cat /proc/net/udp | awk '{print $2}'", intern = T) portsInUse <- hex2numeric(gsub(".*\:", "", c(hexTcp[-1], hexUdp[-1]))) } if(os == "SunOS"){ ## use a locally written script that massages output from netstat portsInUse <- as.numeric(system("/mra/prod/scripts/portsInUse", intern = T)) } port <- 40001 while(!...
2004 Dec 01
3
Hexidecimal conversion
Help I can produce the hexidecimal equivalent of a decimal number but I am having a hard time reversing the operation. I'm good for hex representations to 159 and am close to extending to 2559. The archives are not clear on the existence of a function for this task. Is there one? Here is what I have got so far: #Good for hex values to "9F" as.decmode<-function(as.character(x)){