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.
 
  • Post
  • Reply
hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

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

Adbot
ADBOT LOVES YOU

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
who here thinks regular expressions are hard?

please point them out so i can join in on the shaming.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
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

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
(?:(?:\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*)

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
lol forgot to wrap it in a code block but that's ok the :( make it perfect

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i wish ms sql server had native regex support

there i said it

Chopstick Dystopia
Jun 16, 2010


lowest high and highest low loser of: WEED WEE
k

Accurate representation of me tweaking a regex until it works.

hailthefish
Oct 24, 2010

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

Soricidus
Oct 21, 2010
freedom-hating statist shill

CRIP EATIN BREAD posted:

who here thinks regular expressions are hard?

please point them out so i can join in on the shaming.

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?

gonadic io
Feb 16, 2011

>>=

eschaton posted:

so they’ve kind of reinvented Dylan’s design for syntax-transforming macros in an Algol-like language

which, good for them, but there are solid reasons syntax-transforming macros are mostly used in languages with S-expression syntax

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

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
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

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

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

Night Shade
Jan 13, 2013

Old School

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

mystes
May 31, 2006

CRIP EATIN BREAD posted:

who here thinks regular expressions are hard?

please point them out so i can join in on the shaming.
To write or to read?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



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

Nomnom Cookie
Aug 30, 2009



hackbunny posted:

yeah coworkers hate the gently caress out of my attention to detail and my unconditional availability for mentoring


stop being a burden on your coworkers


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)

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

hailthefish
Oct 24, 2010

yeah there's a max of 20 in a post or something

akadajet
Sep 14, 2003

most times when I see a coworker reach for a regex I can point out a much better alternative to whatever they are doing

Nomnom Cookie
Aug 30, 2009



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

Shaggar
Apr 26, 2006

Cold on a Cob posted:

i wish ms sql server had native regex support

there i said it

it does cause you can call clr procs

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
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

Nomnom Cookie
Aug 30, 2009



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

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 ðŸ™Â
Taco Defender
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.

VikingofRock
Aug 24, 2008




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:
project/
- data/
  - useful_data.txt
- include/
  - project.hpp
- src/
  - project.cpp
- test/
  - some_tests.cpp
and in src/project.cpp I want to do

code:
do_something("../data/useful_data.txt");
What's the right, modern way to handle this? I've been googling it for about a half hour now and I'm having trouble finding the right phrases to bring up useful advice. I'm assuming I'll somehow have Cmake #define a data directory, and then replace the function call with

code:
do_something("CMAKE_DATA_DIR/useful_data.txt")?
?

Nomnom Cookie
Aug 30, 2009



ah you want the cmake equivalent of config.h

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 ðŸ™Â
Taco Defender
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.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

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

VikingofRock
Aug 24, 2008




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

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.

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:
configure_file("data/useful_data.txt" "data/useful_data.txt" COPYONLY)
target_compile_definitions(project
     PRIVATE PROJECT_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data")
and I changed src/project.cpp to say

code:
do_something(PROJECT_DATA_DIR "/useful_data.txt")
However, this solution seems brittle upon reflection. If I were installing an application with associated data, I would expect to be able to do a make install afterwards and have the data copied as appropriate to /usr/local/share/project/ or to some other directory defined by me, and then be able to delete the build directory. With my above solution though, this would break the library. So is there a better, less brittle way to handle this?

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

Xarn
Jun 26, 2015
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).

Xarn
Jun 26, 2015
Also there is no use case better served by ad-hoc regexes than it would be served by first class parser combinator support.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
json path is simultaneously so useful and so frustrating

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
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

Osmosisch
Sep 9, 2007

I shall make everyone look like me! Then when they trick each other, they will say "oh that Coyote, he is the smartest one, he can even trick the great Coyote."



Grimey Drawer
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

Luigi Thirty
Apr 30, 2006

Emergency confection port.

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

tinaun
Jun 9, 2011

                  tell me...

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

animist
Aug 28, 2018
ctps: running

code:
$ cd ~/dev
$ rm -rf */node_modules */target/debug */target/release
just freed up 30gb of space on my tiny laptop ssd, lol

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



do rm -rf * too pls

animist
Aug 28, 2018
god i wish

gonadic io
Feb 16, 2011

>>=

animist posted:

god i wish

extremely same :smith:

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply