packing

Any tools available for packing 32bit/64bit executables together? [closed]

蹲街弑〆低调 提交于 2019-12-04 05:26:51
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I really like the way the SysInternals utilities (e.g. Process Explorer) handle 64bit compatibility. It looks like the 32bit executable has the 64bit version embedded in it, and extracts it if necessary. I'd like a tool which automates this - i.e. takes 32bit and 64bit executables, packs them together somehow, and inserts stub code to launch the right executable according to which platform its gets

Pack four bytes in a float

拈花ヽ惹草 提交于 2019-12-04 02:51:23
I'm writing a shader (HLSL), and I need to pack a color value into the R32 format. I've found various pieces of code for packing a float into the R8G8B8A8 format, but none of them seem to work in reverse. I'm targeting SM3.0, so (afaik) bit operations are not an option. To sum it up, I need to be able to do this: float4 color = ...; // Where color ranges from 0 -> 1 float packedValue = pack(color); Anyone know how to do this? UPDATE I've gotten some headway... perhaps this will help to clarify the question. My temporary solution is as such: const int PRECISION = 64; float4 unpack(float value)

What is the most efficient way in Java to pack bits into byte[] and read it back?

被刻印的时光 ゝ 提交于 2019-12-03 17:03:27
问题 I currently use these two functions to pack and read bits in a byte array. Wondering if anybody has any better ideas or faster ways to do it? Edited the program with a few more optimization and tabled a few calculations. Currently 100mil Put and Get takes about 12 secs instead of 16 secs now. If anybody is using the current code make sure the value passed in to Put is a positive number as it's expecting unsigned numbers coming down. If there is interest I can put up signed and unsigned

Bin packing bruteforce method

◇◆丶佛笑我妖孽 提交于 2019-12-03 08:43:57
I need to make program that solves bin packing problem, but I already made first fit and greedy algorithms, but my lecturer says in some cases it won't find the minimal solution to the problem. So i decided to try bruteforce, but I have no clue how it should check all possible solutions. So yea.. can someone explain to me or give pseudo-code or something. I would appreciate a lot. Dukeling Note that bin-packing is an NP-hard problem, basically meaning it will take excessively long to run brute force on it, even for relatively small input, so brute force for NP-hard problems is almost never a

What is the most efficient way in Java to pack bits into byte[] and read it back?

可紊 提交于 2019-12-03 06:55:40
I currently use these two functions to pack and read bits in a byte array. Wondering if anybody has any better ideas or faster ways to do it? Edited the program with a few more optimization and tabled a few calculations. Currently 100mil Put and Get takes about 12 secs instead of 16 secs now. If anybody is using the current code make sure the value passed in to Put is a positive number as it's expecting unsigned numbers coming down. If there is interest I can put up signed and unsigned versions. class BitData { static void Put(byte Data[], final int BitOffset, int NumBits, final int Value) {

use of the bitwise operators to pack multiple values in one int

与世无争的帅哥 提交于 2019-12-03 00:50:01
问题 Low level bit manipulation has never been my strong point. I will appreciate some help in understanding the following use case of bitwise operators.Consider... int age, gender, height, packed_info; . . . // Assign values // Pack as AAAAAAA G HHHHHHH using shifts and "or" packed_info = (age << 8) | (gender << 7) | height; // Unpack with shifts and masking using "and" height = packed_info & 0x7F; // This constant is binary ...01111111 gender = (packed_info >> 7) & 1; age = (packed_info >> 8); I

C/C++ packing signed char into int

自古美人都是妖i 提交于 2019-12-01 20:51:42
问题 I have need to pack four signed bytes into 32-bit integral type. this is what I came up to: int32_t byte(int8_t c) { return (unsigned char)c; } int pack(char c0, char c1, ...) { return byte(c0) | byte(c1) << 8 | ...; } is this a good solution? Is it portable (not in communication sense)? is there a ready-made solution, perhaps boost? issue I am mostly concerned about is bit order when converting of negative bits from char to int. I do not know what the correct behavior should be. Thanks 回答1:

Piece together several images into one big image

試著忘記壹切 提交于 2019-12-01 17:48:44
I'm trying to put several images together into one big image, and am looking for an algorithm which determines the placing most optimally. The images can't be rotated or resized, but the position in the resulting image is not important. edit: added no resize constraint Possibly you are looking for something like this: Automatic Magazine Layout . Appearantly it's called a 'packing problem', which is something frequently used in game programming. For those interested, here are some suggested implementations: Packing Lightmaps , Rectangle packing and Rectangle Placement I created an algorithm for

Piece together several images into one big image

让人想犯罪 __ 提交于 2019-12-01 17:38:37
问题 I'm trying to put several images together into one big image, and am looking for an algorithm which determines the placing most optimally. The images can't be rotated or resized, but the position in the resulting image is not important. edit: added no resize constraint 回答1: Possibly you are looking for something like this: Automatic Magazine Layout. 回答2: Appearantly it's called a 'packing problem', which is something frequently used in game programming. For those interested, here are some

How to make class in C#, that can be cast to DateTime?

£可爱£侵袭症+ 提交于 2019-12-01 02:45:44
How can I make class, that can be cast to DateTime. But I need to cast my class, when it packed. For example: object date1 = new MyDateTime(); DateTime date2 = (DateTime)date1; I need directly this working example. I know how to do it, but my way will work without packing. I'm not sure is there way to do it. Please, help. PS. I need cast directly object to DateTime. So, MyDateTime have to be packed before. Explicit works well, but it doesn't help if you have packed object. And it have to cast just using ordinary casting like (DateTime) (object) MyDateTime Adam Houldsworth What you appear to be