i want to set my array key initial value to a certain number.
here is what i have:
$tickets=array();
array_push($tickets,"10","20","TBD")
for($i=3; $i<20; $i++)
i want my array initial value to start at 3 not 0.
any ideas
...
Hi there, i have three div's on a page with same ID's
<div id="downloaded">1200</div>
Now when i call the function downloadThis("filename","divID"); i want that the value of every div with id "Downloaded" should change, i am using jquery. Kindly help.
...
Hi, I need to attach unlimited attributes to a record in a table, and I've already designed a system using #3 below using mysql. Unfortunately I am finding that searching across a million records is getting slow. Is #2 a better approach, or is there a better way alltogether? Is this a case for using a view? I'd like to have my keys ...
Hi,
I have a Python function which receives numerous variables, and builds an SQL query out of them:
def myfunc(name=None, abbr=None, grade=None, ...)
These values should build an SQL query. For that purpose, Those who equal None should be changed to NULL, and those who store useful values should be embraced with 's:
name="'"+name+"...
Hi all,
In my website, some products are not for sale in California. While the user checkouts, I have to do a validation like if the cart has items not for sale in California and user's shipping address is in CAlifornia, prevent user from checking out.
The sale in CA is set from admin side using an 'avl' attribute.
here is the code I u...
Hello,
I'm in a need of getting a value of another property in CSS. Say I have this in a CSS file:
.something {
width: 256px;
}
then in something2 I want to use the value:
.something2 {
width: .something.width;
}
how could I achieve this without JavaScript? The reason why I need this is because I'm using CSS 3 animation:
@-webk...
I have a javascript function that goes something like this:
function doSomething(me) {
var isMeChecked = me.checked;
for (i=0;i<=10;i++) {
me.checked = !isMeChecked;
alert (me.checked);
}
}
I assumed that isMeChecked would remain constant after the first load, but it apparently is a ...
Difference between value parameter and reference parameter ? This question is asked sometime by interviewers during my interviews. Can someone tell me the exact difference that is easy to explain with example? And is reference parameter and pointer parameter are same thing ?
Thanks
...
Hello there,
I have some code which requires an iPhone to run. I do however want to test my app on the simulator. On the iPhone I use this to return a value:
return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:-1], @"number"];
I'm looking for something like this I THINK:
- (NSDictionary *) data
{
#if TARGET...
Suppose I want to pass a temporary object into a function. Is there a way to do that in 1 line of code vs. 2, with a struct?
With a class, I can do:
class_func(TestClass(5, 7));
given:
class TestClass
{
private:
int a;
short b;
public:
TestClass(int a_a, short a_b) : a(a_a), b(a_b)
{
}
int A() const
...
I have a combo box setup with 4 items, with indexes ranging from 0 to 3.
Later in my code, I need to do a certain event depending on what is selected. To do this I thought about comparing what the index of the selected combo box item is, because integer comparison is faster than strings, right?
Can anyone let me know how I can grab the...
In .NET I can get the VK value of a pressed key in the "KeyDown" event.
Wath I need is the DIK value of the pressed key. How do I do this?
I tried to use the MapVirtualKey API. But it doesn't work with all keys. (works with the ones in the main keyboard).
Is there an easy way to do this?
...
Trying IE Automation with Powershell.
Task: Select multiple option value fields and click submitbutton.
HTML looks like:
:
:
:
<center><input type="hidden" name="HF_certType" value="x509"><select name="HF_rvk" size="8" multiple>
<option selected value = "Line 1">Line 1 Option</option>
<option value = "Line 2">Line 2 Option</option>
<op...
Consider my variable $result to be 01212.... Now if i add 1 to my variable i get the answer 1213,but i want it to be 01213.... My php code is
echo sprintf('%02u', ($result+1));
Edit:
Answers to this question works.. But what happens if my variable is $result to be 0121212
in future...
...
I have three programs,
first does a selenium test
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
import junit.framework.*;
public class MyTest extends SeleneseTestCase {
int flag_eco;
public void setUp() throws Exception {
setUp("http://www.mysite.com/", "*iexplore");
}
public void testMyTest() throws Excep...
Say I have a ruby method:
def blah(foo=17)
...
end
In code I want to invoke blah with a specific argument "blah(a)" or invoke blah using its default argument "blah()" Is there any way to do that without specifying the method name twice? I'm trying to avoid:
if a.nil?
blah()
else
blah(a)
end
Because it makes the code look m...
I've got a private procedure in a VBA script for MS Access:
Private Sub drawLineDiagram(chartSpace As Variant, title As String, caption As String, x_val() As Variant, y_val() As Variant, Optional y_val2() As Variant = ????)
As you see, I want to have an optional last parameter for an array of values.
What kind of default parameter mu...
Hey folks,
I am getting some basic invoice information in a SQL query and figuring the Order Total and Payment Totals in the same query. Here is what I have thus far:
SELECT
orders.billerID,
orders.invoiceDate,
orders.txnID,
orders.bName,
orders.bStreet1,
orders.bStreet2,
orders.bCity,
orders.bSta...
Hi guys, I have a dictionary(python) with key->value (str->int). I have to chose some key due to it's own value. Then bigger this value the key has less posibility to be chosen. For example if key1 has value 2 and key2->1 key1 the attitude should be 2:1.
How can I do this?
...
Hello guys,
I am having a small problem with pushing a value into a input text field and have it pass on to the next step upon submitting a form in IE.
This process works just fine in FF and Chrome and pretty much every other browser.
Here is the input field:
<div id="donate_form_gift">
<fieldset id="donate_form_g...