user-pic

Alexey Shrub

Subscribe to feed Recent Actions from Alexey Shrub

  • BillThom21 commented on SSH Can Do That? Productivity Tips for Working with Remote Servers

    I actually use WebDrive to do this, if anyone still happens to be looking for a reasonably-priced option. It is a bit less expensive than Expandrive (which I will admit I have never tried). But I've always had success with Webdrive and have been using it for years. www.webdrive.com

  • David Cantrell commented on SSH Can Do That? Productivity Tips for Working with Remote Servers

    For persistent connections I find it better to use the %C token in ControlPath. It produces a shorter string, so will help get around some path length restrictions. Also, that really ought not to be a path in a world-readable place like /tmp!

  • Smylers commented on SSH Can Do That? Productivity Tips for Working with Remote Servers

    Both good ideas. %C didn't exist when I wrote the above.

    On a laptop only used by me, I was using /tmp/ (it avoids need to know your username to put in the config), but for shared computers it isn't a good idea.

  • J commented on The clearest way(s) to check if a List contains...

    I was just thinking on this the other day. To answer your Hash question: Like another commenter said hash lookup time is constant. It's can be a better choice when you want to search the array multiple times.

    When I was thinking about this I did some benchmarks. Hopefully I've done them right. I tested arrays of 100 elements searching for an integer that was in the middle of the array. I've pasted the results below.

    The way I interpret it is that you'd need to do at least 7 lookups for a hash lookup to be a better choice than grep, and around 25 lookups before it outperforms…

  • J commented on The clearest way(s) to check if a List contains...

    I forgot to mention that the reason why the lookup is slower on a single search in the first place is that I'm converting the array to a hash before doing the search. I'm using the "%hash = map { $_ => 1 } @array;" pattern you often see.

Subscribe to feed Responses to Comments from Alexey Shrub

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.