Live data from Hacker News

Show HN: A tool that transforms your whole list with just one example

transformy.io

81–90 of 151 posts

Re: Show HN: A tool that transforms your whole list with just one example

#81
post #15

Amazing tool. Feature requests: allow for more than one example. Input: {"class": "101", "students": 101} {"class": "201", "students": 80} {"class": "202", "students": 50} {"class": "301", "students": 120} Example: Class 101 has 101 students Output: Class 101 has 101 students Class 201 has 201 students Class 202 has 202 students Class 301 has 301 students Right now the first line cannot have any ambiguity. This is fi…

For that use case you can use the Lapis[1][2] desktop app (the secret weapon I use for data munging), which allows you to choose several examples and edit a file with direct manipulation - or define patterns using a DSL. [1] https://en.wikipedia.org/wiki/Lapis_(text_editor) [2] http://groups.csail.mit.edu/uid/lapis/

I love how that editor "just works" 12 years after its last release. Thanks!

Re: Show HN: A tool that transforms your whole list with just one example

#82
post #78

As mentioned by others, this is implemented in Excel 2013 as Flash Fill feature. https://www.youtube.com/watch?v=UccfqwwOCoY

Do you know if this is available on the new Excel for Mac too?

No. The shortcut does not work, nor is the menu entry in the "Fill" menu.

It's one of many missing features.

Re: Show HN: A tool that transforms your whole list with just one example

#83
I like the idea.

Does not seem to handle my main use case however (transforming a schema entry in Rails to a list of symbols).

Eg:

Input:

t.integer "Id"

t.integer "Active"

t.string "Email", null: false

t.string "CryptedPassword", null: false

t.datetime "created_at"

t.datetime "updated_at"

Example:

:Id

Output:

:Id

:Active

:Email

:CryptedPassword

:created

:updated

Re: Show HN: A tool that transforms your whole list with just one example

#84
post #9

Earlier quoted context omitted.

This is really neat! Any chance this will be a cli tool or module/library? It doesn't seem to play will with something like this as an input: 3, Roberto/Carlos, soccer, Brazil 35, Roberto/Carlos Michael Jordan, baseball, USA 6, Roberto/Carlos James Lebron, basketball, USA 10, Roberto/Carlos Shinji Kagawa, soccer, Japan Format: 3, ROBERTO/CARLOS, soccer, Brazil Gives me: 3, ROBERTO/CARLOS, soccer, Brazil 35, ROBERTO/C…

Given this "35, Roberto/Carlos Michael Jordan, baseball, USA" tuple what are you expecting as output?

I was expecting that as the output but got: 35, ROBERTO/CARLOS, Michael, Jordan

See other response as it works on word by word. Here is (hopefully) a better example:

Input:

    35, Billy Jean, soccer, USA
    29, Billy Jo Jean, football, USA
Transform-at:

    35, soccer, Billy Jean, USA
You'll get:

    35, soccer, Billy Jean, USA
    29, Jean, Billy Jo, football
But I was expecting:

    35, soccer, Billy Jean, USA
    29, football, Billy Jo Jean, USA

Re: Show HN: A tool that transforms your whole list with just one example

#86

I love the product. I have a small piece of feedback on the site. You could make it a tiny bit clearer that this is a free, registration free, service which people can start using with just one click. When I first visited the site, I looked it over, noticed the email box and the "get started" and just assumed it was a library I'd need to buy. It wasn't until I came back to the comments here that I realised the site w…

That was originally the plan but we showed it to some non technical people and they only understood the idea once we showed some examples. But you are right that we should make it more clear that it's free. Thanks!

On this same subject, I would just make the boxes on the very first page editable so you can just play with it right away. After reading the description at the bottom I spent a few seconds trying to manipulate the text boxes on the front page before I realized I had to click a button. It would be really cool if they were live editable examples right on the front page.

Re: Show HN: A tool that transforms your whole list with just one example

#87
post #85

Is anyone else bothered by the fact that 5 years ago, this would have been a free command line tool? But nowadays it's a closed-source web app instead?

The audience who are likely to make the most use out of a tool like this are not the same as the audience who would be comfortable using a command line tool.

I mean, you can replicate the core functionality of this fairly easily using awk, and if you're happy doing a bit of piping to perl or whatever, the fancier time re-formatting stuff is also easy.

In essence, the complexity in this tool (and what makes it cool) is the figuring out what you are trying to do without telling it - if you can run a command line tool you can tokenise the input yourself and you're most of the way there already.

Re: Show HN: A tool that transforms your whole list with just one example

#88
This is neat. I find myself wanting more detail on what works, though. For example, I c/ped your original example and tried "Roberto C. from Brazil."

It didn't infer that C. meant to truncate the last name, so everything ended up "John C." No biggie, but trying to figure out what does and doesn't work aside from tokenized string formatting was a bummer. Having the uppercase example led me to believe it could do more types of transformation.

Possible the right answer is hinting of some kind. "Roberto {C.} from Brazil" to hint that the C. should be matched with -something-, and since . naturally means abbreviation would mean "starts with C".

Re: Show HN: A tool that transforms your whole list with just one example

#89
post #59
post #54

This area of research is called "program sketching", which creates programs by example. http://www.eecs.berkeley.edu/Pubs/TechRpts/2008/EECS-2008-17... edit: see below

It's more accurate to call it "programming by example", which is a much older term, in common use, and actually means "creating programs by example". http://en.wikipedia.org/wiki/Programming_by_example Sketching means to provide a partial specification, of which details are filled in by the system. But in this case, the user is providing a full description of a single concrete example. These are different concepts.

Thanks for the clarification, they are similar but not the same. It looks like _sketching_ is more analogous to using Hindley-Milner for filling in gaps in an executable spec, where as Programming by Example infers code from data (examples). There is a wealth of interesting material referenced in http://web.media.mit.edu/~lieber/Your-Wish-Intro.html

Re: Show HN: A tool that transforms your whole list with just one example

#90
post #7

You know, for people that don't know Awk or aren't comfortable with a scripting language, this is a really nice idea. Thinking back to grad school, which was in a non-computer science quantitative field, there are lots of people that would have appreciated having something like this easily available.

It's useful for those people too; it saves you the time/mental load of writing (and potentially debugging) a regex.
Post reply on HN