Testing Chat IV: A New Hope

Harder, Better, Faster, Stronger.
Locked
Message
Author
User avatar
Veef
Posts: 2065
Joined: Mon Sep 26, 2011 4:52 am

Re: Testing Chat IV: A New Hope

#1501 Post by Veef »

read

:riker: ~between~ :riker:

the lines

User avatar
Bounty
Posts: 535
Joined: Mon Oct 03, 2011 5:45 pm

Re: Testing Chat IV: A New Hope

#1502 Post by Bounty »

so what has been going on RE: SDN these days

still dying slowly

?
People in glass trousers shouldn't shit bricks.

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1503 Post by Questor »

Flagg, while I must complement you on your tactical trolling in the Snowden thread, I've really got to question your choice of weapons. So much high megatonnage trolling has been thrown around in that thread that people's detectors are off.

User avatar
Flagg
Posts: 2123
Joined: Mon Sep 26, 2011 2:45 am

Re: Testing Chat IV: A New Hope

#1504 Post by Flagg »

Questor wrote:Flagg, while I must complement you on your tactical trolling in the Snowden thread, I've really got to question your choice of weapons. So much high megatonnage trolling has been thrown around in that thread that people's detectors are off.
No comment. :smugissar:
CUNTS! FOR! EYES!
The Liberal Hate Machine

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1505 Post by adr »

you want to know who are super brave people?

terrorists
In the name of the moon, I will punish you!

User avatar
Flagg
Posts: 2123
Joined: Mon Sep 26, 2011 2:45 am

Re: Testing Chat IV: A New Hope

#1506 Post by Flagg »

adr wrote:you want to know who are super brave people?

terrorists
I don't disagree with this statement.
CUNTS! FOR! EYES!
The Liberal Hate Machine

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1507 Post by adr »

anyway i just got asked an interview question on the internet for the lols

and i fucking failed it. miserably

they axed me to implement the C function strstr. i tried to do it efficiently and ended up doing it TOTALLY WRONG

it passed the first trivial test

then failed the second slightly more complex test

fixed that and it failed the third slightly more complex test

fixed that and it was STILL failing the fourth, this time trivial again, test

and then the interviewer said it is 2x longer than it has to be and had zero speed advantage


so i said fuck it and rewrote it the most stupid simple way i could think of

took 2 minutes and passed all the tests the first draft's descendants failed, while hitting the length guideline too



i guess if i'm ever asked that in a real interview i'll have to remember to keep it simple. try to get fancy and and i'll get it wrong and that's like the anti-impressive
In the name of the moon, I will punish you!

User avatar
Oxymoron
Posts: 4167
Joined: Tue Jan 03, 2012 4:18 pm

Re: Testing Chat IV: A New Hope

#1508 Post by Oxymoron »

adr wrote:i guess if i'm ever asked that in a real interview i'll have to remember to keep it simple. try to get fancy and and i'll get it wrong and that's like the anti-impressive
This. I don't think I have much experience in programming, but so far, all I've seen point to "the simplest the method, the shortest the code, the better" being a good rule of thumb when thinking about how to go about things.
No.

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1509 Post by Questor »

Flagg wrote:
Questor wrote:Flagg, while I must complement you on your tactical trolling in the Snowden thread, I've really got to question your choice of weapons. So much high megatonnage trolling has been thrown around in that thread that people's detectors are off.
No comment. :smugissar:
I do have to admit, my analysis of Snowden is roughly the same as yours (at least the one you post in that thread), I just would never say it on SDN... well, sort of.

