Convert uint8 to int64 in python

I have a variable which is an uint8 type (it has just two values, 0 and 1), and I want to replace the zeros with -1. Do I have first to transform this variable to int64 (or any integer data type that allows negative numbers)? If so, how could I achie...
more »

2017-09-22 13:09 (1) Answers

kbuild C: ~ Operator Converts Unsigned to Signed?

In a Linux kernel module there are definitions for a number of things that are in stdint.h/limits.h for user mode C but are conspicuously missing from the standard kernel headers. E.g. the following: #define UINT16_MIN (uint16_t)0 #define UINT16_MAX...
more »

2017-09-18 19:09 (0) Answers

Name the header from a file

this is the script I'm on: data <- read.table(file.choose(), header = FALSE, sep = "") data.header <- read.table(file.choose(), header = FALSE, sep = "") data.names <- as.vector(data.header[1,]) names(data) <- data.names Basically, my...
more »

2017-08-11 23:08 (1) Answers

data declaration - use 3 parameter

i'm going to use the data types now but there is sth what i just know from other programming languages. imagine that "Date" get's (Year Month Day) when i have data Month = Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec data D...
more »

2017-05-18 18:05 (1) Answers

About scala Double datatype precision

I'm fairly a newbie to scala and in my baby steps, i'm using Centso 7.2 and Scala 2.12 with sbt console: here is my question is: scala> val Y=5.12345938988398773983748934789473289472384723984723849 Y: Double = 5.123459389883988 This is with 15...
more »

2017-05-14 08:05 (1) Answers

Converting dates by AWK

I have a date file of too much records containing specific date format like the following 5th column: 9010146679 20170129 26079 2/6/2017 2/11/2017 1002 9010149451 20170129 26079 2/6/2017 2/13/2017 ...
more »

2017-02-13 10:02 (1) Answers

Wrong data type in pointer declaration

In the below program, I would expect only first one byte of variable i to be read by pointer j. But it is giving a huge value as output. Please let me know your views. #include <stdio.h> #include <limits.h> int main() { int i = 21474...
more »

2016-12-24 08:12 (2) Answers

Conversion between two stream types

I have a question regarding converting between two datatypes in Haskell. Consider the following two datatypes data Stream a = Cons a (Stream a) data Stream2 a = ST {shead :: a, stail :: Stream2 a} Q2: Write sToS2 :: Stream a -> Stream...
more »

2016-12-12 04:12 (1) Answers

what is happening when l(long) -= f(float)?

public class SimplePrint { public static void main(String[] args) { long i = System.currentTimeMillis(); System.out.println(i); float h = 0.0f; i -= h; System.out.println(i); } } The output is: 1477904636902 1477904695296 ...
more »

2016-10-31 10:10 (2) Answers

Why does tensorflow didn't accept np.float?

I am using tensorflow to run a cnn deep learning program, but it failed? i have translated my input data 'images' to np.float32, but it still report dtype error: E tensorflow/core/client/] You must feed a value for placeholder ten...
more »

2016-10-30 07:10 (1) Answers

c# generics within foreach loop

I am confused with correct syntax in order to iterate on collection of generic classes. All these classes are derived FBase: public abstract class FBase : FormElementBaseCL { public FBase(FormElementGroupBaseCL parentElement, int linkedFieldID) ...
more »

2016-10-04 14:10 (0) Answers