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.
 
  • Locked thread
Notorious b.s.d.
Jan 25, 2003

by Reene

Luigi Thirty posted:

so far i've gotten one interview from a recruiter, one the next day from a craigslist posting, and a phone interview from another posting, none of which actually resulted in flat "we don't like your skills, sorry" rejections but weaselly "oh we've rescinded the position due to budget constraints" rejections

up your activity level

finding a job is a full time job. you should be putting in 40 a week minimum on your job search. talk to three recruiters a day, not three a week

Luigi Thirty posted:

my friend tried to get me an interview with a web company in texas but i looked them up on glassdoor and they're a cult so

don't be so picky

your first job might very well suck, but you will learn more than you thought possible, and have a resume to set you up anywhere else

join the cult, whatever it takes to land that first gig

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene
also: take every in person interview

Even if the job is obviously poo poo, it is practice interviewing and an opportunity to accumulate industry knowledge (i.e. Things to bullshit about in casual shop talk)

Valeyard
Mar 30, 2012


Grimey Drawer
ive got a really weird assignment just now in my "introduction to haskell" class - "create a program which will analyse Fortran-90
code which has been annotated with OpenACC pragmas, and generate code for GPU acceleration using the OpenCL API"

haskell is like as if someone was having fun using regex's one day and decided they could make a whole language based around them

Valeyard fucked around with this message at 17:54 on Nov 15, 2014

gonadic io
Feb 16, 2011

>>=
pattern matching is the best thing and i miss it in every language that doesn't have it

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





AlsoD posted:

pattern matching is the best thing and i miss it in every language that doesn't have it

it literally pains me to write any kind of parsing in languages that aren't erlang, clojure, haskell or rust

tef
May 30, 2004

-> some l-system crap ->
learn prolog

Valeyard
Mar 30, 2012


Grimey Drawer
pattern matching in javascript is fine

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





tef posted:

learn prolog

i, in theory, know prolog. i just don't ever get opportunity to use it

Luigi Thirty
Apr 30, 2006

Emergency confection port.

can I teach prolog to install Gentoo

CPColin
Sep 9, 2003

Big ol' smile.
Protip for interviewing: if you send us a 4.5-page resume, we're going to expect you to be able to look at one of the pages on our site and tell us what sort of database structures you would use to produce it.

Not not listen to us repeatedly, then complain that the interview was "unfair" after we tell you no.

Valeyard
Mar 30, 2012


Grimey Drawer
so I have a list of lists (strings) in haskell and I want to go through everything and make it lowercase. I tried:

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    return [toLower x | x<-[y | y<-(lines contents)]]
which isnt working, but hopefully its clear what I am TRYING to do. any ideas?

gonadic io
Feb 16, 2011

>>=
using list comprehensions, if you make the steps explicit things will make much more sense

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    let lowerLine line = [toLower x | x <- line]
    return [lowerLine line | line <- lines contents]

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Valeyard posted:

so I have a list of lists (strings) in haskell and I want to go through everything and make it lowercase. I tried:

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    return [toLower x | x<-[y | y<-(lines contents)]]

which isnt working, but hopefully its clear what I am TRYING to do. any ideas?

map (map toLower) <$> (lines . readFile src_name)

Malcolm XML fucked around with this message at 21:35 on Nov 15, 2014

gonadic io
Feb 16, 2011

>>=
however in this case, I wouldn't use list comprehensions at all since [f x | x <- xs] is sugar for map f xs which I prefer since it's shorter and easier to read. The example then becomes

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    let lowerLine line = map toLower line
    return (map lowerLine (lines contents))
and then by inlining (heh) lowerLine, you get

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    return (map (map toLower) (lines contents))
obv pick which ever of those is clearest to you

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

AlsoD posted:

however in this case, I wouldn't use list comprehensions at all since [f x | x <- xs] is sugar for map f xs which I prefer since it's shorter and easier to read. The example then becomes

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    let lowerLine line = map toLower line
    return (map lowerLine (lines contents))

and then by inlining (heh) lowerLine, you get

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    return (map (map toLower) (lines contents))

obv pick which ever of those is clearest to you

and the second is just the definition of fmap soo

gonadic io
Feb 16, 2011

>>=
oh whoops you also need to use unlines to turn your list of strings into a single string with newlines

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Malcolm XML posted:

and the second is just the definition of fmap soo

it is the moral imperative of every haskell program to use the fewest characters possible

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

AlsoD posted:

oh whoops you also need to use unlines to turn your list of strings into a single string with newlines

of course u might as well run toLower first


or fuse them!!!!

gonadic io
Feb 16, 2011

>>=

Malcolm XML posted:

it is the moral imperative of every haskell program to use the fewest characters possible

fmap (unlines . map (map toLower) . lines) . readFile

:smuggo:

e: pretty sure you get fusion for free here

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan

Notorious b.s.d. posted:

i can only speak for myself, but this doesn't bother me

