I want to know how to extract all data from the collection. I cannot see more than 10 data. Is there any solution to this? Thank you.
Since you want to view the data while the simulation is running the best option is to traceln the data to the console. From there you can copy it and analyze it as you want.
Based on your example you can have a button with the following code.
Related
I'm writing a naive plugin for ElasticSearch and I would much like to update a field from within this script. Is there a way?
Context: I'm trying to use ELK stack to chart differences between documents. The documents are produced from two separate sources continuously.
I have sorted all the pieces, but this one is the last mile for me. Any help is greatly appreciated.
Never mind. I figured it'll need a org.elasticsearch.client.Client within Plugin code. Thanks all.
I'm attempting to load large amounts of data directly into Sphinx from Mongo; and currently the best method I've found has been using xmlpipe2.
I'm wondering however if there are ways to just do updates to the dataset, as a full reindex of hundreds of thousands of records can take a while and be a bit intensive on the system.
Is there a better way to do this?
Thank you!
Main plus delta scheme. When all the updates goes to separate smaller index as described here:
http://sphinxsearch.com/docs/current.html#delta-updates
so I am aware of .plist and archives and SQLLite as methods to store persistent data within the app, however, I have been stuck for a while trying to figure out how to store data from a user's daily activity so it may be displayed in a graph. For example, if a user walks 1 mile one day and 3 the next, how would one go about knowing when its one day and when it's the next?
THe best I can come up with is to store the current date, then the next time the user performs an action, check if the stored date is the same as the current date and if it's not, then save the data for a different day.
Has anyone got any better ideas or is there a standard way to deal with this issue?
I would use a SQLLite DB with a timestamp column indicating when the entry has been written. With NSDateComponents you can figure out later which day the entry has been added.
When you create an index over the timestamp column your queries will be pretty fast, what's kind of perfect for drawing graphs...
Using NSDate is a perfectly fine way. You'll probably need the dates for the graph anyways, or?
SQLLite is still a great method for that. Just don't treat it like a flat file.
SQLLite supports time stamping. Each time you enter the data you can add that stamp to the field. Running a simple SQL query will give you your data in a format you can use for a graph. You can also query the database to see what the current data is or how long it has been since data was last entered.
Read this page for a few hints:
http://www.sqlite.org/lang_datefunc.html
If you are asking about the right data structure for this, just store your data and timestamp in an array. Next time when you update, check the timestamp of last object in the array and see if the data has changed. If yes, add a new entry.
To persist this, just save this array into a PList. Since it's not a lot of data PList won't be a bad idea.
I am developing an iphone app which will fetch the data from CSV file as per the keyword entered in to the UITextFiled, eg. if user enters london than all the possible entries containing the same keyword should be listed down, I have tried CHCSVParser but i am still not able to conclude any result. Can anyone tell me is it even feasible??? and if yes than please help me through the initial steps.
Thanks.
If you can, then using a plist instead of csv will be much easier/flexible.
Maybe you can import your data in a .sqlite ressource file that contains all elements from your csv file.
Then for listing 15 000 elements or a subset of them in a tableview, the nsfetchedresultscontroller will help you. Initializing it with a fetch request will permits you to filter your elements based on one or more attribute name(s).
http://developer.apple.com/library/ios/#documentation/CoreData/Reference/NSFetchedResultsController_Class/Reference/Reference.html
Yeah, if you're going to repeatedly reference "random" elements of your CSV file, you should convert it to an SQLite DB (though that would be overkill if you're only referencing things once). For your app, as well as I can understand the description, a DB of some sort is most definitely warranted.
As to reading the CSV file, there are, no doubt, tools available, but it's probably just as easy to use NSString componentsSeparatedByString to parse each line.
I'm trying to store a lightly filtered copy of a database for offline reference, using ADO.NET DataSets. There are some columns I need not to take with me. So far, it looks like my options are:
Put up with the columns
Get unmaintainably clever about the way I SELECT rows for the DataSet
Hack at the XML output to delete the columns
I've deleted the columns' entries in the DataSet designer. WriteXMl still outputs them, to my dismay. If there's a way to limit WriteXml's output to typed rows, I'd love to hear it.
I tried to filter the columns out with careful SELECT statements, but ended up with a ConstraintException I couldn't solve. Replacing one table's query with SELECT * did the trick. I suspect I could solve the exception given enough time. I also suspect it could come back again as we evolve the schema. I'd prefer not to hand such a maintenance problem to my successors.
All told, I think it'll be easiest to filter the XML output. I need to compress it, store it, and (later) load, decompress, and read it back into a DataSet later. Filtering the XML is only one more step — and, better yet, will only need to happen once a week or so.
Can I change DataSet's behaviour? Should I filter the XML? Is there some fiendishly simple way I can query pretty much, but not quite, everything without running into ConstraintException? Or is my approach entirely wrong? I'd much appreciate your suggestions.
UPDATE: It turns out I copped ConstraintException for a simple reason: I'd forgotten to delete a strongly typed column from one DataTable. It wasn't allowed to be NULL. When I selected all the columns except that column, the value was NULL, and… and, yes, that's profoundly embarrassing, thank you so much for asking.
It's as easy as Table.Columns.Remove("UnwantedColumnName"). I got the lead from
Mehrdad's wonderfully terse answer to another question. I was delighted when Table.Columns turned out to be malleable.