Re: New Year's Resolution - Learn Modern Perl
On 12/21/2014 12:12 PM, Sue Spence wrote: On 21 December 2014 at 16:36, Martin A. Brooks mar...@antibodymx.net wrote: From: Andrew Solomon and...@geekuni.com To: london pm london.pm@london.pm.org Sent: Saturday, 20 December, 2014 6:36:54 PM Subject: New Year's Resolution - Learn Modern Perl Start with 'Hello World' then develop a search engine in Perl and an online game powered by Dancer2. You've probably just guaranteed that no-one on this list will ever use your services. This sort of posting is likely to start a Kerfuffle, if not an actual Flame War, therefore I wish you hadn't done it. It costs nothing to be civil. Also, you most certainly do not speak for everyone on this list. We can't even agree on which editor to use, never mind anything else. :-) sue, that is a silly comment. of course it is emacs. uri
Re: Schwartzian transform
On 08/13/2014 05:33 AM, Dermot wrote: Hi Sorry for the OT post :) I am trying to transform the hash reference below so that the value of position is ordered from 1..4. The sorting works but I can't seem to modify the value of {position} inline. To achieve what I want I have to look through the @sorted array. I'd like to golf this if I can but I've hit a wall. check out Sort::Maker which can generate and rub an ST for you. it can also generate the faster GRT style sort. uri -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
info on eligo
hi all, tell me what you know about eligo recruitment. what kind of rep do they have among this list? they regularly post UK jobs to the perl jobs list and i see some US postings as well. i am interested in contacting them to see if they would do some joint placement. if they are a large corp type they will likely not do it. they claim to be smallish with 20 or so people. write me off list if you want. thanx, uri -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
Re: [ANNOUNCE] Damian Conway Speaking at London.pm: Monday, 10th March
On 03/07/2014 03:57 AM, Damian Conway wrote: how did you convince or blackmail damian to be in oslo in march?! about 10 years ago i produced his training in boston in february and he was frozen to icicles The explanation is pretty straight-forward: Average temperature in Oslo in March: +4 Celsius Average temperature in Boston in January: +4 Kelvin And I think it simply *felt* much colder in Boston. After the nitrogen in the air had liquified. better that than the 110F you were getting in your current summer. tennis players dropping like flies and major wildfires. and we like our liquid nitrogen. lotsa fun to play with. ever have a marshmallow quick frozen in it? i had one at the pittsburgh science museum at one of the first 2 yapc's (went with a small group of perlers). the marshmallow was crunchy! it wasn't too cold as the demo person let them warm up a touch. you chewed on it and it melted and stayed crunchy, a most interesting and very memorable experience. uri, who is looking forward to this spring after a very cold winter -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
Re: [ANNOUNCE] Damian Conway Speaking at London.pm: Monday, 10th March
On 03/06/2014 06:28 PM, Salve J Nilsen wrote: Mark Overmeer said: * mascip (mas...@gmail.com) [140306 08:39]: I can't make it. Any chance that our will be filmed? You may be able come to hear Damian in Amsterdam on March 18 ;-) Or in Oslo on March 26th and 28th :D how did you convince or blackmail damian to be in oslo in march?! about 10 years ago i produced his training in boston in february and he was frozen to icicles. :) i imagine it would be colder in oslo only a month later. what is the mean temp there in march? and i mean MEAN temp! uri -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
smutty british expression?
hi all, i am sure the subject got your attention. i read an article about the beatles sense of humor (50th year since they invaded the states is big here). it mentioned a line from penny lane: a four of fish and finger pies the article author said it was a somewhat smutty british expression. any of you smutty brits care to elucidate? here is the article with that comment: http://www.huffingtonpost.com/harold-bronson/the-beatles-humor_b_474.html thanx, uri -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
Re: Using grep on undefined array
On 08/14/2013 01:03 PM, Abigail wrote: On Wed, Aug 14, 2013 at 12:35:19PM -0400, Avishalom Shalit wrote: wait, aren't $a and $b special ? (they magically live for {$a=$b} etc. ) They are only special in special cases. Outside of that, they are as friendly as your other variable. People who pipe up upon seeing some code that uses $a and $b for illustrative purposes, predicting hell and doom even if there's no sort in that code behave like mindless grasshoppers, incapable of thinking for themselves. They probably also argue one shouldn't take water with you in a desert, because more people drown in water than in any other liquid. $a and $b are never checked under strict. so using them outside of sort can lead to bugs from typos and such. in the right circles using them for demo code is ok but newbies (who seem to like single letter names which is bad in general) will use them in real code and could get trapped. i say it is better not to use them in demo code for that reason. it is just good training (and not to use single letter names anyone except for maybe $i, $j, $x, $y in proper context) use $foo and $bar for demo code as those are strict checked and the classic metasyntactic names. uri -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
Re: Assigning anonymous hash to a list
On 07/30/2013 06:52 PM, Joseph Werner wrote: Hmmm. Yitzchak Scott-Thoennes, I recognize, Abigail I do not (perhaps I should?) So, Yitzchak, is this, in fact, a simple matter of operator precedence in that the ',' operator is of lower precedence than the assignment operator (absurd though that may seem) AND not a case of a scalar value (which is the result of a Perl expression involving a ',' operator) being offered to a list assignment? perldoc perlop shows the comma op has very low precedence. it allows for this: $foo = 1, $bar = 2 ; that does what you think it does, 2 assignments. the example in question breaks into 2 expressions connected by a comma (assignment in perl is still just an expression). the left expression does the assignment and the right expression has nowhere to go (hence its void context). as others (abigail too) have shown, warnings will catch useless data in void context. so parens around the right side changes where the comma binds to just inside the parens. now it assigns that list to the LHS list. note that the comma is now a list separator and not the scalar comma op. so this is absolutely a precedence issue and nothing else. the key is that assignment binds tighter than the comma. your eyes may say otherwise but perl (and abigail) knows better! :) thanx, uri -- Uri Guttman - The Perl Hunter The Best Perl Jobs, The Best Perl Hackers http://PerlHunter.com
Re: Alternative sources of Perl programmers
On 05/15/2013 12:06 PM, AJ Dhaliwal wrote: Damian (and Dave cross) disagree with you on that one. A week with them is worth more than a year's actual experience. On 14/05/13 22:10, Uri Guttman wrote: also even a week of training by damian (or dave cross) won't give actual experience. the trainees might do better but still have a steep learning curve in the real world. real world experience can't be taught in a classroom. i know damian's courses well as i produced a bunch of them in boston. you can only use some of the things you learn in a given shop. house rules, idiot cow-orkers, bad code base and such all conspire to slow down the application of what you learn in classes. in classes you don't work with real code much, you don't have to work around existing code, etc. that is what real world teaches you. as for training these days, o'reilly school of tech has a good set of online perl classes (written by peter scott). you have to code up problems in their sandbox to pass each test/level. they have online people to review and help you out. not saying this is better than a well taught class but it is another way to do it and they do it well. also being online, remote and self paced it has some advantages over a classroom. the real problem is getting shops to PAY for any sort of training. i was producing damian classes successfully for 3 or so years. then the economy bottomed out (this was before the great recession) and training budgets dried up. they still haven't come back yet from what i have seen. i would love to pull together damian training and client sponsorship but that didn't work when i tried it. uri
Re: Alternative sources of Perl programmers
On 05/14/2013 09:05 AM, Aaron Trevena wrote: You don't even need to train them youselves to start with - there are plenty of training courses available to get them started, or you could get a trainer onsite. i tried something like that a few years ago with damian conway. it was an offer to employers to fund a group training and then they could hire from the students. the problem is no one shop needs to train and hire 10 people at one time. and few (really none) of the potential clients went for such a farsighted concept. also even a week of training by damian (or dave cross) won't give actual experience. the trainees might do better but still have a steep learning curve in the real world. it is more like they need a year of apprenticeship to get the experience they need. and no one is going to do that these days. uri
Re: Alternative sources of Perl programmers
On 05/14/2013 12:09 AM, Richard Foley wrote: I had a contract role in Switzerland where the client was happy for me to come on board in a (largely) remote capacity. That meant some on-site work to familiarize me with the team and the project and then shift off-site for the majority of the work. This suited both parties. The agency stepped in, (they'd been unavailable during the telephone interview), and said there was no way I was going to work remotely for this client, and scotched the deal. Both the client and the contractor were screwed, and this had nothing to do with the practicalities of remote working, or problem solving of any kind. This was simply a power broking intervention. how did the agent scotch it? what motivation did they have (other than no ethics and lots of stupidity)? it may sound sappy but i am very happy when i place a perl hacker and all three parties (candidate, client and me) win. it does happen quite a bit IMO. my first placement was a grad student in germany and he moved to nyc for this job and he still has it 8 years later. that makes me happy. :) and i can't scotch things as i like c_ognac better! uri _
Re: cpan you have to see
On 12/12/2012 07:12 AM, Leon Brocard wrote: On Wed, Dec 12, 2012 at 02:29:24AM -0500, Uri Guttman wrote: i can't say much about this but you have to look at the code here. https://metacpan.org/author/PERLOOK/ I congratulate Alexej on joining the CPAN authors club. Instead of making fun of him on a mailing list why not engage with him and help him improve? look at his early rt ticket replies. and i did engage him and admonish his attitude. his reply was more normal but he still thinks his code is doing something useful and even correct. i will point him in better directions later today. but he should be learning basic perl on his own box and wait for publishing until he has something to show. what is up there is very broken ('#' is false in his world) and he doesn't know it. uri
Re: cpan you have to see
On 12/12/2012 11:46 AM, James Laver wrote: On 12 Dec 2012, at 15:57, Uri Guttman u...@stemsystems.com wrote: On 12/12/2012 07:12 AM, Leon Brocard wrote: he still thinks his code is doing something useful It is. I had to write something similar to his Boolean module when I inherited a fucked up database that had different standards for Boolean values in different parts of the code base. Everything was stored in a blob column for extra meta-database hate. Just because you get to work with all of the nice clean code in the world doesn't mean some people aren't stuck with the mistakes of others. Then again, my primary income stream is writing code and yours is recruitment, so it's expected I'm more likely to have to clean up messes. you still have strange views of my career. i have worked with some of the ugliest code and team(mis)work in existence. i have recently been doing perl support of a team where explaining why globals are bad took a few weeks to sink in to one member. you already made a judgment of my perl hunting and now another on my main income. i also get royalties from o'reilly for stuff. i have more pans in the fire than you would imagine. the reason my perl hunting is so good is BECAUSE of my activity in perl development, support, training, writing, etc. i can speak perl to both sides and do a proper match and never need buzzwords or similar fluff. uri
boolean return (was Re: cpan you have to see)
On 12/12/2012 12:57 PM, Joseph Werner wrote: On Wed, Dec 12, 2012 at 12:45 PM, Gareth Harper spansh+lon...@gmail.com wrote: PBP and I disagree with you on this one, Gareth. When a sub does a return 0; to a list context, that is interpreted as true. A bare return; is best practice. and i support that as well. the argument i get from the other side is when calling foo() in a list context that needs a scalar like a hash value: sub foo { ... return if $bad } %bar = ( foo = foo() ) ;# fail my counter answer is to use scalar there: %bar = ( foo = scalar foo() ) ; the win here is letting the caller decide on the context of the boolean return. if you do a return undef (or 0 or '') then the caller can't ever use the sub in a list context expecting an empty list, it always gets a scalar. a plain return works in all contexts and lets the caller force a scalar when needed. uri
cpan you have to see
i can't say much about this but you have to look at the code here. https://metacpan.org/author/PERLOOK/ in particular the boolean stuff is amazing and the print stuff isn't far behind. uri
Re: Agents part CCXXXIV
On 12/03/2012 07:05 AM, James Laver wrote: On 3 Dec 2012, at 06:38, Uri Guttman u...@stemsystems.com wrote: one reason i ask my candidates where else they are being submitted is to avoid those duplications. Bullshit. You ask because you want to try and muscle in on those positions. If you really asked permission before submitting every time (as you claim later in your email) you'd never be in a position of double submission. Pimp standard trick #4. and you can read my mind? wow. too bad my tin foil hat foiled you. i have never tried to learn about open leads from my candidates. i get clients who come to me directly because of many other reasons including a pretty good rep for my work. as for asking permission, again you claim to know what you can't know. not a very logical way of thinking. you can think incorrectly if you want but calling out bullshit without knowing anything is just bullshit. you may hate all agents but don't put that on to me unless you have facts to prove it. i run a very ethical agency and have plenty of backing of that statement. uri
Re: Agents part CCXXXIV
On 12/03/2012 04:51 PM, Tom Hukins wrote: On Mon, Dec 03, 2012 at 10:40:02AM -0500, Uri Guttman wrote: On 12/03/2012 07:05 AM, James Laver wrote: one reason i ask my candidates where else they are being submitted is to avoid those duplications. Bullshit. You ask because you want to try and muscle in on those positions. If you really asked permission before submitting every time (as you claim later in your email) you'd never be in a position of double submission. Pimp standard trick #4. James, stop making unfounded rude accusations on this list. That kind of behaviour has no place here. and you can read my mind? wow. too bad my tin foil hat foiled you. i have never tried to learn about open leads from my candidates. Uri, I completely understand why you feel the need to defend yourself. However this list has a tendency to set itself alight from only the smallest spark. Let's all try to keep our focus on making this group the way we want it. you said it for me. thanks. uri
Re: Agents part CCXXXIV
On 12/02/2012 03:32 PM, Dave Hodgkinson wrote: If an agent sends your resume somewhere without telling you, is there any kind of redress? i wish there were redress other than making those agents wear a dress. i have been on both sides and i distinctly told my agents to never submit me without my permission. there are several reasons why this is important. the most important is duplicate submissions. if you or another agent has submitted you, and then another submission is done, some companies will not accept you due to the issues of who is your agent and who gets a commission.so a double submission can cost you a job.one reason i ask my candidates where else they are being submitted is to avoid those duplications. another reason is if you don't want to work for a company or move to the location or other reasons to not want to be submitted. sometimes a candidate will apply directly and i have to decline to also submit them. i adhere strictly to the rule to always ask for permission to submit. sometimes i am talking to a candidate about a lead and i know they want me to submit them. i still ask the question to get a yes from them. if you run into an agent who does submit you without your permission, be sure to ream them out. talk to the agency boss if you can. maybe blog about them. maybe write something to the perl jobs discuss list. tell them they are on your shit list and will never get referrals again. this is an ethical issue and needs to be addressed before it gets worse. uri
Re: 25 Years of Perl
On 11/23/2012 02:43 AM, Andrew Savige wrote: Live Perl Golf Apocalypse 2000 at TPC 4, aka uri's triumph. wow. that was a painful event. saved by damian's fill in talk and forgiven by gnat. it was a team failure, so i can't take all the credit. iirc nfs didn't work well on the donated boxes or some similar issue we couldn't test for. it was way too ambitious and should have been a much simpler contest. never heard it called by either name nor mentioned in general in a good long while. let's try not to mention it again for an even longer period. remind me not to help you land a perl job! :) uri
Re: 25 Years of Perl
On 11/23/2012 02:43 AM, Andrew Savige wrote: Damian's Coy module 1999 and subsequent explosion of interest in haiku. one of my favorite damian stories is about his talk on coy.pm. this was early damian and tpc didn't schedule him more time or a large enough room. he was given back to back 30 minute slots for coy.pm and some other talk (forgotten now as you will see). the room sat maybe 70 people and was packed way beyond that as word about damian had gotten around. damian did his coy.pm talk and just kept going over into his second slot. NO one told him to stop and no one seem to mind. he filled the 2nd slot with more about coy.pm. the second talk was never given i think. another early damian story. he won the best technical paper at tpc1. at tpc 2 the tech paper judging was down to two top papers (authorship was hidden from the judges). they couldn't decide on the winner. turns out both were by damian! they disallowed him to enter again by naming the award after him. the next year, i co-authored the paper on faster sorting in perl and we won the award only because damian wasn't in the competition. eventually i did write a module implementing the ideas in that paper which became Sort::Maker. uri
Re: 25 Years of Perl
this thread reminds me of something we need to crow about more. so many conventions, inventions, ideas have come from the perl community and then be copied/stolen/absorbed by other langs, usually without much recognition. the most obvious is regexes with the pcre package everyone seems to use but it never can be truly perl compatible. how often have we seen regex questions in perl channels/groups for users in other langs? they say perlers know regexes better. hmmm TAP is used everywhere now. perl invented and spread it so it is universal in the perl world. cpan is always being copied (poorly) by other langs. they just never get the community feeling of uploading to cpan as a cred and for sharing. yapc has yet to be properly copied. no one else delivers more bang for the buck and fun as well. mjd invented lightning talks and they are at many confs now, not just lang ones. another perl invention with no credit given. uri
Re: 25 Years of Perl
On 11/23/2012 08:30 PM, James Laver wrote: On 24 Nov 2012, at 00:36, Uri Guttman u...@stemsystems.com wrote: yapc has yet to be properly copied. no one else delivers more bang for the buck and fun as well. mjd invented lightning talks and they are at many confs now, not just lang ones. another perl invention with no credit given. How are these perl inventions? They are community inventions. perl forms the core of the community and attracts the developers who add to the community. it is hard to separate them. i have told this to people about why i like perl and why perl has so many smart hackers. any community that would allow Acme:: and lauds it, has something special there. it stems from larry and timtowtdi and encouraging and allowing for creativity. humor is a part of that. i know larry fairly well and we all have seen his sense of humor. i met guido once at oscon and he seemed to have no fun even when putting a pie in dan sugalski's face. ask a python coder about the fun of the lang. ask them if they would sanction an Acme:: like name space. even the choice of Acme is funny! our community has more fun. that is a win for perl. :) uri
Re: 25 Years of Perl
On 11/22/2012 07:19 AM, Abigail wrote: I do remember Kevin giving us a tour of CMU, which included the location of the box that was running purl. This was during one of the first YAPCs, so indeed no later than 19100. A community thing that hasn't been mentioned yet: conference auctions. (Isn't London.pm still suffering from the outcome of an auction in 2001?) i can testify to the yap::na auctions for a few years. also the rise of yapc social events. that is a major win for the perl community. at the recent yapc in madison, some complimented yapc for the wide range of social events. other confs they said were just talks and be on your own. yapc is a very diff conference with the low fee, volunteer run, social events, etc. i know you are covering yapc but some emphasis on why it is so great would be a good thing. some memories: the first yapc in pitt/cmu run by lenzo was in the red. during the banquet we passed around a (real) hat). we collected over $2k to cover the shortage. a young 13 yo kid came to that first yapc. told a story of loading linux onto his mother's computer and she got pissed! this was cp5/comport5 of the infamous myspace worm. he is still hacking perl. uri
Re: 25 Years of Perl
On 11/22/2012 12:17 PM, Abigail wrote: On Thu, Nov 22, 2012 at 11:57:52AM -0500, Uri Guttman wrote: the first yapc in pitt/cmu run by lenzo was in the red. during the banquet we passed around a (real) hat). we collected over $2k to cover the shortage. Actually, the collection was during Kevins closing remarks. The $2k was collected before Kevin was finished with his talk. right. we learned about the shortage from his remarks. he didn't ask for the passing of the hat, it just happened. i helped to count the loot and take my piece of the action! :) i don't think any other yapc::na was ever under water. some were close to break even. now tpf backs yapc's costs so there should never be a hat passing. also there were no sponsors back then which is a major income for yapc now. uri
Re: 25 Years of Perl
On 11/20/2012 11:00 AM, Dave Cross wrote: Quoting Uri Guttman u...@stemsystems.com: in that vein you should also mention matt's scripts. evil code but they helped perl gain massive numbers of users. many were kiddies but some actually learned perl. Yes. I'm well aware of the effects of Matt's scripts. In fact I think I may have already mentioned that in this very discussion. you did but i didn't see that before i posted. the number of posts about matt's crap on usenet was enormous. it took the community way too long to rewrite them in clean safe code. that archive is now also forgotten as no one seems to mention them in the age of modern perl and such. uri
Re: 25 Years of Perl
On 11/20/2012 04:17 PM, Randy J. Ray wrote: On 11/20/12 1:10 PM, Dirk Koopman wrote: On 20/11/12 20:42, DAVID HODGKINSON wrote: As did PHP. And the rest is history. Speaking of which, is it just a folk memory that suggests that the first 'P' in PHP once stood for perl? I thought, for the longest time, that PHP had originally been an acronym for Perl Hypertext Pages. But people deny that, so I can't be sure. i recall it was perl home pages. and it definitely was written in perl in the earliest versions. note how much of the syntax and other stuff was stolen from perl and then ruined beyond all recognition. uri
Re: Proprietary Sybase DBI/DBD module
On 10/30/2012 01:35 PM, DAVID HODGKINSON wrote: Chris, Can you define proprietary please? It will be shipped with .so files? The source will be there but the license says we can't change it? it seems pretty obvious to me. the sybase people have written a new driver which is being released in binary only form (hence proprietary) and also they have written a DBD for it which they will (or have) put on cpan. as usual the DBD will be open source and free. i would expect the binary lib to downloadable but useless without a sybase server which is commercial. the confusion is from not clearly describing the binary lib vs the perl/cpan DBD module as separate entities. uri
Re: [ADMIN] Testing the Silence
On 09/24/2012 11:17 PM, Yitzchak Scott-Thoennes wrote: So, HTML::Template or Mason? *ducks* Template::Simple! print '*ducks*' x 100 ; uri
Re: Brainbench perl test?
On 09/06/2012 02:34 PM, Abigail wrote: On Thu, Sep 06, 2012 at 03:55:36PM +0100, Peter Corlett wrote: On 5 Sep 2012, at 17:35, Abigail wrote: [...] No. Well, it filters out the wannabees. It doesn't recognize the serious coder. If, given the Fibonacci sequence, or a similar recursive formula, and your first instinct is to solve it with recursion or iteration, you aren't serious. Isn't the *point* of this to be a simple test to quickly filter out the no-hopers? I'd hope it wasn't the *only* test. Well, I responded to uri who claimed it was the distinguish between wannabees and serious coders. But in my book, being able to calculate the Nth Fibonnaci number doesn't make you a serious coder. It just means you've past one hurdle, and I will have some followup questions. You haven't failed the interview, but you haven't shown that you're a serious coder yet. maybe i overstepped in calling that a serious coder filter. i would never just use that determining a skilled coder. it could be useful to filter out the total losers. i speak to hiring managers all the time and they give out similar tests just to filter out the losers. i review perl tests for a partner agency. i have seen test results that would make you blanch they were so bad. my favorite which i have seen *multiple* times is for a basic merge sort. given a set of large sorted files of lines, write an efficient merge sort. basic stuff and many do ok with it. the dumbest ones read in all the files into a single array and then call sort. then they wait for heat death. the second dumb answer i see is a proper merge sort of only *two* input files into an output file. then another merge sort of that output with another input file until all the input files are done. faster than a full sort but it reads in much of the data N times or so. that is a much more real world problem than fib but the idea of efficiency (which is key to this client) seems to get lost on too many candidates. i have to give ratings on these tests and my partner decides based on that whether to submit them to their client. as you would expect, those answers get downgraded a lot. uri
Re: Interview Questions
On 09/05/2012 06:34 PM, Simon Wistow wrote: On Thu, Sep 06, 2012 at 12:12:16AM +0200, Joel Bernstein said: Really I find interviews are less about individual questions or tasks, and more about where the conversation goes based on them and the interviewer's abilities to steer the conversation and to assess the candidate based on those discussions Yes. Yes. Thrice yes. and i have said that here a few times already. it is also the core tip i give to my candidates when they are interviewing. it is not an interrogation but a conversation. you should ask questions and tell stories about your projects. this is closer to a real work situation where you are discussing how to solve a project. uri
Re: Brainbench perl test?
On 09/04/2012 08:03 AM, Mr I wrote: I've literally had people who were Senior programmers (whatever that means) who, when given the instructions Given that fib(n) is equal to fib(n-1) + fib(n-2) write a fib function in any language didn't even get to the sub fib { my $n = shift; return fib($n-1)+fib($n-2); } IMHO this is a typical example of an awful question! It requires additional knowledge of the problem domain NOT asked by the interviewer.Your assumption is that the candidiate knows: a) the fibonacci sequence b) mathematically how to calculate (included recurrence) why do they need to know it? they are given the formula!! and they can do a linear version if they don't know recursion. and knowing recursion is a good coding test to filter out the wannabes from the serious coders. It's such a flawed question. You're not testing the candidates knowledge of maths you're testing their knowledge of programming. and how to code given an algorithm. very legit. The question does not allow you to assess whether the candidate is freezing due to their lack of knowledge in mathematics or in programming. what math? this is trivial math. if you are a coder with such a limited exposure to the world to not be able to handle this (and you are given the formula!!), then you are not worth hiring. also exposure to fib is very very wide. you have to be living under a rock to not have heard of it. It's equivalent to asking you to write a function ved(n, m) that implements the 16 sutras* and uses them to return the result. A task that maybe easily done by many an Indian programmer yet many in this group would struggle with. way off target. the fib solution is 2-3 lines in recursive and about the same in linear. not a lot of code or brain busting work. A good question should reference a closed problem domain with a clearly defined task (e.g. create a maze in a 6 by 6 grid, sort a pack of single faced cards, etc). That way you can assess the candidates reasoning, approach and coding (hopefully). and if they can't code fib given the formula, you think they can code a maze or a multikey sort?? wow. uri
Re: Brainbench perl test?
On 09/04/2012 09:20 AM, Avishalom Shalit wrote: I remember meeting someone who knew what the sequence was but forgot the name. Ended up calling it the Fettucini sequence. Bonus points. told that to my wife and she just about snorted pasta out of her nose! she didn't know the name fibonacci but laughed as she got the issue. uri
Re: Brainbench perl test?
On 09/04/2012 09:41 AM, Dominic Humphries wrote: On Tue, 2012-09-04 at 14:31 +0100, Matt Freake wrote: For that reason, I would have thought there were other, better, recursion problems out there I could use. Tower of Hanoi? :) but at least 20 disks and it has run before the interview is over! uri
Re: Brainbench perl test?
On 09/04/2012 12:05 PM, Jacqui Caren wrote: On 04/09/2012 15:03, David Cantrell wrote: You are aware, I trust, that the whole point of an interview is to be discriminatory? Discrimination is probably too evocative a word :-) Also an good interview is a two way exchange on info. i said that in another thread. i both run my interviews and tell others (both sides) that it should be a conversation, not an interrogation. both sides should be asking and answering questions and telling interesting, geeky and hopefully fun stories. that is what makes it work for both sides. telling a coding story well means you can communicate, understand the complexities in the tech part of the story, show empathy (need that for teamwork), have a sense of humor, etc. uri
Re: Brainbench perl test?
On 09/04/2012 12:18 PM, David Hodgkinson wrote: On 4 Sep 2012, at 16:07, Smylers smyl...@stripey.com wrote: Piers Cawley writes: Tower of Hanoi is always a better example for solving with recursion than the fibobloodynacci sequence. If nothing else, the recursive solution isn't quite so immediately obvious from the problem, the terminating condition is obvious and an iterative solution isn't quite so hogwhimperingly more efficient. Yes, that's much better. When was the last time you recursed in day to day web type code? every day. i see bad code and i curse. then i curse again, and again and again! uri
Re: Can I get some advice on best way to start Perl Programming
On 08/31/2012 06:09 PM, Denny wrote: Hi Rick, On Fri, 2012-08-31 at 11:16 +, Rick Deller wrote: I have brought a couple of books on the subject which I'm reading through I'm very keen to learn more and how to do it Can anyone suggest more books or another way of doing it ? As well as Mark's suggestions, I can personally recommend the Perl courses run by Dave Cross from this group. I did one of his intermediate courses a few years back, and he's just recently started doing more beginner and cross-training courses if I recall correctly. also the o'reilly school of technology has 4 levels of perl courses written by peter scott. what is good about their setup is you code up answers to problems on their sandbox and get them reviewed by a trainer before you can pass. so you go at your own pace but with help. and you can signup at anytime and not need to wait for a course nearby. uri
Re: Can I get some advice on best way to start Perl Programming
On 08/31/2012 07:30 PM, Paul Makepeace wrote: On Fri, Aug 31, 2012 at 4:16 AM, Rick Deller r...@eligo.co.uk wrote: Hi all, I have brought a couple of books on the subject which I'm reading through I'm very keen to learn more and how to do it Can anyone suggest more books or another way of doing it ? You don't say specifically Perl so I'm going to suggest a similar language: check the subject! :) uri
Re: Brainbench perl test?
On 08/28/2012 01:49 PM, Zbigniew Łukasiak wrote: On Tue, Aug 28, 2012 at 3:09 PM, Dave Hodgkinson daveh...@gmail.com wrote: Anyone done this lately? Still as useful as it used to be? I did it I think 10 years ago, so not really recently, but I am disappointed that I cannot find my certificate at their website now (I still have the paper one). i also did it way back and didn't like it then. multiple choice tests in general suck for actual testing of real world skills and programming ones suck even more. no candidate i have reviewed in ages has ever mentioned brainbench nor has any client. so in my world it is a non-entity. i know of several take home tests from clients that i review or see the answers and they tell me much more than any 'cert' could do. so does reviewing of existing code samples. there is no reason to even consider a timed multiple choice test. uri
Re: Brainbench perl test?
On 08/28/2012 02:46 PM, Paul Makepeace wrote: On Tue, Aug 28, 2012 at 11:09 AM, Uri Guttman u...@stemsystems.com wrote: i also did it way back and didn't like it then. multiple choice tests in general suck for actual testing of real world skills and programming ones suck even more. no candidate i have reviewed in ages has ever mentioned brainbench nor has any client. so in my world it is a non-entity. i know of several take home tests from clients that i review or see the answers and they tell me much more than any 'cert' could do. so does reviewing of existing code samples. there is no reason to even consider a timed multiple choice test. When I interviewed at the BBC they had me do Brainbench. It seemed like a fair, reasonably challenging test. The BBC is a pretty decent employer so I'd consider that a reason to do a timed multiple choice test ;-) it can be used as a very basic filter to remove the idiots (there are plenty of them). clients hate having to do that level of filtering themselves so they may buy brainbench uses. i don't need them as my idiot filter is on a hair trigger all the time. :) From an employer's side - it's practically no cost to them on top of their existing recruitment efforts, and has a bunch of benefits associated with involving an unconnected third party. considering the dozens of clients i have dealt with and none have ever mentioned brainbench, i stand ny my view that it is a non-entity. if you can't pass brainbench, you are a non-starter. if you can pass it you would still need to be properly vetted by me or by coding tests. so it doesn't gain much in my view. thanx, uri
Re: Brainbench perl test?
On 08/28/2012 05:15 PM, David Cantrell wrote: We would, of course, then go through candidates' code with them, talking about how they might improve it given more time, what other approaches they considered and so on. Apparently my solution fucked with peoples' heads. I blame MJD, because IIRC I'd just recently inhaled HOP. that is my primary filtering technique. i review their sample code and talk about its strengths and weaknesses, ways i would like to see it improved, etc. HOW they react to that is a critical part of my review. a couple have been so pissed they almost hung up on me. how dare i tell them how to improve their code!! but most are very open to getting reviews and we end up in good conversations about reasons why i said that and other ways to do things, etc. a collegial attitude where they can learn. even with a lower level coder, that attitude is a big win as i can place them in the right slot knowing they will grow. also this tells me how they think as they will explain why they did some coding thing. most are very appreciative as they get a free review and hopefully integrate my comments into their perl skills. after such an in depth chat (30-60 mins or more), i usually know their perl skills well enough to accurate convey that to my clients. this is why my candidates and clients like my service. old fashioned matchmaking without automated crap in the way. :) thanx, uri
and this place ships bagels to the US!
http://www.stviateurbagel.com/products/?rand=1002335542
Re: and this place ships bagels to the US!
On 08/22/2012 04:35 AM, Raphael Mankin wrote: On Wed, 2012-08-22 at 01:42 -0400, Uri Guttman wrote: http://www.stviateurbagel.com/products/?rand=1002335542 So what's the problem? Bagels are no more native to the US than they are to Canada. They are a European invention. never meant to send it here. address completion typo. uri
Re: Regex help
On 04/20/2012 11:29 AM, Simon Wistow wrote: just fine. However I'm trying to add a new opcode DAT which can take any number of operands DAT 0x170, Hello , 0x2e1 (, ) and it fails there. Running this my ($label, $op, @operands) = $line =~ m! ^ (?::(\w+) \s+)? # optional label ([A-Za-z]+)\s+ # opcode ([^,\s]+) (?:, \s+ # operand ([^,\s]+))*\s* # optional second opcode $ !x; on FOO A, B, C results in @operands being ('A', 'C'); i would take a simpler approach. just grab the whole optional string after the opcode (all the operands) and then split that on comma (and optional trailing whitespace). why try to do it all in one regex when that is simpler and should work fine. so your last regex component would be something like \s*(.+)? or \s*(.*) uri
Re: Regex help
On 04/20/2012 05:23 PM, Simon Wistow wrote: On Fri, Apr 20, 2012 at 08:37:42PM +, Anthony Lucas said: How about a parser using Regexp? Parser::MGC? You can implement a proper parser, or just a few staged regexp, or anything in-between. I ended up just doing this my ($label, $op, $operands) = $line =~ m! ^ (?::(\w+) \s+)? # optional label ([A-Za-z]+)\s+ # opcode (.+) \s* # operands $ !x; # TODO this won't cope with commas inside quotes # e.g DAT 0x20, hello, goodbye, 0x10 my @operands = split /\s*,\s*/, ($operands || ); and that is exactly what i suggested in another post (haven't seen it hit the list yet). :) you can use text::balanced to handle quoted strings. uri
Re: Programming Heresy
On 03/30/2012 05:24 AM, Steve Mynott wrote: Has anyone tried programming outside? E-ink (like on the Kindle) works well in sunlight and I wondered if any such device would be useable (ideally with a decent keyboard). in years (and decades) past, i did some coding on source printouts. i could do it anywhere including outside which i enjoyed immensely. my coding on paper was scribbles, crossed out code, arrows moving things around, very fugly pseudocode notation only i could decipher, etc. often it was just enough to make me remember my ideas which i could then type up on a keyboard. i could be very creative when coding on paper like that (in or outdoors) but i still have fond memories of outdoor sessions in the shade under sunny skies. :) uri
Re: Programming Heresy
On 03/30/2012 12:52 PM, Paul Makepeace wrote: Me too. I actually found these paper sessions some of the most productive ever. Just recently I had my head in a bunch of confusing object relations and wished for the soothing sound of a dot matrix (shows last time I did it) that would let me see wtf was going on… at least i still did it in laser printer days (and i wouldn't mind doing it more now but i am not doing lots of coding very recently). nicely printed code with clean fonts makes this more enjoyable. i code in the white space areas and sometimes on the backs of pages (i try to doubleside print to save paper). when i run out of room in one area, a long arrow does a goto to another white area! as i said, this is for me alone and i never show it to anyone for fear of causing severe retinal damage. uri
Re: Should I work in the US or the UK? - which pays best?
On 12/13/2011 07:22 AM, Leo Lapworth wrote: YES. that is a very delicate and interesting question. i have just learned what one top deal in the uk is and it is way up there. few in the US could match it. google can but you need to work onsite there and much of the pay is in stock options. in fact the total pay there is much more than the top deal i mentioned above. also benefits vary. you get the usual health stuff but vacation time is usually less (could be 3-4 weeks in a rich place) but you don't always get little things like laptops, free lunches, etc. again, it varies a lot. richer companies can offer better packages. startups tend to be leaner. and that is only the tip of the iceberg. there are visa issues, where to live, where to send your optional kids to school, cultural differences, moving expenses (one client of mine does help with that), etc. so don't compare countries for paying best. compare actual jobs and companies. uri
Re: Beware: NET-A-PORTER
On 12/09/2011 02:58 AM, Rudolf Lippan wrote: On Friday, December 09, 2011 at 02:23:22 AM, Avleen Vig wrote: My understanding is that NAP had a very hard time finding people in the US---I know I passed their posts by before. I had serious concerns after talking to them, and the recruiter kept me from jumping 3 or 4 times during the process explaining, They don't understand the US market. I estimate that commission for my position alone would have probably be around 54K, but I think it was probably worth it from what I saw of NAP recruitment. where did you get that figure? given the standard rate of 20% (and i know since i recruit) or even less, that would mean a salary of over 250k which is ridiculous but for a handful of perl hackers i know about (merlyn!). i don't have a deal with NaP so i can't say anything about this blowup. but i wouldn't ever keep someone from taking the bird in the hand. it is unprofessional and #^#^@ed up. At least here in the US, bypassing recruiters is the much preferred method. I don't know why they're still so heavily relied on in the UK. preferred by some but not all. again, depends on the agent. I suspect that is because it adds about 30% to the cost of hiring someone; however, if you can't attract people it is usually less cost than that. no one pays 30% or charges it. and if 30% is your figure then the 54k commission above means a $180k salary which is still on the high side. and using an agency can mean more work for the employer. if an agency just blasts you with dozens of resumes found by buzzword matching, the employer has to screen the resumes, then do a large number of phone screen, then more interviews, etc. so the time spent doing all that must be factored in to the total cost. on the other side if you find the right hacker in a reasonable time, you can use them to get the project done in a reasonable time frame and earn revenue from that. even advertising on the perl jobs list will get you a pile of resumes and all the work needed to filter/screen them. it is 'free' advertising but costly recruiting. this is why picking your agency is just as important as picking your employer. call this a shameless plug for perlhunter.com. uri
Re: Beware: NET-A-PORTER
On 12/09/2011 09:08 AM, Avleen Vig wrote: On Fri, Dec 9, 2011 at 4:09 AM, Uri Guttmanu...@stemsystems.com wrote: On 12/09/2011 02:58 AM, Rudolf Lippan wrote: On Friday, December 09, 2011 at 02:23:22 AM, Avleen Vig wrote: My understanding is that NAP had a very hard time finding people in the US---I know I passed their posts by before. I had serious concerns after talking to them, and the recruiter kept me from jumping 3 or 4 times during the process explaining, They don't understand the US market. I estimate that commission for my position alone would have probably be around 54K, but I think it was probably worth it from what I saw of NAP recruitment. where did you get that figure? given the standard rate of 20% (and i know since i recruit) or even less, that would mean a salary of over 250k which is ridiculous but for a handful of perl hackers i know about (merlyn!). Not hardly. Google regularly pays around this number for good programmers (read: good, not exceptional) in New York. This does include things like stock options etc, not just base pay. i know that number but stock options are about 50% of that. it is a risk and not guaranteed. base pay is about $140k or so plus bonus. i know someone (whom i placed 6 years ago) was getting about $200k including bonus. he got much less when he first started. as i said, i know salary numbers because it is my business to know them. almost no one gets $250k base and i mean salaried, not consulting. $120/hr is already $240k a year and very achieveable as a consultant. And I don't know if merlyn is on this list (hi randal! long time no speak!), but he's out in Portland last I heard, and wages there are a lot lot lower than new york - but quality of life is arguably much, much higher too :-) i know what merlyn asks and gets as i represented him to a ny place. it was more likely consulting than salary but he delivers the goods. regardless, the $54k commission is the figure that sticks out. i would love to get actual facts on that and not third hand information. uri
Re: Beware: NET-A-PORTER
On 12/09/2011 09:32 AM, Avleen Vig wrote: Not entirely true. Telecommuting doesnt erect barriers, it results in different barriers which need ti be handled differently. I worked for a distributed company for almost to years. Since then I've worked from home for almost 18 months. It's not more barriers, it's different ones. Eg in the office I sometimes hated having to find people, figure out where they are, maybe having to deal with them face to face when they're having a bad day. These things get better with telecommuting ime :) i totally agree. i tell my clients that all the time when they are not into allowing telecommuting. it is a management style issue, not a technical one. i placed many in a pure virtual company in the US. they are fully set up for telecommute and have the management experience to do so. another client is 100% onsite. no exceptions. BUT someone i know left there and was allowed to telecommute since he had knowledge and experience they needed. and this was a very large powerhouse place paying top salaries. it is all over the map with rules on allowing telecommuting. some love it as it opens up to more qualified employees. others hate it since they don't have the management set up for it. some do both, onsite if you can move or already live near their offices, telecommute if you have the experience to do so. it is also on the employee's head to be able to telecommute. some just don't have the discipline to deal with kids, spouse and other household distractions. one placement i made recently explicitly wanted to work onsite because he was telecommuting for a while and wanted a solid reason to get out of the house!! there are no fixed rules for this on either side. i have seen all sorts of variations. uri
Re: Beware: NET-A-PORTER
On 12/09/2011 10:36 AM, Jason Tang wrote: On 9 December 2011 15:14, Uri Guttmanu...@stemsystems.com wrote: On 12/09/2011 09:32 AM, Avleen Vig wrote: Not entirely true. Telecommuting doesnt erect barriers, it results in different barriers which need ti be handled differently. I worked for a distributed company for almost to years. Since then I've worked from home for almost 18 months. It's not more barriers, it's different ones. Eg in the office I sometimes hated having to find people, figure out where they are, maybe having to deal with them face to face when they're having a bad day. These things get better with telecommuting ime :) i totally agree. i tell my clients that all the time when they are not into allowing telecommuting. it is a management style issue, not a technical one. i placed many in a pure virtual company in the US. they are fully set up for telecommute and have the management experience to do so. another client is 100% onsite. no exceptions. BUT someone i know left there and was allowed to telecommute since he had knowledge and experience they needed. and this was a very large powerhouse place paying top salaries. it is all over the map with rules on allowing telecommuting. some love it as it opens up to more qualified employees. others hate it since they don't have the management set up for it. some do both, onsite if you can move or already live near their offices, telecommute if you have the experience to do so. it is also on the employee's head to be able to telecommute. some just don't have the discipline to deal with kids, spouse and other household distractions. one placement i made recently explicitly wanted to work onsite because he was telecommuting for a while and wanted a solid reason to get out of the house!! there are no fixed rules for this on either side. i have seen all sorts of variations. I guess when an employer and employee come together to see if there can be a professional working relationship they set out their own criteria. Clearly telecommuting high as a priority for you. Great that you know what you want! The flip side this isn't necessarily the 'norm' in the market place, so you maybe rather restrictive on your employment opportunities. This is of course your choice. i am confused by your saying telecommuting is a priority for me. i place people in perl jobs. the choice of telecommuting or onsite is in the hands of the employers and candidates. i can try to influence those choices but i am happy to place onsite as well. i have had candidates move across the pond, and across large sections of the states for onsite work. it is not in my hands so there is no priority there. when i do direct work myself, yes, i will not be onsite permanently but i can be for short periods like a week at a time. this is something i also promote, a mix of onsite for that p2p communications which can be very valuable and remote for access to a broader range of candidates. smart companies will choose that path and figure out the mix best for them. Personally I appreciate communication methods that are not intrusive (someone coming over and interrupting you when you're in your zone is frustrating at the best of times). But with everything there's a balance to be struck to aid the social dynamics and progress of the project. Some things work well over IRC, and some things over email. However there are definiltely situations I would say getting off your chair and getting yourself sat with the person and talking about something is the more effective way to communicate something. What ever your style of communication it has to work with the peers you're working with. and that is more up to management than the set of peers. you missed the telephone (or skype) which is still closer to classic communications than text only. video conferencing can be even closer. audio/video is much more efficient for some forms of teamwork, brainstorming, etc. email is better for detailed technical threads. each form has its wins/fails and should be used accordingly. telecommuting can work if done well. it can also easily fail if the shop is not accommodating to it. uri
Re: Beware: NET-A-PORTER
On 12/09/2011 10:48 AM, Rudy Lippan wrote: On Fri, 09 Dec 2011 04:09:00 -0500, Uri Guttmanu...@stemsystems.com wrote: i don't have a deal with NaP so i can't say anything about this blowup. but i wouldn't ever keep someone from taking the bird in the hand. it is unprofessional and #^#^@ed up. What would you have done (other than manage your client appropriately)? See below for an expanded timeline for the last week of the process... hard to say as i don't know all the facts. i won't even speculate with more facts as i am biased now given what little i know. here is a small tip i use during a placement. i request (really require but it doesn't always happen) that all emails between the candidate and employer are cc'ed to me. i have fixed little things like time zone differences for calls and lost out on big problems when they blew up and i wasn't cc'ed. my job is to make the placement work as smoothly as possible besides actually doing the best match i can. if i know of a problem, i communicate with both parties in an honest and timely manner. i have yet to have a situation similar to what i have read here. again, it is hard to answer given a story without both the agency's and employer's version. and even then, the facts won't always be evident. it is usually less cost than that. no one pays 30% or charges it. and if I know its a bit high. Even at 20%, it is still a tidy commission. And they may have lowered it to get me in (I have seen that before) knowing that I had contacts and would recommend people to fill out the rest of the vacancies. agencies earn commissions by saving time, effort and costs of recruitment in a shop. i have been dropped as an agent when there are too many candidates coming in directly and desperately needed when the market gets tight. middlemen of all sorts are in all industries. agencies are just another species of middleman. some like to use them for value added, others like to keep it in house and deal directly. to each their own. i know i personally provide a major value added as i screen carefully and have a very high placement rate. many times i have submitted no more than 2 candidates for each lead and one will get hired. that is a massive savings of time and effort in screening and interviews by the employer. that is worth the commission to them. i can't say the same for many other agencies (having dealt with buzzword matching ones many times myself). The whole interview dance was done as a contract. At the end, I was told that I was, The one NaP wanted to lead their US team. Then came the call: Before NAP can sign off they would like to know what you want as a final salary for the hire. I took a off a % 20 30 from the contract rate, and came up with $180K. This looked reasonable because I'd like to be able to offer good Sr. programmers $150K to be competitive in this market. I also said that I was willing to take the $150K, but $180 was my happy point (based on having to relocate, the cost of housing,c). Tuesday: Final interview at NaP in Mahwah, NJ. Wednesday: Current contract ends. Thursday: NAP needs one more signature because of cost. Friday: The person at NaP is out sick, will be back Monday. I clarified that I was about loose out on another offer. Call Scheduled with NAP for 11 EST Monday. Monday: There are actually two people that need to sign off but they want to get everyone in a room tomorrow at 11:30 EST. NaP asks that you hold off one more day. Call at 12:30 EST Tuesday. Tuesday: Hi, pffefh, um, a, yeah, a. I don't quite know what to say, ah, um. NaP wants to know if you would agree to be flexible to $120K for for the final salary for sign off, but they are willing to discuss it again at the end of the contract period. that lowering of the 'accepted' pay range is nasty. if what you say is true (not doubting you), this is on NaP's head and not the agency. but also NaP might have been having problems staffing the whole group (possibly using the wrong agencies :) and suddenly realized their costs were too high. poor planning and decision making. also it seems they didn't own up to this mess either which is something they could have done. not something i would tolerate or condone. Later in the day: My apologies for the delay, I'm home dealing with a sick child. I just caught up with Matt and Net-a-porte has decided not to build a team here in the US. Apparently it's half the cost for them to build a team in the UK vs. here in the US. I'm so sorry Rudolf. I hope you're able to resurrect the offer from last week... that is from the agency. wow. half the cost is absurd as others have said. also remember the commission is a one time thing for salaried employees and so can be written off differently than ongoing costs like actual salaries. also real estate costs could be involved as ny/nj can be
Re: Beware: NET-A-PORTER
On 12/09/2011 12:03 PM, Richard Foley wrote: I couldn't agree with you more, Uri. When anyone mentions Telecommuting, hackles seem to rise, it's like the religious wars between vi and emacs, perl and java, mac + windoze, linux + the rest of the world, etc. I've worked in many places both onsite and offsite, and both situations have pros and cons. Telecommuting is absolutely a solution only when it works for *both* the client and for the contractor, and communication is clearly essential. Thank goodness we work in a world with such amazing network connectivity, and openssh, eh ?-) yeah, it would be tricky to telecommute in the days of punch cards! you can play chess by mail but coding by snail mail? and as i said, some shops are pure virtual with no physical offices. telecommuting doesn't raise hackles there and in mixed shops. i deal with this more than anyone on this list so i know the issues, views and needs of telecommuting. and even in that world there are many variations (technologies used, management/mentoring styles, remote meetings, etc.). uri
Re: Cool/useful short examples of Perl?
from the File::Slurp synopsis. can't get much cooler, short or useful than this. :) # Here is a simple and fast way to load and save a simple config file # made of key=value lines. my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ; write_file( $file_name, {atomic = 1}, map $_=$conf{$_}\n, keys %conf ; -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Cool/useful short examples of Perl?
D == Denny 2...@denny.me writes: D On Mon, 2011-05-30 at 11:59 -0400, Uri Guttman wrote: from the File::Slurp synopsis. can't get much cooler, short or useful than this. :) my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ; write_file( $file_name, {atomic = 1}, map $_=$conf{$_}\n, keys %conf ; D It's kind of horrific looking though, and potentially fragile. Is there D a less hideous way of doing it with another module? Config::Any covers D the read but not the write... the file format is the easiest to read/write. also that is the fastest way to load/save a simple config file. those are parts of the usefulness of those short lines. and if you think those are complex, you haven't seen enough perl! :) uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Cool/useful short examples of Perl?
PN == Philip Newton philip.new...@gmail.com writes: PN On Mon, May 30, 2011 at 17:59, Uri Guttman u...@stemsystems.com wrote: # Here is a simple and fast way to load and save a simple config file # made of key=value lines. my %conf = read_file( $file_name ) =~ /^(\w+)=(\.*)$/mg ; write_file( $file_name, {atomic = 1}, map $_=$conf{$_}\n, keys %conf ; PN I wonder what kind of configuration you use, where values can consist PN only of one or more dots good catch. but i encode the values in the number of dots. unary math rules! uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Cool/useful short examples of Perl?
D == Denny 2...@denny.me writes: D On Mon, 2011-05-30 at 13:10 -0400, Uri Guttman wrote: if you think those are complex, you haven't seen enough perl! :) D I'm trying to think about the target audience, rather than show how D clever I am. that isn't clever in my book. the slurp thing is only one simple regex in list context. i have shown it (a working version!) to intermediate and newbie perlers and they get it when shown how to break it down. that is a skill they usually need to learn and this is a real world example that displays it. just like showing map/grep to the same crowd. they all shy from it until you really explain it. then they add it to their perl vocabulary. you need to challenge them a bit with new stuff instead of handing them simple code anyone can do. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Cool/useful short examples of Perl?
DH == Dave Hodgkinson daveh...@gmail.com writes: DH On 30 May 2011, at 22:17, Uri Guttman wrote: DH No. Real people want to solve real world problems in a simple, DH maintainable way, not wave around a canapé sized penis. you have a strange way of measuring genitals. real world code is also concise and fast and usable. DH And MAINTAINABLE. DH Not everyone speaks line noise. if you think that is line noise, then your perl skills need improving. seriously i have taught the slurp line to total beginners and they get it afterwards. this is for learn.perl.org, not golf. my %conf = read_file( $file_name ) =~ /^(\w+)=(.*)$/mg ; that is an assigment to hash, scalar context call on read_file and a regex getting out key=val lines. all stuff newbies need to know and must learn. it happens to use them all in one basic line. it is all a very teachable thing to anyone who knows what a hash, sub call and regex are. i don't expect newbies to know how to read that line but i do expect them to able to learn from it. that is what proper training is about. not feeding pablum to kiddies. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Cool/useful short examples of Perl?
NC == Nicholas Clark n...@ccl4.org writes: NC You've stated that you *don't* expect newbies to know how to read NC that line. Leo is currently looking for things that newbies could NC be expected to read. then you will get one liners that don't do much. you can't have it both ways. either they are useful or they are so simple that newbies can read them. using modules isn't a way around that as they shouldn't use one without understanding it. so my way is to show how useful a small amount of perl can be. get them intrigued and wanting to learn how to do that. i haven't seen anything else posted here that is even close to useful and cool and newbie level yet. but everyone can jump on mine. wow. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
try something different
instead of showing random perl examples on learn.perl why not highlight the good docs that already exist. the other day someone asked on irc about some ref stuff and i pointed them to perlreftut. the tutes are full of useful stuff but they aren't read by newbies (i know that from many times telling them to read them). so highlight those on learn.perl. excerpt them or describe why they are so useful. same for the FAQ. i always tell newbies to read the entire FAQ even though they won't understand much of it. it is to get them to learn what kind of stuff is there and to learn how to read the docs. that is a skill you can teach on that site with little effort. show how easy it is to learn perl given the great docs that come with it. the docs are deep and wide and scary but making a site that demystifies them will attract more than one liners. there are other ways too to make learn.perl better. use your collective branes to do that instead of one liners. it should be a teaching site that is the primary one newbies should go to. instead it is a backwater with a single book on it. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
edit_file, edit_file_lines
Hi all, Have you ever wanted to use perl -pi inside perl? Did you have the guts to localize $^I and @ARGV to do that? Now you can do that with a simple call to edit_file or edit_file_lines in the new .018 release of File::Slurp. Now you can modify a file in place with a simple call. edit_file reads a whole file into $_, calls its code block argument and writes $_ back out the file. These groups are equivalent operations: perl -0777 -pi -e 's/foo/bar/g' filename use File::Slurp qw( edit_file ) ; edit_file { s/foo/bar/g } 'filename' ; edit_file sub { s/foo/bar/g }, 'filename' ; edit_file \replace_foo, 'filename' ; sub replace_foo { s/foo/bar/g } edit_file_lines reads a whole file and puts each line into $_, calls its code block argument and writes each $_ back out the file. These groups are equivalent operations: perl -pi -e '$_ = if /foo/' filename use File::Slurp qw( edit_file_lines ) ; edit_file_lines { $_ = '' if /foo/ } 'filename' ; edit_file_lines sub { $_ = '' if /foo/ }, 'filename' ; edit_file \delete_foo, 'filename' ; sub delete_foo { $_ = '' if /foo/ } So now when someone asks for a simple way to modify a file from inside Perl, you have an easy answer to give them. -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Junior-mid level Perl (Victoria Conlan)
YS == Yitzchak Scott-Thoennes sthoe...@gmail.com writes: YS On Wed, Apr 27, 2011 at 3:19 PM, Victoria Conlan vi...@comps.org wrote: Specifically, it must be butter. No butter, no shortbread. I've found that vegan buttery-style margarine is acceptable. Especially if you replace half of the flour with ground almonds. Pop over, I'll make you it some time. YS Here in the US, most of the margarine has dairy ingredients, YS especially the more buttery tasting ones. YMMV. there are several quality margarine products that are vegan. earth balance is one we use. definitely good enough for many butter replacement apps. and we use butter too so we can compare. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: [ANNOUNCE] London Perl Mongers Technical Meeting 12th April 2010
PC == Piers Cawley pdcawley-london.0dd...@bofh.org.uk writes: PC Damian made me post this. Don't blame me. In the absence of a string PC quartet and backing singers, this will remain on the page. PC Ah, look at all the boggled mongers PC Ah, look at all the boggled mongers snip PC All the boggled mongers PC Where do they all come from? PC All the boggled mongers PC Where do they all belong? i feel very dirty. must switch to coding in lisp to feel better. and paul and i share the same birthday. not sure what that means. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: [ANNOUNCE] London Perl Mongers Technical Meeting 12th April 2010
CJ == Christopher Jones c.jo...@ucl.ac.uk writes: CJ On 27 Mar 2010, at 18:16, Dave Cross d...@dave.org.uk wrote: On 03/27/2010 09:10 AM, Luis Motta Campos wrote: Dave Cross wrote: On 03/27/2010 08:13 AM, Uri Guttman wrote: and paul and i share the same birthday. not sure what that means. I expect you'll find it's a coincidence :-) As a mathematician I must say coincidences have really low probability of happening... Given the number of people who have birthdays and the relatively small number of days available to have them on - you might want to recheck your working there :) CJ According to someone cleverer than me, you need a group of only 57 CJ people to have a 99% chance that two of them will share a birthday CJ This odd result of probability is called the Birthday Paradox; CJ http://en.m.wikipedia.org/wiki/Birthday_problem?wasRedirected=true and only about 20 (i think 21.x) people for a 50% chance. that is a better party bet as few (other than geeks) would know the true odds of it. and it isn't an odd result, it is very simple probability odds. and the trick is not to calculate the odds of duplicate birthdays but the odds of no duplicates and subtracting from one. 364/365 * 363/365 ... did this one in high school (decades ago) on an old calculator. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: [ANNOUNCE] London Perl Mongers Technical Meeting 12th April 2010
DC == Damian Conway dam...@conway.org writes: DC Chris is correct that I rarely ever allow my talks to be recorded or uploaded. DC And right about the reason too. Information may well want to be free, but it DC therefore also wants my family to starve. DC However... DC In this particular case, because James and Paul asked most DC politely, and because I certainly don't want James to feel DC eviserated, and because so many individuals from London.pm have DC been so very generous in supporting me over so many years, and DC because NO-ONE IS *EVER* GOING TO UPLOAD THE RECORDING TO YOUTUBE DC OR VIMEO OR ANY OTHER PUBLIC REPOSITORY but instead will quietly DC pass it around only amongst themselves, and because as a community DC we really wouldn't want this particular talk to publicly represent DC modern Perl (any more than we'd want SelfGOL to), then in this DC particular case I'm happy to grant permission for this talk to be DC recorded and shared discreetly amongst the local members of DC London.pm. how local is local? :) if you are going to give this talk at yapc::na and/or oscon, i will catch it there. but if now, is the pond too large for boston.pm to be local to london.pm? there are several overlapping members. thanx, uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: [ANNOUNCE] London Perl Mongers Technical Meeting 12th April 2010
DC == Damian Conway dam...@conway.org writes: DC Uri asked: if you are going to give this talk at yapc::na and/or oscon, DC I did so, at OSCON in 2008. you must have used the jedi mind trick afterwards since i don't recall it. this is not the talk you have been listening to. this is not how you are supposed to code in perl uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: [Fwd: Betonmarkets CTO position]
PE == Peter Edwards pe...@dragonstaff.co.uk writes: PE I do hope anyone considering the online gambling gig has read: PE http://en.wikipedia.org/wiki/David_Carruthers#Arrest_during_US_transit_flight PE Welcome to the Land of the Free. Unless you provide on-line PE gambling to US Netizens :-] i didn't want to get into this but i do like to get facts straight. the scandal that article refers to is for betonsports.com and this company is betonmarkets.com. i googled and found nothing mentioning both sites. here is a comment from the ceo of betonmarkets: There is no link whatsoever between the companies. Betonsports was a massive company (over 3000 staff as I seem to remember) and had offices everywhere, so I'm not surprised they also had offices in Malaysia. They were known to be a dodgey company, openly flouting US law. so if you want to slam something, please slam the right thing. as i said, i am trying to place people there and i did chastise the ceo for his spamming of london.pm. i didn't like it when you all got that. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: [Fwd: Betonmarkets CTO position]
just to fill in some info, i have been working with this shop to find a cto. i will tell the ceo this was a foolish move as it breaks the rules. they are a legit outfit and the ceo actually seems to have a perl clue. the perl test he sends out is unique, interesting and really tests your skills in a short time frame. that alone impressed me. anyhow, if anyone wants more info, contact me. if you know someone who may be interested in the job, send them my way and there could be a referal fee in it for you. thanx, uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Regexp capture group list
PLE == Paul LeoNerd Evans leon...@leonerd.org.uk writes: PLE substr( $_[0], 0, $+[0] ) = ; 4 arg substr is faster than lvalue substr. substr( $_[0], 0, $+[0], '' ) ; i do a very similar recursive parse in Template::Simple and i also use $1 and $2 in s/// in the basic rendering. the compiler variation does m// and then a 4 arg substr to chop off the matched leading text. you can see the basic code on cpan and the latest unreleased version with the compiler code at: http://perlhunter.com/git/template http://perlhunter.com/git/gitweb/gitweb.cgi there also may be a way to use \G in the regex to start parsing from where you last parsed. i couldn't get that to work but maybe ask damian for help. :) uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Efficient sorting of SNMP oids
AV == Avleen Vig avl...@gmail.com writes: AV On Oct 31, 2009, at 22:17, Dave Hodgkinson daveh...@gmail.com wrote: Then build it in to your own dist tree. AV Or better yet, extract the key functionality you need from the module AV and mak it part of your script! Easy. and one more idea. sort::maker actually generates source code for its sorts and you can print that out. then you cut/paste that generated code into your program. the only issue i see is how to handle varying length OIDs. but i leave that as an exercise to the reader. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Efficient sorting of SNMP oids
BM == B Maqueira b...@ferrarihaines.com writes: BM Dear all, BM I need to sort eficiently a large array (~9000) of SNMP OIDs. BM I am currently trying the following code: BM my @sorted_oids = map { $_-[0] } BM sort { $a-[1] cmp $b-[1] } BM map { [$_, pack('w*', split(/\./, BM $_))] } @oids; BM But this fails since it outputs 1.3.6.1.4.1.2333.3.2.61001.1.10 before BM than 1.3.6.1.4.1.2333.3.2.8080.1.1.1 sort::maker could do that and generate a faster sort with the GRT. just generate an array of integers (or shorts) and pack them for the key. similar to what you have there. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Efficient sorting of SNMP oids
RF == Richard Foley richard.fo...@rfi.net writes: RF Should that be a numerical sort via the spaceship operator? RF = instead of cmp nope, since he is trying to compare a long string of the packed OIDs. you can't compare woth = anything other than normal integers or floats. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Anyone hiring at the moment?
SC == Simon Cozens si...@simon-cozens.org writes: SC On 26/09/2009 21:40, Billy Abbott wrote: Assuming we're not referring to fried email, than the answer is yes. http://www.kare11.com/news/news_article.aspx?storyid=254168 That assumes you live in Hawaii, of course. The Hawaiian love of Spam has scared me since I heard of it. SC It should scare you; I've heard a theory that Spam is popular in the SC Pacific islands because it tastes similar to... more traditional meats SC that they can't eat any more. too bad, the real answer is more mundane. spam was invented (if you can use that word) for the US army in ww2 and was the c (or k?) ration - meat in a can. it was of course ubiqitous in hawaii during the war as there was a massive military presence there. it became a cheap source of meat for the locals as well as the military. so spam became an accepted and now popular part of the food culture there. this is also true for other asian islands and countries (at least according to wikipedia). and for you brits, spam was about the only non-rationed meat during the war so you have likely some dna in you created from spam molecules your ancestors ate! the monty python spam song was based on the mass of spam eaten in the war and offered on menus. uri
Re: Anyone hiring at the moment?
AA == Andy Armstrong a...@hexten.net writes: AA On 21 Sep 2009, at 14:22, Raphael Mankin wrote: Well, I've been bumming about contracting for over 30 years, and the market seems to be picking up a bit. There are more jobs about and rates are also up. Perl is in a funny state. On the one hand, people are saying that Perl is dead, everything has gone to Python or Java or ... OTOH managers that I have spoken to say that it is extremely difficult to find half way decent Perl programmers. They eal problem is to get through the door in the first place. the pre-selection at the job agencies bears no relation to either skills or requirements. pick a better agency! AA Indeed. Maybe I should pimp myself out as a Perl recruitment AA consultant :) that is what i do! :) uri
Re: Does Perl has a code hider
LB == Léon Brocard a...@astray.com writes: LB 2009/9/16 abhishek jain abhishek.netj...@gmail.com: Do perl have a kind of code encoder which hides the readable Perl code by encoding like we have in PHP. LB In general, no. The Perl FAQ covers the reasons why and what options LB you might want to try instead: LB http://faq.perl.org/perlfaq3.html#How_can_I_hide_the_s LB Regards, Léon LB ps if anyone wants to keep perlfaq entries up to date, i'm sure you LB can find things to do ;-) brian d foy autoposts FAQ entries to comp.lang.perl.misc and they get read and feedback is given to some of them. bdf has updated them as he can when good stuff is posted about an entry. yes, many FAQs are sadly dated but many have been improved. they won't get integrated until the next (sub)release or so. if there is a better place to autopost them (here? :), tell him. i also have some code that will automail faq entries so i can spam here. plenty of perl hackers here with obviously nothing else to do! :) uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Does Perl has a code hider
JL == James Laver james.la...@gmail.com writes: JL On 16 Sep 2009, at 19:17, Uri Guttman wrote: i also have some code that will automail faq entries so i can spam here. JL Yes, spam is always the answer to problems. JL Crazy idea: there is already a process in place for updating FAQ JL entries, leave it be. crazier idea: it doesn't get enough attention. more eyes eq more updates. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Does Perl has a code hider
JL == James Laver james.la...@gmail.com writes: JL On 16 Sep 2009, at 20:04, Uri Guttman wrote: crazier idea: it doesn't get enough attention. more eyes eq more updates. JL It's for a good cause doesn't justify spamming a list that frankly JL has nothing to do with the issue at hand. Fundamentalists in the US JL think they're doing the right thing by shooting abortion doctors. i didn't say i was going to spam this list. you are reading things that aren't written. i was replying to leon's comment about people with nothing better to do so they might as well edit the FAQ. since this list is large with plenty of time, it was an idea. nothing more than that. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Does Perl has a code hider
DC == David Cantrell da...@cantrell.org.uk writes: DC Uri Guttman wrote: brian d foy autoposts FAQ entries to comp.lang.perl.misc and they get read and feedback is given to some of them. bdf has updated them as he can when good stuff is posted about an entry. yes, many FAQs are sadly dated but many have been improved. they won't get integrated until the next (sub)release or so. if there is a better place to autopost them (here? :), tell him. i also have some code that will automail faq entries so i can spam here. plenty of perl hackers here with obviously nothing else to do! :) DC An occasional post here would probably be OK. Not more than one a week DC or so though. well that begs the question. i can easily cron this to whatever schedule people think is fine. the issue with once a week is that it will take a long time (2+ years!) to cycle through the faqs. maybe 3 times a week would work if that is ok with most here. it will easily be filtered as the subject will always have FAQ as its lead marker. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Sub-refs in @INC screwing with your modules
DC == David Cantrell da...@cantrell.org.uk writes: DC As part of an Evil Plan, I am putting a sub-ref into @INC that will DC screw around with modules as they're loaded. Or at least, I'm trying DC to. I can't seem to get this to work: DC perl -MIO::Scalar -e ' DC unshift @INC, sub { DC print q{wibble}; DC return IO::Scalar-new(\q{print q{wobble}}) DC }; DC eval use foo DC ' DC which *should*, if I've RTFM correctly, print wibblewobble. But the DC wobble never appears. What am I doing wrong? this works: perl -le 'open my $fh, q{}, \q{print q{bar}}; unshift @INC, sub {print q{foo}; $fh }; require baz' foo bar i tried putting the open inside the sub and i get this error: perl -le 'unshift @INC, sub {print q{foo}; open my $fh, q{}, \q{bar}; $fh }; require bar' foo foo Recursive call to Perl_load_module in PerlIO_find_layer at -e line 1. BEGIN failed--compilation aborted. why would it recurse on the sub in @INC? it prints foo twice which shows that. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Genius plan for the website!
DH == Dave Hodgkinson daveh...@gmail.com writes: DH On 3 Jul 2009, at 12:32, Edmund von der Burg wrote: 3) tiny, simple, bulletproof script to take templates and generate html pages DH Apache::Template FTW! Then cache on the front. Template::Simple is the easiest and fastest one out there. and the connection to london.pm is that one of your members funded its conversion to a cpan module! also it now has compiled templates (in git but not cpan yet) for even more speed. and CMS::Simple (also git not cpan yet) is the tiny bulletproof module and script that builds all the pages. i now leave you to discuss. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Genius plan for the website!
DH == Dave Hodgkinson daveh...@gmail.com writes: DH On 3 Jul 2009, at 16:47, Uri Guttman wrote: DH == Dave Hodgkinson daveh...@gmail.com writes: DH On 3 Jul 2009, at 12:32, Edmund von der Burg wrote: 3) tiny, simple, bulletproof script to take templates and generate html pages DH Apache::Template FTW! Then cache on the front. Template::Simple is the easiest and fastest one out there DH You missed both the point and the irony. it must be the funny accents you all have! :) and i didn't miss it but more likely replied to the wrong letter in the thread. the OP did mention TT. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Genius plan for the website!
DK == Dirk Koopman d...@tobit.co.uk writes: DK Uri Guttman wrote: Template::Simple is the easiest and fastest one out there. and the connection to london.pm is that one of your members funded its conversion to a cpan module! also it now has compiled templates (in git but not cpan yet) for even more speed. and CMS::Simple (also git not cpan yet) is the tiny bulletproof module and script that builds all the pages. i now leave you to discuss. DK Ok, I'll bite, where do I look for the non-(yet)cpan stuff? cms is the cms::simple thing. it is raw and undocumented but works (the perlhunter.com and bestfriendscocoa sites are built with it). the big win it has is that you can share content and also templates among multiple pages with little effort. i can send you tarballs of either site tree if you want to play with the cms::simple thing. the git repo is here. http://perlhunter.com/git/ this is a browsable version of the repo http://perlhunter.com/git/gitweb/gitweb.cgi thanx, uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Empty Hash Values
DC == Dave Cross d...@dave.org.uk writes: DC Dave Hodgkinson wrote: And fails PBP for exactly the confusion in previous mails. Plain return is Just Wrong. Be explicit. DC PBP disagrees with you. DC9.12. Returning Failure DC Use a bare return to return failure. DCNotice that each final return statement in the examples of the DCprevious guideline used a return keyword with no argument, rather DCthan a more-explicit return undef. DCNormally, relying on default behaviour is not best practice. But in DCthe case of a return statement, relying on the default return value DCactually prevents a particularly nasty bug. DCThe problem with returning an explicit return undef is that≈contrary DCto most people's expectations≈a returned undef isn't always false. i always teach to use plain return and i have some more ways to defend it. one is that return undef is true if called and assigned to an array. i use this to detect an actual undef as data vs no return at all. another point is that plain return allows the caller to decide what to do with the return. it can be assigned to an array (to become empty) or to a scalar. if they want a scalar value in a list context they can wrap it in scalar (this happens as the OP did in a hash assignment or in nested sub calls). if you return undef then you can't control the return value. a call in a list of values where you want it to reduce to an empty list can't be done in that circumstance as you will always have a real undef element in the list. the caller needs to know the context of what they want and plain return allows that control. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Perl Christmas Quiz
UG == Uri Guttman u...@stemsystems.com writes: CJ == Chris Jack chris_j...@msn.com writes: CJ 3) Write a Perl function that takes two references to arrays and CJ returns the intersect of them. If an entry appears n times in CJ array 1 and m times in array 2, the output should list that entry CJ min(n,m) times. Bonus mark for one line solutions. UG this appears to work fine and is a true one line sub. UG use strict ; UG use warnings ; UG sub intersect { UG return keys %{{ map {$_, 1} grep(exists ${{map { $_ = 1 } @{$_[0]}}}{$_}, @{$_[1]}) }} ; UG } and i squeezed out the white space and dropped the superfluous exists to get this version: return keys%{{map{$_,1}grep(${{map{$_=1...@{$_[0]}}}{$_},@{$_[1]})}} ; it may not win in golf but it is a single expression/statement with no declared variables so that should earn some points. i wouldn't call multistatement code a true one liner. :) uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Perl Christmas Quiz
DC == Dave Cross d...@dave.org.uk writes: DC Andy Wardley wrote: I can pick off a few of the easy ones. [SPOILERS] DC [ snip ] 13) Think of a witty and/or interesting Perl Christmas quiz question and answer it. The Fairmont Hotel. What was the question? DC Where did the first (and second, I think) Perl conference take place. yes. in san jose. i still have canvas bags from tpc1! rumor is tpc may be back in san jose due to outgrowing the portland convention center. san jose has a large center opposite the fairmont. the downside is that san jose is a very dull town (especially compared to portland). you have to drive to san francisco or down the coast to monterey to be in more interesting territory. uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: TPC or not TPC
NC == Nicholas Clark n...@ccl4.org writes: NC On Fri, Dec 12, 2008 at 11:32:55AM -0500, Uri Guttman wrote: rumor is tpc may be back in san jose due to outgrowing the portland convention center. san jose has a large center opposite the fairmont. the downside is that san jose is a very dull town (especially compared to portland). you have to drive to san francisco or down the coast to monterey to be in more interesting territory. NC This rumour? NC http://radar.oreilly.com/2008/10/oscon-moves-to-san-jose.html when i learned about it a while back it was still a rumor and not announced. it is interesting that allison recounts the locations of oscon but not the first two years of tpc which were in san jose (but held inside the fairmont hotel in the center). NC OSCON certainly is in San Jose. Whether there is any The Perl NC Conference branding is a different matter. they have used the name 'tpc' under the bigger oscon umbrella. at least they have done that but i am not sure if they continue to do so. but oscon is the direct descendent of tpc (which was o'reilly's first conference and so the origin of their conference megabusiness). uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Perl Christmas Quiz
J == Jasper jaspermcc...@gmail.com writes: UG sub intersect { return keys%{{map{$_,1}grep(${{map{$_=1...@{$_[0]}}}{$_},@{$_[1]})}} ; J Uri, I don't believe this does the right thing with regard to multiple J occurrences of an entry in both arrays. I may be wrong. sub intersect { return keys%{{map{$_,1}grep(${{map{$_=1...@{$_[0]}}}{$_},@{$_[1]})}} ; } my @x = ( 1 .. 5 ) ; my @y = ( 4 .. 8, 4 .. 8 ) ; print intersect( \...@x, \...@y ), \n ; that prints 45 as expected. the outer hash ref and keys does the uniquifying. J I think this works J sub intersect {grep(!++$_[2]-{$_},@{$_[0]}),grep 1x$_[2]-{$_}--,@{$_[1]}} J Bit of a cheat using $_[2], though yeah, using @_ to hold a temp hash. as i said, i think mine is correct as is. and removing the return and converting another = to , makes it shorter: keys%{{map{$_,1}grep(${{map{$_,1...@{$_[0]}}}{$_},@{$_[1]})}} ; uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: Looking for the recruitment guy
PH == Peter Hickman peter.hick...@semantico.com writes: PH Getting in the swing of things for the time of year I have been PH made redundant. Ah well. I know that there is someone on this list PH that specialises in Perl recruitment and I have always intended to PH squirrel it away but never got round to it. So if anyone knows it PH or has other information that I could make use of I would be PH grateful if you could send it to me. that would be me. email me at uri @ perlhunter.com (see, an easy domain to remember or google for! :). PH The additional wrinkle is that tomorrow is possibly my last day PH here and so I wont be able to pick up mail after the weekend. So PH if you have something to tell me you could try peterhi [ at ] PH ntlworld [ dot PH ] com, which should be a good test of my spam filter :) i cc'ed that address. thanx, uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
Re: epic Dave FAIL
NC == Nicholas Clark [EMAIL PROTECTED] writes: NC IIRC, around 6:30 we were 6 men (including 1 Dave), and 5 women, NC and at some point later 11 men (including 2 Daves) and 9 women. NC Epic Dave fail. Even when we counted middle names (2 more that I NC was aware of). Where are all the Daves? NC I wonder how long before we have a point during a social where NC there are more women than Daves, even with all the men declaring NC themselves honourary Daves. October 2nd? November 6th? December NC 4th? dave?! DAVE?! dave's not here!! :) uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Support -- - Free Perl Training --- http://perlhunter.com/college.html - - Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -