Hi,
How to alert variable name, not a value of variable?
var color = 'red';
alert(color); // Will alert 'red'
alert(/* magic */); // Will alert 'color'
i have an html page where i have a table of items (one item per row) where each item is a html link that says "Add" and there is a textbox next to each link with a number in it.
the text link and the textbox are in the same td inside the row of the table.
how do i, using jquery, capture the value from the textbox that is to the right of the link i click on.
I noticed in Firefox when viewing the cookies that the values I am saving are not encrypted. The CakePHP Book states that values are encrypted by default on write(). I can't seem to find any gotchas in the doc
Anyone else experience this problem? I am sure I am missing something.. Would it matter that the value being set is a integer?
Hello All...
I Have one situation where I need to convert integer value into hexadecimal way.
I have done with some logical, but I want the optimized solutions...
Thanks in advance...
In T-SQL, this is allowed:
DECLARE @SelectedValue int
SELECT @SelectedValue = MyIntField FROM MyTable WHERE MyPrimaryKeyField = 1
So, it's possible to get the value of a SELECT and stuff it in a variable (provided it's scalar, obviously).
If I put the same select logic in a stored procedure:
CREATE PROCEDURE GetMyInt
AS
SELECT MyIntField FROM MyTable WHERE MyPrimaryKeyField = 1
Can I get the output of this stored procedure and stuff it in a variable?
Something like:
DECLARE @SelectedValue int
SELECT @SelectedValue = EXEC GetMyInt
(I know the syntax above is not allowed because I tried it!)
CALORIES = \
{ 'Beef' : 200, \
'Chicken' : 140, \
}
class Food():
__slots__ = (
'cal' # Calories
)
def mkFood( name ):
"""Create and return a newly initialized Food item"""
result = Food()
result.cal = calorie in dict(CALORIES[1])
return result
Is that a proper way to the value of the target item in Calories? Like getting 200, 140, such like that.
result.cal = calorie in dict(CALORIES[1])
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next 'jobnumber' . But I want to do this before any entry is made to the table. IE so when a user looks at a form it will display something like 'this is job number 6954'
I have tried $rr = mysql_insert_id() but this only work after I have made an entry
Can anyone help please
thanks
I am trying to run the following SQL statement:
"SELECT *, (IIF([Field]=TRUE,'StringValue1','StringValue2') AS [NewField] FROM [Table1] ORDER BY [NewField] ASC"
But this gives me an error "Parameter NewField has no default value". How can I solve it?
I am using Microsoft Access (MDB) database using Jet Engine from Delphi 7.
Thank you!
I read somewhere that for a high traffic site (I guess that is a murky term as well), 30 - 60 seconds is a good value. Obviously I could do a load test and vary the values, but I couldn't find any kind of documentation on this. Most samples have a minute, a couple of minutes. There's no recommended range. Is there something on msdn or anywhere that talks about this?
Hi!
How do i go about passing the value of width ,height,resize received as parameter to window.open using javascript?
Thanks
Example
function poponload(mywidth,myheight,resizeVal)
{
testwindow = window.open ("http://www.yahoo.com", "mywindow","location=1,status=1,scrollbars=1,width=+mywidth+,height=myheight,resizeVal");
testwindow.moveTo(0,0);
}
<body onload="javascript: poponload(200, 500,yes)">
We have link to some page (with html code), that page have one img, which attributes title and alt are equal.
Script must open link, grab the src attribute of img which title=alt, and throw the value into some variable.
How to do it?
Thanks.
When a vote value is changed, the form POSTs the change, then refreshes the page. This is called on the top of the page upon load:
if (isset($_POST['q'.$question_id]))
{
$user->updateQuestionVotes($question_id, $_POST['q'.$question_id]);
}
Why does it update every time I refresh after the first time? Do I need to unset it somehow?
I am having a small problem trying to decide on database schema for a current project. I am by no means a DBA.
The application parses through a file based on user input and enters that data in the database. The number of fields that can be parsed is between 1 and 42 at the current moment.
The current design of the database is entirely flat with there being 42 columns; some have repeated columns such as address1, address2, address3, etc...
This says that I should normalize the data. However, data integrity is not needed at this moment and the way the data is shaped I'm looking at several joins. Not a bad thing but the data is still in a 1 to 1 relationship and I still see a lot of empty fields per row.
So my concerns are that this does not allow the database or the application to be very extendable. If they want to add more fields to be parsed (which they do) than I'd need to create another table and add another foreign key to the linking table.
The third option is I have a table where the fields are defined and a table for each record. So what I was thinking is to make a table that stores the value and then links to those two tables. The problem is I can picture the size of that table growing large depending on the input size. If someone gives me a file with 300,000 records than 300,000 x 40 = 12 million so I have some reservations. However I think if I get to that point than I should be happy it is being used. This option also allows for more custom displaying of information albeit a bit more work but little rework even if you add more fields.
So the problem boils down to:
1. Current design is a flat file which makes extending it hard and it is not normalized.
2. Normalize the tables although no real benefits for the moment but requirements change.
3. Normalize it down into the name value pair and hope size doesn't hurt.
There are a large number of inserts, updates, and selects against that table. So performance is a worry but I believe the saying is design now, performance testing later?
I'm probably just missing something practical so any comments would be appreciated even if it’s a quick sanity check.
Thank you for your time.
I'm retrieving an IEnumerable list of properties via following code:
BindingFlags bindingFlag = BindingFlags.Instance | BindingFlags.Public;
var dataProperties = typeof(myParentObject).GetProperties(bindingFlag);
Then I'm iterating through the list and retrieving the value for each property.
I've come across two different approaches to doing this, and just wondered what the difference is between them:
1)
object propertyValue = property.GetGetMethod().Invoke(myObject, null);
2)
object propertValue = property.GetValue(myObject, null)
This question asks for one in java,
what's the best candidate in PHP?
BTW,does the following establish:
distributed key value store ==
distributed cache
?
$("input[id^='exc-flwup-<%=Model.Date%>']").click(function() {
$(this).val('');
});
I am using this to clear the input field..when i click on the input box its doign clear but.. on form submit if i ccheck at controler side I am still seeing this value there?
do I need to do anyting else here to make null inputbox?
dear experts,
This question is an extension of this question I asked.
I have a std::vector vec_B.which stores instances of class Foo. The order of elements in this vector changes in the code.
Now, I want to access the value of the current "last element" or current 'nth' element of the vector. If I use the code below to get the last element using getLastFoo() method, it doesn't return the correct value.
For example, to begin with the last element of the vector has Foo.getNumber() = 9. After sorting it in descending order of num, for the last element, Foo.getNumber() = 0.
But with the code below, it still returns 9.. that means it is still pointing to the original element that was the last element.
What change should I make to the code below so that "lastFoo" points to the correct last element?
class Foo {
public:
Foo(int i);
~Foo(){};
int getNum();
private:
int num;
};
Foo:Foo(int i){
num = i;
}
int Foo::getNum(){
return num;
}
class B {
public:
Foo* getLastFoo();
B();
~B(){};
private:
vector<Foo> vec_B;
};
B::B(){
int i;
for (i = 0; i< 10; i++){
vec_B.push_back(Foo(i));
}
// Do some random changes to the vector vec_B so that elements are reordered. For
// example rearrange elements in decreasing order of 'num'
//...
}
Foo* B::getLastFoo(){
&vec_B.back();
};
int main(){
B b;
Foo* lastFoo;
lastFoo = b.getLastFoo()
cout<<lastFoo->getNumber();
return 0;
}
Hi, im just writing my own replace method for any weird characters and i used the ASCI value 0, null to replace unwanted characters, i was hoping for them to be 'deleted', but this doesnt work. A gap just appears in the string.
What exactly does String.Replace() do when removing a character for ""? Does it shift them all down and then 'delete' the final character or something?
I have the following class:
class Seller
{
private string sellerName;
private decimal price;
}
~propreties for SellerName and Price goes here~
I also have a list of sellers:
list<Seller> s = new list<Seller>();
How can I get the maximum value of price out of all the sellers?
Thank you very much.
Hi folks,
Quick question. I want to change the color of an int based on the value being positive or negative, using css if possible.
Any ideas??
Thanks again!
I have a dictionary collection as bleow:
mydic.addvalue(key1, val1)
mydic.addvalue(key2, val1)
mydic.addvalue(key3, val1)
mydic.addvalue(key4, val2)
mydic.addvalue(key5, val2)
From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:
mydic.addvalue(key4, val2)
mydic.addvalue(key5, val2)
My VB source code is on VS2008 and targeted for 3.5
I have following statement in one of the oracle SP:
OPEN CUR_NUM FOR
SELECT RTRIM(LTRIM(num)) as num
FROM USER WHERE USER_ID = v_user_id;
When the above does not return anything the SP result just has no column name in it. But I'd like the cursor to still have num column with some default value like NOTHING when no data is found.
Is this doable ?