pack

Perl pack/unpack/shift

I've been having this problem in Perl for a few days now, and after scouring countless man pages, perldocs and googling too many search terms, hopefully someone here can help me out. I am given two strings which represent hex values, i.e. "FFFF", not the Perl hex number 0xFFFF. Given two of these strings, I wish to convert them to bina...

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) ...

Convert simple code from Perl to PHP (issue)

Possible Duplicate: Convert a Perl code to PHP Hello all, I don't know much in Perl and I'm having problems converting a simple code from Perl to PHP: here is the code: pack("SSA12AC4L", $id, $loc, $name, 'ar', $get->getIP), time))...

Convert a Perl code to PHP

Hi; I need to convert the following perl function to php: pack("SSA12AC4L", $id, $loc, $name, 'ar', split(/\./, $get->getIP), time+(60*60); I use the following code (to test) in PHP: echo pack("SSA12AC4L", '25', '00001', '2u7wx6fd94fd', 'f', preg_split('/\./','10.2.1.1', -1, PREG...

Question to pack() method

I'm building a GUI application, and within a JFrame i have 2 jcombobox's and a JPanel to view certain data. Now when i call the pack() methode in the main class it puts the two jcombobox'es next to my JPanel, which i dont want, because I want them North. Ofcourse I've tried to hard-code it in my code, but it doesn't work after I've calle...

PHP: path / unpack 64bit int in 64bit architecture

Can anyone tell me why I get the following output on x64 architecture: $ php -r 'echo pow(2, 33) . "\n";print_r(unpack("Ivalue", pack("I", pow(2, 33))));' 8589934592 Array ( [value] => 0 ) It seems as though it can handle signed 64bit ints, but can't pack / unpack them. According to the docs: http://us3.php.net/pack, the size of ...

How do I compare packed values in Perl?

I want to use the pack() function in Perl to encode some data. Then I want to compare my packed structure to another packed structure. I want this compare to be on the byte values of this packed structure. According to the documentation, cmp uses the current locale to determine how to compare strings. But I don't want any intelligence a...

How to make an Ant task to sign and pack200 all my JAR files?

My JAR files must be signed for a webstart application. It would be nice to also have them packed to minimize the download time. I'm trying to configure an Ant task to automatically do it during the deploy of the application. Since the pack process reorganizes the jar internal structure invalidating the signature, the Pack200 documentati...

Can/Should I run svnadmin pack on a mirrored repository

We're mirroring a 1.6 repo using svnsync. We run svnadmin pack once a week on the master repo, but I'm wondering if we can or should also run it on the mirrored repository. From what I understand of SVN internals, the filesystem changes svnadmin pack makes would not be mirrored (which makes sense I guess). Can someone confirm if I can/sh...

exception in initializer error

I am using Netbeans. I did some things with bindings and now whenever I start my program, before it even intializes the form, it gives me an error The exception in thread main is ocuring before the form is even an intialized object yet. The form is not even an object yet. Every line in my main() causes an exception. Random stuff. ...

Convert python pack to php pack

Hi, I have this python script b_string = pack('>hqh2sh13sh5sh3sBiiihiiiiii', 21, 0, len(country), country, len(device), device, len('1.3.1'), "1.3.1", len('Web'), "Web", 27, 0, 0, 3, 0, cid, lac, 0, 0, 0, 0) ...

How to detect if "Web Services Feature Pack for WebSphere" is installed in Websphere server?

How do I detect if "Web Services Feature Pack for WebSphere "is installed in Websphere Application Server v6.1? I need this information to solve some classloading issues while deploying cxf webservices in Websphere. ...

How can I get the number of pack`ed items in Perl without actually unpacking?

I have a string of packed values which was created sequentially using something like: while (...) { ... $packed .= pack( 'L', $val ); } In another program, after I load $packed, I wish to find out how many values were actually packed. I know how to do that after unpacking: my @vals = unpack( 'L*', $packed ); print scalar(@vals); ...

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 = "\x12\x34\x56\x78"; say unpack('H*', $buf); # prints 12345678 say unpack('h*', $buf); # prints...

WordPress Mobile Pack Custom Page Template

Heya, Hoping someone can help. I've inherited a WP based website which has WPMP already installed & activated & working on it (I can see it work on many pages). I've had to create a custom template & a few pages that use this template. Unfortunately, when I switch to mobile mode (or check out the new pages on my iPhone), no posts show...

Problem with sending an array using 'pack' function in perl

Hi All, I am using pack function to send contents of a list to a socket. Code is given below. $message_array = pack ("(A*)*", @ul_dcch_message); The list contents are @ul_dcch_message = (101101012411011, "emergency", 25, "simple"); This piece of code sends all the strings and numbers contained in the list. But if the numbers prese...

Powershell pack uri object

I'm trying to create a pack ui referencing a xaml resource inside of an assembly file in powershell. After reading this post I tried to do this: $resource = new-object system.uri("pack://application:,,,/WPFResource;component/test.xaml") The I get an error noting that it is expecting a port since there are two colons. Can anyone pleas...