Print Story C: no longer just your grade in the course
Photos
By gzt (Wed Jan 16, 2013 at 05:46:03 PM EST) gzt, bowie, guns, gun control, cheating, books, c (all tags)
started the semester. taking the statistical computing class. essentially: learn C, do statistics in C, interface C with R.


doing that and continuing the required theory and methods classes.

my hot water pot randomly broke. I was heating up a pot of water and it suddenly stopped heating. at least it died doing what it loved.

we watched a lot of Doctor Who over the break. we finished watching highlights of the Tom Baker era and started on the Davison era. we also started watching Community. i also read a few books, went to the gym regularly, listened to a lot of news, read a lot of news, etc. i can still have NPR playing in the background while i work, but i think television will be relegated to maybe an hour or so on weekends. and, of course, our traditional "french movie sunday afternoons".

Anyway, it's kind of surprising to me how NRA talking points propagate. There's tremendous social pushback to what I think are some very reasonable ideas: you need some sort of license to get a gun (like the state of Illinois' FOID), all gun sales (including private ones) need to be reported and the buyer undergoing a background check (this part may be obviated by the licensing requirement), fund research into the causes of gun violence. The first two are seen as intrusions into lawful citizens' freedoms. The last is seen as partisan gun-grabbing BS that will only be used to support gun control (while they constantly complain that there isn't any evidence that any suggestions we make to curb gun violence will make a difference (except, of course, MORE FREEDOM (which means more guns to them))). but, you know, otherwise reasonable people start trotting out things like "Obama has people with guns guarding h is kids!!!" and I'm like... that doesn't have anything to do with anything, much less with what I'm saying.

I mean, I'm not even floating things like the "assault weapons ban" or the "high capacity magazine" ban. I think a farmer should be able to have everything from a BB gun to a 30-06 if they think they need it (and an AR-15 is between those) and it would be really hard, given various Supreme Court decisions, to get rid of handguns. But handguns are what lead to most gun injuries and deaths. High capacity magazines aren't really the problem (they're easy to make, anyway) and pretty much everything is semi-automatic, so regulating that isn't going to work. What little research has been done suggests criminal gun markets can be seriously inconvenienced by adding hurdles to gun acquisitions, so that's a good place to start. Guns are involved in 30,000 deaths and 100,000 injuries every year in this country, that would suggest to me that the government has some interest in providing at least some minor hurdles that law-abiding citizens can clear easily (e.g., filling out a form, waiting a week or two, having a background check). Yes, this makes private sales slightly more difficult. It does away with the "gun show loophole".

Here are the President's executive orders: http://www.slate.com/blogs/weigel/2013/01/16/read_president_obama_s_new_proposed_executive_orders_and_legislation_on.html Most of those sound quite reasonable. I particularly like 14 and 16.

Lance Armstrong: it's only cheating if it isn't being done by everybody else. That's the problem with steroids in the 90's. Or even now. There are a bunch of sports where countries that have good dope testing agencies cannot compete anymore.

One of the books I read was The Book of Ebenezer Le Page. It was sort of a hip thing to read recently in certain circles. And rightly so: it was a very good book. Highly recommend.

Speaking of books: we made a Christmas tree out of books. It was nice.

I'm on a huge Bowie kick right now.

< Concerned about your job? | The compass wouldn't help at all >
C: no longer just your grade in the course | 42 comments (42 topical, 0 hidden) | Trackback
Obama's List by jimgon (2.00 / 0) #1 Wed Jan 16, 2013 at 06:03:39 PM EST
All seem pretty mundane to anyone but a batshit crazy NRAer.




---------------
Technician - "We can't even get decent physical health care. Mental health is like witchcraft here."
the only thing that makes me nervous... by gzt (2.00 / 0) #2 Wed Jan 16, 2013 at 06:11:48 PM EST
...is how we're going to get "mental health" information to the people policing the whole gun thing. I mean, there are a lot of potential movie parts there and a lot of very very confidential stuff. But I fully support letting doctors, particularly mental health professionals, discuss gun safety with patients.

[ Parent ]
In New York's example by Phil the Canuck (2.00 / 0) #8 Wed Jan 16, 2013 at 07:10:25 PM EST
Information about people who express a desire to hurt themselves or others will be provided to authorities via mandated reporters (social workers, doctors, etc.).  Mandated reporting of this sort of thing is nothing new, the change is that you'll have a mark against you when you apply to purchase weapons.

[ Parent ]
yes, there are questions about... by gzt (2.00 / 0) #11 Wed Jan 16, 2013 at 07:40:58 PM EST
...how it's stored, what gets reported where, who sees what information, etc etc etc. I think it's good and don't think it will end up being a problem, but there's just a potential for it to be done poorly.

[ Parent ]
And that's where HIPAA come into play by jimgon (2.00 / 0) #26 Thu Jan 17, 2013 at 06:35:40 AM EST
The database would need to be non-public data (so Freedom of Information could not apply) and secured so that only people who need access have it.  Since corporations do this regularly on a daily basis I don't see that it's a big deal.




---------------
Technician - "We can't even get decent physical health care. Mental health is like witchcraft here."
[ Parent ]
HIPAA concerns by theboz (2.00 / 0) #25 Thu Jan 17, 2013 at 06:01:55 AM EST
As long as it complies with HIPAA it should be ok.  I also don't think the ability of a doctor to ask you if you own a gun compels you to answer anyway if that is also a concern for non-mental health issues.
- - - - -
That's what I always say about you, boz, you have a good memory for random facts about pussy. -- joh3n
[ Parent ]
Armstrong by Herring (2.00 / 0) #3 Wed Jan 16, 2013 at 06:36:19 PM EST
Hmm. Sure, many people were using EPO and even blood doping in that era but nobody else had the money and the power to run such a sophisticated operation. Several young cyclists died - their blood as thick as raspberry jam - in a low-budget effort to get near the likes of Armstrong.

There is also the way that Armstrong bullied , sued and threatened anyone who dared question him to the extent of ruining other's careers.

As to other sports, well let's put it like this: pro cycling is far slower than it was 10 years ago. Pierre Rolland, the young French rider kicked everyone's arses on the Alpe d'Huez in 2011 and rode away to an amazing victory. His time on the same climb in 2001 would've left him in 40th place - and that was at the end of a much longer stage. Meanwhile on the running track records keep falling ...

(PS Steroids aren't really useful in endurance sports so nobody apart from sprinters would use them)

christ, we're all old now - StackyMcRacky

Why still hold the races? by wumpus (2.00 / 0) #14 Wed Jan 16, 2013 at 08:31:09 PM EST
If winning is solid evidence of cheating (and presumably for several years that was all they had of Armstrong), why hold the races?

Wumpus

[ Parent ]
Er .... money? by Herring (2.00 / 0) #15 Wed Jan 16, 2013 at 08:34:04 PM EST
Have you any idea how much the sport is worth in Europe?

christ, we're all old now - StackyMcRacky
[ Parent ]
but it only pays in funny money by gzt (2.00 / 0) #16 Wed Jan 16, 2013 at 08:40:06 PM EST
i mean, c'mon, it's EUROPE.

[ Parent ]
Not as funny as dollars by anonimouse (4.00 / 1) #23 Thu Jan 17, 2013 at 05:27:39 AM EST
Trillion dollar coins, debt ceilings....etc


Girls come and go but a mortgage is for 25 years -- JtL
[ Parent ]
Ok, have the races. But you can't have a winner by wumpus (2.00 / 0) #27 Thu Jan 17, 2013 at 10:25:55 AM EST
if you already assume he cheated. The other question is why in the world anyone is bothering to listen to what Lance Armstrong has to say. If he has a signal to lie ratio approaching zero, what information could you possibly receive?

Wumpus

[ Parent ]
'gun safety,' sir, not 'gun control'! by the mariner (2.00 / 0) #4 Wed Jan 16, 2013 at 06:51:10 PM EST
 

the safest gun... by gzt (4.00 / 1) #5 Wed Jan 16, 2013 at 06:51:49 PM EST
...is the one in my hand pointing away from me.

[ Parent ]
unless by the mariner (2.00 / 0) #6 Wed Jan 16, 2013 at 07:03:15 PM EST
you're a black guy answering a strange knock at the door in the early hours of the morning. 

[ Parent ]
this is obviously a problem... by gzt (4.00 / 1) #7 Wed Jan 16, 2013 at 07:04:05 PM EST
...neither i nor anybody else i know will ever have.

[ Parent ]
You don't know any black people? by theboz (2.00 / 0) #24 Thu Jan 17, 2013 at 05:59:11 AM EST
Or do you mean you don't know black people that own guns?
- - - - -
That's what I always say about you, boz, you have a good memory for random facts about pussy. -- joh3n
[ Parent ]
C by lm (2.00 / 0) #9 Wed Jan 16, 2013 at 07:33:07 PM EST
Have you ever worked you're way through K&R?

If not, I highly recommend it if C is going to be a significant part of your immediate and medium term future.


There is no more degenerate kind of state than that in which the richest are supposed to be the best.
Cicero, The Republic
i got it a while ago... by gzt (2.00 / 0) #10 Wed Jan 16, 2013 at 07:35:57 PM EST
...and worked through a bit of it, but didn't get all the way through. i intend to work on it quite a bit over the course of the semester. it's one of the recommended books, of course.

[ Parent ]
That book is probably the best C tutorial ever by lm (4.00 / 1) #17 Wed Jan 16, 2013 at 08:56:06 PM EST
IIRC it starts a bit slow. But by the end the exercises get pretty thick. Working through K&R and APUE alone will make you a better programmer than 95% of the folks out there doing programming.

There is no more degenerate kind of state than that in which the richest are supposed to be the best.
Cicero, The Republic
[ Parent ]
what's APUE? by gzt (2.00 / 0) #19 Wed Jan 16, 2013 at 09:54:52 PM EST


[ Parent ]
Stevens by lm (4.00 / 1) #22 Wed Jan 16, 2013 at 11:04:00 PM EST
Advance Programming in the Unix Environment

There is no more degenerate kind of state than that in which the richest are supposed to be the best.
Cicero, The Republic
[ Parent ]
My only complaint with K&R by barooo (2.00 / 0) #30 Thu Jan 17, 2013 at 02:47:37 PM EST
Is that it lulls you into a comfort zone where you think it's perfectly reasonable to use strlen and other friends without enough "n"'s in their name on some random char*, which leads to vulnerabilities and bugs.  Then again, for educational purposes, it does make the code slightly easier to not worry about that stuff. 

My C-fu is a little rusty and I'm going to be needing it again in a few weeks (although with objective C it's pretty rare you need to mess with pointer arithmetic or whatnot which is the only thing making C harder than say javascript.).  I might have to 


man, i need a beefy taco now.
-gzt
[ Parent ]
bugs bad, vulnerabilities mostly irrelevant by gzt (2.00 / 0) #31 Thu Jan 17, 2013 at 04:32:07 PM EST
probably. I mean, to what extent does somebody building the kind of tools I'd be building have to think about security? (semiserious question)

[ Parent ]
that would be next level by nathan (4.00 / 1) #32 Thu Jan 17, 2013 at 04:59:34 PM EST
Some guy manages to reverse-engineer your code to such an extent that he discovers how to feed data into your MCMC app in such a way that it roots the box your app is running on. The Russian mafia plants such innocent-seeming data into, e.g., a batch of industrial data and incepts a bunch of high-security locked-room computers that control uranium refining. They phone home and nuclear war seems innocent.

Only one man can save us. His name? GZT.

He "shoots" his way into the Russian mafia base, reloading constantly from a duffle bag full of Taser cartridges. Suddenly, he's disarmed via Sambo hold by the head mafioso, a Rutger Hauer-looking dude named "Pladimir Vutin".

There is a flurry of tightly choreographed blows. Vutin is winning. Suddenly, GZT turns the tables by bashing him with a previously-concealed stats textbook. Vutin falls into a conveniently located vat full of glue. Immobilized, he cannot escape as GZT saunters up to the edge of the vat and quips, "I told you, Plad. Garbage in -- garbage out".

Parade, medals, celebrations, etc.

[ Parent ]
systema is the current in russian martial arts by gzt (2.00 / 0) #34 Thu Jan 17, 2013 at 06:44:30 PM EST
or, at least, american perception of russian martial arts. sambo is so 1995. but, then, so's Rutger Hauer.

there also needs to be a bear in the fight scene.

[ Parent ]
p.s. in the backstory it turns out that by nathan (2.00 / 0) #35 Thu Jan 17, 2013 at 08:23:43 PM EST
Plad and GZT were classmates at the University of Harvard's Ph.D program in mad science. Plad, a brilliant student, was blinded by his lust for power towers and became a "mathematical outlaw". There may be some unresolved issues between the two strapping, passionate men -- they call that "subtext" in technical literary analysis circles.

[ Parent ]
there should be a rasputin character by gzt (4.00 / 1) #37 Thu Jan 17, 2013 at 09:43:48 PM EST
besides gzt

[ Parent ]
perhaps a mad math monk at harvard state by gzt (2.00 / 0) #38 Thu Jan 17, 2013 at 09:45:51 PM EST
who seduces him to the dark side

[ Parent ]
'professor, i have discovered the Dark Tensor!' by nathan (4.00 / 2) #39 Fri Jan 18, 2013 at 10:20:09 AM EST
Yes... yes... YES! Its powers are MANIFOLD!

[ Parent ]
In your case by barooo (2.00 / 0) #33 Thu Jan 17, 2013 at 05:53:52 PM EST
you probably don't care (except because of bugs).  But writing stuff that will get released in some way or run by others, then yeah. 

man, i need a beefy taco now.
-gzt
[ Parent ]
Only a moron would get a sense of security ... by lm (4.00 / 2) #36 Thu Jan 17, 2013 at 08:26:59 PM EST
... from K&R.

It takes a special kind of ignorance combined with a specific sort of arrogance to do the exercises in K&R and then consider that the trivial implementation of malloc you just wrote is ready for implementation in a production operating system.


There is no more degenerate kind of state than that in which the richest are supposed to be the best.
Cicero, The Republic
[ Parent ]
disagree by barooo (4.00 / 1) #40 Fri Jan 18, 2013 at 10:26:56 AM EST
Have you seen the sort of production code most places have?

I feel like the fact that lots of the code in the book is vulnerable to that sort of thing, and that the book is held up (rightfully so, but that's another story) as the only C book you need contributes to the problem.  It's not the cause, but most people new to C read that book, maybe jump into some mediocre code and copy and paste, and google stuff.  And for examples there's nothing wrong with that sort of code, it's just like not explicitly handling errors around every function call; it obscures what you're trying to do in an example but it's absolutely necessary in real code (and can be done in a less obscuring way, but the you have two or 3 snippets to look at instead of 1).

A lot of people never see "good" "real" C code, and that's the problem.

Maybe I'm wrong, I haven't done C or C++ professionally in about 10 years, maybe it's gotten unpopular enough that the only people that still do C are good at it.  At the time, it was certainly true of the codebase I was working in at a large telecom company, because a lot of it was horrendous.



man, i need a beefy taco now.
-gzt
[ Parent ]
I don't think we disagree by lm (4.00 / 1) #41 Fri Jan 18, 2013 at 11:08:03 AM EST
You seem to be saying that the center of the problem is that ``most people new to C read that book, maybe jump into some mediocre code and copy and paste, and google stuff'' and that a ``lot of people never see `good' `real' C code'' more than K&R per se.

I'll gladly concede that many people give to K&R a role in learning the program that it should not have.

But, realistically, all the other popular introductory C books are far worse.


There is no more degenerate kind of state than that in which the richest are supposed to be the best.
Cicero, The Republic
[ Parent ]
Why.. by Driusan (2.00 / 0) #12 Wed Jan 16, 2013 at 08:03:33 PM EST
Would you do statistics in C? That seems silly.

--
Vive le Montréal libre.
more like.. by gzt (2.00 / 0) #13 Wed Jan 16, 2013 at 08:30:19 PM EST
...doing fast numeric computation in C, the sort of computations that are popular in statistics. what's silly about it, that it's done in C instead of a higher language, or that's it's C instead of, say, C++? if higher (say, why C instead of R?), the answer is that we need something faster and dropping straight to C for some tasks can mean the difference between taking 2 weeks and taking 2 days (or better). if C instead of C++, not completely sure, but R is written in C and the sorts of numerical computing aren't so complicated that they require the additional stuff in C++. or maybe not, i don't know. all i know is that most of the people on the pure stats side tend to drop into C rather than C++. the genomic biostats type people go into C++ instead of C, it seems from my occasional discussions. i don't know why. it could all be cultural.

[ Parent ]
what kinds of numerical calculations do you do by the mariner (2.00 / 0) #18 Wed Jan 16, 2013 at 09:48:43 PM EST
that aren't already implemented in, e.g., LAPACK, QUADPACK, etc. and interfaced to R? 

[ Parent ]
one classic example... by gzt (2.00 / 0) #20 Wed Jan 16, 2013 at 10:18:38 PM EST
...is MCMC stuff. the actual math is pretty simple, sometimes (or at least can be spit out to LAPACK), but you're burning through some big loops. C often ends up being 40-100 times faster than R and maybe 30-50 times faster than vanilla Python while not being that much harder to code.

[ Parent ]
just goes to show, by the mariner (2.00 / 0) #21 Wed Jan 16, 2013 at 10:53:12 PM EST
i don't know jack about statistics. sounds pretty interesting though. (although i do know what mixing is...) 

[ Parent ]
2 days is still pretty long. by garlic (2.00 / 0) #28 Thu Jan 17, 2013 at 11:55:42 AM EST
what sort of parallel processing is possible? How often do the algorithms (vs the input data) change? do you guys do any sort of hardware acceleration via offboarding to more specialized chips?


[ Parent ]
some intense people do a bit of that by gzt (2.00 / 0) #29 Thu Jan 17, 2013 at 02:05:07 PM EST
parallelization is definitely a thing sometimes, so is GPU computing. the thing is, one person's 2-10 day calculation maybe has to run only two or three times ever and then they publish their paper and put it away and do something else that substantially revises the algorithm. so, on the one hand, they have something to gain from more optimization, but, on the other, they're not going to beat themselves up too much about it, especially if it means taking a couple months to learn a technology in order to save a week of waiting for results.

but, yes, statisticians aren't usually great programmers.

[ Parent ]
scientists aren't usually great programmers by bobdole (2.00 / 0) #42 Mon Jan 21, 2013 at 07:19:24 AM EST
way to much of the "I'll just have to run this once, so this will do for now". Which means there is usually little best practice in the code, from parsing data to running computations.
-- The revolution will not be televised.
[ Parent ]
C: no longer just your grade in the course | 42 comments (42 topical, 0 hidden) | Trackback