Questions tagged [type-conversion]

Type conversion is the way of implicitly or explicitly changing an entity of one data type into another. This is done to take advantage of certain features of type hierarchies or type representations.

0
votes
0answers
9 views

calculate stft(Short-time Fourier transform) in tensor flow audio recognition

I have a hard time running this piece of example code here to convert the audio signal into stfts. I am using label_wave.py and editing the "run graph" function.def run_graph(wav_data, labels, ...
0
votes
3answers
31 views

Most efficient way to handle different primitive types

I am making a game which includes allowing the player to select different options and operations and then execute them to get true or false (and then do other things based on the outcome).What I end ...
0
votes
3answers
44 views

Interface variable conversion in Golang

I have a variable which value can be string or int depend on the input. I use interface{} as the type. How to convert the value of that variable to int if the input is like "50", "45", or any string ...
0
votes
1answer
20 views

C++ Fraction mixed comparison operator error

So I am new to c++ and trying to create a C++ fraction class with operations overloading. Everything has been fine up till I get an error on the less than comparison line in the main function:...
-2
votes
0answers
42 views

How to create uint256 in go? [on hold]

I simply have to encode a bool into uint256, but I struggle to find any documentation on this. How can you pad a variable with empty bits so that it has 256 in total?
0
votes
2answers
31 views

How to convert a column with null values to datetime format?

How I convert the df to pandas datetime datatype? (with null value)datet=pd.DataFrame(['2018-09-07 00:00:00','2017-09-15 00:00:00',''],columns=['Mycol'])datet['Mycol']=datet['Mycol'].apply(...
2
votes
0answers
20 views

How to convert string to Unix Epoch time in Python3?

I would like to convert strings with format like 2018-10-15T06:42:17.055476324Z to Unix Epoch format. So it will just be an integer of seconds. How to do this in Python3?
0
votes
1answer
25 views

Why does toHexString have variable length?

Why is it that toHexString prints different strings in what appears to be very specific circumstances? Printing a number below 0x80000000 works just fine. Adding 1 to that value and printing it works ...
-3
votes
0answers
22 views

R studio: Converting character variable to nominal variable

in my dataset I have a character variable (forumtype) that I want to make a categorical variable with 15 categories (f.e.; cancer, smoking, anorex). I have the names of each forum cleaned up but I ...
1
vote
1answer
42 views

How to convert user input into a list and remove all occurrences of a particular digit or character?

I assume I am tackling this problem from the wrong angles or lack the proper understanding of built-in functions and syntax to resolve my issues despite my trying. I also discovered using:input("...
2
votes
1answer
42 views

How can I cast an AD Attribute in a filter condition when calling Get-ADUser in PowerShell?

What I am trying to do:Return a list of AD users filtered by the date stored in an AD attribute using PowerShell. The problemThe date I want to filter on is stored in an AD attribute with a string ...
1
vote
2answers
53 views

How is it possible, in Ada, to have a code failure from assigning a 64bit floating point number to a 16bit integer?

I have just discovered this report on the reasons for the failure of the Ariane 5 rocket. According to the report, the failure occurred when a 64bit floating point number was assigned to a 16bit ...
1
vote
4answers
86 views

How can I convert this object of objects into an array of objects?

How can I convert this object:var json={"user3" : {"id" : 1},"user1" : {"id" : 3},"user2" : {"id" : 6}}to this array:var json=[{...
1
vote
1answer
18 views

Client-server python converting bytes to string

I create a client-server model in python. It's like a chat room, but i tried to encrypt the messages using "CTR" from cryptography.io.When i encrypt and decrypt in the client, it work pretty well ...
-2
votes
0answers
26 views

PHP Convert Text to Number and Number to Text [duplicate]

Basically what im trying to do is convert a string to a number and be able to reverse that conversion ( number to string )For a better understanding, i have the function toNumber that convert a ...
-2
votes
2answers
32 views

Converting Date/Time from String Error When Using Cast

I am getting a "Unable to Convert Date/Time from Character String" error message when I run my Access query, but I am not sure why. I have used this method before and have not had any trouble. SET ...
2
votes
4answers
72 views

address changes after a rvalue reference conversion

#include <iostream>using namespace std;int main(){int i=0;cout << &i << endl;const auto &ref=(short&&)i;cout << &ref << endl;...
0
votes
3answers
32 views

PLC programming: Conversion to datatype of same size and back changes actual value

A function block gives me a number of datatype REAL. The Real must be converted to DWORD.On the used platform the datatypes have the following sizes:REAL: 32 bits (4 bytes)DWORD: 32 bits (4 bytes) ...
0
votes
1answer
35 views

T-SQL Insufficient result space to convert uniqueidentifier value to char

How can I fix this error?Codedeclare @guid uniqueidentifier='4164980A-EFD0-4C60-A18A-253465E00E9C'print 'GUID='+cast(@guid as varchar)ResultMsg 8170, Level 16, State 2, Line 2 ...
3
votes
2answers
82 views

Haskell - Convert integer to double, then String

I'm practicing Haskell by writing a program that will convert a price in cents into dollars. Obviously, this means that my Int will need to become a Double, but I want my final output to be that of a ...
0
votes
1answer
23 views

assigning to list variable datatable object datetime

item["firstTime"] is DateTime object which may be NULLIf I use this:firstDate=Convert.ToDateTime(item["firstTime"].ToString()),while dataobject has some data inside everything is OK.But if ...
-1
votes
2answers
52 views

converting datatable object to int

I have foreach loop where I'm trying to assign object taken from sql that contains id to my list model in which this item must be int.foreach (DataRow item in dtbProduct.Rows){...
2
votes
1answer
50 views

Convert String to Json in Ballerina

Is there a way to convert string to json in Ballerina ?I found this PR - Add jsons:parse() method to get a JSON from a string where it says adding support to parse string to json, but couldn't find ...
1
vote
1answer
39 views

Issue converting char to int java

I am writing a code that takes a infix expression and converts it to postfix. It then takes the postfix expression and solves it. Converting from infix to postfix works fine, but for some reason my ...
1
vote
1answer
29 views

Cast a substring catched by a regex to an integer and used it as an function argument in VB.Net

I've got a string such as :Dim initialString As String="Some text here is f(42,foo,bar) and maybe some other here."And want to replace the "f(42,foo,bar)" part to the evaluation of a function ...
2
votes
1answer
43 views

Haskell implicit conversions

Hello i was looking to using Data.Text.intercalate and from Hackage i do not understand why if the method has the following signature:intercalate :: Text -> [Text] -> Text Why then, does ...
3
votes
2answers
69 views

Why the following code with non-const conversion function is not ambiguous?

Consider the following code (taken from https://en.cppreference.com/w/cpp/language/cast_operator)struct To {To()=default;To(const struct From&) {} // converting constructor};...
4
votes
4answers
108 views

Invalid conversion 'void*' to 'struct*' [duplicate]

I'm beginner in C. I'm trying to practice with solving some problems. And I'm getting this error when I compile my code. [Error] invalid conversion from 'void*' to 'triangle*' [-fpermissive]The ...
0
votes
2answers
78 views

c# detect if the string is long or DateTime before converting

I have code:if(DateTime.TryParse(objString, out DateTime result)){// ...}else if (long.TryParse(objString, out long result)){// ...} else{// ...}If objString="782,4" ...
0
votes
1answer
20 views

Why does typescript require me to workaround setting a value of type boolean?

function f1(){const v : string=String();if(v) {alert("IF");} // OKconst b : boolean=v; // Type 'string' is not assignable to type 'boolean'.if(b) {alert("BOOLEAN");}}f1()...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,