manipulation

Make image transparent in ruby

Greetings, I was wondering if anyone could suggest to me potential libraries in ruby for manipulating jpegs? Specifically I want to make the image 50% transparent so it can act as an overlay. The image in question would be of a house and I'd like it to overlay a village image. Just being specific about the image as the transforms may ...

PHP string manipulation

I'm reading a textfile on the format Phone#(tab)Text(line break) (line break) Or more specifically 4799999999 Hey! You owe us $576.53. Pay up to account no. 9760.00.12345, ID: 201561438. 4798888888 Hey! You owe us $199. Pay up to account no. 9760.05.12345, KID: 201565173. 4797777777 Hey! You owe us... and so on. I want to store...

Help with JYTHON 2.0 CODE -STRING MANIPULATION and replace

As i have already asked this question and i have later realized that tool for which iam writing JYTHON CODES supports presently on till 2.1 version as the intepreter is of 2.1 so some of the advanced technique is not working. Now being a new and excited to learn more in jython so that ican write more better and sma...

VB to Delphi string manipulation code conversion

I have some VB source code and want to convert it to Delphi: Do While Not EOF(textfile) Line Input #textfile, Line Dim retstring() As String retstring = Split(Line, Chr(32)) first = retstring(0) second = retstring(1) I have some text file with lines similar to these: hello all nice to good day I tried some of the sour...

Remove "NULL rows" from a String array using LINQ

How would you remove "NULL rows" from a String array using LINQ? Take this structure (String[,]): "Hello", "World", "Foo", "Bar" null, null, null, null null, null, null, null "Hello", "World", "Foo", "Bar" "Hello", "World", "Foo", "Bar" null, null, "Foo", "Bar" The two rows after the first row should be removed. T...

string manipulation - re.sub in jython

Let say i have a string like this 'this is a statement' and if i want to search and replace string with this 'this ** a statement' string to search for this is a statement , this si a statement , this i a statement and any combination convert them into this trim a statement i.e for any word combination between this & a statement ...

MATLAB Array Manipulation

I'm trying to insert multiple values into an array using a 'values' array and a 'counter' array. For example, if: a=[1,3,2,5] b=[2,2,1,3] I want the output of some function c=somefunction(a,b) to be c=[1,1,3,3,2,5,5,5] Where a(1) recurs b(1) number of times, a(2) recurs b(2) times, etc... Is there a built-in function in MATLAB ...

Array Manipulation

I have an array something like this.. [0] => english [1] => 85 [2] => mathematics [3] => 75 [4] => science [5] => 71 [6] => social [7] => 92 I want all values with even indexes to go as keys and all values odd indexes to go values. Like this [english] => 85, [mathematics] => 75 [science] => 71 [social] => 92 Is there any good funct...

whats the easiest way to exchange row HTML in table via jquery (not drag and drop)

what's the easiest way in jquery to take the entire html for a (including the tr itself, not tr innerhtml) and swap it with another one? i'm kinda messing around with replaceWith, but that's swapping the innerHtml and i want to swap the whole TR html. seems like it should be an easy task for jquery. i'm thinking there's gotta be a wa...

jQuery: using .getJSON to return images and then wrap them in anchors

This is driving me nuts! What the easiest way to wrap an anchor with the img src as the href in this code?: $(function(){ $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=tree&amp;tagmode=any&amp;format=json&amp;jsoncallback=?", function(data){ $.each(data.items, function(i, item){ $("<img...

Linux Text File Manipulation

Hi, I have a file of the format: <a href="http://www.wowhead.com/?search=Superior Mana Oil"> <a href="http://www.wowhead.com/?search=Tabard of Brute Force"> <a href="http://www.wowhead.com/?search=Tabard of the Wyrmrest Accord"> <a href="http://www.wowhead.com/?search=Tattered Hexcloth Sack"> I need to select the text after the = but ...

How to replace POI images in the ARView

Hi, I'm running an Wikitude application which shows the point if Interest (POIs). When the application starts, I click a button to launch ARView (AUgmented Reality) and there I could see the POI images superimposed on the Live Camera images. Now I want to change those images at frequent intervals. I'm using : // Need handler for c...

jQuery/Javascript: string splitting question

hi all, i'd like to split an image's href tag like <img src='/root/myimages/myPic.jpg'> so that i'm getting just myPic.jpg - whats the easiest way? thx ...

Realigning GPS coordinates by Hook or Crook

Hello due to reasons of chinese paranoia and google being a bunch of pansies I am in the situation where I need to alter a number of gps waypoints stored in a gpx file so they are are correctly aligned with google map which is not correctly aligned... for reasons for aforementioned paranoia. So I have a waypoint with a known landmark (r...

R: Manipulating a data frame with contents from a different data frame

Say I have a data frame with the contents: Trial Person Time 1 John 1.2 2 John 1.3 3 John 1.1 1 Bill 2.3 2 Bill 2.5 3 Bill 2.7 and another data frame with the contents: Person Offset John 0.5 Bill 1.0 and I want to modify the original frame based on the appropriate value from the second. I co...

Build Javascript Variable Using jquery Manipulation

I need to build a string variable using jQuery to find all the text nodes surrounded by span tags. Importantly I need to separate each segment of text with the pipe character "|". For example take the following html: <div id="myDiv"> <span>this</span> <span>is</span> <span>the</span> <span>text</span> </div> Using jQuery I need to pr...

R: Performing binary function to a column in a data frame.

Say I have a data frame with the contents: Trial Person 1 John 2 John 3 John 4 John 1 Bill 2 Bill 3 Bill 4 Bill and I want to transform this to Trial Person Day 1 John 1 2 John 1 3 John 2 4 John 2 1 Bill 1 2 Bill 1 3 Bill 2 4 Bill 2 I can ver...

Storing and loading program data, C# WPF

I'm writing a utility program with C# in WPF that allows users to create role-playing scenarios, including monsters, items, characters, etc. The user will create or import the elements (monsters, etc) and then use the imported elements to create scenarios. Everything used by the program is created within the program, so I don't have an...

Bash: how to process variables from an input file?

I've got a bash script that reads input from a file like this: while IFS="|" read -r a b do echo "$a something $b somethingelse" done < "$FILE" The file it reads looketh like this: http://someurl1.com|label1 http://someurl2.com|label2 However, I'd like to be able to insert the names of variables into that file when it suits me,...

Integer comparison as string

Hi I have an integer column and I want to find numbers that start with specific digits. For example they do match if I look for '123': 1234567 123456 1234 They do not match: 23456 112345 0123445 Is the only way to handle the task by converting the Integers into Strings before doing string comparison? Also I am using Postgre rege...