Questions tagged [type-conversion]

1

votes
1

answer
356

Views

how to convert a date in GMT format to another format?

How can i convert Fri Dec 29 05:30:00 GMT 05:30 20 into 29-12-2017 02:28:03 this format in android.i already used the below code for convert the date but i can't work.so please help me out. String date = Fri Dec 29 05:30:00 GMT 05:30 20 SimpleDateFormat sdf = new SimpleDateFormat('dd-MM-yyyy h:mm:...
Radhika
1

votes
1

answer
91

Views

add a customized object to tinyDB

tinydb.putListObject(String,java.util.ArrayList) wants an object but I want to store restaurant object. How can I solve it? ArrayList restaurants = new ArrayList(); // This part gives error. tinydb.putListObject('restaurantsObject',restaurants); After that, I need to convert it to restaurant object...
ozo
1

votes
1

answer
385

Views

Why is there a result of `#Error` in an Access query with a join on two type-converted fields?

I’m getting a result of #Errorin an Access 2010 query which has a right join on two fields which are type-converted. I can eliminate the error by improving my queries, but I’m confused as to why it happens. I have the following two tables, T1 and T2. Both consist of an ID field and a text field....
Scott H
1

votes
0

answer
41

Views

What is the meaning of 'NK' in pandas int64?

I have a column pathsize (int64). However, I got some values define as 'NK'. I've tried to convert this value into an integer, but it doesn't seem to have any effect. NK 687 15 180 12 172 14 166 ... 3 123 Name: pathsize, Length: 92, dtype: int64 The script I used to convert NK into 0...
Saber Alex
1

votes
0

answer
24

Views

Type System attributes : Developing intuition and Addressing Misconceptions

A type system is a set of rules used to provide additional layer of information about entities in a program, so that the runtime, or the compiler, or any other piece of machinery, knows what to do with the strings of bits it operates on. It also help maintain contracts - the compiler (or code analys...
Gabriele Scarlatti
1

votes
0

answer
30

Views

Python3 List of binary data is not seen as bytes

I am having problems trying to extract integers and bytes from a list of data in Phython3. I read a serial port and capture a block of 282 bytes. It is stored as a 'list' where tedData[0] is the whole block. For example I need to extract bytes 249 and 250 and convert to a short integer. Below is...
PhippsJ
1

votes
1

answer
15

Views

Different byte length of base64 decryption

I am trying to decode this base64 string using VB.NET System.Convert.FromBase64String('AgBgVvBR0apvj88GZFp/0ontNtFIcsJoVTachX30kURDlK010Mv9/yv1yLXXr4mqII5z2Hzx9FlGxA==') And it returns 58 bytes. If I convert from Base64 on any online base64 decode program I get 32 bytes..?? What am I doing wrong?
Nathan Woodruff
1

votes
2

answer
3.7k

Views

Convert JSON Data into Excel File Download in Javascript

I have a AJAX POST Request fetching data back in form of a JSON Array. I want to convert this received JSON Data into an Excel File (Not CSV) for download (on a button-click), pls help. The JSON Data might have blank values and missing fields for each JSON row. I tried this in Client side using Jav...
Voila
1

votes
0

answer
323

Views

Cannot find/create new file in Docker

I couldn't find any information or a way to do this, and as I am new to Docker, I thought here would be a good place to ask. I have python code, where I take a .jpg image file, convert it to base64, then decode the base64 and create a .png image file with that data. It's been working outside of Dock...
1

votes
1

answer
54

Views

SAS coverting character variable using INPUT

I have the following dataset where each subject ID has a corresponding value (AVAL) that is currently in a character format. data test; input SUBJID$ AVAL$6.; cards; 001 97.9 001 119 001 061 001 62 001 151.0 ; run; Basically, I want to convert the AVAL variable from character to numeric. I us...
Nathan123
1

votes
0

answer
233

Views

Convert sql server datetimeoffset to C# datetimeoffset or datetime

I have a column with datetimeoffset data type. For e.g. 2018-02-19 10:08:53.8060711 +00:00 I am trying to set this value to the C# property having the same data type. In my application, I am using reflection to set the properties into the model (can't avoid reflection) Here is the sample code - Type...
Ankur Arora
1

votes
1

answer
43

Views

How to convert 2d Integer array into 2d String array?

I have a two dimensional Integer array and I need to convert it into a two dimensional String array. private Integer[][] microboardArray = new Integer[9][9]; Then I have 'get' method from interface which must be implemented. @Override public String[][] getBoard() { } Thank you for your help :).
MapeSVK
1

votes
1

answer
551

Views

Rcpp: Converting SEXP to float/double

