long-integer

Correct declaration of DWord in VBA

时光怂恿深爱的人放手 提交于 2019-12-11 16:47:01
问题 I'm using an API function which returns a DWORD Because I want intellisense on the LoWord and HiWord , rather than using a Long : Declare Sub myAPI(ByRef outVariable As Long) ...as suggested in this list of WinAPI -> VBA datatype conversions, I'm using a type: Public Type DWORD 'same size as Long, but intellisense on members is nice '@Ignore IntegerDataType LoWord As Integer '@Ignore IntegerDataType HiWord As Integer End Type Declare Sub myAPI(ByRef outVariable As DWORD) However RubberDuck's

VB.NET BindingSource Filter two column conversion not valid

做~自己de王妃 提交于 2019-12-11 12:52:00
问题 I need to filter my Table2 with ID number and with year >=2010. This is my code for filter: Me.Table2BindingSource.Filter = "osobljeID ='" & OsobljeIDTextBox.Text & "'" And "Godina >=" & txtGodP.Text When I start app and click on button with this code I got: Conversion from string "osobljeID ='1'" to type 'Long' is not valid. When I use only one column to filter all is working but I need two. (e.g [Me.Table2BindingSource.Filter = "osobljeID ='" & OsobljeIDTextBox.Text & "'"]) but with "And"

Handling large integers in Java without using BigInteger

旧街凉风 提交于 2019-12-11 12:23:37
问题 I am currently working on an assignment that involves calculating Fibonacci numbers up to F(300) using a linear time complexity algorithm. I know via a quick search that a Java long will overflow at around F(93), so I am trying to figure out how to store such a large number. However, our assignment states that we are not allowed to use language libraries such as BigInteger to store our numbers. We must write our own large integer data type or object. What exactly am I to do in this case? I

Android Long-Service Create bg thread and i don't know that is going on

≡放荡痞女 提交于 2019-12-11 11:15:42
问题 Basically i am developing a rss feed for android, and i want to have a updater service that, for each source, get the feeds in specific time. Imagine: Source1 - 5minutes Source2 - 10minutes Source3 - 10minutes I build a differential list to use only one thread that make the requests for update. The datastructure stays like this: Source1 (next sleep - 5), Source2 (next sleep - 0, Source 3 (next sleep 5).. and so on.. What i do is, i add always to a list of providers (that contains the id and

Comparing int with long and others

老子叫甜甜 提交于 2019-12-11 10:18:57
问题 I am wondering if things like this : int a = ...; long b = ...; if (a < b) doSomethings(); always works (excepted for unsigned) I just tested with a few values, but I want to be sure. I assume a is cast to long in the comparison, what about others type ? 回答1: int/long compare always works. The 2 operands are converted to a common type, in this case long and all int can be converted to long with no problems. int ii = ...; long ll = ...; if (ii < ll) doSomethings(); unsigned/long compare always

JSpinner with long values

隐身守侯 提交于 2019-12-11 09:34:54
问题 I am in need of a JSpinner that can handle long, but JSpinner only handles double and int. I did see an answer that used double to simulate a long, but I need to be able to exactly represent each value of long. It is a program that works with each of the 64 bits, so double and int will not do. Is it possible to have a JSpinner use BigInteger as the data type, or would I be better off just making designing my own JSpinner using a JPanel holding a JTextField and two JButtons specifically to

BigInteger Modulo '%' Operation & Less Than / More Than Operations

旧街凉风 提交于 2019-12-11 07:57:20
问题 Hi I have an algorithm in which I need to apply operations to BigInt's. I understand that BigInt's can be manipulated using the Maths class such as: import java.math.*; BigInteger a; BigInteger b = BigInteger.ZERO; BigInteger c = BigInteger.ONE; BigInteger d = new BigInteger ("3"); BigInteger e = BigInteger.valueOf(5); a.multiply(b); a.add(b); a.substract(b); a.divide(b); I need to be able to apply greater than for a while condition e.g. while (a > 0) { Which gives me a syntax error saying

Understanding Java Inclusive or Operator ( | )

感情迁移 提交于 2019-12-11 07:44:36
问题 I'm trying to solve this problem: I have a byte value (1 byte) and I need to transform this value into a long value (8 bytes). But what I want is just replace the first byte of the long variable with the byte value I had before. A example: My Byte Value: 11001101 My Long Value: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 What I want: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11001101 Simple as that! I'm trying to do this (example): byte b =

converting size_t into long, Is there any disadvantage?

依然范特西╮ 提交于 2019-12-11 04:59:36
问题 Is there any disadvantage of converting size_t to long? Because, I am writing an program that maintains linked_list in a file. So I traverse to another node based on size_t and I also keep track of total number of lists as size_t. Hence, obviously there is going to be some conversion or addition of long and size_t. Is there any disadvantage of this? If there is then I will make everything as long instead of size_t, even the sizes. Please advise. 回答1: It's not a problem now, but it may be in

Convert array of 8 bytes to signed long in C++

独自空忆成欢 提交于 2019-12-11 04:06:32
问题 I have an array of 8 bytes and I'm trying to convert it to a signed long in C++, and can't seem to figure it out. From what I could tell long ints are only 4 bytes, can anybody provide some information on this? Is it going to matter if it is 32 or 64 bit? 回答1: You probably should use a int64_t which is guaranteeed to be 8 bytes long. You don't state how your data is represented (its endianness) into your array but you might use reinterpret_cast<> or even better: use shift operations to "build