extraction

Zip entry name ends in directory separator character but contains data

折月煮酒 提交于 2019-12-01 07:55:25
问题 System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extractPath); Using ZipFile in C#, I'm trying to extract a file from a known location and it is throwing the following error: System.IO.Exception: Zip entry name ends in directory separator character but contains data I've done some research, ExtractToDirectory is explained in MSDN but couldn't find this error definition. Would you be able to explain why this error is happening? From MSDN: IOException The directory specified by

Javascript regular expression for extracting Youtube video ids

允我心安 提交于 2019-12-01 07:28:05
问题 The following code is used to get Youtube video ids in order to get a thumbnail image. What is the reasoning behind the first regular expression and what is it doing exactly? It appears to be returning at least two results. Also, could the two be combined? else if(url.match("youtube.com/")){ var vid; var results; //http://www.youtube.com/watch?v=GItD10Joaa0 results = url.match("[\\?&]v=([^&#]*)"); vid = ( results === null ) ? url : results[1]; return "http://img.youtube.com/vi/"+vid+"/2.jpg";

Libarchive to extract to a specified folder?

。_饼干妹妹 提交于 2019-12-01 06:54:13
Anybody can help show examples of using libarchive to extract ZIP files to a specified folder? It looks like the sample programs provided ( untar.c , tarfilter.c and minitar ) all extracts the archive to the current working directory. Is there a way to say "extract to this folder and below" to libarchive and not clobber the program's active folder? One of the main drivers is that the extraction code will be run in a background thread, and thus changing the program working directory may create problems. Also this will be used in an iOS application (iPhone, iPad), which is picky on what folders

Libarchive to extract to a specified folder?

天大地大妈咪最大 提交于 2019-12-01 05:07:10
问题 Anybody can help show examples of using libarchive to extract ZIP files to a specified folder? It looks like the sample programs provided ( untar.c , tarfilter.c and minitar ) all extracts the archive to the current working directory. Is there a way to say "extract to this folder and below" to libarchive and not clobber the program's active folder? One of the main drivers is that the extraction code will be run in a background thread, and thus changing the program working directory may create

How can I extract a resource into a file at runtime?

荒凉一梦 提交于 2019-12-01 02:57:13
I want to distribute only a single .exe, however, at runtime I would like it to extract some embedded image resources to the users hard disk drive. Can I, and if so, how? Use Delphi's TResourceStream. It's constructor will find and load the resource into memory, and it's SaveToFile method will do the disk write. Something similar to this should work: var ResStream: TResourceStream; begin ResStream := TResourceStream.Create(HInstance, 'YOURRESOURCENAME', RT_RCDATA); try ResStream.Position := 0; ResStream.SaveToFile('C:\YourDir\YourFileName.jpg'); finally ResStream.Free; end; end; If you can use

Extracting URL link using regular expression re - string matching - Python

我与影子孤独终老i 提交于 2019-12-01 01:04:44
I've been trying to extract URLs from a text file using re api. any link that starts with http:// , https:// and www. the file contains texts as well as html source code, html part is easy because i can extract them using BeautifulSoup, but normal text seems to be more challenging. I found this online which seems to be the best implementation of URL extraction however it fails on certain tags, specially it can't handle tags and includes them in the URL. any help is appreciated, because I'm not familiar with string matching at all myself here is the signature sp1=re.findall("http[s]?://(?:[a-zA

Java - Regex extract date from string

痴心易碎 提交于 2019-11-30 23:11:01
I need to extract date from this string: BB inform: buy your tickect, final card number xxxx, $ 00,00, on 04/10, at 11:28. If you don't recognize call 40032 2412. Also The full date 04/10/2015 The date pattern is dd/MM or dd/MM/yyyy The code: String mydata = "BB inform: buy your tickect, final card number xxxx, $ 00,00, on 04/10, at 11:28. If you don't recognize call 40032 2412."; Pattern p = Pattern.compile("(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\\d\\d"); Matcher m = p.matcher(mydata); Result: m.matches() == false You can try with this regex : Matcher m = Pattern.compile("

R, tm-error of transformation drops documents

烈酒焚心 提交于 2019-11-30 20:20:50
I want to create a network based on the weight of keywords from text. Then I got an error when running the codes related to tm_map: library (tm) library(NLP) lirary (openNLP) text = c('.......') corp <- Corpus(VectorSource(text)) corp <- tm_map(corp, stripWhitespace) Warning message: In tm_map.SimpleCorpus(corp, stripWhitespace) : transformation drops documents corp <- tm_map(corp, tolower) Warning message: In tm_map.SimpleCorpus(corp, tolower) : transformation drops documents The codes were working 2 months ago, now I'm trying for a new data and it is not working anymore. Anyone please shows

Extracting URL link using regular expression re - string matching - Python

旧城冷巷雨未停 提交于 2019-11-30 19:46:04
问题 I've been trying to extract URLs from a text file using re api. any link that starts with http:// , https:// and www. the file contains texts as well as html source code, html part is easy because i can extract them using BeautifulSoup, but normal text seems to be more challenging. I found this online which seems to be the best implementation of URL extraction however it fails on certain tags, specially it can't handle tags and includes them in the URL. any help is appreciated, because I'm

PDF table extraction

戏子无情 提交于 2019-11-30 17:44:25
I have (same) data saved as a GIF image file and as a PDF file and I want to parse it to HTML or XML. The data is actually the menu for my university's cafeteria. That means that there is a new version of the file that has to be parsed each week! In General, the files contain some header and footer text, as well as a table full of other data in between. I have read some posts on stackoverflow and I also had started some attempts to parse out the table data as HTML/XML: PDF PDFBox || iText (Java) Google Docs Import PDF2HTML || PDF2Table GIF Tesseract-OCR I have got the best result from parsing