extract

How to extract strings from plist files for translation (localization)?

本秂侑毒 提交于 2019-12-10 21:19:36
问题 I need to prepare list of strings for translation of my iPhone application. I have extracted strings from *.m files using genstring and from the XIB files using ibtool command. But I have also lots of texts to translate in plist files (String field types enclosed in string tag). Is there a nice bash script / command to extract those strings into a flat txt file? I could review and filter it so my translators can work with nice list but not with alien looking XML file. 回答1: I made a custom

Extract image data from EPS

拥有回忆 提交于 2019-12-10 21:15:35
问题 I have an encapsulated PostScript file which appears to only wrap an image file; the file is here. Is there a tool to extract the image data from it? 回答1: "convert" will use ghostscript to render the eps, and then continues with the rendered bitmap; this makes it difficult to get the original image back, in most cases you get a re-sampled image. I understand that you want the image out in the original resolution. I haven't got a direct route for you. However, for getting images from pdf files

Extracting Bitmaps from Video WITHOUT Resorting to FFMpeg

做~自己de王妃 提交于 2019-12-10 20:21:26
问题 First, thanks to this forum for having provided me (as a long time lurker) with so much help on my first app (SwatchMatic). I'm trying something harder now for my second, and, for the first time, I'm posing a question. As has pointed out elsewhere on this forum, MediaDataRetriever cannot be counted on to retrieve bitmaps from video at fine-grained steps, even if microseconds are used and even if OPTION CLOSET is used (to get all frames, not just key/sync frames) . So, something like this,

regex php - find things in div with specific ID

自作多情 提交于 2019-12-10 19:59:23
问题 I'm sure this is an easy one, and as much as I've googled and searched here on SO - I can't seem to figure out what is wrong with this. I have other areas on this page where I use similar expressions that return exactly what I want. However, I can't get this particular bit to return what I want, so maybe someone can help me. I have a div with a specific ID "user-sub-commhome" - I want to pull out the text from within that div. The text is surrounded by tags but I can easily use strip_tags to

Detect emails in a text and surrond it with the <a> tag

谁说胖子不能爱 提交于 2019-12-10 19:10:45
问题 greetings all I have a text that may contains emails and I want to detect any email occurrence and surround it with the < a > tag ex: my.email@mycompany.com <a href="mailto:my.email@mycompany.com"> my.email@mycompany.com </a> 回答1: Using the regex from regular-expression.info you can do: text = text.replaceAll("(?i)\\b([A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4})\\b", "<a href=\"mailto:$1\"> $1 </a>"); Ideone Link 来源: https://stackoverflow.com/questions/4561464/detect-emails-in-a-text-and-surrond

How to extract a couple marked strings from a line (python)

ε祈祈猫儿з 提交于 2019-12-10 12:19:37
问题 My Friends, I spent quite some time on this one... but cannot yet figure out a better way to do it. I am coding in python, by the way. So, here is a line of text in a file I am working with, for example: ">ref|ZP_01631227.1| 3-dehydroquinate synthase [Nodularia spumigena CCY9414]..." How can I extract the two strings "ZP_01631227.1" and "Nodularia spumigena CCY9414" from the line? The pairs of "| |" and brackets are like markers so we know we want to get the strings in between the two... I

Perl regex: how to know number of matches

你。 提交于 2019-12-10 11:38:11
问题 I'm looping through a series of regexes and matching it against lines in a file, like this: for my $regex (@{$regexs_ref}) { LINE: for (@rawfile) { /@$regex/ && do { # do something here next LINE; }; } } Is there a way for me to know how many matches I've got (so I can process it accordingly..)? If not maybe this is the wrong approach..? Of course, instead of looping through every regex, I could just write one recipe for each regex. But I don't know what's the best practice? 回答1: If you do

Extracting and parsing HTML from a secure website with Python?

。_饼干妹妹 提交于 2019-12-10 09:50:49
问题 Let's dive into this, shall we? Ok, I need to write a script (I don't care what language, prefer something like Python or Javascript, but whatever works I will take time to learn). The script will access multiple URL's, extract text from each site and store it into a folder on my PC. (From there I am manipulating the data with Python, which I know how to do.) EDIT: Currently I am using python's NLTK module. Here is a simple version of my code: url = "<URL HERE>" html = urlopen(url).read() raw

Extracting movie frames quickly in a 64-bit Cocoa app on Snow Leopard

丶灬走出姿态 提交于 2019-12-10 07:45:34
问题 I wrote a 64-bit Cocoa app on Snow Leopard that extracts individual frames from a movie using the QuickTime API. It uses [QTMovie currentFrameImage], which unfortunately is very slow, as was pointed out here: https://stackoverflow.com/questions/5843702/export-every-frame-from-a-movie-using-quicktime-api Apple's developer site describes the following alternative method using QTPixelBufferContextCreate with NewMovieFromProperties: http://developer.apple.com/library/mac/#qa/qa1443/_index.html

Can Eclipse auto-generate an interface of a 3rd party library class?

纵然是瞬间 提交于 2019-12-10 02:49:59
问题 I'm working with Apache's FTPClient class in the Apache commons net library. Sadly it doesn't implement an interface for most of the functionality which makes testing classes which use it tricky. So, I thought I'd create my own class which wrappers this one and implements an interface. Anyway that's the background. My question is, is it possible in Eclipse to generate an Interface (similiar to Refactor->Extract Interface) but for 3rd party code sitting in a jar file? Just to clarify, I'm not