Get numeric value of the string conversion from a single node.

@param n Node to convert

@return numeric value of the string conversion from a single node.
174008
public double getNumberFromNode(int n)
  {
    XMLString xstr = m_dtmMgr.getDTM(n).getStringValue(n);
    return xstr.toDouble();
  }
183654
static int readInt(Node node)
    {
        if (node == null)
        {
            throw new XmlException(
                "Tried to read int value from null node");
        }
        String value = node.getFirstChild().getNodeValue();
        if (value == null)
        {
            throw new XmlException(
                "Tried to read int value from null value");
        }
        try
        {
            return Integer.parseInt(value);
        }
        catch (NumberFormatException e)
        {
            throw new XmlException(
                "Expected int value, found \""+value+"\"", e);
        }
    }
209392
public int toInteger() throws NumberFormatException {
        int res = 0;
        byte currChar;
        int i=1;
        currChar=chars[pos];
        boolean isMinus=false;
        
        if(currChar==minus_byte)
        	isMinus=true;
        else if(currChar>=zero_byte && currChar<=nine_byte)
    		res+=currChar-zero_byte;
    	else
    		throw new NumberFormatException("value is not numeric");
    	
        for (; i < len; i++) {
        	currChar=chars[pos+i];        		
        	if(currChar>=zero_byte && currChar<=nine_byte)
        	{
        		res*=10;
        		res+=currChar-zero_byte;
        	}        
        	else
        		throw new NumberFormatException("value is not numeric");
        }
        
        if(isMinus)
        	return 0-res;
        else
        	return res;
    }
863865
def get_value(n)
      content = if n.children.empty?
        n.content
      else
        n.children.first.content
      end

      content.force_encoding('UTF-8') if content.respond_to?(:force_encoding)
      content
    end
497402
public String convert(final String value) {

        if(!value.matches(".*[0-9].*")) {
            return value;
        }

        String str = value;
        for(int i=0; i < numMap.length; i++) {
            str = str.replaceAll(String.valueOf(i), numMap[i]);
        }

        return str;

    }
246666
def convert_string_to_number(value):
    
    if value is None:
        return 1
    if isinstance(value, int):
        return value
    if value.isdigit():
        return int(value)
    num_list = map(lambda s: NUMBERS[s], re.findall(numbers + '+', value.lower()))
    return sum(num_list)
800372
public static String stringFor(int n)
    {
        switch (n)
        {
            case CU_JIT_INPUT_CUBIN: return "CU_JIT_INPUT_CUBIN";
            case CU_JIT_INPUT_PTX: return "CU_JIT_INPUT_PTX";
            case CU_JIT_INPUT_FATBINARY: return "CU_JIT_INPUT_FATBINARY";
            case CU_JIT_INPUT_OBJECT: return "CU_JIT_INPUT_OBJECT";
            case CU_JIT_INPUT_LIBRARY: return "CU_JIT_INPUT_LIBRARY";
        }
        return "INVALID CUjitInputType: "+n;
    }
1346474
public static String stringFor(int n)
    {
        if (n == 0)
        {
            return "INVALID CUipcMem_flags: "+n;
        }
        String result = "";
        if ((n & CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS) != 0) result += "CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS";
        return result;
    }
427020
public static String stringFor(int n)
    {
        switch (n)
        {
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_0: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_0";
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_1: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_1";
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT";
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING";
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD";
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED";
            case CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT: return "CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT";
        }
        return "INVALID cudnnConvolutionBwdDataAlgo: "+n;
    }
1309439
public static String last(final String value, int n) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        if (n > value.length()) {
            return value;
        }
        return value.substring(value.length() - n);
    }
710691
public static String numberToString(Number n) throws JSONException {

        if (n == null) {
            throw new JSONException("Null pointer");
        }
        testValidity(n);

        // Shave off trailing zeros and decimal point, if possible.

        String s = n.toString();
        if ((s.indexOf('.') > 0) && (s.indexOf('e') < 0) && (s.indexOf('E') < 0)) {
            while (s.endsWith("0")) {
                s = s.substring(0, s.length() - 1);
            }
            if (s.endsWith(".")) {
                s = s.substring(0, s.length() - 1);
            }
        }
        return s;
    }
1154397
private static String getNodeName(Node n) {
        String nodeName = n.getLocalName();
        if (nodeName == null || nodeName.length() == 0) {
            nodeName = n.getNodeName();
        }
        return nodeName;
    }
233744
public double num()
  {

    int node = item(0);
    return (node != DTM.NULL) ? getNumberFromNode(node) : Double.NaN;
  }
38306
public static final NumericalValue parseNumericalValue (final String value) {
        // return SingleNumericalValue ...
        final Matcher singleValueMatcher = SINGLE_CONSTANT_PATTERN.matcher(value);
        if (singleValueMatcher.matches()) return SingleNumericalValue.parseSingleNumericValue(value);
        // ... NumericalValueRange ...
        final Matcher rangeMatcher = NUMERICAL_RANGE_PATTERN.matcher(value);
        if (rangeMatcher.matches()) return NumericalValueRange.parseNumericalValueRange(value);
        // ... or null
        return null;
    }
44473
public com.google.protobuf.ByteString
      getNodeNameBytes() {
    java.lang.Object ref = nodeName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      nodeName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
582143
public long getCurrentValue(int nth) {
    long v = min.getCurrent(nth).get();
    return (v == Long.MAX_VALUE) ? 0L : v;
  }
731687
public static String stringFor(int n)
    {
        switch (n)
        {
            case CUDNN_STATUS_SUCCESS: return "CUDNN_STATUS_SUCCESS";
            case CUDNN_STATUS_NOT_INITIALIZED: return "CUDNN_STATUS_NOT_INITIALIZED";
            case CUDNN_STATUS_ALLOC_FAILED: return "CUDNN_STATUS_ALLOC_FAILED";
            case CUDNN_STATUS_BAD_PARAM: return "CUDNN_STATUS_BAD_PARAM";
            case CUDNN_STATUS_INTERNAL_ERROR: return "CUDNN_STATUS_INTERNAL_ERROR";
            case CUDNN_STATUS_INVALID_VALUE: return "CUDNN_STATUS_INVALID_VALUE";
            case CUDNN_STATUS_ARCH_MISMATCH: return "CUDNN_STATUS_ARCH_MISMATCH";
            case CUDNN_STATUS_MAPPING_ERROR: return "CUDNN_STATUS_MAPPING_ERROR";
            case CUDNN_STATUS_EXECUTION_FAILED: return "CUDNN_STATUS_EXECUTION_FAILED";
            case CUDNN_STATUS_NOT_SUPPORTED: return "CUDNN_STATUS_NOT_SUPPORTED";
            case CUDNN_STATUS_LICENSE_ERROR: return "CUDNN_STATUS_LICENSE_ERROR";
            case CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING: return "CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING";
            case CUDNN_STATUS_RUNTIME_IN_PROGRESS: return "CUDNN_STATUS_RUNTIME_IN_PROGRESS";
            case CUDNN_STATUS_RUNTIME_FP_OVERFLOW: return "CUDNN_STATUS_RUNTIME_FP_OVERFLOW";
        }
        return "INVALID cudnnStatus: "+n;
    }