Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ChickenWing
Jul 22, 2010

:v:

LeftistMuslimObama posted:

I have a very intricate metadata and cataloging system for my porn, OK?
:goonsay:

Same. It's called pornhub :v:

Adbot
ADBOT LOVES YOU

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
"Our new social media integrated, cloud based, customer responsive app learns from your porn browsing habits, then intelligently predicts your next browsing session and pre-populates your tabs from your favorite sources."

xzzy
Mar 5, 2009

The Ex Machina movie that recently hit theaters has a moment where the protagonist asks if the robot was designed based on his porn profile. He was querying the creator of a Google-like search company.

Google should totally be spending R&D on that instead of augmented reality and self driving cars.

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
The self-driving bangbus will usher in a new era of safety and low production costs.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
In retrospect, while I am very glad that I dropped/washed out of my PhD program with a Master's, I am also very glad I went. I learned a lot, both through coursework and research, and many of those ideas have been helpful in my work. Now, it could be that my work is more theoretical / mathematical than most. But I am always very skeptical of programmers saying that "everything I needed to know, I learned on the job", because even in my fairly short career (10-15 years, depending on what you count) I have met an awful lot of ignorant, bull-headed programmers. I've known quite a few excellent programmers who never even finished undergrad, or didn't study programming in school; but in every single case they saw that as a defect that they needed to fix, usually just by studying independently whatever they'd missed in classwork.

shodanjr_gr
Nov 20, 2007

LeftistMuslimObama posted:

What's even the point of a CS master's or PHD unless you're really into research?

Personally I went into the PhD because I did undergraduate research with a passionate young faculty and loved it. Then I came to grad school, ended up working with a senior faculty/administrator (on some very cool stuff never the less). Yet I realized that the whole process is as much of a pyramid scheme as people describe, it is much less about he advancement of science than it seems from the outside and that industry is actually more intellectually challenging while being much much more rewarding. Most folks in PhD programs that I've met (excluding those from top 5-10 schools) are less outwardly intelligent, less motivated, less social, less productive and much much more miserable than the majority of people I've interacted with in industry.








The problem is that I realized those things about three years into my PhD and after turning down a job offer at a big three firm. So I grinder for another three years. I don't necessarily regret my choice (starting a PhD is what got me in the U.S. In the first place). But if I were to do it again I'd do it differently.





So yeah, if your TA has issues, he's depressed and probably on the verge of a meltdown, so cut him some slack.

fritz
Jul 26, 2003

LeftistMuslimObama posted:

There's something really sick happening to universities in general and I'm not really sure how to fix it. The problem you describe extends well beyond CS postgrad stuff. It's even worse in some fields where you're not considered even equipped to be entry-level until you've got your first doctorate.

Some disciplines there is just a lot to know, when I did my math phd the first 3-4 years were solid coursework, and I came out with huge gaps in major areas (I had no graduate-level algebra or topology classes, and only one semi-formal graduate number theory class).

crazypenguin
Mar 9, 2005
nothing witty here, move along
PhD is just a 5-7 year low-paying job that lets you work on really cool stuff you probably otherwise would not be able to do fresh out of undergrad. (If you're doing a PhD, you don't want to be a professor, and the previous sentence does not describe you, you should probably get out now. There is no other payoff.)

For me, it was compilers and PL design stuff. I had a blast.

IT BEGINS
Jan 15, 2009

I don't know how to make analogies
code:
function isEven(n) {
	n = Number(n);
	return n === 0 || !!(n && !(n%2));
}
myLife.js

Linear Zoetrope
Nov 28, 2011

A hero must cook
I'm a PhD student in AI/Machine Learning, way more heavily towards the former side (I deal with decision making and planning, imitation learning, and some simulation). I'm sure I could've probably tried to get a job at some company doing data analytics or something, but grad school was my plan since undergrad. I'm probably "underpaid", but I also get to work on making computers play games and poo poo. The market for the stuff I like to work on is pretty small. Some video game AI is within what I do, but the stuff I like to work on is closer to "the creature in Black and White" or "The Sims", and not what 98% of games use for AI. Not to mention I hear the game industry can be almost as exploitative as academia.

The closest to the type of jobs I'd like in industry are closer to "Mars rover pathfinding" or "Google car", which seem rarer and harder to get than platinum*, at least with only a BS, so I have a sweet gig working on the stuff I like as a student. If I can't get a tenure track position (likely), I'll basically be hoping I can eventually find something like that. Writing web anything or predicting what consumers would like to watch next on Netflix is my hell.


* I guess there's some industrial robotics, which really isn't my first choice, but I suppose it's vaguely in the realm of what I do.

IT BEGINS posted:

code:
function isEven(n) {
	n = Number(n);
	return n === 0 || !!(n && !(n%2));
}
myLife.js

That programmer was trolling, right? :ohdear:

IT BEGINS
Jan 15, 2009

I don't know how to make analogies

Jsor posted:

That programmer was trolling, right? :ohdear:

