I have a table with anniversary dates. I want a query that returns me rows of anniversaries coming up in the next 10 days. For instance:
birthdate
---------
1965-10-10
1982-05-25
SELECT birthdate FROM Anniversaries WHERE mystical_magical_mumbo_jumbo <= 10
+------------+
| birthdate |
+------------+
| 1982-05-25 |
+------------+
1 row in set (0.01 sec)
I'd like to keep the query in the form x <= 10, because I'll use that number 10 in other parts of the query, and if I set it to a variable, I can change it once everywhere by changing the variable, and not have to re-write the query.
I am using ofstream() to write data into file, i want to program to perform such a way that it should be keep on writting the string into the file as soon as the value gets assingned to string variable, and it should be writting before calling the close() for the buffer and while the program runs itself.
can anyone help me to do that in c++.........
If we keep tag name within selectors.
For example:
#divMainContentBody { … }
.spanImportant { … }
This minimizes the need to switch between your stylesheet and your markup, since the ID and class already tells you what element type it is referring to.
Haven't seen this before so hopefully someone has a easy solve, I have a 3 feature panel divs side by side, what I want happen is the 1st panel has a "hover" class added so I can change the background etc and then on a timed interval the hover class jumps to the next panel then the next panel then back to the start on a loop.
Also on a side note can you keep the code in mind to be able to add more then 3 feature divs so you could have for example 6 or more or less etc.
I can't for the life of me find out how to get visual studio to keep my source to 100 columns width as part of auto-format.
Ctrl+K+D
Surely this doesn't require an extension? What's the simplest way to set it up?
I am reading one line at a time from a file, but at the end of each line it adds a '\n'.
example:
line is: 094 234 hii
but my input is: 094 234 hii\n
I want to read line by linem but I don't need to keep the newlines...
My goal is to read a list from every line: I need ['094','234','hii'], not ['094','234','hii\n']
Any advice?
Hello,
I would like to keep track of all mouse events at system level (not only in my application).
I've quickly googled this but found no real interesting pointer.
Do you know how to achieve this?
Thanks in adavance for your help :)
Regards,
I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket.
I'm not even sure if they both need separate classes, but here's what I have so far:
http://pastebin.com/qzMFFTrY
(it wouldn't all go in a code tag)
The variable I need is con for line 86.
it seems like i have begin rescue end statements everywhere in my code. this doesn't seem like the correct thing to do. i am learning process, can anyone suggest how can i catch any exceptions without having to place everything inside begin,rescue, end.
anyway to just tell ruby to shut up and just keep going even if exception is raised ?
Hi
im looking to find how to implement this scenario:
i have logic code that is inside function,
now i like to be able to execute this function in a separate thread.
now what i have is a raw implementation of this ..
i simple Init the Thread that in its Start/Run method i keep the function logic .
how can i makeit more generic ? so i could send the function ( mybe function pointer )
to generic thread factory/pool ?
in c++
I am trying to compute (360 / 24) / 60 I keep getting the answer 0.0 when I should get 0.25
In words: I want to divide 360 by 24 and then divide the result by 60
public class Divide {
public static void main(String[] args){
float div = ((360 / 24) / 60);
System.out.println(div);
}
}
This prints out:
0.0
Why is that? Am I doing something really stupid, or is there a good reason for this
Hi,
How to read live text from a text file into textbox in C#? The file is being updated all the time by another process, and we need to keep displaying the updated text in the textbox.
Any hint will be appreciated,
Thanks,
What would be the easiest way for creating a dialog:
- in one window I'm giving data for envelope addressing, also set font type from list of sizes
- when clicked OK, in the same window or in next window I get preview of how the envelope would look like with the given names, and used selected font size
It should look similarly to this :
Should I use Jdialog ? Or will JOptionPane will be enough ? The next step will be to choose color of font and background so I must keep that in mind.
In a test that contains some asserts, for example:
Assert.AreEqual(1,1);
Assert.AreEqual(2,1);
Assert.AreEqual(2,2);
is it possible to let the test keep running after it fails at some point? In the example, first condition is true, second fails and the test stops. I'd like to evaluate also the following condition.
I'm trying to use the lame_enc.dll file from LAME in a C# project, but adding the thing seems impossible.
I keep getting an error that says that a reference could not be added and to please check if the is accessible, a valid assembly or COM component.
I have no C++ experience, though I would like to use the functionality. Right now I'm using Process from the .NET framework to call lame.exe and do stuff, but I'd like to know if there's another way.
I have a custom validation method that is exactly the same for two or more models. Where's the best place to put this validation method so that both models can access it and keep things DRY? If the validation fails, I also want to use errors.add_to_base, so wherever this method is put, I should be able to accommodate for that.
I am building an iphone app and would like to keep track of how many times it has been opened so that I can prompt the user to do certain actions after it has been opened X number of times. I have thought about storing a variable in Core Data which I update every time it is opened, but this seems like a waste since it is a singleton data, not multiple instances of an object. What is the best way to store data like this and access it without slowing down the app opening time?
table1 has column CITY and COUNTRY. table2 has column CITY.
how do i delete from table2 all records that have CITY in common with table1 but also the COUNTRY='Russia' ??
please keep in mind that both tables have about 1 million rows of data
While moving from php to rails (Means procedural language to Object oriented language), what are the various things you should keep in mind.
How to think in world of object oriented programming?
What are thinks i should kept in mind before starting the things. Any tips?
I'm writing a plain text document with numbered sections or chapters and am wondering if emacs can help with numbering and re-numbering sections. And of course would be great if it could then generate a table of contents as well.
I have had a search on google and looked through the emacs wiki but did not come up with anything other than for latex stuff and possibly muse mode, but I would like to keep this as a plain text README style document.
Thanks for any help or suggestions.
I was trying to solve this problem http://www.spoj.pl/problems/FACKT/, and I keep getting a Non-Zero Exit Code (NZEC). How exactly do I figure out what to change in the code to overcome this?
Here is the code
import math
import sys
def cal_num(n):
i = 1
f = 1
while f<n:
f *= i
i = i + 1
return i-1
while 1:
line = sys.stdin.readline()
if line == "":
break
n = int(line)
x = cal_num(n)
y = math.factorial(2*x)
l = int(math.ceil(math.log(y,10)))
print (x,l)
Any suggestion would be welcome.
Hi everybody, I need comunicate a rails ap with skype, more specific, I need than(previously aprovation) a user can call other user using skype and keep both id private, is that possible?, thank so much!!!