It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Need help - How to create partition in SQL server which will held 2011, 2012, 2013 data in separate file groups.
I'm struggling to understand between RANGE RIGHT or RANGE LEFT....
Please specify version of you sql server, and read this: http://msdn.microsoft.com/en-us/library/ms187802.aspx
As for RANGE LEFT/RIGHT difference and decision to choose one for datetime column (I'm assuming datetime, but what exactly is the type in your case?), the command would look like this for int type:
CREATE PARTITION FUNCTION OrderDateRangePFN(int)
AS
RANGE [LEFT | RIGHT] FOR VALUES (100,200,300)
When you use RANGE LEFT, the first partition will contain values <=100. With RANGE RIGHT it'll be <100, and that's the difference really (please note that also NULLs will be handled differently).
In your example, if you wish to create partition function on datetime column, with RANGE LEFT your boundary values would have to be specified like this:
('20111231 23:59:59.997','20121231 23:59:59.997','20131231 23:59:59.997')
With RANGE RIGHT it'll be more elegant and plain:
('20111231','20121231','20131231')
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Well i tried and get an server 500 error.
My app must save more than 500 characters sometimes.
Any suggestion?
Using Go btw.
P.S : I always used MySQL before. So this App Engine Datastore is very new for me.
You didn't specify the language, but the documentation for Python says:
For text strings longer than 500 characters (which are not indexed), use a Text instance. For unencoded byte strings longer than 500 bytes (also not indexed), use a Blob instance.
The documentation for Java says
Text string (short) java.lang.String Unicode Up to 500 Unicode characters
Values longer than 500 characters throw IllegalArgumentException
Text string (long) com.google.appengine.api.datastore.Text None Up to 1 megabyte
Not indexed
If you use another language, you should now be able to find the type to use in the documentation.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
The real scenario is a bit complicated so, i will explain in a simple way.
I have a table with 10 columns as below
ID Year1 Year2 Year3 Year4 Year5
--------------------------------------------
1 x1 x1+ x1+ x1+
Year1 Year1+ Year1+ and so on
Year2 Year2+
Year3
x1 is a scalar value
Year1 - previous cell's value for the 'same row'
In such a case, how do i write insert statement in sql server.
I cannot use Insert into tableName values (1, x1, ???.....
I get stuck from the third row onwards. Any help would be help ful. Thank you.
Another option i found was to first insert, and then sequencially update for each cell's value. This method uses too many lines of code and I fear it could lead to overhead
I can think of two possible solutions here.
If you use T-SQL then use variables for columns and update these values as you described before triggering an Insert.
If you use some kind of middle-ware programming language like Java, update the column values before inserting.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
For a school project, we have to develop a theatre booking system, with a graphical representation of the theatre, which is labelled in a really annoying way. Our tutor said we should represent the theatre with a 2-d array of labels, but referencing each label to change the colour is tricky, say if the user booked seat 10,10 then that wouldn't be 10,10 in the array.
Does anyone know of any good methods of solving this? Because I am stumped.
Here is a link to the seating plan: http://i.stack.imgur.com/U14ut.png
I would suggest that you use an array of labels for each row. For example for row A create labels named lblRowA with indexes 1 to 14 and repeat for the other rows (having an array for each row). That should make it easy to map requests onto real world seating.
In addition to the 2-D array of labels, you can use two 2-D arrays of the same size, one for the row letter and one for number of each seat represented by the array of labels.
For example, for labels(4, 7) the seat number might be seatNumbers(4,7) and the row letter might be rowLetters(4,7).
If you know how (or can figure it out), you use one 2D array of a class or structure where each member contains the two values, and possibly reservation information, etc. In that case, you could address the seat information with something like seats(4,7).rowLetter, seats(4,7).seatNumber, and seats(4,7).reserved. You could also have a reference to the seat labels in the seats class.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Foulke's algorithm is defined by
(In + U)2 = In+ U + U2
with:
In : the identity matrix
U : square adjacent matrix
I want to implement this algorithm in C by recurrence.
Any help is appreciated.
Your formula is wrong. Substitute U with identity matrix and you will see that the equality does not hold. You need to change it to (In + U)^2 = In+ 2*U + U^2. Just like numbers. Makes sense, huh?
Otherwise all you need to do is to implement a function that multiplies to two-dimensional matrices and returns the result in a two-dimensional array. I don't think using recursion for this problem is a good option.
I recommend you to use BLAS library. Or you want to make all yourself without any algebra-library?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
We want to implement Public Transport Guide for Android.
Inputs will be beginning and destination point. Outputs will be the directives that
tell how can be gone to the destination with using buses, subways,... e.c
This is not easy for big cities and we must have a well-designed database for quick answer. Tranport algorithm must give optimum lines to the passanger.
I wanna see your precious ideas for database and algorithm design.
Thank you very much for answers.
Most likely you will need a graph there to calculate shortest path.
Your graph will be G=(V,E) such that V = {all possible stations} and E = {(u,v) | there is a transport connecting station u to station v}.
If your graph cannot fit into memory [which is probably the case for a big city], you might want to make a function successors(u) = { v | (u,v) in E } which will allow you to calculate the graph on the fly.
In this older question there is some discussion how to efficiently find a path between two vertices in a dynamic environment similar to the one you are describing.