I have an Erlang app which makes a large number of http client calls using inets. I'd like to reduce my bandwidth bill by accepting gzipped data from servers that provide it. Is there an inets option that would handle this ? [can't find one]. Is there a zip library anyone could recommend ? [I've looked at the stdlib zip library, but it seems only to unzip archives, rather than uncompress individual streams].
Thanks!
Look at zlib module. Look also at file:open/2 option compressed for possible future usage. Note that zip and zlib aka gzip is not same thing. I think you already note it.
Look at http://blog.gebhardtcomputing.com/2007/09/grab-webpage-in-erlang-which-is-gzipped.html for some inspiration, but you probably will need streaming which is well described in manual page.
I'd suggest to do compression/decompression at HTTP frontend (nginx, apache, etc). This will be more optimal.
Related
Is someone tried to extract XML to "Unipass" Programming Language? I've read a XML file then put it on a blob virtual, From there i want i get the data inside .
<patient>
<name>
<given>Henry</given>
<family>Sovelen</family>
<suffix>The 6th</suffix>
</name>
<administrativeGenderCode code="M" codeSystem="2.16.840.1.113883.5.1"/>
<birthTime value="19320924"/>
</patient>
Can someone teach me how to get the value 'Henry' Using unipaas programming language and btw i also used .xsl for stylesheet for that one
UniPaas (previously know as Magic, or eDeveloper, or xpa) is able to read XML directly. XML is one of data sources available for UniPaas; there are gateways for MSSQL Server, Oracle, DB2, MySQL and finally ODBC (which covers pretty much all other sources).
Luckily for you, no need to install support for XML, it's in UniPaas by default.
Since you are new to UniPaas and data sources, I'd recommend to see this video.
Once you have XML connected, you can use APG (automatic program generator) feature to quickly generate simple export-import program.
I'd strongly advice to install "On-line" samples, in Chapter 14 you can find example for XML data (see image below).
Let me know if you need more detail. UniPaas is really powerful tool, but it's "strange kind of animal" and can be confusing at the start.
I am writing an application for iOS and a requirement I have been given is to remove files securely from the file system that may be given to my app from other applications (think 'Open in...'). These files are placed in a temp folder accessible to my app, but I'd like to securely delete these files once I have encrypted them in my own documents folder via the standard protection APIs. Any idea how to do that?
Quotes from the paper linked to by Bavarious:
We found that none of the available software techniques for sanitizing individual files were effective.
Overall, we conclude that the increased complexity of SSDs relative to hard drives requires that SSDs provide verifiable sanitization operations.
I'm not sure the flash memory in iPhones supports these operations, but if they do I'm pretty sure that Apple will have to make them available through their API and I haven't found anything in the API for this.
So basically it doesn't seem to be possible. Perhaps you could file a bug report with Apple and ask them to fix something like this.
I think you're better of looking into the possibility to encrypt the file before saving it.
I am trying to deserialize an old file format that was serialized in Delphi, it uses binary seralization. I know nothing about the structure of the file except some very high level records that are in it.
What steps would you take to solve this problem? Any tools etc?
A good hexeditor, and use the gray matter to identify structures.
If you get a hint what kind of file it is, you can search for more specialized tools.
Running the unix/Linux "file" command can be good too (*) See Barry's comment below for how it works. It can be a quick check for common filetypes like DBF,ZIP etc hidden by using a different extension.
(*) there are 3rd party builds for windows, but they might lag in versions. If you can do it on a recent *nix distro, it is advised to do so.
The serialization process simply loops over all published properties and streams their value to a text file. If you do not know the exact classes that were streamed to the file you will have a very hard time deserializing the file. (if not impossible)
A good hex editor is first. If the file is read without buffering (eg read directly from a TFileStream) you could gain some information when using ProcMon from SysInternals; You can see exactly what data is read in what chunks and thus determine more quickly where the boundaries are between the structures you already identified.
this is quite a difficult topic by all accounts. I am building a website that requires users to upload large (multi-GB). What is the best way allow users to upload a file on a website and allow the file upload to be resumed should it fail? What is the way to write this in rails?
Any ideas greatly appreciated.
Max.
No browsers support resuming uploads.
From my Googling, Flash doesn't seem to, either.
Though I don't know enough about Java to say it's impossible, there don't seem to be any pre-rolled upload solutions that support this method.
In short, you would have to code your own out-of-browser/plugin solution. If that is not feasible, you may have to abandon this feature. Sorry!
EDIT: Actually, after using a better search query, here's a Java solution that seems to support this through partitioning the initial file: JumpLoader. Here is the documentation page for resuming downloads. Best of luck! (You will note that there are purchase links - this is only for an unbranded version, and for the source code. You can use the JumpLoader branded version for free.)
No browser support this, In fact this cannot be done over HTTP.
You will have to write your own java applet, ActiveX control or WPF browser application to achieve this. Any of this will speak to a TCP server listening on the server side to achieve pause-and-resume upload of file.
Six years since you asked, but for future viewers, take a look at ResumableJS. It uses HTML5 File API to break uploads into chunks. They also include a RoR example for accepting the upload.
I'm looking for a free, preferably open source, http image processing server. I.e. I would send it a request like this:
http://myimageserver/rotate?url=http%3A%2F%2Fstackoverflow.com%2FContent%2FImg%2Fstackoverflow-logo-250.png&angle=90
and it would return that image rotated. Features wanted:
Server-side caching
Several operations/effects (like scaling, watermarking, etc). The more the merrier.
POST support to supply the image (instead of the server GETting it).
Different output formats (PNG, JPEG, etc).
Batch operations
It would be something like this, but free and less SOAPy. Is there anything like this or am I asking too much?
The ImageResizing.Net library is both a .NET library and an IIS module. It's an image server or an image library, whichever you prefer.
It's open-source, under an MIT-style license, and is supported by plugins.
It has excellent performance, and supports 3 pipelines: GDI+, Windows Imaging Components, and FreeImage. WIC is the fastest, and can do some operations in under 15ms. It supports disk caching (for up to 1 million files), and is CDN compatible (Amazon CloudFront is ideal).
It has a very human-friendly URL syntax. Ex. image.jpg?width=100&height=100&mode=crop.
It supports resizing, cropping, padding, rotation, PNG/GIF/JPG output, borders, watermarking, remote URLs, Amazon S3, MS SQL, Amazon CloudFront, batch operations, image filters, disk caching, and lots of other cool stuff, like seam carving.
It doesn't support POST delivery of images, but that's easy to do with a plugin. And don't you typically want to store images that are delivered via POST instead of just replying to the POST command with the result?
[Disclosure: I'm the author of ImageResizer]
Apache::ImageMagick, you install that - and also Apache along with mod_perl. This is the standard setup, check docs, there are alternatives. This is probably as turn-key as it gets.
Sample conf:
<Location /img>
PerlFixupHandler Apache::ImageMagick
PerlSetVar AIMCacheDir /tmp/your/cache/directory
</Location>
Your requests could look like:
http://domain/img/test.gif/Frame?color=red
More docs are here!
While not an out of the box solution, check out ImageMagick. There is a perl interface for it, so combine that with some fairly simple cgi scripts, or mod_perl and it should do the trick.
You can use LibGD or ImageMagick to build a service like that fairly easily. They both have many language bindings.
You could make this with Google App Engine -- they provide image processing routines and will host for free within some bounds.
Here are some examples of people doing things like this already
http://appgallery.appspot.com/results?q=image
I found this product, it seems to match my requirements
Try Nginx image processing server with OpenResty and Lua. It uses ImageMagick C API. Openresty comes with LuaJIT. It has amazing performance in terms of speed. Checkout some benchmarks for LuaJIT and Openresty.