compression

Automate zip file reading in R

浪子不回头ぞ 提交于 2019-11-27 19:23:32
I need to automate R to read a csv datafile that's into a zip file. For example, I would type: read.zip(file = "myfile.zip") And internally, what would be done is: Unzip myfile.zip to a temporary folder Read the only file contained on it using read.csv If there is more than one file into the zip file, an error is thrown. My problem is to get the name of the file contained into the zip file, in orded to provide it do the read.csv command. Does anyone know how to do it? UPDATE Here's the function I wrote based on @Paul answer: read.zip <- function(zipfile, row.names=NULL, dec=".") { # Create a

Is it possible to compress video on Android? [closed]

纵饮孤独 提交于 2019-11-27 19:07:00
I want to do video compression. Actually in my application I want to have two options, one is low and another is high. If I choose the low option then the application will compress the video and then upload it. If I choose high then it will upload the original video which I have recorded itself. I want to do this thing in my application and I'm confused. I have searched google a lot but I'm not able to find the useful way to solve this question please if anyone can help me out. I used ffmpeg4android , And was able to achieve this in about 10min using only java, Note that its a commercial

Create normal zip file programmatically

做~自己de王妃 提交于 2019-11-27 18:59:42
I have seen many tutorials on how to compress a single file in c#. But I need to be able to create a normal *.zip file out of more than just one file. Is there anything in .NET that can do this? What would you suggest (baring in mind I'm under strict rules and cannot use other libraries) Thank you Edit: if you're using .Net 4.5 or later this is built-in to the framework For earlier versions or for more control you can use Windows' shell functions as outlined here on CodeProject by Gerald Gibson Jr . I have copied the article text below as written (original license: public domain ) Compress Zip

ZLIB Decompression - Client Side

耗尽温柔 提交于 2019-11-27 18:51:55
I am receiving data as an " ZLIB " compressed inputstream. Using Javascript/Ajax/JQuery, I need to uncompress it on the client side. Is there a way to do so? Please help. I already have this working in JAVA as below, but need to do this on Client Side. url = new URL(getCodeBase(), dataSrcfile); URLConnection urlConn = url.openConnection(); urlConn.setUseCaches(false); InputStream in = urlConn.getInputStream(); InflaterInputStream inflate = new InflaterInputStream(in); InputStreamReader inputStreamReader = new InputStreamReader(inflate); InputStreamReader inputStreamReader = new

Compressing big number (or string) to small value

自闭症网瘾萝莉.ら 提交于 2019-11-27 18:36:48
问题 My ASP.NET page has following query string parameter: …?IDs=1000000012,1000000021,1000000013,1000000022&... Here IDs parameter will always have numbers separated by something, in this case , . Currently there are 4 numbers but normally they would be in between 3 and 7 . Now, I am looking for method to convert each big number from above into smallest possible value; specifically compressing value of IDs query string parameter. Both, compressing each number algorithm or compressing whole value

Best compression algorithm for XML?

≡放荡痞女 提交于 2019-11-27 18:31:58
I barely know a thing about compression, so bear with me (this is probably a stupid and painfully obvious question). So lets say I have an XML file with a few tags. <verylongtagnumberone> <verylongtagnumbertwo> text </verylongtagnumbertwo> </verylongtagnumberone> Now lets say I have a bunch of these very long tags with many attributes in my multiple XML files. I need to compress them to the smallest size possible. The best way would be to use an XML-specific algorithm which assigns individual tags pseudonyms like vlt1 or vlt2. However, this wouldn't be as 'open' of a way as I m trying to go

Using SharpZipLib to unzip specific files?

淺唱寂寞╮ 提交于 2019-11-27 18:31:13
I'm trying to use SharpZipLib to pull specified files from a zip archive. All of the examples I've seen always expect that you want to unzip the entire zip, and do something along the lines of: FileStream fileStreamIn = new FileStream (sourcePath, FileMode.Open, FileAccess.Read); ZipInputStream zipInStream = new ZipInputStream(fileStreamIn); ZipEntry entry; while (entry = zipInStream.GetNextEntry() != null) { // Unzip file } What I want to do is something like: ZipEntry entry = zipInStream.SeekToFile("FileName"); As my needs involve using a zip as a package and only grabbing files into memory

How to Compress/Decompress tar.gz files in java

柔情痞子 提交于 2019-11-27 18:30:05
Can anyone show me the correct way to compress and decompress tar.gzip files in java i've been searching but the most i can find is either zip or gzip(alone). My favorite is plexus-archiver - see sources on GitHub . Another option is Apache commons-compress - (see mvnrepository ). With plexus-utils, the code for unarchiving looks like this: final TarGZipUnArchiver ua = new TarGZipUnArchiver(); // Logging - as @Akom noted, logging is mandatory in newer versions, so you can use a code like this to configure it: ConsoleLoggerManager manager = new ConsoleLoggerManager(); manager.initialize(); ua

Can gzip compression be selectively disabled in ASP.NET/IIS 7?

ぃ、小莉子 提交于 2019-11-27 18:25:50
I am using a long-lived asynchronous HTTP connection to send progress updates to a client via AJAX. When compression is enabled, the updates are not received in discrete chunks (for obvious reasons). Disabling compression (by adding a <urlCompression> element to <system.webServier> ) does solve the problem: <urlCompression doStaticCompression="true" doDynamicCompression="false" /> However, this disables compression site-wide. I would like to preserve compression for every other controller and/or action except for this one. Is this possible? Or am I going to have to create a new site/area with

Minifying final HTML output using regular expressions with CodeIgniter

a 夏天 提交于 2019-11-27 17:38:30
Google pages suggest you to minify HTML, that is, remove all the unnecessary spaces. CodeIgniter does have the feature of giziping output or it can be done via .htaccess . But still I also would like to remove unnecessary spaces from the final HTML output as well. I played a bit with this piece of code to do it, and it seems to work. This does indeed result in HTML that is without excess spaces and removes other tab formatting. class Welcome extends CI_Controller { function _output() { echo preg_replace('!\s+!', ' ', $output); } function index(){ ... } } The problem is there may be tags like