Questions tagged [pack]

A function in several scripting languages for packing data, creating a sequence of specifically ordered and aligned bytes, into a binary structure. The opposite of the `unpack` function. This tag should be used with a programming language tag as well. While also used as a directive or pragma in some compilers to cause the compiler to ignore standard variable alignment for data aggregates (i.e. struct), do not use this tag for posts on that subject.

The pack function combines several high-level variables into a single low-level binary representation that usually matches the machine-level representation that you would see in a C struct. The inverse operation is .

Most versions of pack and unpack functions use a format or template that specifies the byte by byte layout of the data being put into or copied out of the memory area containing the binary representation.

Documentation:

682 questions
186
votes
7 answers

Remove large .pack file created by git

I checked a load of files in to a branch and merged and then had to remove them and now I'm left with a large .pack file that I don't know how to get rid of. I deleted all the files using git rm -rf xxxxxx and I also ran the --cached option as…
user1116573
  • 2,817
  • 4
  • 17
  • 27
87
votes
3 answers

How to publish nuget prerelease version package

I understand how to publish a nuget package using nuget command line nuget command line But I Have searched around I don't find docs about how to publish a nuget prerelease package
icn
  • 17,126
  • 39
  • 105
  • 141
72
votes
10 answers

exception in initializer error in java when using Netbeans

I am using Netbeans. I did some things with bindings and now whenever I start my program, before it even initializes the form, it gives me an error The exception in thread main is occuring before the form is even an initialized object yet. The…
Adam Outler
  • 1,651
  • 4
  • 19
  • 23
44
votes
2 answers

Can someone explain to me the pack() function in PHP?

I would like to know more about the pack() function in PHP: https://secure.php.net/manual/en/function.pack.php I know it packs data into binary, but I'm not sure what all those v V n N c C mean and I was wondering if someone could be so kind as to…
Tower
  • 98,741
  • 129
  • 357
  • 507
35
votes
2 answers

Including Shoes in Shoes package

I've been having a problem with including Shoes in a Shoes app for Windows. The packager tool works perfectly when I don't ask to include Shoes in the app: I get an .exe that, if launched on a Shoes-less computer, downloads Shoes and then runs as…
Logelz
  • 359
  • 2
  • 4
27
votes
3 answers

pack / unpack functions for node.js

Are there any modules that provide pack / unpack functionality for nodejs similar to python's struct module? I haven't found any specifically for node, and I'd assume that javascript implementations would be significantly slower. Thanks.
Adam M-W
  • 3,509
  • 9
  • 49
  • 69
25
votes
4 answers

Protobuf 3.0 Any Type pack/unpack

I would like to know how to transform a Protobuf Any Type to the original Protobuf message type and vice versa. In Java from Message to Any is easy: Any.Builder anyBuilder = Any.newBuilder().mergeFrom(protoMess.build()); But how can I parse that…
Overholt
  • 867
  • 1
  • 10
  • 23
21
votes
2 answers

What is application's site of origin and when to use it

What is application's site of origin When to use it How is the build action of a resource file associated with it What is the difference between pack://application:,,, and pack://siteoforigin:,,,
sudarsanyes
  • 3,156
  • 8
  • 42
  • 52
20
votes
4 answers

Java equivalent of Python's struct.pack?

Is there any function equivalent to Python's struct.pack in Java that allows me to pack and unpack values like this? pump_on = struct.pack("IIHHI", 0, 0, 21, 96, 512)
thiruvadi
  • 251
  • 1
  • 3
  • 5
19
votes
1 answer

pragma pack(1) nor __attribute__ ((aligned (1))) works

My code used to work in the past, but now the struct size suddenly is 16 bytes. It used to be 13 bytes. I recently upgraded from Xcode 4.2 to Xcode 4.3.1 (4E1019). #pragma pack(1) struct ChunkStruct { uint32_t width; uint32_t height; …
neoneye
  • 50,398
  • 25
  • 166
  • 151
17
votes
7 answers

What is the suggested way to cron-automate ZODB packs for a production Plone instance?

Looking at plone.org to find a way to periodically pack my instance's ZODB I could only find http://plone.org/documentation/faq/how-do-i-pack-the-zodb that doesn't talk about automated packs, but just manually initiated ones. I know I can simulate…
silviot
  • 4,615
  • 5
  • 38
  • 51
17
votes
4 answers

How to pack a tkinter widget underneath an existing widget that has been packed to the left side?

I'm attempting to write a basic Tkinter GUI that has a Text widget at the top, then a Button widget left aligned under it, then another Text widget underneath the button. The problem I'm having is, after packing the Button widget to the left, when…
Bryce Thomas
  • 10,479
  • 26
  • 77
  • 126
14
votes
1 answer

How to add the "Action Bar Icon Pack" to Android Studio

I've just downloaded the Action Bar Icon Pack from https://developer.android.com/design/downloads/index.html, and I've not been able to figure out a way to "install" these icons in Android Studio... Should I copy&paste it to the res/drawable folder,…
Jausk
  • 325
  • 1
  • 3
  • 11
14
votes
2 answers

Python struct.pack() for individual elements in a list?

I would like to pack all the data in a list into a single buffer to send over a UDP socket. The list is relatively long, so indexing each element in the list is tedious. This is what I have so far: NumElements = len(data) buf =…
user1636547
  • 304
  • 1
  • 3
  • 13
13
votes
3 answers

When would you use unpack('h*' ...) or pack('h*' ...)?

In Perl, pack and unpack have two templates for converting bytes to/from hex: h    A hex string (low nybble first). H    A hex string (high nybble first). This is best clarified with an example: use 5.010; # so I can use say my $buf =…
cjm
  • 61,471
  • 9
  • 126
  • 175
1
2 3
45 46