HNHacker News
TopNewBestAskShowJobs

mattewong

78 karma · joined August 12, 2015

submissionscomments
mattewong··on Show HN: ifthensave.com – A privacy-focussed financial planning tool
My 2 cents: This is a lot of work just to see it in action. I have to click, fill out a form to save a scenario, then start entering data. I can understand why it was built that way-- it makes sense from an engineering perspective to do so-- but it creates a significant obstacle, especially when there is very little insight into the mechanics of the model without going through all of that work. In addition, the data entry UI is a bit confusing, even for someone familiar with finance.

Would suggest: * describe what the "black box" does if one bothers to enter all their portfolio info * make several predefined + pre-populated scenarios that a visitor can choose from list in <= 2 clicks. You could even just dupe allocations from common investment profiles such as one might see in a 401k option or when choosing from typical passive ETF/fund vehicles * make the above step "dupe" into a new scenario that the user can then edit/tweak to their preference

mattewong··on Show HN: Nsga – Rust Implementation of the NSGA-II
Not being familiar with NSGA, I would find it very interesting if your link provided some context/example as to why this intriguing problem matters in the real world. I'm sure it does, I just can't fathom it and googling "NSGA" comes up with what appear to be very unrelated results
mattewong··on Show HN: Random Data Generator for arbitrary data types
For relatively small data sets in CSV format, you can use the in-browser utility-- which is quite convenient (no installation, no security concerns) at https://zsvhub.com/playground/. A subset of the features there are available in a native command-line utility (all open-source-- see https://github.com/liquidaty/zsv), to which the "obfuscate" feature that is currently available in the playground will soon be available and is anticipated to be extremely fast (in keeping with the project's current status as the fastest CSV parser). Full disclosure: I am one of the contributors / authors of zsv/lib and zsvhub
mattewong··on Show HN: SQL on CSV/TSV/etc + native/WASM + worlds fastest CSV parser
Will take a look. Does it come with a sample main() that can either spit out some specified columns, or simply count rows? and/or plug into https://bitbucket.org/ewanhiggs/csv-game. Feel free to post this as an issue
mattewong··on Show HN:in-browser CSV/XLSX stratification & validation w covid & loans examples
There is a lot of talk these days about "big" data, but we see a lot of "small data" use cases-- say, 1,000 to 1mm rows-- where repetitive but non-automated tasks hamper everyday work for armies of analysts. Many pieces must be assembled to solve this puzzle, of which this covers a small-- but non-trivial-- bit. Hopefully interesting to at least those lucky folks whose everyday job is to muck around with data and generate these kinds of reports
mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
Thank you for the ideas / links / mentions! I had not seen them and will check them out. Always looking for improvements!
mattewong··on Show HN: Full-featured+fast SIMD CSV lib, extensible utility & web playground
Correction! https://zsvhub.com/playground/ (needs the ending slash) which is powered by a web version of the SIMD parser (https://github.com/liquidaty/zsv). BTW some quick performance notes on the zsv CLI (not the playground): prelim testing is ~2x faster than xsv or tsv-utils on osx (Intel), Linux and BSD (amd64), ~20% faster on Windows
mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
Saw it :)

> done efficiently with very few branches, though, using mostly SIMD and some scalar operations on masks [...] first phase basically looking for a comma or newline followed by a quote, then looking for the next unescaped quote

Yes that's almost exactly what ZSV does, except it just looks for any interesting char (i.e. delim or dbl-quote), irrespective of position relative to other interesting char, and then let's the non-SIMD loop figure out to do with the chunks in between. We tried pretty hard to use CLMUL-- ZSV was designed after a decent-enough digestion of Lemire and Langdale's work to try those techniques-- but the json vs CSV differences were too much, at least for us, to overcome due to the extra 8+ vector calls, without giving up more than the benefit. Furthermore, if you are going to "normalize" the value, even more of that benefit gets lost (in other words, if you read 'aa"aa,"aa""aa"', which are equivalent, and you want to spit out two equivalent values, then you will have to modify the second value before printing non-CSV, or modify the first value to print well-formed CSV, and either way you can't do that more efficiently with vector operations). Since we were not willing to give up the CSV edge cases, we were also not able to find any benefit from CMUL. That's not to say we turned over every stone-- maybe there is a way and we just missed it.

