I have a simple query over a table, which returns results like the following:
id id_type id_ref
2702 5 31
2702 16 14
2702 17 3
2702 40 1
2702 26 4
And I would like to merge the results into a single row, for instance:
id concatenation
2702 5,16,17,40,26:31,14,3,1,4
Is there any way to do this…
if (preg_match('(\p{Nd}{4}/\p{Nd}{2}/\p{Nd}{2}/\p{L}+)', '2010/02/14/this-is-something'))
{
// do stuff
}
The above code works. However this one doesn't.
if (preg_match('/\p{Nd}{4}/\p{Nd}{2}/\p{Nd}{2}/\p{L}+/u', '2010/02/14/this-is-something'))
{
// do stuff
}
Maybe someone could shed some light as to why the one below doesn't work.…
I can use __LINE__ as a method parameter just fine, but I would like an easy way to use it in a function that uses strings.
For instance say I have this:
11 string myTest()
12 {
13 if(!testCondition)
14 return logError("testcondition failed");
15 }
And I want the result of the function to be:
"myTest line 14:…
I have a table like this
C1 C2 C3 Code
1 2 3 33
1 2 3 34
2 4 1 14
1 2 3 14
i want to select only those record whose code is appearing only in single row. ie, in this case rows with code 33 and 34.. as they appear only once in this table.
How can i write a query for that
Hi ,
I have a string val = "14 22 33 48";
int matrix[5];
I need to insert each of the values in the string into the respective location in the array
Eg: matrix[0] = 14;
matrix[1] = 22;
matrix[2] = 33;
matrix[3] = 48;
How do I do this ?
Hay, i have a field in one of my models which saves the creation date of an object
created_on = models.DateTimeField(blank=False, auto_now_add=True)
This works as expected.
In my templates i want to list objects like this
June 15
{{ objects here which was created on June 15 }}
June 14
{{ objects here which was created on June 14…
I have a simple query over a table, which returns results like the following:
id id_type id_ref
2702 5 31
2702 16 14
2702 17 3
2702 40 1
2702 26 4
And I would like to merge the results into a single row, for instance:
id concatenation
2702 5,16,17,40,26:31,14,3,1,4
Is there any way…
I have a string "14 22 33 48". I need to insert each of the values in the string into the respective location in the array:
int matrix[5];
so that
matrix[0] = 14;
matrix[1] = 22;
matrix[2] = 33;
matrix[3] = 48;
How do I do this?
I'm working on an events website so dates are very important search terms, ie: 'whats on on fri 14th september'
I've seen it done in various methods for example:
domain/whats-on/city-hall/14-09-2010/event-name.html
domain/whats-on/city-hall/2010/09/14/event-name.html
the first is 'shallower'.
the second could be clearer for…
I want to add badge for tab widget at android. i use android-viewbadger lib, but i not set badge show to image
here code:
tabs = (TabWidget) findViewById(android.R.id.tabs);
badge = new BadgeView(this, tabs, 2);
// badge.setBackgroundResource(R.drawable.badge_28);
…
I have a lines like this
NF419andZNF773 (e=10^-92,).
ZNF571 (e=2 10^-14,)
What's the regex for extracting the results above so that it gives
NF419andZNF773 - 10^-92
ZNF571 - 2 10^-14
I tried this but fail.
$line =~ /(\w+)\s\(e=\s(.*),\)/;
print "$1 - $2\n";
From the following array,how to count the dates for the number of times it has occured in the array.The output should be in the following format [date,count]
new_dates = [['2012-12-02', 14],['2012-12-03',2],....]
Input:
dates = [['2012-12-02', 17], ['2012-12-01', 5], ['2012-12-02',…
hi, how does header including in c++ work? I have the classes already implemented in .h file and when there is #include in two files, there's this error:
files.h:14:7: error: redefinition of ‘class abstract_file’
files.h:14:20: error: previous definition of ‘class abstract_file’
multiple…
Given an array. How can we find sum of elements in index interval (i, j) in constant time. You are allowed to use extra space.
Example:
A: 3 2 4 7 1 -2 8 0 -4 2 1 5 6 -1
length = 14
int getsum(int* arr, int i, int j, int len);
// suppose int array "arr" is initialized here…
Just using it as a method parameter is fine but what about an easy way to use it in strings?
For instance say I have this:
11 void myTest()
12 {
13 if(!testCondition)
14 logError("testcondition failed");
15 }
And I want the output to be:
"myTest line 14:…
I have one text box in which I take the value of how many number do you want to print. Now My question is that how can I use for loop so that the number which I want to print is equal to the number that I got from textbox.One more thing is that i want to print only three numbers in…
I have a RHEL 5 workstation with 2 nvidia Quadro FX4500 cards, with one display attached to each card.
After doing a clean install of RHEL 5.5, the second display doesnt work (it worked ok in RHEL 5.2). Neither separate X screens nor Xinerama are working.
The kernel version is…
I'm developing a game engine using OpenTK. I'm trying to get to grips with the use of VBO's. I've run into some trouble because somehow it doesn't render correctly.
Thus far I've used immediate mode to render a test object, a test cube with a texture.
namespace…
I've been running rdiff-backup for the past week or so, every night at 4am.
It started out not taking that long, but its taking longer and longer and longer every time its runs every night.
In some cases there are quite a few new and changed files and in other…
I'm trying to serve a maintenance page to clients making request to my application when it is under maintenance. Following is my nginx configuration for that purpose.
server {
recursive_error_pages on;
listen 80;
...
if (-f…
I have an ubuntu 12.04 server with zend server CE installed. I now wanted to enable https but after the first steps according to the documentation, 'a2enmod ssl' and 'apache service restart', apache does not listen on 443 but neither…
Mongodb fail to start after showing this error...and not able to start it again..?Can u help me find out?
*** glibc detected *** /usr/lib/mongodb/mongo: corrupted double-linked list: 0x000000000f750b50 ***
Mon Nov 26 19:01:29…
Note: I already have a workaround for this problem (as described below) so this is only a "want-to-know" question.
I have a productive setup with around 50 hosts including blades running xen 4 and equallogics providing iscsi. All…
Starring at the log made me think, what is /phpTest/zologize/axa.php and why are bots looking for it? Previously, I had lots of /HNAP1/ requests. Requesting /HNAP1/ from IPs from log revealed, that all of them were sent by Linksys…