Hi,
I'm starting learning Ruby on Rails. So my application, like every Rails app, has three databases:
Development
Test
Production
And the question is: how do i switch from a db to another?
Thanks
Hi Everybody,
I am writing a blackberry application and pushing screens one after another(three in series)
Screen1 displays Screen2 and Screen2 displays Screen3
When i press "Back Key" on my Blackberry Device i.e., bold 9700, its prompts a dialog box with Question mark image and buttons "Save" "Discard" "Cancel".
Why does this dialog appears?
How can i avoid this dialog?
Please Help
Thanks
SIA
I have three mysql tables
items
the columns are id, title
items_in_categories
the columns are id, item_id, category_id
categories
the columns are id, title
I want to find all the items that belong to ALL the stated categories. Not any one category, but ALL categories
Eg, if I want to search all the items that belongs to category id 3 and 5
I would like to use as simple a way as possible.
I have tried AND and a nested NOT EXISTS as stated in the mysql manual.
Nothing worked.
I have a big program on java, that uses multithreading. In some case, the program starts loading 100% of three cores of my eigth cores system. In normal use, the program use all cores of 1-2 percent loading. How can i find a class, that overloading cores?
Today i listened a lecture about fenwick trees (binary indexed trees) and the teacher says than this tree is a generalization of interval and segment trees, but my implementations of this three data structures are different.
Is this afirmation true? and Why?
I am developing a quiz application which consists of a question and three options and I am using radio buttons for these options.My query is,I click on one of the options and whenever i want to click another option, the previous option remains in the checked state and it does the same whenever I click on the third option too.
I need a solution where in it behaves as a natural radio button,only one option is checked at any point of time.
Hi guys,
I need to delete duplicate users in django (by duplicate I mean two or more users with the same email).
If your instance there are three records like this:
id email
3 [email protected]
56 [email protected]
90 [email protected]
I need to delete records 56 and 90 and leave the oldest record id - 3
Is there a way to quickly do this.
Thanks :)
I have to write a user manual for my product, and I have been searching for a standard for the last three days. I didn't find any useful information. Can anyone guide me as to what standards exists for this purpose (User Manual Writing)?
If there are some good suggestions, that will also help me.
Thanks in advance.
I've got a set of data that has three attributes, say A, B, and C, where A is kind of the index (i.e., A is used to look up the other two attributes.) What would be the best data structure for such data?
I used two dictionaries, with A as the index of each. However, there's key errors when the query to the data doesn't match any instance of A.
Hi I am working on a kind of raffle system which divides 1 million random numbers into an x amount of tickets, e.g. 1 million random numbers to 10,000 tickets.
Each ticket is a row in a database, we then have another table ticket numbers in which i need to give 100 numbers to each ticket they are related by the ticket id.
So at the moment this is my code:
//Amount of the 1 million tickets divided to the tickets
$numbersPerTickets = $_POST['numbersPerTicket'];
//The total cost of the property
$propertyPrice = $_POST['propertyPrice'];
//The total amount of tickets
$totalTickets = NUMBER_CIELING / $numbersPerTickets;
//The ticket price
$ticketPrice = $propertyPrice / $totalTickets;
//Generate array with random numbers up to 999,999
$randomTicketNumbers = createTicketNumbers();
//Creation loop counter
$ticketCreationCount = 1;
//Loop and create each ticket
while($ticketCreationCount <= $totalTickets)
{
//Create a padded ticket number
$ticketNumber = str_pad($ticketCreationCount, 6, 0, STR_PAD_LEFT);
$query = '
INSERT INTO tickets(
propertyID,
ticketNumber,
price
)
VALUES(
"'.$propertyID.'",
"'.$ticketNumber.'",
"'.$ticketPrice.'"
)
';
$db->query($query);
//Get the ID of the inserted ticket to use to insert the ticket numbers
$ticketID = $db->insert_id;
$loopBreak = $numbersPerTickets;
$addedNumberCount = 1;
foreach($randomTicketNumbers as $key => $value)
{
$query = '
INSERT INTO ticketNumbers(
ticketID,
number
)
VALUES(
"'.$ticketID.'",
"'.$value.'"
)
';
$db->query($query);
unset($randomTicketNumbers[$key]);
if($addedNumberCount == $loopBreak){
break;
}else{
$addedNumberCount++;
}
}
$ticketCreationCount++;
}
But this isn't working it adds the right amount of tickets, which in the case for testing is 10,000 but then adds far too many ticket numbers, it ends up exceeding the million numbers in the random tickets array, The random tickets array is just a simple 1 tier array with 1 million numbers sorted randomly.
Someone just starting to learn a technology is referred to as a beginner. But what are the various levels in terms of experience.
I have seen Beginner, Intermediate, Expert being used.
But is there just these three levels, or there are more, that is further break up. Is there any agreed standard to quantify experience levels.
I would like to add custom folders to a Sql Server Management Studio 2008 solution.
Currently only three folders are included: Connections, Queries, and Miscellaneous with no easy way to add or customize this folder layout.
What are the differences between these built-in Python data types: list, sequence and slice? As I see it, all three essentially represent what C++ and Java call array.
Hi:
Is there any alternative to non-ISO gcc specific extension __attribute__ on 64-bit kernels ?
Three types that i've noticed are: function attributes, type attributes and variable attributes.
eg.
i'd like to avoid using __attribute__((__packed__)) for structures passed over the network, even though some gcc based code do use it.
Any suggestions or pointers on how to entirely avoid __attribute__ usage in C systems/kernel code ?
thanks
Saifi.
I've come across this story quite a few times here in the UK:
NHS Computer System
Summary: We're spunking £12 Billion on some health software with barely anything working.
I was sitting the office discussing this with my colleagues, and we had a little think about. From what I can see, all the NHS needs is a database + middle tier of drugs/hospitals/patients/prescriptions objects, and various GUIs for doctors and nurses to look at. You'd also need to think about security and scalability. And you'd need to sit around a hospital/pharmacy/GPs office for a bit to figure out what they need.
But, all told, I'd say I could knock together something with that kind of structure in a couple of days, and maybe throw in a month or two to make it work in scale.
If I had a few million quid, I could probably hire some really excellent designers to make a maintainable codebase, and also buy appropriate hardware to run the system on. I hate to trivialize something that seems to have caused to much trouble, but to me it looks like just a big distributed CRUD + UI system.
So how on earth did this project bloat to £12B without producing much useful software?
As I don't think the software sounds so complicated, I can only imagine that something about how it was organised caused this mess. Is it outsourcing that's the problem? Is it not getting the software designers to understand the medical business that caused it?
What are your experiences with projects gone over budget, under delivered? What are best practices for large projects? Have you ever worked on such a project?
A user will provide a function with three unknown values: a, b and c. For example:
sin(a+b)+ln(5)*(log(ab)-32/sqrt(abc))
How should I store the function so as to best be able to work with it?
I'm looking for a replacement for JCaptcha, which doesn't seem to be maintained any more, and isn't very good to begin with. The replacement has to integrate nicely with JavaEE webapps.
As I can see it, there are three options:
JCaptcha - No longer maintained, crude API
SimpleCaptcha - much nicer API, nicer captchas, but seems to be Java6 only
ReCaptcha - easy to use, uses remote web-service to generate captchas, but not much control over look and feel
Has anyone used any others, that they'd recommend?
i have three buttons what is the best way to disable button when clicked and make other two button enabled
<Button Name="initialzeButton"
Width="50"
Height="25"
Margin="460,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Click="initialzeButton_Click"
Content="Start"
Cursor="Hand" />
<Button Name="uninitialzeButton"
Width="50"
Height="25"
Margin="0,0,64,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="uninitialzeButton_Click"
Content="Stop"
Cursor="Hand" />
<Button Name="loadButton"
Width="50"
Height="25"
Margin="0,0,9,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="loadButton_Click"
Content="Load"
Cursor="Hand" />
Suppose user enter this string at terminal
123 456 456 //then hit enter
How do I scan these three (could be more) numbers in different variables in python
Could be something like this:
for i in range(1,n)
m[i]=#WHAT FUNCTION SHOULD I PUT HERE
In c++ we can easily use cin>>m[i] inside above loop to scan the variables.
If i use input() or raw_input() , they would scan whole line in single variable.
I have an ASP.NET project which has already some custom fields in it's web.config file. I've added in it three more fields and used them in my changes, and it's working great.
But where it needs to be used, there aren't these thre fields in the web.config (this was expected, I've just added by hand for tests and developing).
How do I check the existance of fields in web.config, and in case of not finding it, how do I add it permanently to the web.config ?
Thank you
how to get a Dictionary key by value in C#?
Dictionary<string, string> types = new Dictionary<string, string>()
{
{"1", "one"},
{"2", "two"},
{"3", "three"}
};
I want simething like this:
getByValueKey(string value);
getByValueKey("one") must be return "1".
What is the best way do this? may be HashTable, SortedLists?
if the last 4 chars in my string(result) are " AND" or the last three chars are " OR" I would like to remove these from the string. So far I have am trying result.trimend and a few other methods but am unsure how to get it working.
Thanks
If one has three fields in a db that they are querying an object by....
One of these fields must always be an associations id.
Concerning the other two fields "only one needs to be true"
What interpretation do you take or make of "only one needs to be true"?
Let us suppose i have these three methods defined:
int F1(int, int);
int F1(float, float);
Float F1(int, int);
and i am calling method F1 here:
Console.writeline(F1(5,6).ToString()));
Which method it will call and why?
I use Microsoft Visual SourceSafe for version control. I like that change this approach and use a newer software for this work, now I want to know that what are the differences between these three application? Which one is better?
Are these solutions integrated with visual studio?