extract

MATLAB: Extract multiple parts of a matrix without using loops

Hi, I have a huge 2D matrix and I would like to extract 15 different 100x100 parts out of it. I have two vectors x and y where the top left indices of the parts are saved. I have used something like this: result = cam1(x(1:end):(x(1:end)+99), y(1:end):(y(1:end)+99)); but the result is just a 100x100 matrix instead of a 15x100x100. Wh...

How to extract nested tables from HTML?

Hi everybody. I have an HTML file (encoded in utf-8). I open it with codecs.open(). The file architecture is: <html> // header <body> // some text <table> // some rows with cells here // some cells contains tables </table> // maybe some text here <table> // a form and other stuff </table> // probably some more...

(WPF) How to extract frames from multiframe images (tif, gif)

I'm trying to extract thumnail images of each frame in an animated gif. The following code is how I'm tyring to do it, but the thumbnail property of the BitmapFrame instance is always null. Am I doing something wrong? GifBitmapDecoder bd1 = new GifBitmapDecoder( new Uri(thisImage.Path), BitmapCreateOptions.None, BitmapCacheOption.D...

how to create username from email address provided - PHP

I have a signup page on my website where a user must provide a email address and password only. I want to be able to create a username for this user automatically by using the first part of the email provided; User supplies [email protected], i want to make username 'gordon' I don't need explanation on how to create form or submis...

Javascript extracting number from string

Hi, I have a bunch of strings extracted from html using jQuery. They look like this: var productBeforePrice = "DKK 399,95"; var productCurrentPrice = "DKK 299,95"; I need to extract the number values in order to calculate the price difference. (So I wend up with ≈ var productPriceDiff = DKK 100"; or just: var productPriceDiff ...

Excel - extracting data based on another list

Hello all, I have an Excel worksheet with two columns (name/ID) and then another list that is a subset of the names only from the larger aforementioned list. I want to go through the subset list and then pull the data from the larger list (name/ID) and put it somewhere else...essentially only grabbing the data from the larger list if th...

Efficient extraction of file from jar

I have an application written in Java that uses a jar file(it uses more than one, but that's not the point). The fact is, the Jar file I'm using contains files that I absolutely MUST extract to the filesystem. So far I'm using Class.getResourceAsStream and FileOutputStream, but this method is somewhat slow. Note that some of these file...

Extract history from Korn shell

I am not happy about the history file in binary format of the Korn shell. I like to "collect" some of my command lines, many of them actually, and for a long time. I'm talking about years. That doesn't seem easy in Korn because the history file is not plain text so I can't edit it, and a lot of junk is piling up in it. By "junk" I mean ...

Algorithms for named entity recognition

Hello! I would like to use named entity recognition (NER) to find adequate tags for texts in a database. I know there is a Wikipedia article about this and lots of other pages describing NER, I would preferably hear something about this topic from you: What experiences did you make with the various algorithms? Which algorithm would y...

[jQuery] How to extract a string from a larger string?

Using jQuery how would I find/extract the "Spartan" string if the outputted HTML page had the following.. <a href="/mytlnet/logout.php?t=e22df53bf4b5fc0a087ce48897e65ec0"> <b>Logout</b> </a> : Spartan<br> ...

Is there an easier away to extract these data?

my $changelog = "/etc/webmin/Pserver_Panel/changelog.cgi"; my $Milestone; open (PREFS, $changelog); while (<PREFS>) { if ($_ =~ m/^<h1>(.*)[ ]Milestone.*$/g) { $Milestone=$1; last; } } close(PREFS); Here is an example of the data its extracting from: <h1>1.77 Milestone</h1> <h3> 6/26/2009 </h3><ul style="margin-t...

Unable to extract SO's data dump file by Mac

I run the following Gert's extract command to the data dump file which format .7z seems to be a problem: extract () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; *.tar.gz) tar xvzf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x $1 ;; ...

extract cab file and execute the exe file(inside the cab file) automatically

Hi! I have a cab file(w/ an executable file inside) embedded on my webpage. When the user access the page the cab file will be automatically extracted and the executable file inside should be executed as well. Is this possible? My hunch is that this will be configured in my inf file but I don't know how. I would appreciate your help in t...

iphone 3gs video capabilities

I am creating an app that needs to capture contents of a video recorded in-app with the video camera api for "supporting devices" AKA 3GS. Was wondering if anyone knows if it is possible to do the following: Edit your video that was recorded in-app by virtue of cutting down frames to a specified duration. Say, 2 seconds. This might amo...

Python extract domain name from URL

hello, how would you extract the domain name from a URL, excluding any subdomains? My initial simplistic attempt was: '.'.join(urlparse.urlparse(url).netloc.split('.')[-2:]) This works for http://www.foo.com, but not http://www.foo.com.au. Is there a way to do this properly without using special knowledge about valid TLDs or country...

SharpZipLib ~ How to extract specific files from a zip

Ok, I have a list of files (SourceFile objects which just contain the filename only) then I want to pull those specific files out of a zip and dump them into a temp directory so I can distribute them later. I came up with this, but I am unsure on how to proceed next.. private List ExtractSelectedFiles() { List zipFilePaths = new...

Read Word 2007 file and extract text, comments, and commenter name using ASP.NET/C#

I have an ASP.NET app that permits Word 2007 document uploads. Once they are uploaded I'd like to parse out the document text and also any comments made by reviewers. I'd like to be able to get the comments and the commenter initials/name. Are there free libaries to do this? I prefer not to automate Word as this process needs to be some...

Extract only numbers from data in Jython

Hello, Here is my problem. I'm working on a Jython program and I have to extract numbers from a PyJavaInstance: [{string1="foo", xxx1, xxx2, ..., xxxN, string2="bar"}] (where xxx are the floating point numbers). My question is how can I extract the numbers and put them in a more simple structure like a python list. Thank you in adv...

Extract a portion of text using RegEx

Hi, I would like to extract portion of a text using a regular expression. So for example, I have an address and want to return just the number and streets and exclude the rest: 2222 Main at King Edward Vancouver BC CA But the addresses varies in format most of the time. I tried using Lookbehind Regex and came out with this expression...

How can I extract text from a PDF file in Perl?

I am trying to extract text from PDF files using Perl. I have been using pdftotext.exe from command line (i.e using Perl system function) for extracting text from PDF files, this method works fine. The problem is that we have symbols like , and other special characters in the PDF files which are not being displayed in the generated txt...