DCG - Favourite tags
   25 tags on

DCG - Favourite tags

  • All Sites

2 answers

Preg Replace text to links with domains filter

Hello everyone i have a problem I have a text $text = " some and text http://www.somelink2.com/html5.jpg and some text http://www.somelink.net/test/testjava/html5.html#fbid=QTb-X6fv5p1 some ...

48 secs ago
2 answers

why is PHP hanging, when a bash call forks

I am calling some bash code from php, but even though I fork the bash (with &), the php will not finish before the full bash is done. This code: <html> <body> HTML START<br> …

3 mins ago
2 answers

Can I call a Perl OO function without first saving the object to a variable?

How can I turn this two statement snippet into a single statement? my $handle = &get_handle('parameter'); $handle->do_stuff; Something like {&get_handle('parameter')}->do_stuff;, but …

4 mins ago
0 answers

Cmake: How to hold off finding libraries?

I have a Cmake project where I use static libraries from another project (which uses its own unique build system). I have a bash script set up which compiles the libraries. The problem arises when …

5 mins ago
0 answers

Wrapping words in a SQL query string with regex

i have a database class that is written in PHP and it should take care of some things i don't want to care about. One of these features is handling the decryption of columns that are encoded with the …

0 answers

VIM: Delete one whitespace to the left

Consider this code: foo = (int)someVariable - 42; bar = someFunction('someArgument') + 42; By placing the cursor on the leading character of someVariable and someFunction we can experiment with dw, …

8 mins ago
0 answers

XQJ BaseX API in java shows different result for xquery than the BaseX application

Using the baseX application I constructed a XQuery that returned the result that I need. Using The XQJ BaseX API I implemented this same xquery so I can use these results in my java application. This …

8 mins ago
3 answers

Regular expression for matching n amount of parenthesis

I need to parse expressions of the following form: (S (A (B (D xyz)) (C m))) The amount of ( will always equal the amount of ), but there may be any arbitrary number of opening and closing ...

9 mins ago
0 answers

Keychain for ssh-add

I need to pull from Github all the time and I have a passphrase, but it's a pain, so I typically run... ssh-agent bash ssh-add ~/.ssh/id_rsa <prompt and give passphrase> And that works for …

1 answer

Changing the highlighted text background color in VIM on Mac OS X

I have a color scheme that I really like for the terminal on my Linux box. I have edited Terminal.app's color scheme on my Mac to be identical to on my Linux box, and for the most part I am happy. I …

13 mins ago
0 answers

Using SED with RegEx to put underlines back in links in hundreds of CSS files

I've got hundreds (more than 700) sets of web folders, each containing discrete CSS stylesheets. (If you are curious, they are online courses.) Recently a decision was made that links should have ...

15 mins ago
1 answer

Anything wrong with nested Perl subs, that are only called locally?

If I have the following code sub a { my $id = shift; # does something print &a_section($texta); print &a_section($textb); sub a_section { my $text = shift; …

15 mins ago
0 answers

xslt aggregation sum

I want do some sum of the values and return it as a row or column with the data. taking the below xml as example: <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <root> ...

15 mins ago
1 answer

Javascript matching “rgb(xx,xx,xx)” with regular expression regEx?

I would highly appreciate it if someone can point me in the right direction on this. I have an array "cArr" and within this array I have 2 elements. What I would like to do is to match the ...

16 mins ago
2 answers

Tables using Perl CGI.pm

I am trying to create a table using CGI.pm. The table would contain results from querying a database. The array final contains record numbers on which the queries will be executed. The results for ...

17 mins ago
1 answer

sed + removes all leading and trailing whitespace from end of each line on solaris system

I have Solaris machine – ( SunOSsmu1a 5.10 Generic_142900-15 sun 4vsparcSUNW,Netra-T2000 ) The following sed syntax removes all leading and trailing whitespace from end of each line , ( I need to ...

17 mins ago
0 answers

The proper way to find xml node using libxml2 and xpath in python

I'm new to xml parsing in python. I've been playing around with libxml2 and xpath but unfortunately the documentation for that isn't very good. Suppose I have an xml doc which looks something like ...

19 mins ago
0 answers

Bash/xdotool: Commands work, but not in a script

I am making a bash script for Linux which closes the terminal window if the window loses focus. On the command line, I was able to do this: termwin=$(xdotool getactivewindow) while : do if [[ …

1 answer

AppleScript show input text box with a image

I am very newbie in AppleScript. I am wrinting a bash script and I need the user type a CAPTCHA. So, I am trying to use AppleScript to show to the user a dialog with the CAPTCHA image (a simple .png …

19 mins ago
10 answers

Maximum number of inodes in a directory?

Is there a maximum number of inodes in a single directory? I have a directory of 2 million+ files and can't get an the ls command to work against that directory. So now I'm wondering if I've ...

20 mins ago
1 answer

how find value of javascript variable with regex?

I want RegEx in php that find value of js variable in my html page. Like this: varName = "http://sample.com";

1 answer

Http get ungzip response in bash

I need to manually ungzip response of the following page: http://muaban.net/ho-chi-minh.html I'm doing echo -e "GET /ho-chi-minh.html HTTP/1.1\r\nHost: muaban.net\r\nAccept-Encoding: gzip\r\n" | nc …

21 mins ago
1 answer

Setting up gVim on windows

I am trying to get gVim working on a windows 7 machine and am having the following problems: Whenever I try to change the _vimrc file, I get a message saying that I don't have permission to save in …

22 mins ago
2 answers

R remove part of string after “.”

It is a simple question but i don't see what i am doing wrong. I am Working in R with accession numbers like variable a a <- ...

23 mins ago
1 answer

Regular expressions in Smart Mobile Studio

How do I work with regular expressions in Smart Mobile Studio? For example, how do I code following example in Object Pascal? var re = /\w+\s/g; var str = "fee fi fo fum"; var myArray = ...

3 answers

Bash function that changes directory

I have a common use case that I'd like to write a function for: I often want to cd to some directory relative to some file. My current workflow looks like this: $ gem which rspec/core | ruby -e ...

24 mins ago
2 answers

Using regex in PHP to get string between two characters?

So I have a LOT of data, some of the chunks are in the following format : |- |style=&quot;text-align:left;&quot; bgcolor=&quot;#242424&quot;|{{ci|Ahri}} ...

24 mins ago
2 answers

Convert leading spaces to tabs in ruby

Given the following indented text: two spaces four six non-leading spaces I'd like to convert every 2 leading spaces to a tab, essentially converting from soft tabs to hard tabs. I'm …

29 mins ago
2 answers

XSL transformation of complicated XML

I have a complicated XML and I am trying to write a XSL transformation to convert it to HTML. Could someone please help me with it? Here is the XML <?xml version="1.0" encoding="iso-8859-1"?> …

30 mins ago
1 answer

Simple Java regular expression

I have a lot of: FooModel f = new FooModel(); .. Bar Model b = new BarModel(); I need to retreive any Model Object from a Java source code but I don't want to complete declaration. I just want the …

31 mins ago
15 30 50 per page
1 2 3