Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I generate a Timeline with data of a SQL query. I use various timesheets in the same row. The problem is, that sometimes I get same timesheet from two different query in a row, so these are in full cover. In this case I would like to see only one.
Is there a built in feature in the API to handle this situation?
Example: http://i.stack.imgur.com/KVClR.jpg
I am not certain that this will work, but you could try grouping your data before drawing the chart:
// the first array should contain a list of all of your column indicies, the second should be empty
var groupedData = google.visualization.data.group(data, [0, 1, 2, 3], []);
This will create a DataTable identical to your original, except any rows that are exact duplicates will be reduced to a single row.
It is probably faster to handle this in SQL than in javascript, though.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm building a real estate website with property listings, some filters to search and an address field with autocomplete. It's working fine, but the performance on the autocomplete is super slow. It takes almost a second to get a response. Considering all services are in my region I think that's pretty slow.
I improvised sort of a "fuzzy" search where I split the source string (for example if the user searches for "Jumeirah, Rimal" becomes ["jumeirah", "rimal"]) and try to match a location's full "path" (a string like locationID/city/community/sub-community/tower, in this example "are.1.50/Dubai/Jumeirah Beach Residence/Rimal") to each part of the split string. The expression becomes something like this:
contains(#path, :fullString) OR
(contains(#path, :stringOne) AND contains(#path, :stringTwo) AND ... )
The important thing is that because I need to use the "contains" operator, I can't do it efficiently with a KeyExpression and I need to use the slower FilterExpression with a full scan. I only have 7,500 locations to search from and the performance is pretty bad already.
This made me think if I should use an SQL based database like Aurora. AFAIK SQL can execute complicated queries very efficiently.
I will also look into AWS's elastic search solution.
What do you think?
DynamoDB is most performant when you are able to perform a query operation to find an exact partition key, using the scan operator will likely lead to a performance hit and lead to increased usage of read credits.
Whilst a relational database such as Aurora can perform this operation, using ElasticSearch will likely be more performant for this operation.
By using ElasticSearch functionality for performing a fuzzy search is supported and is one of the key benefits to using this as a document store.
If you used Postgresql Aurora, use this: https://hub.packtpub.com/how-to-perform-full-text-search-fts-in-postgresql/
That's Full-text search inside the DB with indexes (check GIN and RUM index types). no need to duplicate your data out of the DB into a Elasticsearch instance also you can get more creative from there and use extra fields from your db to rank the results in a better way. absolutely recommended. e.g. now that I know these rows match the fuzzy search, let's do an inner join get extra data and tweak the ranking function to show geolocated results by distance (PostGIS)
I saw some guys saving more than 80% of their bill by removing the elasticsearch server and serving that FTS query from its own postgres
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am using aws dynamodb.
Let's say I have a slideshow gallery like below.
There are only 3 columns in my Table "Banners" which are id, createAt and url.
I can use upload button to upload photo.
When I press upload, 2 api will be called.
The first one is to create photo and store it at aws s3 bucket and then return the url, and the second one is used to store the url in Table "Banner".
Now I've come up a new design as below.
Every time I upload photo, it will show in "inactive banner".
The "Active Banner" will be shown in the slideshow at the top.
I can drag and drop the photo from "inactive banner" to "active banner" and vice versa.
Also, the order inside "active banner" can be changed by dragging to different position.
Every time I make changes, I need to click save to call api(PATCH/PUT) and make it work.
I have a few questions for the design.
1.Do I need to add more column in my dynamodb or new table? If yes, what should I do?
2.When I create/update banner, what actions should I do? I am not sure how to make it work by make http request.
As it is one-to-one data ; so need to create multiple tables. Simple design would be to add two more columns in your table :
boolean activeOrInactive
int order
whenever you create banner; u would continue doing whatever u are right now along with default values of these two new columns also. During update banner; u will just update those values.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a grid set up with a bunch of columns and rows. Right now im able to double click a cell and create a new frame. But I would like to capture the row data on the double click and display that in the new frame. I understand how to create a new frame and display data in it, i just need help in capturing the row data on the double click
was able to achieve this by using GetCellValue(); in wxWidgets.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
What would be better Logic approach to setup recurring Order modelling.
There is Order model with tons of Order information along with
o.recurrence_unit
o.recurrence_period
These ones are already calculated:
o.expire (date )
o.days_left (number, 31)
How would you setup parent / child relationship.
The idea I was scratching with "related" field back to original Order model. There is a possibility, the child recurring orders would need an model to themselves. Email reminders need to be sent to.
Tree-node-like models could be represented database-wise with a "parent" field pointing to the same model.
parent = models.ForeignKey('self', related_name='children')
However, caution is advised when you have to travel the "tree", as you should load from databse all instances and then travel it in Python using some sort of data structure rather than accessing your database multiple times with the antipattern some_instance.parent.parent.parent.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
For example: I have 2 lists (company and workers)
I would like to make a worker list view that will display all needed worker data + company.name + company.id
I know lookup field will display one specified column, but how can I bind another one to same lookup?
Thanks...
When you are creating the new lookup column in your workers list, it would ask you for the list from which you want to lookup (company in our case).
After that you need to specify which column's value you want to use as lookup value (this is the one specified column that you have said in your question).
Underneath that it would show a list of all columns available in the looked up list.
Select all columns that you want to show from your looked-up (company) list into your (worker) list view.
Note: dont think that now you would be asked for values of all these other selected columns when you are creating a new (worker) item. It would only ask for the primary column value (company title in our example). The other selected columns are only for display purpose and fetch values directly from looked-up list item.
You can also find my detailed blog post on this matter here.