If possible I would like to use the following structure for a command however I can't seem to figure out how to achieve this in Python:
./somescript.py arg <optional argument> -- "some long argument"
Would it be possible to achieve this in a feasible manner without too much dirty code? Or should I just reconsider the syntax (which is…
Here the scenario: I have a unidirectional 1:N Relation from Person Entity to Address Entity. And a bidirectional 1:N Relation from User Entity to Vehicle Entity.
Here is the Address class:
@Entity
public class Address implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy =…
(Bubble Sort) In the bubble sort algorithm, smaller values gradually "bubble" their way upward to the top of the array like air bubbles rising in water, while the larger values sink to the bottom. The bubble sort makes several passes through the array. On each pass, successive pairs of elements are compared. If a pair is in…
Hello everyone,
I am designing a transportation agency/workflow system, and it including 3 types of people, customer who requests to transport some stuff, drivers who deliver the stuff, and truck manager who manages transport source/destination truck coordination and communicates/organizes drivers.
The system is expected…
I am new to c# and need help understanding what going on in the following function
public bool parse(String s)
{
table.Clear();
return parse(s, table, null);
}
where table is a Dictionary. I can see that is is recursive but how is parse being passed three params when it is defined to take…
Hi guys! I am somewhat mystified by concat and joins in MySQL 4. Here's where I am having an issue.
I have two tables...
person
id, fname, lname, city, state, zip
capital
state, city
I am needing to generate all states and the number of persons (from the person table) from each. Something like ....
AK | 5
AL | 7
…
Now , I execute the command line "rake db:migrate" on the window OS, but I got the problem in the console. it print couldn't find HOME environment -- expanding~/.ruby-uuid'`
who can help me to solve this ? Thank you and best regards!
A sequence is bitonic if it monotonically increases and then monotonically de-
creases, or if it can be circularly shifted to monotonically increase and then
monotonically decrease. For example the sequences 1, 4, 6, 8, 3, -2 ,
9, 2, -4, -10, -5 , and 1, 2, 3, 4 are bitonic, but 1, 3, 12, 4, 2, 10 is not
bitonic.
…
I'm trying to use regular expression to extract the comments in the heading of a file.
For example, the source code may look like:
//This is an example file.
//Please help me.
#include "test.h"
int main() //main function
{
...
}
What I want to extract from the code are the first two lines, i.e.
//This is an…
Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a while, it may die.
Class Person
{
Void Feed(Rabbit r); …
Hi,
I know that encapsulation is binding the members and its behavior in one single entity. And it has made me think that the members have to be private. Does this mean if a class having public members is not following 100% Encapsulation rule?
Thanks
I may have all this OO completely wrong, but here goes:
Ok the scenario is a classic order entry.
Customer places an Order which has OrderLineItems of StockItems. Order is entered by Employee.
1) Application starts and asks for login/password
2) Employee selects 'Orders' from Mainmenu form
3) Orders forms…
I've uploaded the Magento installation file to my hosting and I've been told to go to the URL you uploaded it to using you browser, then the installation wizard will run you through the processes.
I uploaded to /home/domain/public_html/magneto
What URL should I use to access it?
Thanks in advance
By using left hand rule, I rotate one object left and right using y axis, and rotate up/down using x axis.
After first object is rotated to the right, the up/down rotation should be using z axis.
However, when I try to rotate using z axis, after the first rotation, it has the same effect when I rotate…
I am just following the tutorial about NerdDinner and was stuck because when I am implementing the "Index" View Template I got no data from it. It seems that when I loop around in the code below:
<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
Upcoming Dinners…
Whats wrong with these pre-processor directive in C#
#define OUTPUT_DIRECTORY "E:\asdf\sdfg\jhkl\"
I also tried giving:
#define OUTPUT_DIRECTORY "E:\\asdf\\sdfg\\jhkl\\"
for both I get error:
Error 1 Single-line comment or
end-of-line expected
I am trying to do an app, to where when it launches, it will detect audio, and then play it back automatically. NO BUTTONS, nothing to press. Just a picture of something then, it listens for audio, then plays it back. Similar to the Talking Carl app in the App Store. Any ideas/help? Would…
I have a person object, which can have unlimited number of first names. So the first names are another object.
ie
person --- name
--- name
--- name
What I want to do is write an nhiberate…
On the MSDN site there is an example of some C# code that shows how to make a web request with POST'ed data. Here is an excerpt of that code:
WebRequest request = WebRequest.Create ("http://www.contoso.com/PostAccepter.aspx ");
request.Method = "POST";
string postData = "This is a…
I have a main controller to handle the very front-end of my authentication system, it handles login, logout, update user info, etc. functions that I anticipate calling by POST'ing from views/forms. What about something like a "delete_user" function though? My thoughts are a button…
Hey all!
So, I was just coding a bit today, and I realized that I don't have much consistency when it comes to a coding style when programming functions. One of my main concerns is whether or not its proper to code it so that you check that the input of the user is valid…
When I initialise a struct in C (Node is the struct):
struct Node
{
/* Non-Relevant code */
};
This works:
Node *rootNode = new Node();
but so does this:
Node *rootNode = new Node;
Is there a difference, and what is the difference between using () or not…