packing Questions

2

I have a piece of Python code: def func1(): a=set() b = ','.join(map(str, list(a))) return b, [] def func2(): d = 1 e = 2 return func1() + (d, e,) def main(): a,b,c,d = func2() if __name...
Embolism asked 16/1, 2015 at 8:46

3

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 r...
Moorings asked 26/1, 2011 at 23:12

11

Solved

Consider: struct mystruct_A { char a; int b; char c; } x; struct mystruct_B { int b; char a; } y; The sizes of the structures are 12 and 8 respectively. Are these structures padded or pac...
Ankledeep asked 29/11, 2010 at 17:16

2

Solved

I am trying to model random closed packing spheres of uniform size in a square using python. And the spheres should not overlap but I do not know how to do this I have so far: Code: import rand...
Basie asked 11/10, 2016 at 0:57

2

I am trying to implement a 3D packing algorithm using the extreme point-based approach. The paper which introduced this approach can be seen here: Extreme Point-Based Heuristics for Three-Dimension...
Hux asked 2/4, 2017 at 16:11

2

Solved

I'm stumbling through Gtk+ tutorials and the reference, trying to understand how to get a decent layout done. The docs say you should use GtkGrid instead of the deprecated Box/HBox/VBox, but I’m ha...
Timmons asked 29/8, 2013 at 14:37

3

Solved

I searching algorithm to solve problem like this: I have few windows, each window can be moved and re sized but with specified ratio between width and height, eg. 2:1 (height:width). Each window ...
Rae asked 16/12, 2010 at 2:0

0

we are trying to create a visualisation with D3 which represents a stock portfolios assets with relative sized weightings with 3 levels deep nested data. We have used D3 Pack and a zoom function su...
Ringo asked 21/6, 2018 at 5:3

1

Let's say I have a package foo, and foo packages up binary shared objects that I use in multiple Python scripts. Foo v1 (shared objects) Bar v1 (requires Foo v1) Baz v1 (requires Foo v1) Now...
Vehicle asked 18/1, 2018 at 23:39

7

Solved

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...
Charybdis asked 2/7, 2011 at 12:24

1

Solved

Are there any guarantees regarding packing of structs in C? Just as an example, provided that sizeof(double) == 8, is it guaranteed that sizeof(struct { double x, y; }) == 16? I am aware that the...
Navigator asked 5/12, 2017 at 21:17

1

Solved

I know structure packing is a common thing in C++ programming (at least on low memory systems). But what about classes. I know it works because I tried it #include <iostream> #pragma pack(p...
Unquestioned asked 31/5, 2017 at 14:8

5

Solved

I'm writing some software where each bit must be exact(it's for the CPU) so __packed is very important. typedef union{ uint32_t raw; struct{ unsigned int present:1; unsigned int rw:1; unsigned...
Cultus asked 11/6, 2009 at 2:37

1

Solved

How can I define #pragma pack(2) as a structure attribute? I've read here that __attribute__((packed,aligned(4))) is roughly equivalent to #pragma pack(4). However, if I try to use this (at least...
Sasin asked 31/3, 2017 at 7:51

7

Solved

Ive got a bunch of rectangular objects which I need to pack into the smallest space possible (the dimensions of this space should be powers of two). I'm aware of various packing algorithms that wi...
Incandescence asked 31/7, 2009 at 16:1

1

Is there any way to see how C structs are packed during build time? I've read through several similar posts about how structs may be packed: How structs are saved in memory C Why isn't sizeof...
Adria asked 9/6, 2016 at 4:51

5

I was trying to pack circles of different sizes into a rectangular container, not packing in circular container that d3.js bundled with, under d3.layout.pack. here's the layout I want to achieve: ...
Demetrademetre asked 12/11, 2012 at 7:13

2

In python, one can declare a tuple explicitly with parenthesis as such: >>> x = (0.25, 0.25, 0.25, 0.25) >>> x (0.25, 0.25, 0.25, 0.25) >>> type(x) <type 'tuple'> ...
Dialect asked 15/1, 2016 at 10:37

1

Solved

Can you help me understand what is going on here with GTest and struct packing? The problem seems to be related to how a struct is packed when used as a value in a value-parameterised test in GTes...
Underlinen asked 17/11, 2015 at 0:19

1

Solved

Hi all I understand that if rtree is created with range values in boost it would use packing algorithm. I need an example of rtree using packing algorithm. Here is my code that uses quadratic algor...
Sacrificial asked 9/7, 2015 at 14:34

1

Solved

I have two questions related to using list in R and I am trying to see how I can improve my naive solution. I have seen questions on similar topic here but the approach described there is not helpi...
Superfecundation asked 17/5, 2015 at 4:32

4

Solved

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 t...
Squadron asked 12/4, 2012 at 10:16

1

Solved

Note: I don't think this is a duplicate of this question, which is talking about a non-background pack which hangs git with a subtly different error message. In one of my git repositories, each ...
Kiethkiev asked 20/2, 2015 at 16:42

5

Solved

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 i...
Schistosomiasis asked 23/7, 2009 at 9:31

9

Solved

During a code review I've come across some code that defines a simple structure as follows: class foo { unsigned char a; unsigned char b; unsigned char c; } Elsewhere, an array of these objec...
Priory asked 4/11, 2009 at 20:24

© 2022 - 2024 — McMap. All rights reserved.