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
Valeyard
Mar 30, 2012


Grimey Drawer
im a really, really bad programmer

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Valeyard posted:

im a really, really bad programmer

gonadic io
Feb 16, 2011

>>=

Valeyard posted:

its not as simple as that though, i only want to drop the flag on lines where it actually exists

if the substring isn't in the string then replace won't do anything. from what i can see there's no harm in calling replace on every string - if the flag exists it'll get deleted and if it doesn't then nothing will happen.

e: if you want more control you could always use stripSuffix (again from Data.Text) along with rtrim

gonadic io fucked around with this message at 21:59 on Nov 23, 2014

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I like valeyard's posts itt keep up the good work

Valeyard
Mar 30, 2012


Grimey Drawer

AlsoD posted:

if the substring isn't in the string then replace won't do anything. from what i can see there's no harm in calling replace on every string - if the flag exists it'll get deleted and if it doesn't then nothing will happen.

ok good point thanks, I re read what you said. i was overcomplicating it

BONGHITZ
Jan 1, 1970

BONGHITZ posted:

are you on drugs?

take a bunch of drugs and bring it up at a meeting

gonadic io
Feb 16, 2011

>>=

Symbolic Butt posted:

I like valeyard's posts itt keep up the good work

i like answering valeyard's posts :)

honestly a job where i taught haskell would be my ideal job but unfortunately i can't lecture undergrads without finishing my phd which i'm not entirely certain is going to happen at this point.

e: the only part of my phd that i've actually enjoyed was the bit where i got to be a teaching assistant (wander around the labs, marking courseworks and answering questions) for a few haskell (and python) modules

BONGHITZ
Jan 1, 1970

why do you need a phd to teach? seems like a bit of overkill

FamDav
Mar 29, 2008
it's kind of a shame that you can't do undergrad teaching without a phd, and moreso that a lot of institutions prioritize research over teaching at the level.

I want to teach a winter course on haskell at my college jan 2016 but I think they'll say no :(.

gonadic io
Feb 16, 2011

>>=
i've been looking into teaching college, or i guess i could see if undergrads around here would pay for private programming tuition? :confused:

Valeyard
Mar 30, 2012


Grimey Drawer

AlsoD posted:

i like answering valeyard's posts :)

honestly a job where i taught haskell would be my ideal job but unfortunately i can't lecture undergrads without finishing my phd which i'm not entirely certain is going to happen at this point.

e: the only part of my phd that i've actually enjoyed was the bit where i got to be a teaching assistant (wander around the labs, marking courseworks and answering questions) for a few haskell (and python) modules

and im thankful that you like answering my posts!

code:
lines = [T.unpack (T.replace (T.pack " !$acc argmode read") (T.pack "") (T.pack x)) | x <- remAcc]
I dont know how innefficient that is, but it works and is far far far far less convuluted than what i was trying. so thanks again

i didnt realise it was so easy to switch between String and Text

Seaside Loafer
Feb 7, 2012

Waiting for a train, I needed a shit. You won't bee-lieve what happened next

AlsoD posted:

i've been looking into teaching college, or i guess i could see if undergrads around here would pay for private programming tuition? :confused:
i have actually done this and yes its possible. how you get your clients though depends, i got mine through knowing people. have they got a local message board or something? they do have a tendancy to basically ask you to do their coursework for them though which is all sorts of dodgy.

gonadic io
Feb 16, 2011

>>=
the correct solution!

the way i'd personally write it (although it'll compile identically to yours) is:

