Open Side Menu Go to the Top

03-15-2013 , 03:23 PM
Quote:
Originally Posted by NoahSD
yeah.. it seems pretty reasonable to me that the code
Code:
def func(param=x) :
  #whatever
should be equivalent to

Code:
def func(param) :
  if param.not_assigned() : #I made this up!
    param = x
  
  #whatever
Smarter people than I have thought about this longer than I have, so I'm probably missing some reason that that sucks, though.
This isn't too far off from what people actually do. You can't write a direct translation to python, but what you are attempting to describe is, in essence, lambda functions and the very reason functional programming works. The only difference is that you'd be pushing function into a variable (value):

Copy / pasted from Clojure Programming:

Code:
(def strange-adder 
      (fn strange-adder
            ([x] (strange-adder x 1)) 
            ([x y] (+ x y)))) 

;;; is equivalent to: 

(defn strange-adder 
              ([x] (strange-adder x 1)) 
              ([x y] (+ x y))))
The non-default-parameter version is:

Code:
(def strange-adder 
   (fn strange-adder [x y] 
       (+ x y)) 

;;; is equivalent to: 

(defn strange-adder [x y] 
     (+ x y))
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
03-15-2013 , 03:28 PM
I used to think 4 gb of ram was a lot.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 03:42 PM
Quote:
Originally Posted by jjshabado
Only when talking to developers do you have someone say:

"Strictly what you're saying is completely wrong. But I understand what you actually mean and thats the way it works most of the time."
Hahaha, touche, but I was wrong. Given your description,

a = [1, 2]
def f(b = a)

If someone reassigns a, b still holds the original reference.

With evaluation at function invocation semantics, b is set to the new reference.

Quote:
Originally Posted by jjshabado
My compiler skills are limited and rusty but it seems like it should be easy to differentiate between an existing symbol and code that creates a new object. Who knows, but I could accept a "this solution was too hard" much better than trying to pretend what they're doing now is the best design.
At first, I thought your implementation strategy is confusing, but now I'm just confused.

To extrapolate what you're saying, if you have:

a = [1, 2]
b = [3]
def f(c = [a, b, 4])

If you reassign a and b within the body of f, subsequent calls are not affected
If you mutate a and b, subsequent calls are affected
If you mutate c, subsequent calls are not affected

Do I have that correct?

It comes down to, evaluate all variables at function definition, then evaluate the rest at function invocation. This is a whole another language and I don't know enough about python to know whether this is doable without breaking language semantics. Mostly, I'm not sure whether something is a simple variable or a function call is even known statically - it's not in Javascript or Ruby for instance.

Or maybe you're happy with Scala/C++ semantics.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 03:46 PM
Quote:
Originally Posted by adios
I used to think 4 gb of ram was a lot.
8,000 Megabytes And Constantly Swapping lighting my PC on fire because that smack Eventually Munches All Computer Storage: just so damn powerful Even My Aunt Crashes the System.

*thump* *thump* *thump*
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 04:07 PM
Quote:
Originally Posted by candybar
At first, I thought your implementation strategy is confusing, but now I'm just confused.

To extrapolate what you're saying, if you have:

a = [1, 2]
b = [3]
def f(c = [a, b, 4])

If you reassign a and b within the body of f, subsequent calls are not affected
If you mutate a and b, subsequent calls are affected
If you mutate c, subsequent calls are not affected

Do I have that correct?
Yup, that's what I'm thinking.

I was just being a smart ass before, but you're right that my original description wasn't really accurate. I'm not sure what the perfect semantic description of what I'm saying is but I think it comes down to always evaluate the default parameter at invocation.

I'm not familiar enough with C++/Scala to know how they work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 04:18 PM
Quote:
Originally Posted by jjshabado
I'm not sure what the perfect semantic description of what I'm saying is but I think it comes down to always evaluate the default parameter at invocation.
That's is how C++ and Scala work. Honestly I didn't know and I had never written any code that relies on this behavior to my knowledge - I had to write some sample programs to find out. Either way, that means the following:

Quote:
a = [1, 2]
b = [3]
def f(c = [a, b, 4])

If you reassign a and b within the body of f, subsequent calls are not affected
is no longer true, because a and b are also evaluated at invocation.

We're really milking this, it's not that big a deal.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 04:51 PM
a and b being evaluated at invocation doesn't seem bad there. Again it would be the same behaviour as if you did: f([a,b,4])
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 05:01 PM
Re: What used to pass for good computer equipment...yes, this is mine (well, inherited) and yes, I still have it

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 05:03 PM
Quote:
Originally Posted by jjshabado
a and b being evaluated at invocation doesn't seem bad there. Again it would be the same behaviour as if you did: f([a,b,4])
I agree.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 09:33 PM
xhad,

cute pic but let's be real: packard bell and "good computer equipment" have never belonged in the same sentence.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-15-2013 , 09:47 PM
Wasn't the mantra back in the 90's "just say no to Packard Bell?"

Last edited by kerowo; 03-15-2013 at 09:47 PM. Reason: and that was before I could afford to be a fanboi
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 05:57 AM
Quote:
Originally Posted by adios
I used to think 4 gb of ram was a lot.
Code:
kris@base:~$ cat /proc/swaps
Filename				Type		Size	Used	Priority
/dev/sdc1                               partition	8191996	0	-1

Code:
kris@base:~$ cat /proc/meminfo
MemTotal:        8144780 kB
MemFree:         1022776 kB
Buffers:          201952 kB
Cached:          5366712 kB
SwapCached:            0 kB
Active:          1846860 kB
Inactive:        4886028 kB
Active(anon):    1165164 kB
Inactive(anon):     5704 kB
Active(file):     681696 kB
Inactive(file):  4880324 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       8191996 kB
SwapFree:        8191996 kB
Dirty:              2512 kB
Writeback:             0 kB
AnonPages:       1164252 kB
Mapped:           116000 kB
Shmem:              6656 kB
Slab:              89056 kB
SReclaimable:      62140 kB
SUnreclaim:        26916 kB
KernelStack:        2720 kB
PageTables:        22224 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    12264384 kB
Committed_AS:    2691956 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      303820 kB
VmallocChunk:   34359411284 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      271040 kB
DirectMap2M:     5986304 kB
DirectMap1G:     2097152 kB
For a couple of weeks I didn't even have a swap partition
Still surprised that 7GB is actually used.

Quote:
Originally Posted by Xhad
Re: What used to pass for good computer equipment...yes, this is mine (well, inherited) and yes, I still have it
Do any of you run a retro BBS by chance? I was thinking it might be neat to set one up just for fun and see who uses it without advertising it anywhere
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 06:50 AM
So when I was wandering around campus and looking at all the flyers the other day it seemed like programmers are in demand (shocker) but also very "unqualified" ones are needed.

I'm wondering why companies don't address this in a better fashion like having a "walk in programmer" jobs page. Just list what the candidate should know and how long you'd expect someone with no background to get there (maybe suggested reading as well).
I.e. Django junior dev:
List Python skills required
List Django skills required
List testing framework used, skills required
List "we use svn/git, you should know how to do X,Y,Z"
List basics in HTML/SCC/JS the candidate should know.
List SQL basics the candidate should understand

And maybe even add a little bit of code and a listing a la "you would be expected to read and understand this code, read the following bug report, write a test for it and fix the bug in about 1h"
"You would be expected to understand how this renders in a browser and how to change the positioning of item X to position Y in about 10 minutes"

Basically some candidate can look at the list, study the stuff specific to the job and apply as soon as he thinks he's ready. Offer less pay but also a growth path into one of the regular jobs. Done.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 09:31 AM
If companies don't have the manpower to get their regular stuff done how are they going to have the manpower to develop and maintain those adds and watch after baby programmers in their system?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 12:00 PM
clown,

1. unix systems cache aggressively, which is almost certainly why you have 7G "in use".

2a. i don't understand how you think it's reasonable to boil programmer candidates down to a list of skills. this is what HR has been trying and miserably failing to do for 30 years. it's not how programming works and it's now how you hire reasonable programmers.

2b. i want to know if i'm an intermediate poker player yet, so someone please post a list of things that would make me an intermediate poker player.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 12:20 PM
Can you play horse while 3 tabling limit?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 12:30 PM
of course! and i have a smooth 6. wait, what do you mean this isn't razz?!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-16-2013 , 06:34 PM
Clowntable's avatar is Open BSD. Learn something new everyday.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 07:41 AM
2a) Maybe the job situation is different here but there are tons of companies that are looking for people to do simple stuff so they can free their devs to do algorithm work and harder things. Seems like long term +EV to bring in guys for that and outlining specific knowledge needed and assigning one mentor that spends some time with them, assesses if he's capable enough and shows him a path of becoming a full dev later.
Those positions don't need to be full time. Learn this and that by doing so you show us you have the right mindset and we'll hire you for 20h/week or whatever you want seems perfectly targeted at students. You could even recommend what classes they should take etc

