ryuslash is currently certified at Journeyer level.

Name: Tom Willemse
Member since: 2011-08-31 21:25:36
Last Login: 2013-08-02 09:31:43

FOAF RDF Share This

Homepage: https://ryuslash.org

Notes:

I started out as a C#.Net developer, using Windows, with an interest in C++. I installed Linux (Ubuntu, then Fedora), learned a little C++ and gained an interest in C. Now I'm a PHP developer using Emacs, Linux (Archlinux), with knowledge of C and Python and an interest in Go and Lisp (Guile specifically).

My current goal is to become proficient in C, proficient in using Guile to extend my projects and use Go to write web applications in.

Recent blog entries by ryuslash

Syndication: RSS 2.0

So lately I've actually been able to contribute tiny bits to some projects here and there.

It's difficult, every time you send something to someone to review, well, they review it, and might find out that it's crap. Luckily, so far, that hasn't happened to me.

It's also not easy because everyone has a different sense of style, or a different idea of where to go with a project. Of course, with that second one it's easy to fork any free or open source project and take it in your own direction, but when you send something to someone and they just don't like the look of it (though the code is valid) things get weird.

A week or so ago I sent someone a pull request on github (yes, sadly I'm using this again now) and it fixed a problem. The change didn't come from me, I just took over maintainership of the package for it in the Arch User Repository and felt that the right thing to do was pass along what a user of the package told me.

It was just one line, it was a single extra #include line in a single file, and me being forever in doubt I took a few seconds (perhaps even minutes) to think about where the author would like this one extra line to be.

It was a C++ file, so there were mostly .h-less includes, and there was #include <errno.h> in its own paragraph. So I thought stick them together, that probably looks best.

Turns out the author disagreed, haha. I sent him a pull request with the one line added and he threw it away and added it where he liked it to be. As he should have, of course, since it's useless to take my commit, create a merge commit and then create another commit to move that line up.

The whole thing struck me as funny, though. Personally, I probably couldn't throw someone elses pull request away, I'd be afraid they would dislike me for it. Perhaps that also has something to do with only having had two contributions to any of my projects so far, so perhaps I'm too worried about losing what little I have.

I can't imagine how really big projects do this, it must get messy, even with well defined coding standards. I don't think it would be fun to have to decline a contribution that does some really cool things just because it looks bad.

I've been trying out several types of code folding in emacs, but I've never found a very good one. Folding mode seemed clunky and could sometimes break font locking it seemed. HideShow actually removes (doesn't delete of course) the lines, so the line numbers get screwed up and things like goto-line get messed up.

This time I'm trying out outline-minor-mode. I've tried it before and didn't really like it, but this time I've combined it with some, IMO, nice header comments.

I've written a simple skeleton to help me write these comment lines:

(define-skeleton outline-skeleton
"Insert command"
"Text: "
'(beginning-of-line)
'(setq beginning-of-line-point (point))
'(indent-according-to-mode)
'(setq beginning-of-indent-point (point))
comment-start "-----[ " str " ]"
(let ((len (- fill-column
(length comment-start)
(length comment-end)
(length str)
9
(- beginning-of-indent-point
beginning-of-line-point))))
(insert-char ?- len))
comment-end)

And then I add this hook:
(add-hook
'prog-mode-hook
(lambda ()
(outline-minor-mode 1)
(set (make-local-variable 'outline-regexp)
(concat "\\s *" (regexp-opt `(,comment-start)) "-----\\["))
(hide-body)
(local-set-key [C-tab] 'outline-toggle-children)))

And whenever I load a file with these comments I get a nice and clean outline of my file.

Also, since it uses the variables comment-start and comment-end it works for multiple programming languages. I've tried it in both emacs-lisp and php.

Looks like:
;-----[ Prog mode ]---------------------------------------------------

What are some of the other options people use?

ntd progress #1

So I’ve only had a little bit of time to work on ntd. But at least I did do something, though nothing major. I got rid of the gets() function by replacing it with getline(), I know this is a GNU extension, but it’s apparently recommended and for now I don’t think anyone other than myself is using it, and since I only use archlinux I’m in minimal danger of incompatibilities.

I’m still getting some errors with valgrind, but if I eventually figure them out I will be able to fix it.

Maybe tomorrow I can finally start adding another command.


Syndicated 2011-09-19 22:50:05 from RyuSlash's Blog » Advogato

New toudou

So, I’m trying again… After feeling I couldn’t achieve what I wanted with toudou or toudou2 through 5, I’m starting from scratch again with ntd (New toudou).

This time I’m first going to focus on creating a shell in which I can perform the actions that I want. After that I will start looking at/thinking about user interfaces again.

Right now it’s only a tiny shell with some big holes in it (usage of gets, for example) that need to be fixed, and it only knows help and exit for commands, but it’s a start, again.

The code for it is here, though I can’t recommend looking at it yet, it might burn your eyes out.


Syndicated 2011-09-19 13:39:26 from RyuSlash's Blog » Advogato

17 Sep 2011 (updated 17 Sep 2011 at 08:22 UTC) »
redi: Ok, but, now I have 2 people to reply to, and I want to post something new. If I split it into 3 posts my name will appear high on the recentlog 3 times, making people think that I think I'm important enough to take up that much space.

Now, if I combine the replies and the post into 1, the 'thread' is completely broken, nothing about what I'm saying here indicates whether or not I'll be replying to anyone else or starting a new post. I don't care if comments get shown on the recentlog or not, if it's purely about conversation, but an indication of what it is meant to be might be nice. So that if I were to split it in 3, it would at least be clear that 2 of those were replies to others, and not just spam :)

cdfrey: As I've just said to redi, comments showing up on the recentlog would be fine, probably even a good idea because of exactly what you said. Also, I agree with your article comment, if we could at least see from the original post what discussion has been had over it, I would gladly leave it at that and be more than happy (since I'm already happy).

Thanks to both of you, and Zaitcev, for your comments, I appreciate it.

I've chosen a middle road, I'll split it in 2 (one for replies and one for post) and leave some time before I post again in the hope someone else is going to post as well :)

3 older entries...

 

ryuslash certified others as follows:

  • ryuslash certified djcb as Journeyer

Others have certified ryuslash as follows:

  • cdfrey certified ryuslash as Journeyer
  • redi certified ryuslash as Apprentice
  • chalst certified ryuslash as Apprentice

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page