I have a class called Deal.
Deal has vote_scores.
I would like to see how many vote_scores are in Deal that are greater than 2.
My guess :
for vote_scores 2 in Deal
count
end
Doesn't really work :D
I know how to detect if a particular GET method is in the url:
$username = $_GET['username'];
if ($username) {
// whatever
}
But how can I detect something like this:
http://www.mysite.com?username=me&action=editpost
How can I detect the "&action" above?
I just research the sqlite3! i dont know the way to connect database - it's maked by sqlite - to C++ project! Could you help me create a example, please? Thanks so much everybody!
How can I match the following pattern?
"anything123.anythingelse"
Alphanum of any length, with exactly 1 "." in the middle, and then alphanum of any length?
Thanks.
If we only need to graphically authorize a user,
view a few tables representation (from database),
ability to change data in the database visually
what tools to use to write such a web application that will run on Tomcat?
What framework allows to do that in the most straightforward, easy-to-manage and elegant way?
I have been asked in an interview, To write a sql query which fetches the first three records with highest value on some column from a table. i had written a query which fetched all the records with highest value, but didnt get how exactly i can get only first three records of those.
could you help me in this.
thanks.
I was going over some sample questions for an upcoming test, and this question is totally confusing me. Any help would be appreciated.
Consider the following code:
class GraduateStudent : public Student
{
...
};
If the word "public" is omitted, GraduateStudent uses private inheritance, which means which of the following?
GraduateStudent objects may not use methods of Student.
GraduateStudent does not have access to private objects of Student.
No method of GraduateStudent may call a method of Student.
Only const methods of GraduateStudent can call methods of Student.
Input integer array:
a[8] = { a1, a2, a3, a4, b1, b2, b3, b4 }
Output array:
a[8] = { a1, b1, a2, b2, a3, b3, a4, b4 }
Forget all corner cases, make sure your solution works for any int array of size 2n. You can use one or two temp variables for looping or anything, but you shouldn't use any temp arrays/stacks/queues etc to store entire array or part of array.
I'm able to get answer in O(n*log n), but I'm looking for better solution.
I have a UI question that troubled me on the best method to handle 4 decimal places for prices.
In an table already cramped full of data, I would want to simplified the interface to makeit not so cluttered. The actual current UI is shown below.
http://i41.tinypic.com/bg5tub.jpg
The problem is, for a unit price/units/D.Price and Dis.(Discount) to have 4 decimal places ($0.3459) is quite rare but it still happens (5 in 100 entries). This will result a lot of junk decimal places, cluttering up the interface.
What is the best solution to this problem?
In short, I want to declutter it yet maintain the precision.
Note: This is web app
a table with a pk and status column which is having values as 'Y','N','NULL'
Query:
get the count of records with status column as 'Y', if this count exceeds 1% of total count of records then dont delete , else delete the records in the table.
i tried like this
Declare
v_count Number;
v_count1 Number;
BEGIN
v_count := select count(*) from temp;
v_count1 := select count(*) from temp where status = 'Y' ;
v_count := v_count + ((0.1) * (v_count))
if (v_count1 > v_count)
{
insert into temp1 values(pk,status)
}
else
{
Delete from temp ;
}
END;
1- Does mod_rewrite means that if I make this url:
domain.com/ad.php?id=8498292
INTO
domain.com/8498292
that all links on my website will have to be changed to the later above?
example the link: domain.com/ad.php?id=8498292 wont work now, unless I replace it with domain.com/8498292 ?
Or will the server know that they are the same still?
2- Will the rewritten link appear rewritten in the browsers adress bars also, so if I enter domain.com/ad.php?id=8498292 it will actually appear as domain.com/8498292 in the adress bar itself?
3- Will images and all other related links and material on the page whose link is rewritten remain intact? ie will pictures and links still work FROM that page which are relative?
Thanks
for ( var i:int = 0 ; i < 1; i++)
{
for ( var j:int = 0 ; j < 1; j++)
{
if (shape[j][i] == 0 )
{
pencil.graphics.beginFill(0);
pencil.graphics.drawRect(10,10,5,5);
pencil.graphics.endFill();
}
}
}
i am trying to run this code where shape is an array 2*2
gives an error
ReferenceError: Error #1069: Property 0 not found on Number and there is no default value.
at Main()
need help
Hi,
What's the simplest way to add an admin menu button with x submenus?
How can I make use of the table styling of WP?
I just want to show a table of orders from a non WP table, but displayed in WP admin??
Should I make a plugin?
#include "stdio.h"
#include "conio.h"
#include <iostream>
using namespace std;
int main (void)
{
char my_char[] = "happy birthday";
int i;
bool j=false;
char my_char_temp[1];
do
{
for (i=0;i<sizeof(my_char)-2;i++)
{
j=false;
if (my_char[i+1] < my_char[i])
{
my_char_temp[0]=my_char[i+1];
my_char[i+1] = my_char[i];
my_char[i] = my_char_temp[0];
j=true;
}
}
}while (j);
cout << my_char;
}
what am i doing wrong?
im just trying to sort the letters within the char
the output i get is completely wrong
If I have an oracle query like below:
SELECT * FROM table_a where A = "1", B = "2", C = "3"
for this query to pickup one of the indexes of table_a...does the index need to be on all 3 of these columns?
What I am asking is:
What if Index is on A, B, C, D?
What if Index is on B, C?
Will the index only be picked when
it is on A, B, C?
Hey everyone,
First off, sorry for my noob-ness. Believe me when i say ive been rtfm'ing. Im not lazy, im just dumb (apparently). On the bright side, this could earn someone some easy points here.
I'm trying to do a match/replace with a pattern that contains special characters, and running into syntax errors in a Flex 3 app. I just want the following regex to compile... (while also replacing html tags with "")
value.replace(/</?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?>/g, "");
On a side note, the pattern /<.*?/g wouldn't work in cases where there are html entities between tags,
like so:
<TEXTFORMAT LEADING="2">
<P ALIGN="LEFT">
<FONT FACE="Arial" SIZE="11" COLOR="#4F4A4A" LETTERSPACING="0" KERNING="0"><one</FONT>
</P>
</TEXTFORMAT><TEXTFORMAT LEADING="2">
<P ALIGN="LEFT">
<FONT FACE="Arial" SIZE="11" COLOR="#4F4A4A" LETTERSPACING="0" KERNING="0">two</FONT>
</P>
</TEXTFORMAT>
The first regex would get both "<one" and "two", but the second would only get "hi"
Thanks!
Stabby L
I have following jQuery code
$(document).ready(function() {
for(var i=1;i<4;i++) {
var img= ".img"+i;
var p= ".p"+i;
$(img).on("click", function(){
$(p).hide();
});
}
});
Applied on the following html:
<div>
<article>
<h1>Over mezelf <img src='images/plus.png' class='img1'/></h1>
<p class='p1'>Test</p>
</article>
<article>
<h1>Contact <img src='images/plus.png' class='img2'/></h1>
<p class='p2'>Test</p>
</article>
<article>
<h1>Website <img src='images/plus.png' class='img3'/></h1>
<p class='p3'>Test</p>
</article>
</div>
When I click on the images, the last <p> disappears, it doesn't work on the other ones.
// ACCORDION
$('.accordion .answer').hide(); // hide all
$('.accordion .question').click(function(){
$('.accordion .answer').slideUp(); // hide all open
$(this).addClass('active').next().slideDown(); // show the anwser
return false;
});
HTML:
<dl class="accordion">
<dt class="question">question</dt>
<dd class="answer">answer</dd>
<dt class="question">question</dt>
<dd class="answer">answer</dd>
</dl>
... works, but
the 'active' class is removed from inactive question elements and
atleast one of the answer remains open, all answers should be able to close.
Thanks!
Hi this works fine in Firefox, but not IE. What am I doing wrong? Thanks for the help in advance!
$(document).ready(function(){
$("#radiodiv").buttonset();
$('#radio1').bind("click", function() {
alert('Hello');
});
}
<form>
<div id="radiodiv">
<input type="radio" id="radio1" name="radio" checked="checked" /><label for="radio1">WaveHeight</label>
<input type="radio" id="radio2" name="radio" /><label for="radio2">Current</label>
<input type="radio" id="radio3" name="radio" /><label for="radio3">WaveHeightDir</label>
</div>
</form>
I have created a dropdown menu with jquery:
here
Everything is ok but in ie6. I know ie6 not supported z-index, but is there any solution for ie6?
Thanks in advance
A=rand(10)
B=find(A98)
How do you have text saying "There were 2 elements found" where the 2 is general i.e. it isn't text, so that if I changed B=find(A90) it would automatically no longer be 2.
need some quick help. This is a university program, everything is working fine except when I call my :forLoop method to iterate through 100 numbers (1,1,100) starting at 1 going by 1 til 100 and doing the iteration % 5 (i%%5). for some reason I cannot get this to work. appreciate any help or direction.
When I echo %%A it is iterating through all the number perfect. When I echo %result% I get a blank "" (nothing inside)
:forLoop
FOR /L %%A IN (1,1,100) DO (
set /A result=%%A %% 2
echo "%%A"
echo "%result%"
)
Correct code is
:forLoop
setlocal ENABLEDELAYEDEXPANSION
FOR /L %%A IN (1,1,100) DO (
set /A result=%%A %% 5
echo !result! >> results.txt
set /A total=!total!+!result!
echo !total!
)
Hello,
I am in need of a reliable UDP library. The one I wrote does not work too well and I would like to see what a 3rd party can do in the same circumstances.
Enet will not work because of some "interesting" compile issues in xcode (I have another question on stack overflow about that).
Any suggestions for a portable, reliable UDP library would be greatly appreciated.