This tag refers to the process of converting the data type of one piece of information into another type.
Questions tagged [data-conversion]
1963 questions
0
votes
1 answer
Color Conversion from Integer to Hex?
Fun challenge, harder than you think. Given the integer 16744448 as a "color" end up with the color blue.
If you google the color, it shows right as #0080FF, but if you then go to a Decimal to hex converter, you get #FF8000.
I am not sure if one is…

Alan
- 2,046
- 2
- 20
- 43
0
votes
0 answers
Confusing binary numbers
I had a doubt which is confusing me,
Isn't 1101(base 2) = 13 (base 10) or is it 1101 (base 2) = -5 (base 10) ?
I am assuming that when we use two's complement method then we use a negative integer, but when we generally use the integer then it is…

Sahil Silare
- 313
- 2
- 3
- 15
0
votes
1 answer
How to convert and concatenate positions in an lpBuffer to end up with a hex number printed as an integer?
I am new to C++.
I have referenced 10+ stackoverflow pages citing similar problems, but no matter what I try I cannot extrapolate a solution to fit my specific problem.
I have some electronics feeding data into a serial port, of which the…

Sean McCready
- 1
- 2
0
votes
0 answers
convert cable modem config file to json/xml/java objects
Please help me.
I am working n/w domain project.
I have config file like this.
Main
{
NetworkAccess 1;
MaxCPE 3;
GlobalPrivacyEnable 1;
BaselinePrivacy
{
AuthTimeout 10;
ReAuthTimeout 10;
AuthGraceTime…
0
votes
0 answers
Inputting a picture as a 2D matrix
I have an assignment about working with pictures that depth cameras take.
First thing first, this is how one of these pictures looks like.
The way the camera works is that it represents objects in different tones of color depending on how far they…

Machi
- 43
- 1
- 7
0
votes
1 answer
cast to pointer from integer of different size when converting uint64_t to bytes
[EDIT]I wanted write uint64_t to char* array in network byte order to send it as UDP datagram with sendto, uint64_t has 8 bytes so I convert them as follow:
void strcat_number(uint64_t v, char* datagram) {
uint64_t net_order = htobe64(v);
…

karol wołonciej
- 109
- 1
- 1
- 10
0
votes
0 answers
Conversion failed when converting the varchar value....
I am struggling with a common error... We are trying to capture several variants of string results and convert them to a single text word 'Negative'
,(CASE WHEN max(MR_RNATest.OBSVALUE) like '%not%detected%'
**OR…

Kate
- 1
0
votes
1 answer
C++ string to integer wrong value can it be reversed?
Folks,
This is less of a C++ question and more of a recovery from damage question.
We had a piece of C++ code that was inserting into a MSSQL database.
The developer tells me the value being passed was an integer but to craft the correct insert…

Andye
- 51
- 1
- 1
- 9
0
votes
1 answer
How to properly select wanted data and discard unwanted data from binary files
I'm working on a project where I'm trying to convert old 16bit binary data files into 32bit data files for later use.
Straight conversion is no issue, but then i noticed i needed to remove header data from the data-file's.
The data consists of 8206…

Nanoni
- 451
- 2
- 7
- 20
0
votes
2 answers
void* array convert element to another type
I have something like this:
void* a[] = {(void*)"Hello",(void*)1};
cout << (char*)a[0] << endl;
cout << (int)(int64_t)((int*)a[1]) << endl;
How I can simplify line
(int)(int64_t)((int*)a[1])
Is it possible to change the void * into an int easier?

idiot
- 53
- 6
0
votes
2 answers
Talend - Transform "EEE MMM dd hh:mm:ss z yyyy" in "yyyy-MM-dd"
I receive a date from a file in this format: "EEE MMM dd hh:mm:ss z yyyy" and I'm trying to convert this value into Date "yyyy-MM-dd". For that I'm using:
TalendDate.parseDate("yyyy/MM/dd", TalendDate.formatDate("yyyy/MM/dd",…

SaCvP
- 393
- 2
- 4
- 16
0
votes
1 answer
How to 'flatten' complex Powershell object (hashtable) for output as CSV entry?
I'm generating an object which contains the results of some diagnostics process.
It has the following structure:
ProdVersion : [string]
LastAttempted : [ordered hashtable]
LastSuccessful : [ordered hashtable]
Pings : [array of…

Max
- 71
- 3
- 8
0
votes
1 answer
Convert Decimal to MM:SS:MS Django
I am trying to convert a decimal value from my Django model into a time format of MM:SS:MS.
For example: 97.13 as a decimal value would become 01:37:13.
Is there any easy way to implement this with a raw SQL query in Django? Lets say I have this…

Zakerias
- 356
- 2
- 3
- 18
0
votes
1 answer
Hex dump to binary data conversion
Need to convert hex dump file to binary data use xxd command (or any other suitable methods that works). The raw hexdump was produced not with xxd.
Tried two variants with different options:
xxd -r input.log binout.bin
xxd -r -p input.log…
user4515590
0
votes
1 answer
Convert hex dump to binary file use xxd
I have hex file from memory dump created from reading memory area of 32768 bytes in size.
... ... ....
80001174: aaaa aaaa aaaa aaaa aaaa aaaa 27bd ff80 | ............'...
80001184: afa1 0004 afa2 0008 afa3 000c afa4 0010 |…
user4515590