> are quotes in fields that don't start with a quote not special?

Sorry missed that q before. Yes, that is correct, at least according to how Excel parses with dbl-click-to-open (as opposed to doing an import operation from a menu). They only serve as a delimiter when they are strictly the first char. So: 'first cell, " second cell ,third cell' gives you 3 cells, the second of which starts and ends with a space and has a double-quote as its second char (i.e. the equivalent of '" "" second cell "')

As an aside, we made a deliberate decision to be consistent with Excel, for reason other than that in our experience, the users who are least able to cope with edge cases on their own, and therefore rely the most on the software to do what they want/expect-- are also most likely to accept Excel as the "standard", whereas users who want/need a different standard than Excel are also most likely to be able to be able to come up with some solution (e.g. python or other) if their need isn't met by the default behavior of a given software tool.

mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
Huh? your comment proves exactly what my prior post said, which is that you end up with 3 equal values that were each represented, in the input, in different ways. Looks like csv.reader + dialect=excel is doing exactly that.
mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
As promised: https://github.com/liquidaty/zsv
mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
If their data comes from a controlled bubble and they need not assume "real-world" data, then CLMUL might do nicely but best case it would likely only be a marginal improvement (and even then I would be willing to bet, not at anything less than 512 bit vector sizes). Best case, it still needs additional vector calls to support quoting. Obviously, if no quoting will be supported, it's even simpler, but then you also cannot support commas or newlines inside of cell values and are getting so far from "CSV" that you might as well just say you have pipe-delimited data which happens to use comma instead of pipe in which case you don't need CLMUL. If quoting needs to be supported, CLMUL will still require a number of repeated passes, shifts etc to deal with the various cases including an escaped first quote char, last quote char, non-first-or-last quote char and embedded commas/newlines.
mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
What I can tell you is that if you save a file with 'AA"A,"AA""A","A"A"A' (excluding the surrounding single-quotes) and then double-click to open in Excel, you get 3 cells with the exact same values. Furthermore, if you run `echo 'AA"A,"AA""A","A"A"A' | xsv select 1,2,3` you again get the same 3 values. For people working with CSV, it's far more likely that the user cares more about consistency with Excel than consistency with some python lib or with Google sheets-- neither of which are used much, compared to Excel, in the worlds where CSV tends to reside (at least in my experience)
mattewong··on Show HN: Full-featured+fast SIMD CSV lib, extensible utility & web playground
In the spirit of giving, we give you ZSV/lib, a fully-baked SIMD-powered CSV parser and extensible standalone utility. This is the initial alpha release, and includes select, sql, count, desc(rice), pretty, flatten, 2json, 2tsv, serialize and stack commands, along with a web playground (https://zsvhub.com/playground) demonstrating an extension for converting XLSX/M, generating stratifications and much, much more to come soon. Feedback appreciated. Enjoy!!
mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
Even with the CLMUL trick, CSV parsing does not play nice. It can be made to work for JSON parsing because you can make more assumptions. With CSV, it only works smoothly if you are willing to accept a subset of what most spreadsheet programs accept i.e. to assume your CSV is "well-formed". Considering for example that the following three cells:

AA"A,"AA""A","A"A"A

when opened in Excel will all give you the same value, using CLMUL to normalize will require many repeated additional SIMD operations-- probably at least 8 if not more. At some vector size it will be worth it, but not clear at 256. The irony is, if you are stuck with CSV input, then the fact that you couldn't get a better format/encoding also suggests that you can't assume your CSV is "well-formed"

mattewong··on Leveraging SIMD: Splitting CSV Files at 3Gb/S
Stay tuned for a SIMD powered CSV parser library and standalone utility about to drop this weekend. Alpha, but test showing it to be faster than anything else we could get our hands on
← PreviousPage 4 of 4