code:
{-# LANGUAGE OverloadedStrings #-} -- at top of file
import Data.Text (unpack, pack, replace)

dropReads :: [String] -> [String]
dropReads = map (unpack . replace " !$acc argmode read" "" . pack)
but then i've been known to get a bit too free with partial application.

the OverloadedStrings compiler flag (must be before everything else in the file) lets you drop the T.pack on the string literals and the limited import should let you avoid conflicts so that you don't need to import Data.Text qualified. of course, it can make things clearer if it's qualified since it makes it obvious which functions come from which package so ymmv

gonadic io fucked around with this message at 22:52 on Nov 23, 2014

gonadic io
Feb 16, 2011

>>=
with regards to efficiency it's probably also one of the better solutions since pack and unpack are O(n) each, replace will be nearly O(n) in this case and Data.Text has some clever fusion rules which should eliminate any intermediate data structures.

remember that normal Strings are singly-linked lists (as opposed to Texts which are arrays) and so will be super slow especially if you're traversing and reversing them multiple times. honestly if i were to write your code i'd have done absolutely everything (all the parsing etc etc) using Texts instead of Strings but it doesn't matter too much for your coursework

gonadic io fucked around with this message at 22:43 on Nov 23, 2014

gonadic io
Feb 16, 2011

>>=

Valeyard posted:

code:
len = take (length remAcc) [0,1..]
indicesOf = zip len remAcc

also it's a minor point, but the way zip works is that it stops if it reaches the end of either of the lists so you don't need take here and .. will increment by 1 by default so this could just be indicesOf = zip [0..] remAcc which would be a fair bit faster as length is O(n) because the default String type is, as I've said, really really bad!

Valeyard
Mar 30, 2012


Grimey Drawer

AlsoD posted:

also it's a minor point, but the way zip works is that it stops if it reaches the end of either of the lists so you don't need take here and .. will increment by 1 by default so this could just be indicesOf = zip [0..] remAcc which would be a fair bit faster as length is O(n) because the default String type is, as I've said, really really bad!

ahh of course. i knew zip worked like that, as that same property caused me problems when i was doing something earlier, but i didnt put those thoughts together

luckily, i dont need either of these lines now. but noted :smugmrgw:

gonadic io
Feb 16, 2011

>>=

FamDav posted:

it's kind of a shame that you can't do undergrad teaching without a phd, and moreso that a lot of institutions prioritize research over teaching at the level.

agreed to both counts

Seaside Loafer posted:

i have actually done this and yes its possible. how you get your clients though depends, i got mine through knowing people. have they got a local message board or something? they do have a tendancy to basically ask you to do their coursework for them though which is all sorts of dodgy.

most of the current undergrads already know me due to my time spent in the labs and apparently i have a reputation for being a good teacher :unsmith: but yeah there is a fb group for compsci undergrads here

maybe i'll have a chat with one of the profs about it

Seaside Loafer
Feb 7, 2012

Waiting for a train, I needed a shit. You won't bee-lieve what happened next

i dont see any reason why you couldnt just post a '£20/$20 an hour tutoring in whatever' on there. probably worth clearing it with a prof though. and if you are on the same course they will kill you for any hint of plagerism. does the outfit run some sort of pupil assisted learning scheme? thats quite common totally above board and the uni will pay you.

Valeyard
Mar 30, 2012


Grimey Drawer
feck, one of my other assignments i thought was due the 30th is actually due 40 minutes ago, so rip 2 bands already and ive not even finished it

Valeyard fucked around with this message at 20:33 on Nov 24, 2014

power botton
Nov 2, 2011

i lol so much at people still in school and people in school who waste time on hw

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
guys i think my company is shortchanging the poo poo outa me but i don't know because i have no idea how much my skillset is worth :smith:

i should be interviewing, right?

Valeyard
Mar 30, 2012


Grimey Drawer

power botton posted:

i lol so much at people still in school and people in school who waste time on hw

i cant wait to leave school and start inflicting my code on to people in the real world

BONGHITZ
Jan 1, 1970

sometimes i wonder if i am being trained to jump through a series of hoops and paying for the privilege

Careful Drums
Oct 30, 2007

by FactsAreUseless

BONGHITZ posted:

sometimes i wonder if i am being trained to jump through a series of hoops and paying for the privilege

basically, yeah. that's just how the game is played i guess

Careful Drums
Oct 30, 2007

by FactsAreUseless

Blinkz0rz posted:

guys i think my company is shortchanging the poo poo outa me but i don't know because i have no idea how much my skillset is worth :smith:

i should be interviewing, right?

yep.

i told a guy on the phone today i'm looking for 85-90k salary and he didn't bat an eye. i'm not even four years out of college :stonk:

Seaside Loafer
Feb 7, 2012

Waiting for a train, I needed a shit. You won't bee-lieve what happened next

Blinkz0rz posted:

guys i think my company is shortchanging the poo poo outa me but i don't know because i have no idea how much my skillset is worth :smith:

i should be interviewing, right?
no harm in just setting yourself up on couple of the reputable meta-jobsearch agencys and seeing what they throw your way is there, just prepare yourself for lots of potentially embarressing phone calls which start with 'hi mr Blinkz0rz, im calling from superpeople recruitment are you free to talk about a couple of positions i have available?' although nipping out of the office to take those calls in private might psyke the boss out a bit :)

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Careful Drums posted:

yep.

i told a guy on the phone today i'm looking for 85-90k salary and he didn't bat an eye. i'm not even four years out of college :stonk:

i'm 5 years out and just got bumped to 93k but i asked for 100. it's so hard to figure out what the market will bear until you get far enough into the process. i love my company and the work they do but argggg pay me more, please!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

"40 dollars an hour? are you sure they didn't mean 40 thousand a year" --my mom

CPColin
Sep 9, 2003

Big ol' smile.
I'm about to hit my eighth anniversary at my current job and I'm sub-80k. :waycool:

But we work only 40 hours per week, soooo

Bloody
Mar 3, 2013

CPColin posted:

I'm about to hit my eighth anniversary at my current job and I'm sub-80k. :waycool:

But we work only 40 hours per week, soooo

lol your getting owned

Bloody
Mar 3, 2013

unless your in a low cost of living market

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Bloody posted:

lol your getting owned

i see posts like this and I honestly wonder what I could be getting paid but i'm not sure how far i have to go to find out.

i live in the boston metro area, have 5 years of working experience slinging code, have done project management work, managed developers, architected a mobile data collection solution for use in africa, wrote an etl tool that processes millions of records and feeds a reporting engine that does decision support for malaria spraying in africa and like a billion other projects

wtf an i worth yospos?

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
tbh i think the reason I don't get paid poo poo is cause the company i work at is a research firm and not a tech company

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

Bloody posted:

lol your getting owned

CPColin
Sep 9, 2003

Big ol' smile.
I had a job offer from my alma mater, for less money.

It was hard to decide. :psyduck:

Bloody
Mar 3, 2013

Blinkz0rz posted:

i see posts like this and I honestly wonder what I could be getting paid but i'm not sure how far i have to go to find out.

i live in the boston metro area, have 5 years of working experience slinging code, have done project management work, managed developers, architected a mobile data collection solution for use in africa, wrote an etl tool that processes millions of records and feeds a reporting engine that does decision support for malaria spraying in africa and like a billion other projects

wtf an i worth yospos?

prob around 6.5 figures

Bloody
Mar 3, 2013

do we work together?

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

Valeyard posted:

i cant wait to leave school and start inflicting my code on to people in the real world

hahaha no, never leave school and be the academic who creates the next 'a monad'

"a burrito? no, it's more like a turducken but inside out" :twisted:

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Bloody posted:

do we work together?

maybe?

where's your office?

Adbot
ADBOT LOVES YOU

CPColin
Sep 9, 2003

Big ol' smile.

Bloody posted:

do we work together?

stand up and say something unique and I'll post if I hear you

Edit: oh.

  • Locked thread