Nope. I'm assuming he ripped it from this question on StackOverflow. No, he didn't rip it from any of the answers - he took it from the question, where the guy explains how this function fails a whole bunch.

The Fool
Oct 16, 2003


This may be ignorant, but is there a reason that

code:

return n % 2 

won't work?

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
!!(n && !(n%2));

:psyduck:

Is there something Javascript specific I'm not seeing here?

FlapYoJacks
Feb 12, 2009

Knyteguy posted:

!!(n && !(n%2));

:psyduck:

Is there something Javascript specific I'm not seeing here?

No, the guy is just a blithering idiot.


The Fool posted:

This may be ignorant, but is there a reason that

code:
return n % 2 
won't work?


No reason that I can see.

sarehu
Apr 20, 2007

(call/cc call/cc)
You mean return 0 == n % 2;

FlapYoJacks
Feb 12, 2009

sarehu posted:

You mean return 0 == n % 2;

return n % 2 would work fine though?

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
You also might want to check for type safety because :javascript:.

Mogomra
Nov 5, 2005

simply having a wonderful time

Pavlov posted:

You also might want to check for type safety because :java script:.

Yup. parseFloat and !isNaN first. :sigh:

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
I will never understand what they were thinking with the javascript typing and equality system, besides maybe, "Who cares, nobody's going to write real programs with it."

Pavlov fucked around with this message at 01:55 on May 14, 2015

Impotence
Nov 8, 2010
Lipstick Apathy

Pavlov posted:

I will never understand what they were thinking with the javascript typing and equality system, besides maybe, "Who cares, nobody's going to right real programs with it."

they were right though

kitten smoothie
Dec 29, 2001

Pavlov posted:

I will never understand what they were thinking with the javascript typing and equality system, besides maybe, "Who cares, nobody's going to right real programs with it."

http://programmers.stackexchange.com/questions/221615/why-do-dynamic-languages-make-it-more-difficult-to-maintain-large-codebases

quote:

Let's take JavaScript for example. (I worked on the original versions of JScript at Microsoft from 1996 through 2001.) The by-design purpose of JavaScript was to make the monkey dance when you moused over it.

sarehu
Apr 20, 2007

(call/cc call/cc)

ratbert90 posted:

return n % 2 would work fine though?

You want to return a boolean, not a number such as 0, 1, or 1.5. Also n % 2 returns a truthy value when n is not even.

xzzy
Mar 5, 2009

I read in a stack exchange comment somewhere that javascript was created so jquery could be created. So I think that justifies its use.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

ratbert90 posted:

return n % 2 would work fine though?

But the method is called isEven, not isOdd...

Linear Zoetrope
Nov 28, 2011

A hero must cook
Clearly you all have been blinded by these worthless dynamic languages and need the power of a good static type system!

code:
#[derive(Debug,Copy,Clone,Eq,PartialEq)]
enum Parity {
    Even,
    Odd,
}

fn parity(n: i64) -> Parity {
    if n % 2 == 0 {
        Parity::Even
    } else {
        Parity::Odd
    }
}

fn isEven(n: i64) -> bool {
    parity(n) == Parity::Even
}
The real horror is that I'd probably actually do this.

Linear Zoetrope fucked around with this message at 04:14 on May 14, 2015

Impotence
Nov 8, 2010
Lipstick Apathy
php:
<?
function isEven(int $i): bool {
        $check = ($i / 2);
        if (stripos((string)$check, '.') === false) {
                return true;
        } else { return false; }
}
?>

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Biowarfare posted:

php:
<?
function isEven(int $i): bool {
        $check = ($i / 2);
        if (stripos((string)$check, '.') === false) {
                return true;
        } else { return false; }
}
?>

lol if this works, because it means php returns a float result from integer division

WHERE MY HAT IS AT
Jan 7, 2011
PHP doesn't have integer division. When would you ever need that?
E: http://phpthegoodparts.tumblr.com/

WHERE MY HAT IS AT fucked around with this message at 04:55 on May 14, 2015

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

WHERE MY HAT IS AT posted:

PHP doesn't have integer division. When would you ever need that?

Why isn't there a :php: yet?

Linear Zoetrope
Nov 28, 2011

A hero must cook

Dessert Rose posted:

lol if this works, because it means php returns a float result from integer division

Julia auto-promotes ints to floats for division, but there is a special operator for integer division. It seems to work pretty well there, but then Julia is also a scientific computing language.

VikingofRock
Aug 24, 2008




Jsor posted:

Clearly you all have been blinded by these worthless dynamic languages and need the power of a good static type system!

code:
#[derive(Debug,Copy,Clone,Eq,PartialEq)]
enum Parity {
    Even,
    Odd,
}

fn parity(n: i64) -> Parity {
    if n % 2 == 0 {
        Parity::Even
    } else {
        Parity::Odd
    }
}

fn isEven(n: i64) -> bool {
    parity(n) == Parity::Even
}
The real horror is that I'd probably actually do this.

IMO that's actually pretty reasonable.

