|
akadajet posted:you must be a joy to work with irl yeah coworkers hate the gently caress out of my attention to detail and my unconditional availability for mentoring carry on then posted:funny how "better at programming" always really means "more like the kind of programmer i am" stop being a burden on your coworkers Kevin Mitnick P.E. posted:i kinda felt insulted but also had it coming so 🤷 I have NEVER insulted a single programming tool or programmer in my entire stay here in yospos, ever (I checked). I'm a javascript apologist. I owe a personal debt to visual basic. I used to be a pascal fan. I criticize gcc but I know it inside and out. I recognize python's huge shortcomings and it's still my go to language for experimentation. I've never used haskell, the haskell fanboyism a couple years ago was very offputting but I never said a bad word about it. and java programmers of all people feel attacked and outright make up accusations I've made. I like java without reservations, I've used it personally and professionally, I've recommended and lauded it here in yospos, if I don't post much about it, it's because it's a really simple and straightforward language with very little trickery possible or necessary (which is one of its strongest points). I don't have the faintest goddamn idea what you and carry on then are on about. stop being insecure about what I can do in "my" language that you can't in "yours" - do you know what java can't do and c++ can, actually? running on android, ios and windows, built with standard dev tools, interacting with native C/C++ libraries on one side and java, swift and C# on the other. NOT poo poo like zero overhead and compile-time code generation (which I still use because it's the way C++ was designed to be used - do you often write java code that's a single class with hundreds of static methods? no because that's not how you use java even if you can). let me love the gently caress out of programming in peace, please the other side of the coin is that I can't stand poo poo like regular expressions etc etc two problems and I won't stay silent about it. have some pride in your work and learn to use the "hard" tools (regexes are not that hard. nor are autotools, to name another popular bugaboo) hackbunny fucked around with this message at 23:39 on Dec 11, 2018 |
# ? Dec 11, 2018 23:36 |
|
|
# ? Jun 7, 2024 17:27 |
|
who here thinks regular expressions are hard? please point them out so i can join in on the shaming.
|
# ? Dec 11, 2018 23:40 |
|
eh it comes up all the time. really, they're flawed, they're idiosyncratic, they're second-class code in almost every implementation, but "hard" they're not. I can't really effortpost because I've never looked at them in depth, but if you need help with a regex, just raise your hand
|
# ? Dec 11, 2018 23:44 |
|
(??:\r\n)?[ \t])*(???:[^()<>@,;:\\".\[\] \000-\031]+(???:\r\n)?[ \t] )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(??:\r\n)?[ \t]))*"(??: \r\n)?[ \t])*)(?:\.(??:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?? ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(??:\r\n)?[ \t]))*"(??:\r\n)?[ \t])*))*@(??:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0 31]+(???:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\ ](??:\r\n)?[ \t])*)(?:\.(??:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+ (???:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?: (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(???:\r\n)?[ \t])+|\Z |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(??:\r\n)?[ \t]))*"(??:\r\n) ?[ \t])*)*\<(??:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(???:\ r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](??:\r\n)?[ \t])*)(?:\.(??:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(???:\r\n) ?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](??:\r\n)?[ \t] )*))*(?:,@(??:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(???:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](??:\r\n)?[ \t])* )(?:\.(??:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(???:\r\n)?[ \t] )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](??:\r\n)?[ \t])*))*) *??:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(??:(?:\r\n)?[ \t])+ |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t ]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031 ]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\]( ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(? :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(? :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(? :(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)? [ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]| \\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<> @,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|" (?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(? :[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[ \]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000- \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|( ?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,; :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([ ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\" .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\ ]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\ [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\ r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\] |\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0 00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\ .|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@, ;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(? :[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])* (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[ ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\] ]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*( ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:( ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t ])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t ])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(? :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?: [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\ ]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[" ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n) ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<> @,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@, ;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\ ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)? (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\". \[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?: \r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[ "()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t]) *))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]) +|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\ .(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z |(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:( ?:\r\n)?[ \t])*))*)?;\s*)
|
# ? Dec 11, 2018 23:46 |
|
lol forgot to wrap it in a code block but that's ok the make it perfect
|
# ? Dec 11, 2018 23:46 |
|
i wish ms sql server had native regex support there i said it
|
# ? Dec 11, 2018 23:47 |
|
Cold on a Cob posted:(????????) Accurate representation of me tweaking a regex until it works.
|
# ? Dec 11, 2018 23:51 |
regex isn't hard it's just an incredibly specific and obtuse thing that I have occasion to use like once every two years and never for anything particularly complex so I don't really give a poo poo about it or, you know, remembering it, in between those occasions
|
|
# ? Dec 11, 2018 23:54 |
|
CRIP EATIN BREAD posted:who here thinks regular expressions are hard? this is the terrible programming thread, please do not shame people for being terrible at programming in this thread. you can probably shame people for being terrible programmers in the sense of programmers who are terrible as people though, that's legit right?
|
# ? Dec 11, 2018 23:55 |
|
eschaton posted:so they’ve kind of reinvented Dylan’s design for syntax-transforming macros in an Algol-like language yeah on reflection (heh) I'd need another layer on top of this for better manipulation of a parsed ast. like token traversal is great if you're doing stuff that isn't even valid syntax but I'm just trying to move some args around so i don't need that
|
# ? Dec 11, 2018 23:56 |
|
in cjs news, I'm back to win32 internals and kernel mode windows after a decade+ hiatus and it's like riding a bike apparently, you never forget. some parts are new and unfamiliar (eg. still not fully getting the hang of api sets) but most of it is still the good old win32 I knew by heart. nothing interesting to post about atm, just the usual win32 inter-process fuckery. unless win32 inter-process fuckery is not "usual" to you, in which case I have a lot to say
|
# ? Dec 12, 2018 00:08 |
|
see how much repetition there is? and how even in languages with variables and functions and recursion, you can't use those extremely basic facilities in regular expressions? that's what I meant when I said they're flawed and part of what I meant when I called them second-class. other parts of their second class status are that they're strictly serial - all input comes in, then all output comes out - and opaque to debuggers. not true limitations, "just" implementation issues, sure, but nobody seems interested in solving them
|
# ? Dec 12, 2018 00:15 |
|
Cold on a Cob posted:lol forgot to wrap it in a code block but that's ok the make it perfect i like the part where the emote parser gives up a tenth of the way in
|
# ? Dec 12, 2018 00:41 |
|
CRIP EATIN BREAD posted:who here thinks regular expressions are hard?
|
# ? Dec 12, 2018 00:42 |
|
Night Shade posted:i like the part where the emote parser gives up a tenth of the way in p sure its a regex with some kind of dumb hardcoded limit, bbcode also stops working if you use too many in a post
|
# ? Dec 12, 2018 00:44 |
|
hackbunny posted:yeah coworkers hate the gently caress out of my attention to detail and my unconditional availability for mentoring what jeez no i just said something lovely and you obliquely insulted me in response a few days ago. if you think you didn't insult me im ok with that; like i said i felt insulted but also imo had it coming p.s. value types. thats what java can't do. well, what it can't do that i care about even a little bit
|
# ? Dec 12, 2018 01:58 |
yeah there's a max of 20 in a post or something
|
|
# ? Dec 12, 2018 01:58 |
|
most times when I see a coworker reach for a regex I can point out a much better alternative to whatever they are doing
|
# ? Dec 12, 2018 02:02 |
|
sometimes theres a regular language you wanna recognize and a regular expression can be real good for that. or not. some people never really take to heart "just because you can do something doesn't mean you should" and it really shows in the regexes they write
|
# ? Dec 12, 2018 02:02 |
|
Cold on a Cob posted:i wish ms sql server had native regex support it does cause you can call clr procs
|
# ? Dec 12, 2018 02:06 |
|
Implying someone works at the turd-shunting yard is a zero-cost insult, so it's not surprising that it just got optimized away in hackbunny's mental model
|
# ? Dec 12, 2018 02:10 |
|
Shaggar posted:it does cause you can call clr procs ah the heres an ffi gently caress you school of design. didnt know ms was in the habit of stealing from list weenies
|
# ? Dec 12, 2018 02:11 |
|
90% of the time when I'm writing a regex it's because a tool I'm using accepts them for filtering or find/replace, and I'm writing ".*something.*" or whatever. Imo this level of regex ability is important for everyone to learn. If a regex isn't immediately understandable or pulled directly from an RFC, I'm probably pushing back hard in code review.
|
# ? Dec 12, 2018 02:16 |
So I'm building a C++ project with Cmake, and the project has some associated data files which I would like to reference in my source code. E.g. the project layout is something like this:code:
code:
code:
|
|
# ? Dec 12, 2018 02:45 |
|
ah you want the cmake equivalent of config.h
|
# ? Dec 12, 2018 02:49 |
|
the bazel equivalent is a data dependency https://docs.bazel.build/versions/master/build-ref.html#data This probably isn't helpful for cmake, but maybe it'll point you to some new search terms or find a project with both bazel and cmake configured and copy them.
|
# ? Dec 12, 2018 03:32 |
|
Shaggar posted:it does cause you can call clr procs that doesn't count and you know it not everyone likes me enabling that poo poo and installing sql#, i'd like to have decent string handling out of the box thanks
|
# ? Dec 12, 2018 03:53 |
Kevin Mitnick P.E. posted:ah you want the cmake equivalent of config.h Illusive gently caress Man posted:the bazel equivalent is a data dependency https://docs.bazel.build/versions/master/build-ref.html#data Okay, after some searching which was guided by these posts, I have a solution, but I don't like it. To CMakeLists.txt I added: code:
code:
In case it is important, the data files are relatively small—a few kilobytes total—so the cost of copying them around is fairly negligible. VikingofRock fucked around with this message at 07:54 on Dec 12, 2018 |
|
# ? Dec 12, 2018 06:04 |
|
Yup, that's not a good solution for exactly the reason you found out. You should decide on the installed project layout and then create the path as "path to binary" + known relative path (and optionally add a command line config option to redirect the search elsewhere).
|
# ? Dec 12, 2018 07:43 |
|
Also there is no use case better served by ad-hoc regexes than it would be served by first class parser combinator support.
|
# ? Dec 12, 2018 07:44 |
|
json path is simultaneously so useful and so frustrating
|
# ? Dec 12, 2018 08:34 |
|
if you’re playing with language design just write a recursive-descent parser, it’s easy at the beginning and you’ll be able to just make tweaks and hacks and try things extremely easily and you’ll also be able to emit reasonable error messages
|
# ? Dec 12, 2018 09:58 |
If you're not into regex but want to do structural text parsing, I've always been aprtial to EBNF style things, like so: https://github.com/Engelberg/instaparse
|
|
# ? Dec 12, 2018 11:03 |
|
I want a bagel equivalent anyway I’m writing an assembler for my homebrew computer and expression parsing still sucks I forgot everything I learned from writing a lisp lol
|
# ? Dec 12, 2018 11:14 |
|
gonadic io posted:yeah on reflection (heh) I'd need another layer on top of this for better manipulation of a parsed ast. like token traversal is great if you're doing stuff that isn't even valid syntax but I'm just trying to move some args around so i don't need that dtolnay's reflect crate seems like an interesting way to build a higher level api on top of proc macros, id love to see more work on it
|
# ? Dec 12, 2018 11:46 |
|
ctps: runningcode:
|
# ? Dec 12, 2018 11:56 |
|
do rm -rf * too pls
|
# ? Dec 12, 2018 11:59 |
|
god i wish
|
# ? Dec 12, 2018 12:07 |
|
animist posted:god i wish extremely same
|
# ? Dec 12, 2018 12:43 |
|
|
# ? Jun 7, 2024 17:27 |
|
tinaun posted:dtolnay's reflect crate seems like an interesting way to build a higher level api on top of proc macros, id love to see more work on it I will check this out thanks, it seems quite needs suiting at first glance
|
# ? Dec 12, 2018 12:45 |