pack

Windows API to determine Service Pack version

We're working on a device driver for Vista. There's a known bug in SPO (that was fixed in SP1). We have a workaround that only works in SP0 (and destroys the behavior in SP1). Is there a Windows API or another way to tell what Service Pack version is installed? (Programmatically). ...

CMFCRebar on a dialog box.......

Can we create a CMFCRebar on a dialog box? If yes, then how? I need to have a CMFCReBar drawn on a dialog box with a toolbar and and menubar. ...

Bit packing in C

I'm trying to convert an RGB image to an ARGB image, basically just adding 255 in for the alpha channel. I was wondering if there is any pack method to do this without iteration? So to iterate over my RGB data and append the 255 to each pixel. ...

Converting grouped hex characters into a bitstring in Perl

I have some 256-character strings of hexadecimal characters which represent a sequence of bit flags, and I'm trying to convert them back into a bitstring so I can manipulate them with &, |, vec and the like. The hex strings are written in integer-wide big-endian groups, such that a group of 8 bytes like "76543210" should translate to th...

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

Hi, I would like to know more about the pack() function in PHP: http://fi.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 kind and give me a practical demonstration when to use which formats? The online documentation, for cha...

Pack Notation in WPF

Hello, I have a question about pack notation. I'm trying to access a png image file within a XAML page from another resource assembly. Let's say the Resource Assembly (which is outside of the local assembly that my xaml file is in), is ResourceAssembly.Common.Resources and that my image is in ResourceAssembly.Common.Resources/Images/im...

Action Pack Subscription License Keys - Physical vs Virtual

I've noticed on my Action Pack Subscription there are new license keys for Windows Operating Systems that are labeled Physical and Virtual. There is no documentation on the site about what the differences are for those keys. I called Microsoft and got the run around. Eventually, the MS tech emailed me a snippet of text that described w...

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

Hi all, 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 I then go to pack the second Text widget, it puts it next to the button on the ri...

How do I convert Perl's pack 'Nc*' format to struct.pack for Python?

I'm trying to convert a Perl script to python, and it uses quite a few different packs. I've been able to figure out the lettering differences in the "templates" for each one, but I'm having an issue with understanding how to handle Perl's lack of length declaration. example: pack('Nc*',$some_integer,$long_array_of_integers); I don't...

Wrong packing of JFrame using JPanel in borderlayout

Hello there. I am writing a simple application in Java that does some particle simulation on a bunch of sheep (don't ask). For this I want a window with a JPanel for graphics (which will be resizable with a simple combobox that contains some standard resolutions) and some other elements like buttons to start and pause the simulation etc....

Does svnadmin pack work on non-upgraded 1.6 repos?

I've been attempting to run svnadmin pack on repos that were originally created with SVN 1.6. However, I see no output to suggest the command is doing anything. Is it the case that shard packing occurs automatically for native 1.6 repos (as opposed to on-demand for upgraded repos)? The output I expect to see is: $ svnadmin pack /var/svn...

Need help with "pack" for perl and php

Hello! I've the task to convert a crypt function someone made in perl into php code. Everything works okay except this: Perl: $wert = Encode::encode( "utf8", $wert ); $len=length $wert; $pad = ($len % 16)?"0".chr(16 - ($len % 16)):"10"; $fuell = pack( "H*", $pad x (16 - $len % 16)); PHP: $wert = utf8_encode($wert); $len = mb_strlen...

jQuery Linking vs. Download?

Which way is better? To link to the jQuery Pack at http://ajax.googleapis.com. Or to download the appropriate file and link locally? Does it matter? Is there a chance the link may disappear? Or is there a chance the file online will be updated, and it's better to link to it? Curious. Thanks, Tracy ...

How can I handle packed data from Perl/PHP in C++?

I got a problem implementing a PHP programm in C++. It is about the PHP/Perl function unpack. I don't know how to do the follwing in C++ (no problem in reading a file... but how do i unpack("C*") the read contents). <?php $file = fopen("bitmaskt.dat", "rb"); //create the data stream $matrix_x = unpack("C*", fread($file, 286));...

Finding <div> in html using C#

I've seen some results on StackOverflow already on a similar topic and they all recommended the HTML Agility Pack. I've also found a few examples on it too, but it isn't working. My current code: HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml("http://stackoverflow.com/"); List...

How can I convert a 48 hex string to bytes using Perl?

I have a hex string (length 48 chars) that I want to convert to raw bytes with the pack function in order to put it in a Win32 vector of bytes. How I can do this with Perl? ...

Python: How to transfer varrying length arrays over a network connection

Hi, I need to transfer an array of varying length in which each element is a tuple of two integers. As an example: path = [(1,1),(1,2)] path = [(1,1),(1,2),(2,2)] I am trying to use pack and unpack, however, since the array is of varying length I don't know how to create a format such that both know the format. I was trying to turn...

How do I unpack a binary string in PHP?

How can I do this Perl code in PHP? print unpack ("H*", pack ("B*", "00000000100000012000000" )); ...

How to print a variable in reversed byte order in Perl?

Hi, I'am trying to convert the variable $num into its reverse byte order and print it out. This is what I have done so far: my $num=0x5514ddb7; my $s=pack('I!',$num); print "$s\n"; He prints it out as some non-printable characters and in a hex editor it looks right, but how can I get it readable on the console? Already tried print ...

What disables #pragma pack(push)?

Hi All, I have a code that uses #pragma pack(push,8) but it does not seem to take effect somehow but I can't figure out what's causing this problem. For example, look at the following code. #include <windows.h> #include <stdio.h> #pragma pack(push, 8) typedef struct _MY_DATA { LARGE_INTEGER a; LARGE_INTEGER b; ULONG count; } MY_D...