long-integer

Powerpoint Slide Count Variable in VBA

北城余情 提交于 2019-12-12 23:38:27
问题 I am creating a Powerpoint in vba. My plan is to set up the code such that each subroutine creates a certain slides. However I need to pass through the slide number to each subroutine in order for it to create the proper slide in the right position. I am having trouble defining what the .Slides.Count is in excel vba. I understand it is technically a Long, but somehow I was able to pass it through as an Integer in another patch of code that is no longer working. My questions are: The .Slides

Selecting 'long' versus 'long long' as 64-bit type under LP64/ILP64/LLP64 data models?

99封情书 提交于 2019-12-12 21:29:52
问题 I'm trying to understand the requirements for selecting a built-in 64-bit data type using either long or long long . I'm having trouble understanding the type equivalence and the alignment requirements of long versus long long . What is the best practice or criteria when selecting long versus long long as a 64-bit type under LP64/ILP64/LLP64 data models? Here are some related questions. They completely cover other topics, like sizeof(long) <= sizeof(long long) , but they don't quite have a

Java Class Long - method longValue()

独自空忆成欢 提交于 2019-12-12 19:31:43
问题 Why has the java class Long a method longValue()? And what is the use of that? The java doc says the numeric value represented by this object after conversion to type long. Is there a case where I need this? Could the following first code code differ from the second for any long value? //Is there a value where this myLong value contains other... Long l = new Long("..."); long myLong = l; //...than this one? Long l = new Long("..."); long myLong = l.longValue(); 回答1: Before Java5 there is No

C++: Counting total frames in a game

穿精又带淫゛_ 提交于 2019-12-12 13:13:00
问题 Not a very good title, but I didn't know what to name it. Anyway, I am counting the total frames (so I can calculate an average FPS) in my game with a long int . Just in case the game went on reallly long, what should I do to make sure my long int doesn't get incremented past its limit? And what would happen if it did go past its limit? Thanks. 回答1: Average FPS throughout the length of an entire game doesn't seem to be a very useful statistic. Typically you will wish to measure peaks and

Performing a calculation in Java gives completely wrong answer [closed]

…衆ロ難τιáo~ 提交于 2019-12-12 12:27:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . In the code below, when x = 60 and y = 2, result = 500. This is correct, but any x value between 60 and 119 also gives 500. Also, when x < 60, I get a divide by 0 error. Additionally, when x >= 120, result = 0. I am stumped as to why this is happening. I have also tried using various combinations of int, float,

Factorial function produces wrong result for 21! and above

时光怂恿深爱的人放手 提交于 2019-12-12 12:06:54
问题 for (int i = 0; i <= 25; i++) System.out.printf("%d! = %,d\n", i, factorial(i)); The code above initializes the factorial method below: public static long factorial(int num1) { if (num1 == 0) return 1; else return Math.abs(num1 * factorial(num1 - 1)); } As so the following output is created: 0! = 1 1! = 1 2! = 2 3! = 6 4! = 24 5! = 120 6! = 720 7! = 5,040 8! = 40,320 9! = 362,880 10! = 3,628,800 11! = 39,916,800 12! = 479,001,600 13! = 6,227,020,800 14! = 87,178,291,200 15! = 1,307,674,368

“OverflowError: Python int too large to convert to C long” on windows but not mac

孤街醉人 提交于 2019-12-12 09:29:03
问题 I am running the exact same code on both windows and mac, with python 3.5 64 bit. On windows, it looks like this: >>> import numpy as np >>> preds = np.zeros((1, 3), dtype=int) >>> p = [6802256107, 5017549029, 3745804973] >>> preds[0] = p Traceback (most recent call last): File "<pyshell#13>", line 1, in <module> preds[0] = p OverflowError: Python int too large to convert to C long However, this code works fine on my mac. Could anyone help explain why or give a solution for the code on

Double from long bits

不打扰是莪最后的温柔 提交于 2019-12-12 07:16:03
问题 I have an unsigned long long (or uint64_t ) value and want to convert it to a double . The double shall have the same bit pattern as the long value. This way I can set the bits of the double "by hand". unsigned long long bits = 1ULL; double result = /* some magic here */ bits; I am looking for a way to do this. 回答1: The portable way to do this is with memcpy (you may also be able to conditionally do it with reinterpret_cast or a union, but those aren't certain to be portable because they

How can I make Jackson deserialize a Long to a Date Object?

偶尔善良 提交于 2019-12-12 06:37:35
问题 I'm serializing some java.util.Dates within a Map. The dates are serialized into Longs (Jackson writes the Long value of the Date instance to the JSON string), however, they're not being de-serialized back to Date instances, but as Long instances. I'd like Jackson to de-serialize the dates back to Date objects (rather than formatted Strings or Longs), how can I achieve this? Map<String, Comparable<?>> change = new HashMap<String, Comparable<?>>(); change.put("DESCRIPTION", "LIBOR"); change

INSERTing very long string in an SQL query - ERROR

╄→гoц情女王★ 提交于 2019-12-12 05:38:38
问题 The problem is that whenever I input a big-ass text in the form of my php page and try to INSERT it through a SQL query into the database, it gives me an error like this: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'sample title', 'spent the long months of the rainy season shut up in a small room th' at line 1" The query is this: $sql = "INSERT INTO `d` (`user_id`, `title`, `message`) VALUES ($user_id