How do I order images in a list in an inline style with css? I have tried puting inline style in the list tag but it is showing it in block form. Any help will be greatly appreciated
How do I do something like the following
SELECT ADDDATE(t_invoice.last_bill_date, INTERVAL t_invoice.interval t_invoice.interval_unit)
FROM t_invoice
...where the column t_invoice.last_bill_date is a date, t_invoice.interval is an integer and t_invoice.interval_unit is a string.
Basically, I want to determine a person's next bill date based on his desired billing frequency. Is there a better way to achieve this?
i'm having some problems with tomcat 7 for configuring jdbc-pool : i`ve tried to follow this example: http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency
so i have:
conf/server.xml
<GlobalNamingResources>
<Resource type="javax.sql.DataSource"
name="jdbc/DB"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mydb"
username="user"
password="password"
/>
</GlobalNamingResources>
conf/context.xml
<Context>
<ResourceLink type="javax.sql.DataSource"
name="jdbc/LocalDB"
global="jdbc/DB"
/>
<Context>
and when i try to do this:
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource datasource = (DataSource)envContext.lookup("jdbc/LocalDB");
Connection con = datasource.getConnection();
i keep getting this error:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:803)
at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
pls help
tnx
When I run some php code I've written, I get the following message:
You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version for the
right syntax to use near 'condition,
price, name, email) VALUES('Fake
Title', 'Fake Subhead', 'Fake Author'
at line 1
I do not see anything wrong with my syntax, however, which is like:
mysql_query("INSERT INTO table (x1, x2, x3) VALUES('$y1', '$y2', '$y3')");
Any ideas?
What is the easiest way to take an objects and convert any of its values from null to string.empty ?
I was thinking about a routine that I can pass in any object, but I am not sure how to loop through all the values.
What would be the preferred way to convert opacity (0 - 1) to hex (00 - ff) in Javascript?
My thoughts are to use an if statement to check if opacity is between 1 and 0.95 then use ff. Work my way down to 0.
IIRC the situation is that IE simply doesn't support rounded corners, but some other browsers need browser-specific extensions... either FF or web-kit, I don't recall.
I'm happy to use it in some cases and let IE fall-back to square corners, but does using browser-extension CSS break validation... I quite like having my site validate AND work on IE6.
Hi,
I have a list and a value and want to check if the value is not in the list.
list = [u'first record', u'second record']
value = 'first record'
if value not in list:
do something
however this is not working and I think it has something to do with the list values having a u at the start, how can I fix this? And before someone suggests the list is returned from Django queryset so I can't just take the u out of the code :)
Thanks
Hello,
we are developing a windows application, and as most apps out there, there is a login form. What I don't like is that the login form validates the user and opens the main form if user and pass are correct. Simple as is.
All the function calls etc are called without verifying the user and pass again, what should be the right thing to do.
What's the best way to develop a secured application that if for any reason, the login form is by passed, the other function calls won't run?
Some devs suggested that we include an user and pass params on each function, which seems to be wrong...
thanks!
I'm attempting to create an anti-bruteforcer for the login page on a website. Unfortunately, my query is not working as expected. I would like to test how many times an IP address has attempted to login, and also return the ID of the user for my next step in the login process. However, I'm having a problem with the query... for one thing, this would only return rows if it was the same user as they had been trying to login to before. I need it to be any user. Secondly, regardless of whether I use LEFT JOIN, RIGHT JOIN, INNER JOIN or JOIN, it will not return the user's ID unless there is a row for the user in login_attempts.
SELECT COUNT(`la`.`id`), `u`.`id`
FROM `users` AS `u` LEFT JOIN `login_attempts` AS `la`
ON `u`.`id` = `la`.`user_id`
WHERE `u`.`username` = 'admin' AND `la`.`ip_address` = '127.0.0.1' AND `la`.`timestamp` >= '1'
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?
I am trying to piece two queries together. Below is the code Im using. However the table is splitting up the data. How can I remedy this? Or what better solutions are there?
while($row = mysql_fetch_array($result))
{
echo "<tr id='centered' >"; echo "<td class='leftalign'>" . $row['Quarter_Name'] . "</td>";
echo "<td>" . $row['Quarterly_yield'] . "</td>";
echo "<td>" . $row['Quarterly_yield'] . "</td>";
echo "<td>" . $row['Quarterly_yield'] . "</td>";
}
while($row = mysql_fetch_array($result8))
{
echo "<td>" . $row['Quarterly_yield'] . "</td>";
}
I have this code but it doesn't work:
jPanel1.add(jLabel1);
jPanel2.add(jButton1);
jPanel2.add(jButton2);
jPanel3.add(jPanel1,jPanel1.TOP_ALIGNMENT);
jPanel3.add(jPanel2,jPanel2.BOTTOM_ALIGNMENT);
setContentPane(jPanel3);
pack();
Please tell me why!
I have a template system, that replaces text such as {HEADER} with the appropriate content. I use an array like this, that replaces the key with the value using str_replace.
$array = array("HEADER","This is the header");
foreach($array as $var => $content) {
$template = str_replace("{" . strtoupper($var). "}", $content,$template);
}
Now im trying to use a defined variable like this:
define("NAME","Site Name");
Inside the value for the header. So I want the defined variable to be inside the array which gets replaced so it would look like this, but it doesn't work.
$array = array("HEADER","Welcome to ".NAME."'s website!");
Any ideas? tell me if im not clear
Hi all.
I've made a small function which, given a tuple, compares if all elements in this tuple is of the same sign.
E.g., tuple = [-1, -4, -6, -8] is good, while [-1, -4, 12, -8] is bad. I am not sure I've made the smartest implementation, so I know this is the place to ask.
def check_consistent_categories(queryset):
try:
first_item = queryset[0].amount
if first_item < 0:
for item in queryset:
if item > 0:
return False
return True
else:
for item in queryset:
if item < 0:
return False
return True
except:
return False
I have a nested set of jQuery droppables...one outer droppable that encompasses most of the page and an a set of nested inner droppables on the page. The functionality I want is:
If a draggable is dropped outside of any of the inner droppables it should be accepted by the outer droppable.
If a draggable is dropped onto any of the inner droppables it should NOT be accepted by the outer droppable, regardless of whether the inner droppable accepts the draggable.
So that would be easy if I could guarantee 1+ inner droppables would accept the draggable, because the greedy attribute would make sure it would only get triggered once. Unfortunately the majority of the time the inner droppable will also reject the draggable, meaning the greedy option doesn't really help.
Summary: The basic functionality is a set of valid/invalid inner droppables to accept the draggable, but when you toss the draggable outside any of the draggables it gets destroyed by the outer droppable.
What's the best way of doing this?
Say a string is abc/xyz/IMPORTANT/DATA/@#!%@!%, and I just want IMPORTANT/DATA/!%#@%!#%
I am terrible at regex, and really haven't learned JavaScript API yet
I am using the XmlSerializer like this,
XmlSerializer xs = new XmlSerializer(typeof(myType));
Now I have 5 different "myType". How do I pass the specific type dynamically so I don't have to repeat the same code 5 times?
I am not familiar with PHP at all and had a quick question.
I have 2 variables @pricePerUnit and @invoicedUnits. Here's the code that is setting these to values:
$InvoicedUnits = ((string) $InvoiceLineItem->InvoicedUnits);
$pricePerUnit = ((string) $InvoiceLineItem->PricePerUnit);
If I output this, I get the correct values. Lets say 5000 invoiced units and 1.00 for price.
Now, I need to show the total amount spent. When I multiply these two together it doesn't work (as expected, these are strings).
But I have no clue how to parse/cast/convert variables in PHP.
What should I do?
I have the following:
CSS
#pageBody
{
height: 500px;
padding:0;
margin:0;
/*border: 1px solid #00ff00;*/
}
#pageContent
{
height:460px;
margin-left:35px;
margin-right:35px;
margin-top:30px;
margin-bottom:30px;
padding:0px 0 0 0;
}
HTML
<div id="pageBody">
<div id="pageContent">
<p>
blah blah blah
</p>
</div>
</div>
</div>
If I uncomment the border line in pageBody, everything fits sweetly... I had the border on to verify things were as expected. But removing the border, pageBody drops down the page about 20px, while pageContent does not appear to move at all.
Now this is not the real page, but a subset. If nothing's obvious I can attempt to generate a working minimal sample, but I thought there might be an easy quick answer first.
I see the same exact problem in Chrome and IE8, suggesting it's me not the browser. Any tips where to look? I wondered maybe the 1px border was some tipping point making the contents of a div just too big, but changing #pageContent height to e.g 400 makes no difference, other than clipping the bottom off that div.
hi guys, can anyone help me how to write code for checking spellings in android?
or can anyone provide me the sites which will be useful to me.
thanks in advance
any help will be appreciated.
I am creating an inherited form and when i click add, it is showing the message as
"Do you want to open or save the file". The file is tmp_auto.tmp file.
Give me a solution..Thanks..
I am creating an inherited form and when i click add, it is showing the message as "Do you want to open or save the file". The file is tmp_auto.tmp file.
Give me a solution..Thanks..
Also, it shows "Navigation to the webpage was canceled"