I was playing with this example though and I was trying to figure out how to make it generic over the Rem trait. What's the Rust way to cast the 2 to the appropriate type? (The fact that I can't figure this out probably means that I am the coding horror)

Linear Zoetrope
Nov 28, 2011

A hero must cook

VikingofRock posted:

IMO that's actually pretty reasonable.

I was playing with this example though and I was trying to figure out how to make it generic over the Rem trait. What's the Rust way to cast the 2 to the appropriate type? (The fact that I can't figure this out probably means that I am the coding horror)

Nah, I couldn't figure it out either and gave up, changing it to i64. I figured it wasn't worth it for a silly throwaway code block on an internet forum. I got stuck on the same part. I guess you could do two using One + One from the num crate, but that'd be pretty ridiculous.

E: You're right that it's probably not terrible, but unless you're going to do something interesting with Parity other than an evenness check, it's probably overengineering.

Linear Zoetrope fucked around with this message at 05:34 on May 14, 2015

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Dessert Rose posted:

Why isn't there a :php: yet?

Fortunately there is a unicode character: 💩

"We're looking for a developer experienced with hate 'em all, poop and my squeal. You might have to do a little cease as well."

Impotence
Nov 8, 2010
Lipstick Apathy

Dessert Rose posted:

lol if this works, because it means php returns a float result from integer division



http://3v4l.org/05nmB

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that

Jsor posted:

Julia auto-promotes ints to floats for division, but there is a special operator for integer division. It seems to work pretty well there, but then Julia is also a scientific computing language.

Honestly Julia is a pretty refreshing language all around from what I've seen.

Vanadium
Jan 8, 2005

VikingofRock posted:

IMO that's actually pretty reasonable.

I was playing with this example though and I was trying to figure out how to make it generic over the Rem trait. What's the Rust way to cast the 2 to the appropriate type? (The fact that I can't figure this out probably means that I am the coding horror)

Best way I could figure out, short of doing something like from_str("2"):

code:
#![feature(zero_one)]

use std::ops::{Add, Rem};
use std::num::{One, Zero};

#[derive(Debug,Copy,Clone,Eq,PartialEq)]
enum Parity {
    Even,
    Odd,
}

fn parity<T: One+Zero+Add<T, Output=T>+Rem<T, Output=T>+PartialEq>(n: T) -> Parity {
    let zero: T = Zero::zero();
    let two: T = <T as One>::one() + <T as One>::one();
    if n % two == zero {
        Parity::Even
    } else {
        Parity::Odd
    }
}

fn is_even<T: One+Zero+Add<T, Output=T>+Rem<T, Output=T>+PartialEq>(n: T) -> bool {
    parity(n) == Parity::Even
}

fn main() {
    println!("{}", is_even(42_f64));
}
Even that requires the nightly branch instead of stable. They used to have more traits for writing code generic over numeric types but I think they didn't want to commit to them for 1.0 so they all got yanked a while back.

QuarkJets
Sep 8, 2008

Pavlov posted:

Honestly Julia is a pretty refreshing language all around from what I've seen.

I really liked Julia a lot until I started using Python's Numba module

Linear Zoetrope
Nov 28, 2011

A hero must cook

VikingofRock posted:

IMO that's actually pretty reasonable.

I was playing with this example though and I was trying to figure out how to make it generic over the Rem trait. What's the Rust way to cast the 2 to the appropriate type? (The fact that I can't figure this out probably means that I am the coding horror)

Update: this may be out of date, but it may be impossible to use constants in generics right now. (Luckily, for this specific use case there's an is_even method in the num::integer::Integer trait, but no multiplying arbitrary numbers by 5).

Pavlov posted:

Honestly Julia is a pretty refreshing language all around from what I've seen.

QuarkJets posted:

I really liked Julia a lot until I started using Python's Numba module

Julia's pretty cool, but I had a hell of a time developing anything with command line or file input in it. Juno is not built for that, which is a shame because it has so many nice features. I also had this annoying problem where Juno and Julia's packages were not in sync (stored in different places), so it would've taken a lot of package installing to switch to the command line version. I literally ended up hard coding absolute file paths.

To be fair, this isn't at all Julia's fault so much as a mix of Juno and Atom's.

Atom is super annoying in general because it gives you no installation options or configuration. If your main drive is a small SSD, there is literally no way to inform Atom (or anything derived from it) to kindly install to another drive. Just double click the installer and it pops up a beautiful splash screen designed by some wonderful graphic design guy and proceeds to autoinstall wherever the hell it feels like it. It's so "simple" and "elegant". And "horrible".

Linear Zoetrope fucked around with this message at 09:49 on May 14, 2015

qntm
Jun 17, 2009
Python code:
def isEven(n):
    return True if n == 0 else isOdd(n - 1)

def isOdd(n):
    return False if n == 0 else isEven(n - 1)

Adbot
ADBOT LOVES YOU

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀
code:
for(int i = INT_MIN; i<INT_MAX; i+=2){
    if (n == i) return true;		
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply