Show HN: A tool that transforms your whole list with just one example
121–130 of 151 posts
Re: Show HN: A tool that transforms your whole list with just one example
#122Re: Show HN: A tool that transforms your whole list with just one example
#123Earlier quoted context omitted.
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
Sketching is a superset of programming by example. In examples, you only get input/output pairs, which as this thread shows, infers frustratingly close but wrong programs. In sketching, the input and output can also includes partial programs (sketches), so you can mark what you like, tweak, etc, and it fills in the rest. Increasing usability, the fragments can be in different languages. For example, input can be simp…
By analogous, I meant more generally, using some partial knowledge about a program or spec to fill in missing pieces, not types specifically.
Nice to know folks are using these techniques to do real world tasks, I always thought something like this would be first used for cleaning data. Types, properties, sketches and examples.
Three levels of relatedness, https://vimeo.com/22606387
Re: Show HN: A tool that transforms your whole list with just one example
#124Amongst other things this can be used for cleaning tables/lists from special characters, changing date formats and creating xml or json. Feedback and suggestions are very much welcome! We plan on adding a few more features soon as right now it is fairly basic but would like to hear some opinions and see if there's people out there that have a use for this.
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…
http://linux.die.net/abs-guide/x19673.html
It took me about a year of use before I could figure out how to munge lines in it, so it's definitely not for the faint of heart. I use it for things like transforming excel spreadsheets into C struct arrays.
Re: Show HN: A tool that transforms your whole list with just one example
#125Re: Show HN: A tool that transforms your whole list with just one example
#126Useful if Emacs is unavailable.
Re: Show HN: A tool that transforms your whole list with just one example
#127On your main screen, make the example editable. It would be nice to be able to just enter into the green box to see how it works rather than have to click through the "Get Started" Also, your instructions makes it seem like the example is editable: SUPER EASY TO USE 1. Paste your source data in the white box on the left. 2. Type in the green box on the right how you would like the first line of your data to look. 3.…
Re: Show HN: A tool that transforms your whole list with just one example
#128This is a great idea! It didn't behave the way I expected with some URLs as input, though: http://example1.org/path/index.html http://www.example2.org/path/index.html http://www.example3.org/ https://www.example4.org/a/b/c/d/e/f/g/hijklmnop The pattern I gave was: example1.org, path/index.html So I expected to get: example1.org, path/index.html www.example2.org, path/index.html www.example3.org, www.example4.org, a/b…
For example, if the rules were: example content must be contained within braces, and any braces within the example content need to be escaped, it's clear. At that point, your example becomes:
{example1.org}, {path/index.html}
It would still probably just return "wwwexample.4, g/hijklmnop" for the last example though, because it's ambiguous as to whether you want just the end of the url, or the whole thing. Allowing regex markup for more explicit matching would make it clearer still, but your example still causes problems until you go all the way to positive lookbehind assertions. At that point I need to learn all that, I might as well just use perl: # perl -pe 's{.*https?://([^/]+)(/\S*).*}{$1, $2}' /tmp/foo
example1.org, /path/index.html
www.example2.org, /path/index.html
www.example3.org, /
www.example4.org, /a/b/c/d/e/f/g/hijklmnopRe: Show HN: A tool that transforms your whole list with just one example
#129Afaik, "LeBron" is his first name. The way you use it (and misspell it) is confusing, I'd suggest you replace him with a simpler alternative (Kobe Bryant? Tim Duncan? whatever). Same for Kagawa -- the Japanese use surnames in a different way, might be simpler to replace him.
Re: Show HN: A tool that transforms your whole list with just one example
#130Afaik, "LeBron" is his first name. The way you use it (and misspell it) is confusing, I'd suggest you replace him with a simpler alternative (Kobe Bryant? Tim Duncan? whatever). Same for Kagawa -- the Japanese use surnames in a different way, might be simpler to replace him.