What is the difference between using int and uint? All the examples I have seen so far are using int for integers. Any advantage of using uint? Thanks.
I have an application creating a bunch of divs through a loop.
Each div has the class "product"
so it looks like
<div class="product">
!.....stuff here ....!
<div class="show_on_hover">...buttons here... </div>
</div>
so there are about 12 of these same divs per page.
I would like to hover over a specific one and show the specific "show_on_hover" div which is initially set to display:none.
$('.product').hover(function() {
$(.show_on_hover).show();
},
function () {
$(.show_on_hover).hide();
}
);
That is what I have so far but it will show ALL of the .show_on_hovers on the page so I am wondering how to get only the specific one you have moused over to show. This effect is seen on youtube when you mouseover any of the comments, and some comment tools pop up.
Thanks!
I have a grid named 'GridView1' contains two columns 'Date' and 'Session Deatils' i am displaying like this way only
<asp:GridView ID="GridView1" OnRowCommand="ScheduleGridView_RowCommand"
runat="server" AutoGenerateColumns="False" Height="60px"
Style="text-align: center" Width="869px" EnableViewState="False">
<Columns>
<asp:BoundField HeaderText="Date" DataField="Date"><HeaderStyle Width="80px" /></asp:BoundField>
<asp:BoundField DataField="" HeaderText="Session Detais" /> </Columns>
But here i need to display 3 column sections downside Session details without any column borders for each dates,,how can i achive like this wasy
Date SessionDetails
06-04-2010 Time-(value from database) Topic-(value from database) Head-(value from database)
------- ------------------ ------------------- ----------------------
Hi I wanted to enroll in Apples iPhone developer program the problem is I myself don't own a credit card is it Ok if I use some one else's credit card to sign up...
I mean will Apple pay the guy whose credit card I have used or can I specify my Account details for any future transactions & just use this credit card for paying Apple.
(& yes I cannot get a credit card, I am currently jobless never ever had a credit card before in my life & credit card companies are very skeptical to give me one.)
Thank you
Hi All,
I'm trying to detect if a file exists at runtime, if not, create it. However I'm getting a 'The process cannot access the file 'myfile.ext' because it is being used by another process.' error when I try to write to it.
Any ideas how to fix it?
Thanks
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;
}
This loop checks if a record is in the sqlite database and builds a list of dictionaries for those records that are missing and then executes a multiple insert statement with the list. This works but it is very slow (at least i think it is slow) as it takes 5 minutes to loop over 3500 queries. I am a complete newbie in python, sqlite and sqlalchemy so I wonder if there is a faster way of doing this.
list_dict = []
session = Session()
for data in data_list:
if session.query(Class_object).filter(Class_object.column_name_01 == data[2]).filter(Class_object.column_name_00 == an_id).count() == 0:
list_dict.append({'column_name_00':a_id,
'column_name_01':data[2]})
conn = engine.connect()
conn.execute(prices.insert(),list_dict)
conn.close()
session.close()
edit: I moved session = Session() outside the loop. Did not make a difference.
I have the following directory structure of a project:
Folder "project" in Eclipse:
--folder "src"
--folder "resources"
----trayicon2.png
--folder "db"
----test.db
--folder "bin"
I'm accessing the image with:
Image image = Toolkit.getDefaultToolkit().getImage("resources/trayicon2.png");
and from Eclipse that is not a problem.
Then I generate an "executable jar file", and add the dirs, making a directory structure of:
Folder "project"
--folder "db"
----test.db
--folder "resources"
----trayicon2.png
--project.jar
And now the image is no more accessible. Also, the database is no more accessible; while in Eclipse I used to access it with:
Connection conn = DriverManager.getConnection("jdbc:sqlite:db/test.db");
How can I access the resources (images and db) after generating the jar file "project.jar"?
Hi every one im new to php im working on sphider search feature im not getting how to index pdf using sphider can ayone one pls help me out in this thanks in advance.
have file data of format
3.343445 1
3.54564 1
4.345535 1
2.453454 1
and so on upto 1000 lines and i have number given such as a=2.44443 for the given file i need to find the row number of the numbers in file which is most close to the given number "a" how can i do this i am presently doing by loading whole file into list and comparing each element and finding the closest one any other better faster method?
my code:i need to ru this for different file each time around 20000 times so want a fast method
p=os.path.join("c:/begpython/wavnk/",str(str(str(save_a[1]).replace('phone','text'))+'.pm'))
x=open(p , 'r')
for i in range(6):
x.readline()
j=0
o=[]
for line in x:
oj=str(str(line).rstrip('\n')).split(' ')
o=o+[oj]
j=j+1
temp=long(1232332)
end_time=save_a[4]
for i in range((j-1)):
diff=float(o[i][0])-float(end_time)
if diff<0:
diff=diff*(-1)
if temp>diff:
temp=diff
pm_row=i
Hi!
I'm learning C right now and so I'm fiddling about with pointers. Is there a way to determine the word width of the CPU in C because I'm writing a small program which prints it's own stack (Because I'm curious how it is structured), so that information would come in handy. Right now I'm using an int pointer, as an integer is 4 Bytes wide and I'm using a 32-bit Intel Atom CPU.
Thanks in advance, C gurus ;o)
Hello, everyone!
I have a game I'm working on. My players are stored in a vector, and, at the end of the game, the game crashes when trying to insert the high-scores in the correct positions.
Here's what I have (please ignore the portuguese comments, the code is pretty straightforward :P):
//TOTAL_HIGHSCORES is the max. number of hiscores that i'm willing to store. This is set as 10.
bool Game::updateHiScores()
{
bool stopIterating;
bool scoresChanged = false;
//Se ainda nao existirem TOTAL_HISCORES melhores pontuacoes ou se a pontuacao for melhor que uma das existentes
for (size_t i = 0; i < players.size(); ++i)
{
//&& !(players[i].isAI())
if (players[i].getScoreValue() > 0 && (hiScores.size() < TOTAL_HISCORES || hiScores.back() < players[i].getScore()))
{
scoresChanged = true;
if(hiScores.empty() || hiScores.back() >= players[i].getScore())
hiScores.push_back(players[i].getScore());
else
{
//Ciclo que encontra e insere a pontuacao no lugar desejado
stopIterating = false;
for(vector<Score>::iterator it = hiScores.begin(); it < hiScores.end() && !(stopIterating); ++it)
{
if(*it <= players[i].getScore())
{
//E inserida na posicao 'it' o Score correspondente
hiScores.insert(it, players[i].getScore());
//Verifica se o comprimento do vector esta dentro do desejado, se nao estiver, este e rectificado
if (hiScores.size() > TOTAL_HISCORES)
hiScores.pop_back();
stopIterating = true;
}
}
}
}
}
if (scoresChanged)
sort(hiScores.begin(), hiScores.end(), higher);
return scoresChanged;
}
What am I doing wrong here?
Thanks for your time, fellas.
I have this code:
a=[['a','b','c'],['a','f','c'],['a','c','d']]
for x in a:
for y in x:
if 'a' in x:
x.replace('a','*')`
but the result is:
a=[['a','b','c'],['a','f','c'],['a','c','d']]
and bot a=[['b','c'],['f','c'],['c','d']]
What should I do so the changes will last?