int Questions

4

Solved

I run into a problem on my code when moved to production because the production server is 32bit while my development machine is 64bit (I'm running Kubuntu 12.04 64bit). My question is. Is it possib...
Skindeep asked 21/3, 2013 at 20:27

4

Solved

I have been using int(10) and just noticed that Wordpress uses bigint(20) - What is different to use bigint(20) and int(10) for id auto increment? Which one should I use for id column? `id` bigint...
Guanine asked 22/1, 2011 at 17:38

11

Solved

I have this method in my java code which returns byte array for given int: private static byte[] intToBytes(int paramInt) { byte[] arrayOfByte = new byte[4]; ByteBuffer localByteBuffer = ByteBuf...
Gameness asked 7/4, 2011 at 18:5

7

Solved

I have to convert an int to an hex value. This is for example the int value: int_value = -13516; To convert to a hex value i do: hex_value = Integer.toHexString(int_value); The value that I s...
Absenteeism asked 6/8, 2013 at 10:52

7

Solved

Say I have a float number. If it is an integer (e.g. 1.0, 9.0, 36.0), I want to remove the ".0 (the decimal point and zero)" and write to stdout. For example, the result will be 1, 9, 36. If the fl...
Misconceive asked 9/7, 2016 at 14:12

6

Solved

Using the new Enum feature (via backport enum34) with python 2.7.6. Given the following definition, how can I convert an int to the corresponding Enum value? from enum import Enum class Fruit(En...
Izawa asked 30/5, 2014 at 9:50

3

Solved

I am trying to use an Optional Int in Realm and am getting an old error I think. Code dynamic var reps: Int? = nil Error 'Property cannot be marked dynamic because its type cannot be represen...
Guthrie asked 26/10, 2015 at 21:58

8

Solved

In Swift 2.x I believe I could do: let number = 1 let result = Bool(number) print(result) // prints out: true But since Swift 3 I've been unable to do this and it gives me the error: Cannot ...
Penates asked 15/10, 2016 at 14:15

16

I'm converting an unsigned integer to binary using bitwise operators, and currently do integer & 1 to check if bit is 1 or 0 and output, then right shift by 1 to divide by 2. However the bits a...
Calore asked 4/2, 2012 at 21:42

30

Solved

Is there any EASY way to sort an array in descending order like how they have a sort in ascending order in the Arrays class? Or do I have to stop being lazy and do this myself :[
Picco asked 7/11, 2009 at 23:5

5

Solved

I am looking for a way to print an integer in assembler (the compiler I am using is NASM on Linux), however, after doing some research, I have not been able to find a truly viable solution. I was a...
Hagiology asked 23/11, 2012 at 5:25

6

I'm preparing for a class lesson (I'm teaching) and I'm trying to predict any possible questions from the students and I ran into one that I can't answer: If we have floats, why do we ever use int...
Baring asked 8/12, 2013 at 10:11

2

Solved

I'm wondering if there is an easier way to write these two initializers as a generic Initializer public required init(_ value : Double) { super.init(value: value, unitType: unit) } public requir...
Copeck asked 28/5, 2015 at 13:25

27

Solved

I was curious to know how I can round a number to the nearest whole number. For instance, if I had: int a = 59 / 4; which would be 14.75 if calculated in floating point; how can I store the resu...
Zettazeugma asked 11/3, 2010 at 5:20

5

Solved

I have a unsigned char array[248]; filled with bytes. Like 2F AF FF 00 EB AB CD EF ..... This Array is my Byte Stream which I store my Data from the UART (RS232) as a Buffer. Now I want to convert...
Petrapetracca asked 2/9, 2012 at 22:31

4

Solved

const std::string::size_type cols = greeting.size() + pad * 2 + 2; Why string::size_type? int is supposed to work! it holds numbers!!!
Pigtail asked 25/7, 2009 at 3:4

15

Solved

I want to take an integer (that will be <= 255), to a hex string representation e.g.: I want to pass in 65 and get out '\x41', or 255 and get '\xff'. I've tried doing this with the struct.pack...
Golanka asked 16/2, 2010 at 0:7

3

Solved

In Swift, I can do something like this: let ordinalFormatter = NumberFormatter() ordinalFormatter.numberStyle = .ordinal print(ordinalFormatter.string(from: NSNumber(value: 3))) // 3rd but I do...
Benedic asked 20/1, 2017 at 21:31

8

Solved

Is there a way to convert a floating number to int in Julia? I'm trying to convert a floating point number to a fixed precision number with the decimal part represented as 8bit integer. In order to...
Laughlin asked 10/11, 2016 at 4:47

17

Solved

I have a table field in a MySQL database: userid INT(11) So I am calling it to my page with this query: "SELECT userid FROM DB WHERE name='john'" Then for handling the result I do: $row=$r...
Axum asked 16/3, 2011 at 9:20

6

Solved

In an interview, I was asked what do I think about the following code: #include <stdio.h> int main() { float f = 10.7; int a; a = f; printf ("%d\n", a); } I answered: The compiler w...
Gautier asked 26/1, 2016 at 7:14

8

Solved

This program works, except when the number of nJars is a multiple of 7, I will get an answer like $14.999999999999998. For 6, the output is 14.08. How do I fix exceptions for multiples of 7 so it w...
Blouson asked 17/1, 2012 at 13:22

6

Solved

I have two columns in a Pandas data frame that are dates. I am looking to subtract one column from another and the result being the difference in numbers of days as an integer. A peek at the dat...
Garboil asked 15/6, 2016 at 16:21

10

Solved

I just want to know if there's a better solution to parse a number from a character in a string (assuming that we know that the character at index n is a number). String element = "el5"; String s;...
Dagoba asked 11/2, 2011 at 11:11

31

Solved

I have a class called Questions (plural). In this class there is an enum called Question (singular) which looks like this. public enum Question { Role = 2, ProjectFunding = 3, TotalEmployee = 4...
Indistinctive asked 3/6, 2009 at 6:46

© 2022 - 2024 — McMap. All rights reserved.