SEXP callFunction1(List network, List words, Function testWordContinuity){ SEXP res = testWordContinuity(network, words); return res; } for(int i=0; i
thposs
1

votes
1

answer
95

Views

issue looping over clob data in pl/sql. invalid type when setting variable to current iteration

I am currently using pl/sql to attempt to loop over some data in a clob column from a table. When I use just a select query and do the operations to the clob data, the procedure finishes just fine. Here is that example: DECLARE l_xml Clob; type fieldIds is table of number; isIdInTable Number; BEGIN...
Andrew
1

votes
1

answer
350

Views

Cython with Python3.5: convert list of string to char**

I am trying to pass a list of string to a C++ function that takes a char** as argument using Cython. I tried other solutions I can't remember but I mainly tried the two following options: Using a convertion function extracted from here, which is basically the same answer than here, but it raises an...
Romzie
1

votes
2

answer
284

Views

Laravel DB query to array

I stored 'hello,world' in a mysql database as an array and then tried to retrieve using below query @php $post_id = $post->id; $result= DB::table('posts') ->select('tags') ->where('id', '=', $post_id) ->get(); echo($result); @endphp The echoed result is: [{'tags':'hello,world'}] I need to echo si...
Shawty
1

votes
2

answer
165

Views

set<shared_ptr<T>>::iterator to set<shared_ptr<T const>>::const_iterator

So I have seen the questions about casting std::shared_ptr to std::shared_ptr and that is working well so far. But I have another question. I'd like to return an interator to my std::set, where both the T and the std::shared_ptr is const. I have been unable to convert them straight over, or with any...
N00byEdge
1

votes
0

answer
202

Views

Date conversion error while loading into pandas dataframe from spark dataframe

I am getting the below error while trying to convert a spark data frame to pandas data frame here is the code to fetch two columns from a table import pyspark as py from pyspark import SparkContext, SparkConf from pyspark.sql import * import pandas as pd spark = SparkSession.builder \ .master('loca...
ragav
1

votes
1

answer
3.9k

Views

as.factor() in numeric conversion R

So I am learning R now, and I notice from many source that whenever we want to convert a datatype to numeric,we use two functions as.numeric() and as.factor(). For example if I want to convert column Year to numeric, it will be as.numeric(as.factor(survey.data$Year)) I tried to use as.numeric() alon...
Efan Du
1

votes
1

answer
228

Views

Word/Doc/Pdf file to csv file format

I'm developing a PHP project i just want to know that is it possible to convert a doc/pdf file into csv file format then i would be able to import it to database (mysql). I've tried every tutorial but failed to get an answer
1

votes
1

answer
114

Views

Why is conversion not working?

I'd like to develop an algorithm that is able to do a AnyBase 2 AnyBase conversion in C++. So I started with just translating this javascript code into C++ and ended with the use of a BigInt - library because it will of course not work using integer (long int, long double, etc) precision - so I had...
1

votes
1

answer
36

Views

Value incorrect Recursion

I have a little problem with my function, the function does the conversion of decimal to binary but I print the value backwards for example the following code: I pass the 28 to binary that would have to be 0000011100 but I return 0011100000 public void binary(int n, char[] array, int bits) { if (0 =...
Patrick
1

votes
0

answer
13

Views

unconventional time format syntax

I have an Excel sheet with one column defining time in the following format 3:34'35'. In R it is a factor. I would like to convert it to a numeric value. Unfortunately ' and 'signs prevent me from working with it as a string. Could anybody suggest how to get to recognizable time format or to numer...
Denis
1

votes
1

answer
244

Views

Date Conversion in .net format “dd/mm/yyyy HH:mm:ss AM/PM”

I'm trying to convert a date formatted like dd/mm/yyyy HH:mm:ss AM/PM into YYYY-mm-dd hh:mm:ss.fffZ but had no success. This is what I've tried: System.Globalization.CultureInfo enUS = new System.Globalization.CultureInfo('en-CA'); string inputDate = '14/02/2008 1:55:11 PM'; DateTime newDate = Conve...
Amar
1

votes
0

answer
177

Views

Loopback: Remote Method is converting “null” to null value

I am having an issue where whenever my front end (angular) makes a remote method call that has a string 'null' in it once it gets to the remote method in Loopback, Loopback has converted the string 'null' to a null value. For example if a remote method /query takes in a filter: { 'name': 'null' } Lo...
emarel
1

votes
1

answer
207

Views

c# - Reading From CSV, Type Conversion Error

I'm using CSVHelper, though this seems to occur with the manual methods I know. I'm trying to create some form of 'save data' system using csv files, which will store all important variables that need to be loaded on the program running. Here's my code with generalized variable names: StringReader...
Dylanerd
1

votes
1

answer
41

Views

Error in converting image in png

I am trying to convert the image from jpg into png.Its work fine $src1 = 'Camel.jpg'; $image = imagecreatefromjpeg($src1); imagepng($image, 'new.png'); But I put the 'src1' instead of 'new.png' the conversion is failed. $src1 = 'Camel.jpg'; $image = imagecreatefromjpeg($src1); imagepng($image, $src1...
Nandy
1

votes
0

answer
45

Views

Getting compiler error 'binary '<<' : no operator found' in VS 2005

I am getting the below compiler error when I build my project: XMLHelper.h(22) : error C2678: binary '
Raghu Ramaiah
1

votes
0

answer
18

Views

Creating a matrix for R

I have a txt file with two columns. A= gene names B= tumors with mutation in that gene I want to produce a file that is a matrix with all tumors listed in one column and then all the gene names across in a row. See attachment for example Can this be done with R or awk? enter image description her...
Meghan Rudd
1

votes
0

answer
43

Views

is it possible to infer higher-order function receiver type based on the parent function parameters?

Given a function: inline fun executeSomething( defaultValue: String, entity: T, maybeDefault: String = defaultValue, onSuccess: (T) -> Unit ) I would like to infer onSuccess, receiver type T based on the parent function parameters or something like that. This one works, compiler infer the entity...
1

votes
2

answer
366

Views

Converting DataResponse<String> to a usable type

I have a POST request that is illustrated below. I need some help on how to be able to use the response data. The response I am getting is in a form of a dictionary. What is the best practice to use here? The error message I am getting is: Cannot assign value of type 'DataResponse' to type 'String'...
EmbeddedOS
1

votes
1

answer
32

Views

Deal with Radio Buttons in Laravel

Problem: I have a table categories on my database which contains the cat_id as primary key of type int and cat_name as name of the category. But I collect info from the under via radio. Question: How can I convert the 'on' and 'off' from the user to integers? Error Given: Illuminate\Database\QueryE...
Malico
1

votes
0

answer
59

Views

Convert .GDB file to .shp file

I have a .gdb folder with LOCK Files, FREELIST Files, ATX Files, GDBINDEXES Files, GDBTABLE Files, GDBTABLEX Files and, SPX Files. I want to convert them to .shp files. Could you tell me the required codes? Thanks.
Sara Ebrahimi
1

votes
1

answer
27

Views

mysql using cast to duplicate column var to int

by mistake I cteated a column as var(45) and when I export the table to cvs I don't see the numbers . now I want to make it as integer when I use this command : select cast(SIM as signed) from sample.table1 I don't get any error - so I guess it convert it to int, right? but how do I copy the new...
Korenron
1

votes
0

answer
140

Views

Cannot convert value of type ‚[[XXX]]‘ to expected argument type ‚[[XXX]]‘

I implemented a custom class class DisplayItem: NSObject { … } that works correctly in my app. It uses the function findDisplayItemTableDifferences1 that determines differences between two 2-dim arrays. The 1st dimension are the sections of a tableView, the 2nd are the rows of a section. This 2nd...
1

votes
3

answer
126

Views

Use DEC2BIN() in Excel create a list

Edit: I actually wrote my cell formula backwards and am not spending the amount of time required to reverse it now. Forwards or backwards works in my situation. I have the need to create a list of 'options' that is using a 32-bit decimal number to select the binary options. Example: 511 is given, w...
Joshua Garrow
1

votes
0

answer
30

Views

Error: Conversion to TensorType from function variable in Python code

I've been trying the Kaggle Blackhole Dataset example that has been explained in Cameron Davidson-Pilon's book 'Bayesian Methods for Hackers' in Chapter 5. However, I have been having difficulty in using the pymc3 package and its functions. The priors have been defined as uniform distributions and t...
namboo3
1

votes
1

answer
240

Views

Implicit conversion of T to ActionResult<T> does not work for some types

In asp.net core 2.1, AsctionResult is introduced, and an implicit type conversion is defined from T to ActionResult In my code, I get an error for some conversions. For instance: Error CS0029 Cannot implicitly convert type 'System.Collections.IEnumerable' to 'Microsoft.AspNetCore.Mvc.ActionResult...
Alireza
1

votes
1

answer
293

Views

convert std::string to const tchar*

I have a function that takes in a parameter called arrayOfStrings defined as below: const TCHAR* arrayOfStrings[] = { L'Test' }; Now I would like to convert strings to the type above, but I don't know how. This link provides a solution for converting string to tchar, but not const tchar*. This other...
Navid Nazari
1

votes
0

answer
242

Views

Convert image to numpy array, save it into Excel and reverse the all

I tried my best to solve this issue on my own and I think I've hit a roadblock as it stands so far. I'm new to Python and so far so good on a web scraping project I'm trying to complete. What I'm currently trying to accomplish is to take an image, convert it into something readable by Pandas like a...

View additional questions