compression

How to unpack the contents of a JavaScript file?

流过昼夜 提交于 2019-11-27 02:15:59
问题 You know how those packed js files look like, right? eval(function(p,a,c,k,e,d){ ... } ('obfuscated-string'.split('|'),0,{})) It just so happens to be that i have to tweak some large legacy code that looks like that and I want to find a way to turn this into a more readable version. If that's not possible, can i at least get rid of the eval? 回答1: You can with online unpackers: try one of these, find one that suits you: Dean Edwards Unpacker JSUnpack 回答2: JS Beautifier will both reformat and

Compress large Integers into smallest possible string

 ̄綄美尐妖づ 提交于 2019-11-27 01:57:05
问题 I have a bunch of 10 digit integers that I'm passing in a URL. Something like: "4294965286", "2292964213". They will always be positive and always be 10 digits. I'd like to compress those integers into the smallest possible form that can still be used in in a URL (aka letters and numbers are perfectly fine) and then uncompress them later. I've looked at using gzipstream but it creates larger strings, not shorter. I'm currently using asp.net so a vb.net or c# solution would be best. Thanks 回答1

Is it better to encrypt a message and then compress it or the other way around? Which provides more security?

流过昼夜 提交于 2019-11-27 01:53:06
问题 I have the assumption there is no added protection at all. 回答1: There is no difference in the security provided, but because of the way compression algorithms work, you are probably going to get better compression if you compress first then encrypt. Compression algorithms exploit statistical redundancies (such as those that exist in natural language or in many file formats) in the data which should be eliminated when you encrypt it, therefore an encrypted message shouldn't be able to be

How can I skip compressing one PNG?

删除回忆录丶 提交于 2019-11-27 01:45:45
(Note: I have solved this problem, but it took long enough that I'm posting question/answer here.) The Xcode build process "optimizes" my PNGs when building. This isn't usually a problem, but iTunesArtwork being processed in this way causes corrupts it so that iTunes not to be able to show it. How can I prevent this? You can read more about Xcode's PNG compression here: http://iphonedevelopment.blogspot.com/2008/10/iphone-optimized-pngs.html While you can turn off PNG optimization/compression entirely using "Compress PNG Files" in your project settings (it's visible only if the project's Base

Zlib compression Using Deflate and Inflate classes in Java

一世执手 提交于 2019-11-27 01:23:48
问题 I want trying to use the Deflate and Inflate classes in java.util.zip for zlib compression. I am able to compress the code using Deflate, but while decompressing, I am having this error - Exception in thread "main" java.util.zip.DataFormatException: unknown compression method at java.util.zip.Inflater.inflateBytes(Native Method) at java.util.zip.Inflater.inflate(Inflater.java:238) at java.util.zip.Inflater.inflate(Inflater.java:256) at zlibCompression.main(zlibCompression.java:53) Here is my

High quality JPEG compression with c#

China☆狼群 提交于 2019-11-27 01:17:13
I am using C# and want to save images using JPEG format. However .NET reduces quality of the images and saves them with compression that is not enough. I want to save files with their original quality and size. I am using the following code but compression and quality are not like the original ones. Bitmap bm = (Bitmap)Image.FromFile(FilePath); ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); ImageCodecInfo ici = null; foreach (ImageCodecInfo codec in codecs) { if (codec.MimeType == "image/jpeg") ici = codec; } EncoderParameters ep = new EncoderParameters(); ep.Param[0] = new

JavaScript: Decompress / inflate /unzip /ungzip strings [closed]

旧城冷巷雨未停 提交于 2019-11-27 01:15:30
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm looking for JavaScript implementation of string inflating algorithms. I want to compress on the server side (Java), and decompress on the client side (JavaScript). I've found: unzip strings in javascript That one is marked as answered with an answer for different problem. Other answers are also for something

python zipfile module doesn't seem to be compressing my files

柔情痞子 提交于 2019-11-27 01:13:20
问题 I made a little helper function: import zipfile def main(archive_list=[],zfilename='default.zip'): print zfilename zout = zipfile.ZipFile(zfilename, "w") for fname in archive_list: print "writing: ", fname zout.write(fname) zout.close() if __name__ == '__main__': main() The problem is that all my files are NOT being COMPRESSED! The files are the same size and, effectively, just the extension is being change to ".zip" (from ".xls" in this case). I'm running python 2.5 on winXP sp2. 回答1: This

How do you unzip very large files in python?

五迷三道 提交于 2019-11-27 01:04:06
Using python 2.4 and the built-in ZipFile library, I cannot read very large zip files (greater than 1 or 2 GB) because it wants to store the entire contents of the uncompressed file in memory. Is there another way to do this (either with a third-party library or some other hack), or must I "shell out" and unzip it that way (which isn't as cross-platform, obviously). Here's an outline of decompression of large files. import zipfile import zlib import os src = open( doc, "rb" ) zf = zipfile.ZipFile( src ) for m in zf.infolist(): # Examine the header print m.filename, m.header_offset, m.compress

Tools to optimize (remove redundancy and merge) CSS? [closed]

安稳与你 提交于 2019-11-27 00:56:49
问题 I'm searching for a good CSS compress, merge and optimization tool. I have found tools that clean the CSS but they don't optimize the overwrites. Here is a basic example: a{color:#000} and on another line the a color is overwritten with this: a{color:#fff} Does anyone know of a tool that can clean the unused CSS, that was overwritten and keep just the applied style? 回答1: I don't particularly understand what you mean by "clean unused CSS", but in any case, I'll throw two tools at you, and