I think he's an impulsive dipshit who's in so deep he can't figure out how to crawl back out. Snowden saw something, copied it off and talked to newsies impulsively, then didn't want to pay the consequences of that action, so he ran. Then he realized that running to a country like China was about as good an idea as if the Rosenberg's had bought tickets on the Aeroflot Flight 101. It doesn't matter if he gives info to the chinese intelligence agency (and my guess is that they are staying as far away from him as they can, he looks like he might have been trying to, which ups the stakes from Pentagon Papers to The Rosenbergs in terms of how the government has to treat it.

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1510 Post by Questor »

adr wrote:i guess if i'm ever asked that in a real interview i'll have to remember to keep it simple. try to get fancy and and i'll get it wrong and that's like the anti-impressive
I find this to be a relatively good idea in programming in general. Doing shit like side-effecting assigments and other fancy shit just causes problems. Make you code exactly as complicated as it needs to be to solve a problem.

Unless of course your a "code as art" developer, but then again, most of them work in languages that are more conducive to that.

User avatar
Oxymoron
Posts: 4167
Joined: Tue Jan 03, 2012 4:18 pm

Re: Testing Chat IV: A New Hope

#1511 Post by Oxymoron »

Questor wrote:"code as art"
Behold, art :

Code: Select all

#include                                     <math.h>
#include                                   <sys/time.h>
#include                                   <X11/Xlib.h>
#include                                  <X11/keysym.h>
                                          double L ,o ,P
                                         ,_=dt,T,Z,D=1,d,
                                         s[999],E,h= 8,I,
                                         J,K,w[999],M,m,O
                                        ,n[999],j=33e-3,i=
                                        1E3,r,t, u,v ,W,S=
                                        74.5,l=221,X=7.26,
                                        a,B,A=32.2,c, F,H;
                                        int N,q, C, y,p,U;
                                       Window z; char f[52]
                                    ; GC k; main(){ Display*e=
 XOpenDisplay( 0); z=RootWindow(e,0); for (XSetForeground(e,k=XCreateGC (e,z,0,0),BlackPixel(e,0))
; scanf("%lf%lf%lf",y +n,w+y, y+s)+1; y ++); XSelectInput(e,z= XCreateSimpleWindow(e,z,0,0,400,400,
0,0,WhitePixel(e,0) ),KeyPressMask); for(XMapWindow(e,z); ; T=sin(O)){ struct timeval G={ 0,dt*1e6}
; K= cos(j); N=1e4; M+= H*_; Z=D*K; F+=_*P; r=E*K; W=cos( O); m=K*W; H=K*T; O+=D*_*F/ K+d/K*E*_; B=
sin(j); a=B*T*D-E*W; XClearWindow(e,z); t=T*E+ D*B*W; j+=d*_*D-_*F*E; P=W*E*B-T*D; for (o+=(I=D*W+E
*T*B,E*d/K *B+v+B/K*F*D)*_; p<y; ){ T=p[s]+i; E=c-p[w]; D=n[p]-L; K=D*m-B*T-H*E; if(p [n]+w[ p]+p[s
]== 0|K <fabs(W=T*r-I*E +D*P) |fabs(D=t *D+Z *T-a *E)> K)N=1e4; else{ q=W/K *4E2+2e2; C= 2E2+4e2/ K
 *D; N-1E4&& XDrawLine(e ,z,k,N ,U,q,C); N=q; U=C; } ++p; } L+=_* (X*t +P*M+m*l); T=X*X+ l*l+M *M;
  XDrawString(e,z,k ,20,380,f,17); D=v/l*15; i+=(B *l-M*r -X*Z)*_; for(; XPending(e); u *=CS!=N){
                                   XEvent z; XNextEvent(e ,&z);
                                       ++*((N=XLookupKeysym
                                         (&z.xkey,0))-IT?
                                         N-LT? UP-N?& E:&
                                         J:& u: &h); --*(
                                         DN -N? N-DT ?N==
                                         RT?&u: & W:&h:&J
                                          ); } m=15*F/l;
                                          c+=(I=M/ l,l*H
                                          +I*M+a*X)*_; H
                                          =A*r+v*X-F*l+(
                                          E=.1+X*4.9/l,t
                                          =T*m/32-I*T/24
                                           )/S; K=F*M+(
                                           h* 1e4/l-(T+
                                           E*5*T*E)/3e2
                                           )/S-X*d-B*A;
                                           a=2.63 /l*d;
                                           X+=( d*l-T/S
                                            *(.19*E +a
                                            *.64+J/1e3
                                            )-M* v +A*
                                            Z)*_; l +=
                                            K *_; W=d;
                                            sprintf(f,
                                            "%5d  %3d"
                                            "%7d",p =l
                                           /1.7,(C=9E3+
                              O*57.3)%0550,(int)i); d+=T*(.45-14/l*
                             X-a*130-J* .14)*_/125e2+F*_*v; P=(T*(47
                             *I-m* 52+E*94 *D-t*.38+u*.21*E) /1e2+W*
                             179*v)/2312; select(p=0,0,0,0,&G); v-=(
                              W*F-T*(.63*m-I*.086+m*E*19-D*25-.11*u
                               )/107e2)*_; D=cos(o); E=sin(o); } }
No.

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1512 Post by adr »

what i was trying to do here was implement it in better than O(m*n) time. the boyer-moore algorithm can do that, but i only vaguely recalled how it worked and tried to do my own thing based on that and totally fucked it up, and ended up at the brute force solution by roundabout by the time it worked...


now on simple code itself one time i got criticised by the same guy asking this question for writing this:

Code: Select all

bool isOdd(int i) {
  if(i % 2 == 0)
      return false;
  else
      return true;
}
and he said " i would have just written "return i&1;" and that you didn't raises red flags to me

i&1 did come to mind but i rejected it thinking of shit like ones-complement machines and worrying maybe there's another edge case i didn't consider

but granted i could have still said "return i%2 != 0;" but i don't like that either because != 0, unless you specifically want "is not equal to zero" strikes me as a double negative

and i'd rather spend a brain cycle on reading longer code than double-thinking to ensure that double negative is indeed what i meant

i guess it is valid, if my brain needs an extra few seconds to think that through maybe that is a legitimate liability

but meh


BTW my code and return i&1 compile to exactly the same thing

if you can think of a simple optimization like that, odds are good that the compiler already knows it.
In the name of the moon, I will punish you!

User avatar
Oxymoron
Posts: 4167
Joined: Tue Jan 03, 2012 4:18 pm

Re: Testing Chat IV: A New Hope

#1513 Post by Oxymoron »

Yeah, when your code is optimized so much in its written form that it become hard to read for a human, maybe you should take a step back and think about the poor guys who will have to maintain it and weigh it with the advantages you expect from that optimization.
No.

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1514 Post by Questor »

adr wrote:and he said " i would have just written "return i&1;" and that you didn't raises red flags to me
Fucking C nuts... I mean he's right that it will work, but still.

Optimizations that don't compile differently are stylistic.

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1515 Post by adr »

At best the guy is ADR, at worst he's a spy.
:lol:

BTW of course he's a spy, he worked for the NSA!

"i meant a CHINESE spy!!!!!1111!!11!!111"
In the name of the moon, I will punish you!

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1516 Post by Questor »

Hey, ADR,

Have you ever played with functional programming? I'm thinking of taking a flyer into it for some of my more data driven tasks.

User avatar
Oxymoron
Posts: 4167
Joined: Tue Jan 03, 2012 4:18 pm

Re: Testing Chat IV: A New Hope

#1517 Post by Oxymoron »

Isn't C all about the functions ?
No.

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1518 Post by adr »

questor:

a little bit. i haven't done haskell or f# or whatever (though i have done some common lisp) but the principles are somewhat known to me and i have used them in D and javascript

i have a love/hate relationship with what i know. when my mind conceives of the program in functional terms, i love it

otherwise i think it is incomprehensible code golf (Python has this thing called 'list comprehensions'. more like list incomprehensions amirite? though i find if i read them with the part of my brain that speaks SQL it isn't so bad. but more often than not i program with the C speaking part of my brain, and thus tend to prefer stupid simple procedural code)


the other key parts, immutabilty, no side effects, stuff like that i think are generally parts of good code anyway, though sometimes functional drives it too far

what the fuck is a monad anyway

beats the hell out of me
In the name of the moon, I will punish you!

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1519 Post by adr »

Oxymoron wrote:Isn't C all about the functions ?
functional programming is different though, it is about functions that return functions that otherwise don't change things

see wikiepiesdsa http://en.wikipedia.org/wiki/Functional_programming
In the name of the moon, I will punish you!

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1520 Post by Questor »

adr wrote:though i find if i read them with the part of my brain that speaks SQL
This is the part that is really drawing me to it - And I'd be doing F#, I think, to provide interoperability with C# and VB.NET - functional programming just seems to make so much sense when dealing with datasets.

Admittedly, LinQ goes a long way towards bringing the same stuff to C#.

User avatar
adr
Moon Prism Power, Make Up!
Posts: 1462
Joined: Fri Sep 07, 2012 10:59 pm

Re: Testing Chat IV: A New Hope

#1521 Post by adr »

yeah, i think it is pretty elegant there
In the name of the moon, I will punish you!

User avatar
Questor
Posts: 793
Joined: Tue Oct 04, 2011 2:51 am

Re: Testing Chat IV: A New Hope

#1522 Post by Questor »

What's sad is that my favorite series on MS products (X Unleashed by SAMS) doesn't cover F#.

User avatar
RogueIce
#YOLO
Posts: 2089
Joined: Mon Sep 26, 2011 4:57 pm

Re: Testing Chat IV: A New Hope

#1523 Post by RogueIce »

Oxymoron wrote:you should take a step back and think about the poor guys who will have to maintain it
Isn't deliberately averting that known as "programmer job security"? :v

User avatar
Oxymoron
Posts: 4167
Joined: Tue Jan 03, 2012 4:18 pm

Re: Testing Chat IV: A New Hope

#1524 Post by Oxymoron »

That guy may be you in a year or two, after you have completely forgotten what you had in mind, so...
No.

Glass Fort MacLeod
Fuckin' New Guy
Posts: 176
Joined: Tue Oct 09, 2012 9:39 am

Re: Testing Chat IV: A New Hope

#1525 Post by Glass Fort MacLeod »

Veef wrote:http://blip.tv/sf-debris-opinionated-re ... ew-6607010

lol Chuck just subtly slammed SDN here
I don't read it as such. I read it as more fatigue with what SDN represents, rather the mindset that worships dogman and placating preconceptions rather than exploring or discussing ideas. I've ranted about this on various ways here enough that people should know I feel the same way about shit like SDN, SB, or vs debating in general, so Chuck's frustrations can really stand out for me as well.

You could just as easily say its frustration at the whole ST vs SW/ASVS type stuff as it is about SDN, but you really can apply it across the board to alot of mindsets. I've found similar problems in hard scifi (or many specualtive technology groups) and lots of other franchises besides ST vs SW. Heck, I have enough issues dealing with people who 'worship' the 40K shit I do, even when I'm arguing with them over what I myself posted because I didn't want it becoming tribal.

Heck part of me wonders if this might not also be aimed at his own popularity, as Chuck has clearly moved form the realm of being simply an 'opinionated fan' and elevated to 'celebrity' where people clearly take his opinion as gospel (like alot of other internet 'commentators/critics/what have you') While I've never been on chuck's level (or Mike or Curtis' for that matter) I've had to deal with it in my own small way, and it can be incredibly frustrating, especially when people form their opinions about you on the basis of what other people (those who like your stuff) say, rather than as you are.

Locked