Alexey Shrub
- Website: worldmind.livejournal.com
Recent Actions
-
Commented on The clearest way(s) to check if a List contains...
All variant is bad, good variant is: do_something if 'flour' in @ingredients but I don't now how make it...
-
Commented on Three Command-Line Utilities
You can use remind utility http://www.linuxjournal.com/article/3529...
-
Commented on SSH Can Do That? Productivity Tips for Working with Remote Servers
For multiple connection use screen utility - it is make many window in one ssh connection and (main feature) all your windows stay live after connections is broken, connect again, run screen -d -RR and see all your shell windows...
-
Commented on Non-functional perl code testing - automated code review
I experiment with Code::Statistics - if I rigth undestand ccomp it is cyclomatic complexity, but cyclomatic complexity is not depend of nesting, for this metric those codes is equal: 1. if(1){if(1){if(1){if(1){if(1){if(1){}}}}}}; 2. if(1){};if(1){};if(1){};if(1){};if(1){};if(1){}; But now I need test for nesting...
-
Commented on Non-functional perl code testing - automated code review
I experiment with Code::Statistics - if I rigth undestand ccomp it is cyclomatic complexity, but cyclomatic complexity is not depend of nesting, for this metric those codes is equal: 1. if(1){if(1){if(1){if(1){if(1){if(1){}}}}}}; 2. if(1){};if(1){};if(1){};if(1){};if(1){};if(1){}; But now I need test for nesting...
-
Commented on Non-functional perl code testing - automated code review
@ rjbs: Thanks, I found a couple interesting test modules in Dist::Zilla::PluginBundle::TestingMania...
-
Commented on Non-functional perl code testing - automated code review
@Mithaldu Thanks, I saw this module, but now don't remember why I don't use it....
- Posted Non-functional perl code testing - automated code review to Alexey Shrub
Comment Threads
-
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
%Ctoken inControlPath. 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.
%Cdidn'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.
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.