|
im a really, really bad programmer
|
# ? Nov 23, 2014 21:51 |
|
|
# ? May 24, 2024 23:33 |
|
Valeyard posted:im a really, really bad programmer
|
# ? Nov 23, 2014 21:51 |
|
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 |
# ? Nov 23, 2014 21:52 |
|
I like valeyard's posts itt keep up the good work
|
# ? Nov 23, 2014 21:56 |
|
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
|
# ? Nov 23, 2014 21:57 |
|
BONGHITZ posted:are you on drugs? take a bunch of drugs and bring it up at a meeting
|
# ? Nov 23, 2014 21:58 |
|
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
|
# ? Nov 23, 2014 22:01 |
|
why do you need a phd to teach? seems like a bit of overkill
|
# ? Nov 23, 2014 22:10 |
|
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 .
|
# ? Nov 23, 2014 22:14 |
|
i've been looking into teaching college, or i guess i could see if undergrads around here would pay for private programming tuition?
|
# ? Nov 23, 2014 22:17 |
|
AlsoD posted:i like answering valeyard's posts and im thankful that you like answering my posts! code:
i didnt realise it was so easy to switch between String and Text
|
# ? Nov 23, 2014 22:19 |
|
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?
|
# ? Nov 23, 2014 22:26 |
|
the correct solution! the way i'd personally write it (although it'll compile identically to yours) is: code:
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 |
# ? Nov 23, 2014 22:28 |
|
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 |
# ? Nov 23, 2014 22:31 |
|
Valeyard 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!
|
# ? Nov 23, 2014 22:58 |
|
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
|
# ? Nov 23, 2014 23:18 |
|
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 but yeah there is a fb group for compsci undergrads here maybe i'll have a chat with one of the profs about it
|
# ? Nov 24, 2014 01:22 |
|
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.
|
# ? Nov 24, 2014 02:35 |
|
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 |
# ? Nov 24, 2014 19:09 |
|
i lol so much at people still in school and people in school who waste time on hw
|
# ? Nov 24, 2014 20:22 |
|
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 i should be interviewing, right?
|
# ? Nov 24, 2014 20:56 |
|
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
|
# ? Nov 24, 2014 21:06 |
|
sometimes i wonder if i am being trained to jump through a series of hoops and paying for the privilege
|
# ? Nov 24, 2014 21:21 |
|
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
|
# ? Nov 24, 2014 21:47 |
|
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 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
|
# ? Nov 24, 2014 21:47 |
|
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
|
# ? Nov 24, 2014 21:54 |
|
Careful Drums posted:yep. 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!
|
# ? Nov 24, 2014 22:11 |
|
"40 dollars an hour? are you sure they didn't mean 40 thousand a year" --my mom
|
# ? Nov 24, 2014 22:12 |
|
I'm about to hit my eighth anniversary at my current job and I'm sub-80k. But we work only 40 hours per week, soooo
|
# ? Nov 24, 2014 22:26 |
|
CPColin posted:I'm about to hit my eighth anniversary at my current job and I'm sub-80k. lol your getting owned
|
# ? Nov 24, 2014 22:27 |
|
unless your in a low cost of living market
|
# ? Nov 24, 2014 22:28 |
|
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?
|
# ? Nov 24, 2014 22:42 |
|
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
|
# ? Nov 24, 2014 22:43 |
|
Bloody posted:lol your getting owned
|
# ? Nov 24, 2014 22:47 |
|
I had a job offer from my alma mater, for less money. It was hard to decide.
|
# ? Nov 24, 2014 23:00 |
|
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. prob around 6.5 figures
|
# ? Nov 24, 2014 23:00 |
|
do we work together?
|
# ? Nov 24, 2014 23:01 |
|
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"
|
# ? Nov 24, 2014 23:06 |
|
Bloody posted:do we work together? maybe? where's your office?
|
# ? Nov 24, 2014 23:08 |
|
|
# ? May 24, 2024 23:33 |
|
Bloody posted:do we work together? stand up and say something unique and I'll post if I hear you Edit: oh.
|
# ? Nov 24, 2014 23:08 |