Widget with search facility in wxwidgets - user-interface

I was wondering if there were any nice widgets in wxwidgets, with search ability. I mean searching for data in large tables like, data in wxgrid.
Thanks in advance

It would be slow and inefficient in several ways to store all of a large dataset in wxGrid, and then to search through wxGrid.
It would be better to keep the dataset in a database and use the database engine to search through it. wxGrid need only store the data that is visible in the GUI.
Here is some high level pseudo code of how this works.
Load data into store. The store should probably be a database, but it might be a vector or any STL container. Even a text file could be made to work!
Set current viewable row to a sensible value. I am assuming your data is arranged in rows
Load rows including and around current into wxGrid.
User enters search term
Send search request to data store, which returns row containing target
Set current row to row containing target
Load rows including and around current into wxGrid.

Related

Filter a Data Source from a Different Data Source

I have two chart tables both with different data sources. I want one table to act as the filter to the other table.
Here is the problem...
I tried a custom query for my data source which used the email parameter to filter the data source.
The problem is every time a user changes a filter on any page a query is executed in BigQuery, slowing the results and exponentially increasing my BigQuery monthly charges.
I tried blending the two tables.
The problem is the blended data feature only allows for 10 dimensions to be added to the resulting blended data source and is very slow.
I tried creating a control filter using a custom field on the "location" column on each table sharing the same "Field Id".
The problem is that the results table returns all the stores until you click on a location in the control list. And I cannot let a user see other locations.
Here is a link to a data studio sample report you can clearly see what I am trying to do.
https://datastudio.google.com/reporting/dd33be45-ab13-4881-8a3b-cabafa8c0dbb
Thanks
One solution which i can recommend to over come your first challenge, i.e. High cost. You can customize cost by using GCP-Memorystore, depending on frequency of data that is getting updated.
Moreover, Bigquery also cashes data for a query if you are not using Wild cards on tables and Time partitioned tables. So try to customize your solution over analysis cost if it is feasible over your solution. Bigquery Partition and Clusting may also help you in reducing BQ analysis cost.

Best Xcode/cocoa method for displaying an array of inter-dependent data

I am an occaisional cocoa programmer who needs to write an app to display a table of data. I need a push in the right direction so I can avoid blind alleys. Stock data would provide a reasonable example of what I need to do. The raw data is collected by another program and written to a file, let's say stock trading volume, open, high, low, and close price. I need to parse the input file data and display it, but also add data (columns) that are derived from the other entries (rows), like average volume and moving average close price. I need to be able to scroll through a large file, and be able to find things, like a particular date or close price greater than some value.
An NSTableView – dataSource gives my code execution control for each data item, which would allow me to calculate derived items on the fly. It also requires the most code.
NSArrayController wraps up a lot of code, but I don't know if my code would get execution control to parse the input data. I'm also fuzzy on how to dictate what range of rows gets displayed (by scrolling or by searching).
Core data seems to tighten things up even more, but seems geared toward data that is created, saved, and read by the application, rather than something that is saved by another application in a format that differs from what needs to be displayed.
Thanks for any guidance you may provide.
Scott

Grid - When should you switch from html to server side table processing?

,This question is likely subjective, but a lot of "grid" Javascript plugins have come out to help paginate and sort tables. They usually work in 2 ways, the first and simplest is that it takes an existing HTML <table> and converts it into a sortable and searchable information. The second is that it passes info to the server and has the server select info from the database to be displayed.
My question is this: At what point (size wise) is it more efficient to use server-side processing vs displaying all the data and have the "grid plugin" convert it to a sortable/searchable table client-side?
Using datatables as an example, I have to execute at least 3 queries to get total rows in the table, total filtered results for pagination, and the filtered results to be displayed for the specific selected page. Then every time I sort, I am querying again. Every time I move to another page, or search in the table, more queries.
If I was to pull the data once when the client visits the page, I would be executing a single query, and then formatting and pushing the results to the client all at once. This increases the page size, and possibly delays loading of the page once it gets too big. The upside is there will only one query, and all the sorting, searching, and pagination is handled by the plugin, so no waiting for a response and no more queries.
If I was to have just a few rows, I imagine just pushing the formatted table data to the client at the page load would be the fastest. But with thousands of rows, switching to server-side would be the most efficient way.
Where is the tipping point? Is there a tipping point, or is server-side or client-side the way to go 100% of the time?
The answer on your question can be only subjective. So I explain how I personally understand the problem and give me recommendation.
In my opinion the data with 2-3 row and 3-4 column can be displayed in HTML table without usage any plugin. The data you display for the user the more important will be that the user will be able to grasp the information which will be displayed. So I think that the information for example have to be good formatted and marked with colors and icons for example. This with help to grasp information from probably 10 rows of data, but not much more. If you just display table with 100 rows or more then you overtax the user. The user will have to analyse the data to get any helpful information from the table. Scrolling of the data makes this not easier.
So I think that one should give the user comfortable or at least convenient interface to sort and to filter the data from the table. The exact interface is mostly the matter of taste. For example the grid can have an additional filter bar
For filtering and even for sorting of the data it's important to have not pure strings, but to be able to distinguish the data types like integer (10 should be after 9 and not between 1 and 2), numbers (correct interpret '.' and ',' inside of numbers), dates (3/20/2012 should be grater as 4/15/2010) and so on. If you just convert HTML table to some grid you will have problems with correct filtering or sorting. Even if you use pure local JavaScript data to display in grid it would be important to have datasource which has some kind of type information and then to create the grid based in the data. In the case you can gives date as JavaScript Date or as ISO 8601 string "2012-03-20" and in the grid display the data corresponds the specified formatter as 3/20/2012 or 20-Mar-2012.
Whether you implement filtering, sorting and paging on the server side or on the client side is not really important for the user who open the page. It's important only that all works quickly enough. The exact choose of the grid plugin, the filtering (with filter toolbar or external controls) and styling of the grid depend on your taste and the project requirements.

jqGrid: Best practice for doing upsert like operations

I'm setting up a jqGrid (in a Google Chrome Extension) which will handle local JSON data.
My concern is performance due to my unique use case. I have thousands of records getting dynamically generated on the client side over a few minutes and I can't wait for the data to be generated so currently I add this data to the grid row by row using 'addRowData'.
But the problem is, when I'm adding data to the grid I have to check if that data already exists and if it does I need to update the existing record. I'm just having trouble understanding the best way to accomplish this, is the only way I can search the grid by calling 'getCol' and then searching the array. My concern with calling getCol is I presume this searches the DOM? But I could be wrong, I have scroll: 1 set and I'm starting to think this might mean its pulling data directly from an array?
Or maybe I should be implementing this a totally different way? It would of been so much easier if I could of just inserted all of this data into an array and then loaded the grid but due to the time taken to generate the data the user needs to see it ASAP.

Core Data find item sort order index with sort parameters

I have fetched an array of items from my core data store sorted by a "Name" property. The user of my app is able to change the name of the item, and the UI is supposed to update to show the results sorted in the new way with a cool animation. The only trouble I'm having is retrieving the new order index of the item after its name is updated. Is it inefficient for me to just fetch the whole result set again (could be quite large... 1000+ records) for the sole purpose of finding the objects new sort order index?
Can anyone think of a better way of accomplishing this task?
No, it is not inefficient it is the way it is supposed to work. If you have very large fetches you can make the fetches more efficient by restricting the fetch batch size, explicitly fetching as faults, fetching by attribute etc.
See the Core Data Programming Guide:Performance for details.

Resources