Is there any Python project/module working on a binary plist writer? I need one for a REST implementation I'm doing. I would like the server to send a HTTP REsponse containing a binary plist instead of json, for example. The server is Apache with mod_python and django installed. Considering adding bplist format alongside json as output formats, just inorder to simplify parsing on the iPhone, plus cutting the data transfers down.
I'm thinking of writing my own, but contributing to an existing project would be prefereable.
Thanks in advance.
I was afraid I might have to learn SWIG, implement this myself, or switch to another language for this hobby project that involves parsing binary plists -- but after a quick pip search plist, I found biplist.
What about plistlib in the default Python distribution? It is available for all platforms since Python 2.6; before Python 2.6, it was included in the Mac version, but I guess you can simply grab the source from Python 2.6 and backport it if you really need to support older Python versions.
Update: Sorry, I've just realised that you need to support the binary plist format. In that case, use libplist, which supports both the binary and the XML format. It is written in C++, but they provide a SWIG interface definition file with which SWIG can easily generate a Python module for it. Ubuntu/Debian also includes a package called python-plist which contains precompiled binaries.
Related
I am trying window socket programming in c++.I am using winsock2.h for this purpose.i am doing this in code blocks using GNU GCC and getting errors as shown in attachment as you can see.This is important to know that I trying just client server model.
I am not putting my code here because code is available on msdn(I have just copied from there).I am just providing link
Server code
https://msdn.microsoft.com/en-us/library/windows/desktop/ms737593(v=vs.85).aspx
client code
https://msdn.microsoft.com/en-us/library/windows/desktop/ms737591(v=vs.85).aspx
Posted a comment, but confident enough to make an answer...
The screenshot you included shows Linker errors, so everything is probably compiling correctly. To use WinSock2, your program must link with Ws2_32.lib, which is a standard system library included with the Windows SDK.
SDK stands for Software Development Kit. It contains many header files and libraries that are needed to write software for Windows. Sorry if this is too basic, but... You included the header file WinSock2.h. That header only includes the declarations for all the WinSock functions - just a description of the functions. The function definitions (the code for the functions) is located in a library that you have to "link" with. In some cases you will get source code for a library that you can compile with, but most of the time you will only get a pre-compiled LIB file such as Ws2_32.lib. The Windows SDK contains the LIB files for most of the programs you can write for Windows.
For more information search for "linking", "Win32 libraries", and "dynamic link libraries" (DLLs).
I've just read this paper which presents the BSDiff tool as a method to diff-and-patch binary files. I wonder whether these types of tools are good and suitable in systems which can't afford any kind of error in this process.
I'm working in an embedded project and we are looking for ways to update the bootloader image without transferring the whole new version, but only small pieces. The binary image that we want to update, encompasses not only the application we've developed but also the OS (FreeRTOS) and third party libraries.
Try this implementation of BSDiff:
https://github.com/Cheedoong/bsdiff
Cross-platform, and with no dependency on other library.
My web application is getting bigger and bigger, now is 25Mb. I have to upload it everytime and takes a while with my DSL. I was thinking of using a binary patch system, but I can't find a good one. Requirements:
Work on Linux and Windows
(Desired) be available on Amazon Ec2 linux via yum
Easy to integrate in scripts
Suggestions? Alternative ways of doing this?
Considering that a war file is nothing more than a zip file, my guess is that tiny little changes to one file could potentially modify the whole binary (such is the nature of compression) so binary patching really doesn't make sense since you might be sending the whole thing each time anyway.
Instead may I suggest that you simply explode the war file and use something like rsync to keep the contents up to date? I'd think this would be less of a headache while accomplishing the same thing.
For Linux: bsdiff/bspatch
The bsdiff package is also available under cygwin.
I'm trying to write an SSH client for the iPhone, and I'd like to use the libssh2 open source library to do so. It's written in C.
How should I include this C library for my iPhone app? Should I compile it into some binary that I include into the my app, or do I add all the source to my project and try to compile it along with the rest of my app?
I'm interpretting this question as:
"Should I compile the C library code once, and include the binary library in my project? Or should I include all the source and compile it every time I build my app?"
It depends. One of the projects I work one depends on several external libraries. Basically, we have a simple rule:
Do you think you will need to change code in the C library often?
If you will be changing the code, or updating versions often, include the source and build it with the rest of your project.
If you're not going to change the code often or at all, it might make sense to just include the pre-built binary in your project.
Depending on the size of the library, you may want to set it up as a distinct target in your project, or for even more flexibility, as a sub-project of your main project.
If I was in your place, I would build libssh2 ahead of time and just include the binary library in my iPhone project. I would still keep the libssh2 source around, of course, in case it does need to be re-built down the road.
I have an iPhone app that is 90% c. I have had no problem adding 3rd party sources to my project and compiling. I am using Lua, zLib, and libpng with no modifications. I've also included standard libraries like unistd and libgen and they just workâ˘
The Three20 iPhone library has a great howto on adding their library to your xcode project. Give that a shot.
I think you will find in the long run you will be better off building it into a standalone library and linking it with your application. This makes it easier to integrate into future apps. Another benefit is that it encourages code separation. If you feel pretty confident with the library, you can link your debug exe to the release build of the library and get some extra performance.
I can't really think of any downsides to creating a library, after the initial cost of setting it up, and having an extra project to modify if you have some changes that need to be made to all your projects. Even if you don't know how to make a library for the iPhone, this is a good excuse to learn.
Just adding the source to you project should work fine as well.
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?), but the more it can do (eg EXIF from images?) the better without compromising the ID3 tag reading abilities.
I'm interested in making a script that goes through my media (right now, my music files) and makes sure the file name and directory path correspond to the file's metadata and then create a log of mismatched files so I can check to see which is accurate and make the proper changes. I'm thinking Ruby or Python (see a related question specifically for Python) would be best for this, but I'm open to using any language really (and would actually probably prefer an application language like C, C++, Java, C# in case this project goes off).
There is a great post on using PowerShell and TagLibSharp on Joel "Jaykul" Bennet's site. You could use TagLibSharp to read the metatdata with any .NET based language, but PowerShell is quite appropriate for what you are trying to do.
use exiftool (it supports ID3 too). written in perl, but can also be used from the command line. it has a compiled windows and mac version.
it is light-years ahead of any other metadata tool, supporting almost all known audio, video and image files, supports writing (not just reading), and knows about all the custom/extended tags used by software (such as photoshop) and hardware (many camera manufacturers).
#Thomas Owens PowerShell is now part of the Common Engineering Criteria (as of Microsoft's 2009 Product Line) and starting with Serve 2008 is included as a feature. It stands as much of a chance to be installed as Python or Ruby. You also mentioned that you were willing to go to C#, which could use TagLibSharp. Or you could use IronPython...
#Thomas Owens TagLibSharp is a nice library to use. I always lean to PowerShell first, one to promote the language, and two because it is spreading fast in the Microsoft domain. I have nothing against using other languages, I just lean towards what I know and like. :) Good luck with your project.
Further to Anon's answer - exiftool is very powerful and supports a huge range of file types, not just images, but video, audio and numerous document formats.
A Ruby interface for exiftool is available in the form of the mini_exiftool gem
see http://miniexiftool.rubyforge.org/