as a contractor, i'll work as many hours as you want. literally around the clock if that's what suits you. i've done more than 24 hours in a single shift many times, because the customer demanded it.

and i billed for every hour

it's funny how rigid a 9-6 schedule gets when booking that 5:30pm meeting is gonna cost extra

i was referring to salaried contract, not hourly

gonadic io
Feb 16, 2011

>>=
also, when you're more comfortable with haskell and want to make your program faster at the expense of a little bit of convenience, use the library Data.Text instead of the default String type.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

AlsoD posted:

fmap (unlines . map (map toLower) . lines) . readFile

:smuggo:

e: pretty sure you get fusion for free here

why even bother with unlines and lines they cancel each other out

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Malcolm XML posted:

why even bother with unlines and lines they cancel each other out

fmap toLower . readFile


BITCH

gonadic io
Feb 16, 2011

>>=
sir, the question was 'is this your handwriting?'

FamDav
Mar 29, 2008

thats really no way to talk to a lady

Soricidus
Oct 21, 2010
freedom-hating statist shill

VLADIMIR GLUTEN posted:

i was referring to salaried contract, not hourly
find a better employer then. i'm salaried and i can work pretty much whatever hours i choose so long as my work gets done.

that might sound like a bad thing if you've been brainwashed by life in a hypercapitalist dystopia such as the usa, but here in socialist europe it works out that I never have to do more than 40 hours in a week and it's pretty sweet all round.

in short, lol if u have to get into work before 11 (or stay past 2, if you're a morning person)

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan

rotor posted:

buttbot is the only worthwhile software ever written

Valeyard
Mar 30, 2012


Grimey Drawer

AlsoD posted:

using list comprehensions, if you make the steps explicit things will make much more sense

code:
read_F95_src src_name = do 
    contents <- readFile src_name
    let lowerLine line = [toLower x | x <- line]
    return [lowerLine line | line <- lines contents]

thanks for this. ive been shying away from seperating steps out, as I feel like it is not In The Spirit of functional programming. but that is a lot better

chugging along trying to use parsec now to parse fortan90 variable declarations

Arcsech
Aug 5, 2008

Valeyard posted:

thanks for this. ive been shying away from seperating steps out, as I feel like it is not In The Spirit of functional programming. but that is a lot better

chugging along trying to use parsec now to parse fortan90 variable declarations

some people want concise conCISE CONCISE because it makes them feel clever and yeah haskell lets you do that really easily but it also makes for write-only code. definitely do separate stuff out if it makes it easier to understand, in any language

if you want to try to make stuff as compact as possible as a challenge then sure golf your heart out but if youre writing code that anyone else (including future you) well ever have to look at please leave the long version

gonadic io
Feb 16, 2011

>>=
for real though, use map instead of simple list comprehensions like that. sure when you end up filtering and with local let expressions then they're fine, but usually map is way more idiomatic, useful, and common.

FamDav
Mar 29, 2008
any language that doesnt have lines/unlines in the std lib better have "as performant as c and c++" as a goal.

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
is it enough to just have split/join instead?

Ruby code:
"line1\nline2\nline3".split("\n")
=> ["line1", "line2", "line3"]

["line1", "line2", "line3"].join("\n")
=> "line1\nline2\nline3"
I've only heard of this specific lines/unlines thing in haskell

(join is one of the few cases where I feel like ruby got the syntax right compared to python)

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

AlsoD posted:

for real though, use map instead of simple list comprehensions like that. sure when you end up filtering and with local let expressions then they're fine, but usually map is way more idiomatic, useful, and common.

i'm pretty sure list comprehensions in general are discouraged in style guides now?

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Arcsech posted:

some people want concise conCISE CONCISE because it makes them feel clever

I loving hate this poo poo. Be as long winded as you want, the compiler doesn't give a poo poo and maintainers will thank you for it.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
if your object is a left handed recursive descent decarbonator, I want the class named LeftHandedRecursiveDescentDecarbonator, not a LHRecDesDec

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

rotor posted:

I loving hate this poo poo. Be as long winded as you want, the compiler doesn't give a poo poo and maintainers will thank you for it.

is that true in jit languages? j/w

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i wrote a recursive worker that enqueues the next worker if it's not done with the task

now we get honey baadger reports that are extremely long. i feel bad about it. but i'm not sure that honey badger reports matter.

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

fart simpson posted:

i'm pretty sure list comprehensions in general are discouraged in style guides now?

it's kinda funny that python stole comprehensions from haskell and it's generally agreed and encouraged to use them instead of stuff like filter and map.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

MALE SHOEGAZE posted:

i wrote a recursive worker that enqueues the next worker if it's not done with the task

now we get honey baadger reports that are extremely long. i feel bad about it. but i'm not sure that honey badger reports matter.

nothing named "honey badger" matters

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

rotor posted:

nothing named "honey badger" matters

i think it wins out because people were like 'it's called honey badger so e shouldnt use it' and other people were like 'yah, but that's a bad argument'

  • Locked thread