Basically what I'm saying is that there's a void of low level/aspiring programmer that tends to be filled wrong here (they'll just hire a CS grad for it), some fill those with interns but it's pretty much always and one and done type internship.

2b) Making a sustainable 50k/year+ imo (after taxes)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 09:06 AM
Clowntable, the jobs you're describing seem like good candidates for outsourcing - in which case you can pay significantly less than 50k/year.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 12:06 PM
Is there a shortage of developers really? I wonder about it as it sure seems to me that reqs I see want a lot of specific knowledge and skills. In short, if I really needed to ramp up a development effort I would tolerate more of a learning curve for candidates that I thought would handle the position. It is qualitative assessment on my part, just my impression.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 01:25 PM
Quote:
Originally Posted by jjshabado
Clowntable, the jobs you're describing seem like good candidates for outsourcing - in which case you can pay significantly less than 50k/year.
50k was the answer to intermediate poker player. No way 50k should be payed for the jobs I described.

I wouldn't outsource them either because they are a great stepping stone to get engineers down the line. I mean if you can't find them, train them ldo
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 03:15 PM
Quote:
Originally Posted by clowntable
2b) Making a sustainable 50k/year+ imo (after taxes)
nice results-orientation. i see you are a beginning poker player at best!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 03:18 PM
more seriously, clown, my point is that hiring from a laundry list is a terrible plan for anything resembling knowledge work. frankly, i'd rather have a smart, motivated learner with ~zero experience than some mouth-breathing "web developer" who read a blog or hacked up some ****ty code so they could say with a straight face that they had "experience" with all the items on some arbitrary list.

i do agree with your point about finding good junior folks and training them up. in fact, i think this is one of the most valuable things i do for the company as a "senior engineer" at my current gig.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-17-2013 , 03:38 PM
I said sustainable 50k not just 50k in any way. I was a cash player dunno about bink-MTT land, was thinking along the lines of grinding out 50k playing 100NL/200NL-ish etc

Quote:
frankly, i'd rather have a smart, motivated learner with ~zero experience than some mouth-breathing "web developer" who read a blog or hacked up some ****ty code so they could say with a straight face that they had "experience" with all the items on some arbitrary list.
I must suck at communicating. The idea is precisely targeting the zero knowledge guy. Basically the add would be "ok, you know nothing...learn these skills in a couple of weeks and swing by our office". Job interview would focus heavily on the learnign process and how they went about that.
Wouldn't be targeted at a guy that can do the stuff in the add but at a guy that can quickly learn the stuff in the add.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m