user-pic

E. Choroba

  • Commented on Day 5: Look ma, no 'argument list too long'! (App::rmhere)
    http://blogs.perl.org/users/randal_l_schwartz/2011/03/perl-to-the-rescue-case-study-of-deleting-a-large-directory.html...
  • Commented on Use Ctrl-d!
    I usually set IGNOREEOF in bash to 1, so I have to press ^D twice to quit. Sometimes, after pressing it for the first time, I realize there's something important in the session I need to copy somewhere else. Also,...
  • Commented on A small puzzle for you
    Kinda different approach. https://gist.github.com/choroba/4be98adb9425bd40ba0d...
  • Commented on What is the Perl community?
    Well said. Proud to be part of the community!...
  • Commented on Specify the min perl version for your distribution
    If you are too lazy to remember or look up what Perl version supports // and \p{Unicode}, you might like Syntax::Construct....
  • Commented on Inheritance is Bad: Code Reuse Part II
    _you need to change the behaviour from Destroyable to DestroyableResitances at runtime just for a specific object_ Roles can be applied to an instance. See "Applying Roles" in Moose::Role....
  • Commented on Warning: perlsphere.net has been hacked
    Firefox doesn't warn yet. Oops, I tried - I'll lose my identity, money and files!...
  • Commented on Do not use each
    Sorry, should have been: perl -E 'for my $x (qw(* < >)) { print "$x: ", scalar glob($x), "\n"}'...
  • Commented on Do not use each
    Unfortunately, glob is similarly broken: perl -E 'for my $x (qw(* )) { print "$x: ", scalar glob($x), "\n"}'...
  • Commented on Meta-testing
    Here you go. Created with TrEd ([http://ufal.mff.cuni.cz/tred]), written in Perl. http://i193.photobucket.com/albums/z176/echoroba/out.jpg?t=1399928650...
  • Commented on Make Your Live Demo Flawless!
    I recently wrote a script to simulate two users committing to a git repository - we wanted to test different strategies using "git rebase". https://www.youtube.com/watch?v=wY3ktKGforQ Looks pretty similar!...
  • Commented on Is that an Int?
    Using \D can be dangerous in the unicode world: use utf8; print "໖" =~ /\d/;...
  • Commented on Plz recommend an in-browser irc client
    kiwiirc.com...
  • Commented on I want mop rest capability to define fast accessor
    In case of inside-out objects, $self->x is not the same as $self->{x}, but rather something like $register->{x}{refaddr $self}....
  • Commented on Games in Perl/Tk
    Hopefully fixed in the new version....
  • Commented on Games in Perl/Tk
    I wrote a Perl/Tk multiplayer game years ago. It still has a bug: buffering issues with sockets. It should not be so hard to fix it, though :-) http://sourceforge.net/projects/chalaxy/?source=directory...
  • Commented on New, experimental screencasts
    Linux (openSUSE 12.2), Firefox 22.0....
  • Commented on Thank you Ack!
    BTW, XeTeX uses UTF-8 source files (probably not relevant to your thesis :-)....
  • Commented on New, experimental screencasts
    I can see the player, but after clicking on "Play", I get Can't play video Media source loading has failed. What's wrong with old plain YouTube? :-)...
  • Commented on PPI highlighted Mojolicious "quine"
    Oops. Just put this on one line: $a=q!print '$a=q'.$a.';';$a=~s/\x2a/\x21/g;print $a;!; print '$a=q!'.$a.'!;'; $a=~s/\x2a/\x21/g; print $a;...
  • Commented on PPI highlighted Mojolicious "quine"
    Just a note: For a program to be a quine, it should accept no input. Reading its own source code disqualifies your examples as quines. This is a Perl quine, though: $a=q!print '$a=q*'.$a.'*;';$a=~s/\x2a/\x21/g;print $a;!;print '$a=q!'.$a.'!;';$a=~s/\x2a/\x21/g;print $a;...
  • Commented on Be Careful With state Variables
    Yes, state variables are not as magical as one might hope: FILE: while (1) { state $first_file; LINE: while (<>) { state $first_line; say 'First file' if not $first_file++; say 'First line' if not $first_line++; # WRONG } }...
Subscribe to feed Recent Actions from E. Choroba

  • Dean commented on Use Ctrl-d!

    Reminds me of the NetApp CLI (OnTap)... which forces ctrl-D

  • Ovid commented on Inheritance is Bad: Code Reuse Part II

    First, you should generally be consuming all of your roles in a single with statement:

    with qw(Destroyable PositionRW);

    By composing those separately as you have (two separate with statement),you’re lose the composition safety of roles and your code is reduced to little more than mixins.

    Your concerns about separate Position roles don’t make sense to me. One is mutable and the other is not. Since position and movement are different things, why not make them different roles in your example? And you can define a position inter…

  • perlancar commented on Day 5: Look ma, no 'argument list too long'! (App::rmhere)
    perl -e 'chdir "BADnew" or die; opendir D, "."; while ($n = readdir D) { unlink $n }'

    Yup, I remember that Randal's post. And the above is essentially what the rmhere script does, with some options and progress reporting as the main raison d'etre.

    BTW, another way to delete contents of a huge directory (mentioned in rmhere's POD) is: "find ./ -type f -maxdepth 1 -delete". This is probably rather speedy too.

  • pru-mike commented on A small puzzle for you

    Yet another solution http://pastebin.com/7HSB8YTW

  • Sid Burn commented on Inheritance is Bad: Code Reuse Part II

    Your concerns about separate Position roles don’t make sense to me. One is mutable and the other is not. Since position and movement are different things, why not make them different roles in your example?

    It should be more a minimal example that. But the primary reason why i didn't name it "Moveable" was more that i don't see changing a Position as movement. That's also why i named it "PositionRW". I named the method "move_by". But in real-life you would name that "add" or better overload the "+" operator. And the interface of a Position is a lot more complex, you probably …

Subscribe to feed Responses to Comments from E. Choroba

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.