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

AlsoD posted:

ya, this is what do-notation is for - the parsers are monads. i'm not entirely sure what you mean by 'result' of the three parsers, but this returns a tuple of all three results together which you then pattern match on yourself. if you're not sure how tuples work it is 100% necessary for learning haskell so go read that chapter of learn you a haskell/your lecture notes.

code:
p1 :: Parser Int
p2 :: Parser String
p3 :: Parser Double

p4 :: Parser (Int, String, Double)
p4 = do
    int  <- p1
    str  <- p2
    dubs <- p3
    return (int, str, dubs)
liftM3 (,,) p1 p2 p3

Thank you again, that makes sense. I (think) I am fine with tuples, and yes learn you a haskell is what the lecture notes are based on haha

This is too difficult. ive looked around and cant find any similar examples at all. the two best pages on parsec in haskell ive found (http://book.realworldhaskell.org/read/using-parsec.html and http://unbui.lt/#!/post/haskell-parsec-basics) dont seem to cover it all. i have something like..

code:
example_string = "  integer(kind=4), parameter:: ipppp = 150" --trying to parse the beginning, before the ccomma. the (kind=4) part is optional

kind_parser :: Parser Integer
kind_parser =
    do
        string "(kind="
        num <- integer
        char ')'
        return num

type_parser :: Parser VarType
type_parser =
    do
        whiteSpace
        w <- word
        --this is where i struggle, ive tried using num <- optional kind_parser - but that doesnt work, the idea is to capture the value of kind if it is available, if not then set it to 4
        comma
ive clearly got a fundamental problem, causing these lots of small issues. but it seems like id only know these answers if id came accross it before, which i havent as part of the course

Adbot
ADBOT LOVES YOU

AWWNAW
Dec 30, 2008

my nigga have u tried javascript

Notorious b.s.d.
Jan 25, 2003

by Reene

Deacon of Delicious posted:

also, a helpful tip: telling someone to just not be so sadbrains doesn't work. i mean jfc if it were that easy it wouldn't be a problem

I don't expect luigi thirty to pull himself up by his bootstraps or fix everything in his life at once or magically stop being sadbrains tomorrow

just a job search for your first job is a bad place to "phone it in." even a depressed person must make choices where to apply greater or lesser effort, and your first job search is a place where more is better.

Notorious b.s.d.
Jan 25, 2003

by Reene
another way to put it: rejections during your first job search may often have very little to do with you as a candidate

if you don't already have connections to the industry to lean on, it's a numbers game. just gotta make a very large number of attempts, no way around it

no use beating yourself up for failures, either. repeated failure is an expected part of the process. can't let it get to you, because it's not your fault. just keep grinding out cover letters and sitting for interviews.

Bloody
Mar 3, 2013

Notorious b.s.d. posted:

another way to put it: rejections during your first job search may often have very little to do with you as a candidate

if you don't already have connections to the industry to lean on, it's a numbers game. just gotta make a very large number of attempts, no way around it

no use beating yourself up for failures, either. repeated failure is an expected part of the process. can't let it get to you, because it's not your fault. just keep grinding out cover letters and sitting for interviews.

This is all true for everything remotely challenging in life btw

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

This is all true for everything remotely challenging in life btw

lots of things in life will not immediately punish you for withdrawal or dysfunction. not all important things are "challenging"


you can phone it in at work and not get fired

you can ignore your mothers email and still get invited to Christmas

you can fail to call friends for long periods and still be welcome when you recover

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Valeyard posted:

Thank you again, that makes sense. I (think) I am fine with tuples, and yes learn you a haskell is what the lecture notes are based on haha

This is too difficult. ive looked around and cant find any similar examples at all. the two best pages on parsec in haskell ive found (http://book.realworldhaskell.org/read/using-parsec.html and http://unbui.lt/#!/post/haskell-parsec-basics) dont seem to cover it all. i have something like..

code:
example_string = "  integer(kind=4), parameter:: ipppp = 150" --trying to parse the beginning, before the ccomma. the (kind=4) part is optional

kind_parser :: Parser Integer
kind_parser =
    do
        string "(kind="
        num <- integer
        char ')'
        return num

type_parser :: Parser VarType
type_parser =
    do
        whiteSpace
        w <- word
        --this is where i struggle, ive tried using num <- optional kind_parser - but that doesnt work, the idea is to capture the value of kind if it is available, if not then set it to 4
        comma
ive clearly got a fundamental problem, causing these lots of small issues. but it seems like id only know these answers if id came accross it before, which i havent as part of the course

it's kinda weird that they use learn you a haskell at the place that like invented haskell or something

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Valeyard posted:

Thank you again, that makes sense. I (think) I am fine with tuples, and yes learn you a haskell is what the lecture notes are based on haha

This is too difficult. ive looked around and cant find any similar examples at all. the two best pages on parsec in haskell ive found (http://book.realworldhaskell.org/read/using-parsec.html and http://unbui.lt/#!/post/haskell-parsec-basics) dont seem to cover it all. i have something like..

code:
example_string = "  integer(kind=4), parameter:: ipppp = 150" --trying to parse the beginning, before the ccomma. the (kind=4) part is optional

kind_parser :: Parser Integer
kind_parser =
    do
        string "(kind="
        num <- integer
        char ')'
        return num

type_parser :: Parser VarType
type_parser =
    do
        whiteSpace
        w <- word
        --this is where i struggle, ive tried using num <- optional kind_parser - but that doesnt work, the idea is to capture the value of kind if it is available, if not then set it to 4
        comma
ive clearly got a fundamental problem, causing these lots of small issues. but it seems like id only know these answers if id came accross it before, which i havent as part of the course

how's VarType defined?

triple sulk
Sep 17, 2014



Notorious b.s.d. posted:

another way to put it: rejections during your first job search may often have very little to do with you as a candidate

if you don't already have connections to the industry to lean on, it's a numbers game. just gotta make a very large number of attempts, no way around it

no use beating yourself up for failures, either. repeated failure is an expected part of the process. can't let it get to you, because it's not your fault. just keep grinding out cover letters and sitting for interviews.

Mr. b.s.d. is right. It's hard to not be made to feel like poo poo when you get turned down repeatedly. It can be really tough, but always try to keep in mind that software development is one of the most subjective fields for interviews. There are always people who are very smart and have lots of credentials that get turned down, so you are not alone.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

triple sulk posted:

Mr. b.s.d. is right. It's hard to not be made to feel like poo poo when you get turned down repeatedly. It can be really tough, but always try to keep in mind that software development is one of the most subjective fields for interviews. There are always people who are very smart and have lots of credentials that get turned down, so you are not alone.

this would be a much easier pill to swallow of grueling 4 hour technical interviews werent the norm. it's really hard to convince yourself that 'it's not personal' after the rejecters spend many hours and dollar interviewing you.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

MALE SHOEGAZE posted:

this would be a much easier pill to swallow of grueling 4 hour technical interviews werent the norm. it's really hard to convince yourself that 'it's not personal' after the rejecters spend many hours and dollar interviewing you.

just keep in mind that study that showed interviewers mostly make up their minds in the first 10 seconds of the interview, before you even speak.

cowboy beepboop
Feb 24, 2001

what is the least worst php framework? hooray porting legacy code-bases.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

my stepdads beer posted:

what is the least worst php framework? hooray porting legacy code-bases.

if you're in a position to choose a new framework, you're in a position to choose a new language

gonadic io
Feb 16, 2011

>>=

'optional' discards the result (presumably it's meant to be used for comments and stuff), you want to use 'option' instead which you supply with a default value to return if the parser fails.

This is all in the parsec docs* which I got to by googling "parsec optional". Nobody expects you to understand those overly general type signatures immediately (there's a reason that scala's docs lie about the type sigs) but the description for these combinators make the difference clear.

*: https://hackage.haskell.org/package/parsec-3.0.0/docs/Text-Parsec-Combinator.html

e: for now, just pretend that 'ParsecT s u m a' is actually 'Parser a' and ignore the 'Stream' bit to the left of the =>. that way the horrific 'optional :: Stream s m t => ParsecT s u m a -> ParsecT s u m ()' becomes 'optional :: Parser a -> Parser ()' and it's clear that is discards the result and returns () instead.

option effectively has the type 'option :: a -> Parser a -> Parser a'. as for how you'd know to do this, well the most significant type parameter, the type of the actual value(s) inside, is always the last one in a monad anyway

gonadic io fucked around with this message at 14:43 on Nov 17, 2014

gonadic io
Feb 16, 2011

>>=
so it'd be something like

code:
type_parser :: Parser VarType
type_parser = do
    whiteSpace
    w <- word
    num <- option 4 kind_parser
    comma
    -- continue parsing the rest of the string
    return (VarType{type=w, kind=num, inout=fart, name=butt, value=piss})
(depending on how a value of type VarType is constructed of course)

gonadic io fucked around with this message at 14:11 on Nov 17, 2014

gonadic io
Feb 16, 2011

>>=

Valeyard posted:

ive clearly got a fundamental problem, causing these lots of small issues. but it seems like id only know these answers if id came accross it before, which i havent as part of the course

a nontrivial part of haskell (as I'd imagine any language unless you want to reimplement everything yourself) is looking through relevant libraries for a function that does what you want. try the search engine https://www.fpcomplete.com/hoogle or hayoo (remember to limit your search to the package parsec and even the version if you're using an old one)

gonadic io fucked around with this message at 14:39 on Nov 17, 2014

jony neuemonic
Nov 13, 2009

my stepdads beer posted:

what is the least worst php framework? hooray porting legacy code-bases.

laravel is a genuinely good framework.

whatever you do though, stay far away from symfony.

DimpledChad
May 14, 2002
Rigging elections since '87.

fidel sarcastro posted:

laravel is a genuinely good framework.

whatever you do though, stay far away from symfony.

this. laravel is probably up there with rails in quality in terms of full-featured, classic mvc frameworks. i mean, you still have to write php though. but laravel is as good as it gets.

Soricidus
Oct 21, 2010
freedom-hating statist shill

DimpledChad posted:

this. laravel is probably up there with rails in quality in terms of full-featured, classic mvc frameworks. i mean, you still have to write php though. but laravel is as good as it gets.
man, look at these turds, you can practically see your face in them

and your posting

DimpledChad
May 14, 2002
Rigging elections since '87.
what can i say, i'm a terrible programmer. look at thread title.

Bloody
Mar 3, 2013

this website is great http://hammerprinciple.com/therighttool

Soricidus
Oct 21, 2010
freedom-hating statist shill

lol @ people giving ruby high marks for "third-party libraries are well-documented and of high quality" and "it is easy to tell at a glance what code in this language does"

distortion park
Apr 25, 2011



I often feel like I am not smart enough to write this language

For c# wtf. Maybe they lost their tab key.

Bloody
Mar 3, 2013

pointsofdata posted:

I often feel like I am not smart enough to write this language

For c# wtf. Maybe they lost their tab key.

it does poorly at that -> double negative. a little confusing to read.

Arcsech
Aug 5, 2008

apparently lua is the least angry-making programming language and visual basic is the most rage-inducing, followed closely by php

cobol, visual basic, fortran, and php are the most dread-inducing, d is the least

visual basic, cobol, php, and actionscript are the most embarassing languages, clojure, go, and ocaml are the least

so basically visual basic, php, and cobol are the worst programming languages, which everyone already knew

Arcsech
Aug 5, 2008

Bloody posted:

it does poorly at that -> double negative. a little confusing to read.

yeah this could be phrased way better

Bloody
Mar 3, 2013

Arcsech posted:

apparently lua is the least angry-making programming language and visual basic is the most rage-inducing, followed closely by php

cobol, visual basic, fortran, and php are the most dread-inducing, d is the least

visual basic, cobol, php, and actionscript are the most embarassing languages, clojure, go, and ocaml are the least

so basically visual basic, php, and cobol are the worst programming languages, which everyone already knew

yep it confirms what non-idiot programmers have known for a while

Pollyzoid
Nov 2, 2010

GRUUAGH you say?

Arcsech posted:

apparently lua is the least angry-making programming language and visual basic is the most rage-inducing, followed closely by php

cobol, visual basic, fortran, and php are the most dread-inducing, d is the least

visual basic, cobol, php, and actionscript are the most embarassing languages, clojure, go, and ocaml are the least

so basically visual basic, php, and cobol are the worst programming languages, which everyone already knew

haxe is the least rage-inducing, the bottom items list is just reversed

confusing site, but at least the full list is in clear order

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan
i had to write some php for the first time. holy poo poo that is a bad language

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

VLADIMIR GLUTEN posted:

i had to write some php for the first time. holy poo poo that is a bad language

it's better than vbscript

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

the lowest possible bar

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
I had to maintain a little php thing and it wasn't awful

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

i used php a little a bit over 10 years ago, but the only thing worse that i remember was the crappy xaml based scripting language used for writing heroes of newerth mods. you couldn't even define functions in that but my time was literally worthless that year so i came up with some pretty cool mods despite using notepad.exe to edit xaml

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker
theres always coldfusion if you really want to out-php php

vbscript is not a bad try though

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
Personal Home PAge

Seaside Loafer
Feb 7, 2012

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

i did cobol for 5 years years ago, here let me show you the not at all to much typing required syntax for a 1 to 10 for loop

code:
perform varying x from 1 by 1 until x = 10
    stuff
end-perform
the way variable definitions work is even more amusing

wish some fucker would offer me some niche part time contract to bug fix thier stuff, id make a mint, must be one of last surviving experts in that poo poo

gonadic io
Feb 16, 2011

>>=
natural language coding!!!1

Notorious b.s.d.
Jan 25, 2003

by Reene

rotor posted:

the lowest possible bar

i have written both php and vbs for money. once i worked on both in the same application. (pls do not ask about that)

i would do vbs again if the money were right. i'm not sure i can say that about php.

edit: actually no. i'm never doing either one. i might rather eat 3 meals a day in soup kitchens and sleep on a subway grate than work with either technology on a daily basis. it would at least require serious thought whether homelessness was preferable to going back to that world

Notorious b.s.d. fucked around with this message at 03:20 on Nov 19, 2014

Notorious b.s.d.
Jan 25, 2003

by Reene
the last time i worked on a php application the spaghetti was so bad that i ended up rewriting the DOM in js and stuffing data into hidden inputs in order to customize a wizard

i could not figure out the templates enough to add a field to a pre-existing form without breaking the app

judging from the comments the prior authors were apparently very proud of their "mvc" "design"

Adbot
ADBOT LOVES YOU

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Notorious b.s.d. posted:

the last time i worked on a php application the spaghetti was so bad that i ended up rewriting the DOM in js and stuffing data into hidden inputs in order to customize a wizard

i could not figure out the templates enough to add a field to a pre-existing form without breaking the app

judging from the comments the prior authors were apparently very proud of their "mvc" "design"

sounds like ur bad at programming, lol

  • Locked thread