Am Dienstag, 19. Februar 2013 um 00:50 schrieb Carsten Haitzler: On Mon, 18 Feb 2013 20:53:42 +0100 Leif Middelschulte <leif.middelschu...@gmail.com> said:
Am Montag, 18. Februar 2013 um 20:34 schrieb Davide Andreoli: 2013/2/18 Leif Middelschulte <leif.middelschu...@gmail.com (mailto:leif.middelschu...@gmail.com <leif.middelschu...@gmail.com>)> Hello everyone, Every few days I come across some functionality that isn't usable 'straight forward' but isn't explicitly documented either. After asking on IRC I usually go back to read the library's C code, which sometimes is quite a bit time consuming. Since I strongly believe that many problems and their respective solutions are reoccurring, I'd like to have some sort of searchable snippets for EFL usage. I'm referring to short snippets, not to full fledged examples that could be added to examples/ or deserve a blog entry/whatever. Let me give you an example: Problem: Change an edje part's rel1 value via message using embryo Straight forward solution I assumed: set_state_val(…) Real solution: custom_state(…) set_state_val(…) set_state(…) exactly this is explained in the example: efl/src/examples/edje/embryo_custom_state.edc I didn't want a custom state. I wanted to modify the current one. So this is - imo - not straight forward! Nevertheless I found an example that showed it. you can't modify a state from embryo without making a custom state. you MAKE a custom state FROM an existing state... Herrgott nochmal, it was just an example for a snippet ;-) Please stop commenting about this particular example and think about other pieces of code (if necessary)/the idea in general instead! An examplary snippet _could_ look like: embryo_part_modify_rel.edc: // TAGS: edje embryo message part modify resize rel1 rel2 script { public message(Msg_Type:type, id, ...) { new Float:rel_val; rel_val = getfarg(2); custom_state(PART:"some_part", "default", 0.0); // We need to create a custom state, since we can't modify a preexisting one set_state_val(PART:"some_part", STATE_REL1, 0.0, rel_val); // Modify the state we can actually modify set_state(PART:"some_part", "custom", 0.0); // Set part's state the the customized one } } -- Leif Now I'd go and create a snippet that contains only the few correct lines + comments and tag it with e.g.: "edje part geometry change rel1 embryo message" I imagine a dedicated git repository (e.g. 'snippets') that contains tagged code snippets (first commit line) and a web interface to eventually add/edit/browse/search entries. Luckily we have phabricator, which already provides all of this :-) Now we'd just need to add such a repository. What do you guys think? I don't think a new place to put example is a good idea, will make the search of resources more difficult. We have example/test/snippets too much sparse around: in sources, in the wiki, in examples, in tests... I think we need a sort of "contentrator" for all that info around. As I wrote it's not about full examples, just snippets! Are you familiar with gists? (see http://gist.github.com) I don't have the time to write out entire examples, but have the time to copy/paste a few lines I just coded/figured out and add some comments to them. Maybe a well done wiki page can be enough, I'm thinking of a sort of "big index" of resources grouped by libs. If we'd use a git repository you could use tools of your choice (e.g. grep) to search the given snippets for matching tags (either we embed them into the commit message or into the files). -- Leif ------------------------------------------------------------------------------ The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net (mailto:enlightenment-devel@lists.sourceforge.net<enlightenment-devel@lists.sourceforge.net> ) https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net (mailto:enlightenment-devel@lists.sourceforge.net<enlightenment-devel@lists.sourceforge.net> ) https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel