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

Osmosisch posted:

Basically only do a PhD if you are offered a project/subject that you won't get sick of by a supervisor that you get along with, and if you can afford to take a pay cut and probably also be self-supporting for a while after the project's pay ends and your thesis isn't finished. For your sanity you should look at it more it as a personal growth project rather than a career advancement thing.

That said, I have zero regrets because all those things were true for me and it's extremely satisfying to see citation numbers go up and people follow up on my research.

But I've got nothing to do with it anymore because gently caress working in academia. Publish or perish, my rear end.

Extremely this. If you are genuinely interested in some research field, figuring out something sizeable and then being cited and seeing how people build on your research feels loving great.




-------------------------

Kilometres Davis posted:

I like the space either side. The asterix can hang.

I also like my brackets:
code:
 
foo()
{
        if(bar) 
        {
                /* like this */
        } 
} 


Peeny Cheez posted:

Your brackets are wrong and I hope you get gonorrhea.

Adbot
ADBOT LOVES YOU

Xarn
Jun 26, 2015

CRIP EATIN BREAD posted:

djgpp? that's a name i haven't heard in ages.

I've heard about it recently, because someone wanted a configuration define that removes all mentions of wchar_t :suicide:

Xarn
Jun 26, 2015

Jabor posted:

it really loving sucks

but it's still better than all the other options for what it does

Also lol no* other choice in academia.

*For simple things you might actually transpile something into LaTeX :shrug:

Xarn
Jun 26, 2015
I already know you work on XCode and think it's good, but somehow you keep surprising me with just how wrong you are

Xarn
Jun 26, 2015
:murder:

Xarn
Jun 26, 2015

Boiled Water posted:

today in terrible programming: my boss said to me: "hey boiled can we remove the square brackets from the json output? yeah the ones demarking arrays, our scandi customers are having trouble parsing them"

:suicide:

:murder:

Xarn
Jun 26, 2015

Illusive gently caress Man posted:

I usually interpret "c/c++" as "c++ but used really badly in a c-like way"

IME it is always this.

Xarn
Jun 26, 2015

TheFluff posted:

this miserable pile of angle brackets and colons allegedly wraps a c function that uses setjmp/longjmp for error handling (lol libjpeg) such that it throws c++ exceptions instead and im not sure if it’s terrible or awesome

maybe “awful” in the olde English sense is the word I’m looking for


quote:

code:
/*************
  ▒▒▒▒▒
  ▒▒▒▒▒▒▒▒▒
  ▓▓▓░░▓░
 ▓░▓░░░▓░░░
 ▓░▓▓░░░▓░░░
 ▓▓░░░░▓▓▓▓
  ░░░░░░░░
  ▓▓▒▓▓▓▒▓▓
 ▓▓▓▒▓▓▓▒▓▓▓
▓▓▓▓▒▒▒▒▒▓▓▓▓
░░▓▒░▒▒▒░▒▓░░
░░░▒▒▒▒▒▒▒░░░
░░▒▒▒▒▒▒▒▒▒░░
  ▒▒▒   ▒▒▒
 ▓▓▓    ▓▓▓
▓▓▓▓    ▓▓▓▓
*************/
class Jumpman {

:drat:

Xarn
Jun 26, 2015
I might be permanently broken, I find it pretty readable. :v:


I'll admit I am pretty bad writing these things, didn't really have reason to practice too much.

Xarn
Jun 26, 2015

Sapozhnik posted:

dont do c++ its super bad
:wrong:

Sapozhnik posted:

otoh c is fine for what it is
:right:

Xarn
Jun 26, 2015

DONT THREAD ON ME posted:

yeah, it's a very different approach. my main worry is ambiguity, it seems like you could easily have two different types that each have a "foo" method with the same input/return types but wildly different semantics. it's like duck typing.

Yup, that can definitely happen and it hurts to debug. OTOH the "ducktyping" nature of templates also means that different types from libraries that have never heard of each other can both be passed to a template as long as their "foo" method does conceptually the same thing :shrug:


In the end I firmly prefer the fact that I don't need to have things derive from Callable and can instead just provide them with operator().


----edit----
Also a free advice: Use Catch for testing :v:

Xarn fucked around with this message at 13:43 on Sep 1, 2018

Xarn
Jun 26, 2015

Progressive JPEG posted:

imo:
- don't use exceptions
- mark all destructors virtual
- templates are effectively a preprocessor stage
- use smart pointers everywhere (e.g. unique_ptr for members rather than raw pointers)
- don't bother with c++ streams just use the c printf stuff, unless theres something better in the last 5 years idk

Literally all of this is wrong.

e:

The one thing it gets right (avoid standard streams if possible), is still made wrong by recommending printf and its ilk.

Xarn fucked around with this message at 07:39 on Sep 2, 2018

Xarn
Jun 26, 2015

DONT THREAD ON ME posted:

interesting. I'm curious about the public/private/protected forms of inheritance, that's new to me. cheers!

It is pretty much the same as the public/private/protected specifiers, but applied to the fact that the class is inheriting form a base. https://godbolt.org/z/lMdYJt


DONT THREAD ON ME posted:

what's wrong with smart pointers? I'm not really using them yet because I want to get experience with raw pointers but I figured modern C++ was all about the smart pointers.

They are perfectly OK, when you use them correctly (e.g. shared_ptr tends to be overused as gently caress), but it is a lovely advice, because it leads to code like this

code:
auto vec = std::make_unique<std::vector<int>>();
vec->push_back(123);
vec->push_back(456);
and increases general pointer-chasiness of code, when the proper advice is "use the gently caress out of RAII" and the code is supposed to be

code:
std::vector<int> vec;
vec.push_back(123);
vec.push_back(456);
Basically, you should have a positive reason to use a pointer, instead of placing the object directly onto stack/making it direct part of the object's layout.

Xarn
Jun 26, 2015
Every time I hear horror stories about old gcc or old VS, I am so glad I started doing C++ with VS2010...

Xarn
Jun 26, 2015

redleader posted:

low level langs are great for all the pearl-clutching about "ownership" they bring out. just let your gc take care of memory, and let finalizers take care of any other resources. ez and objectively, inarguably correct

I found them, the one person dumb enough to use finalizers that always fucks up everything.

Xarn
Jun 26, 2015
unique_ptr disallows copying, because it is, well, unique.

It doesn't disallow moving, because that means ownership transfer -> you can return it from a function just fine.

Xarn
Jun 26, 2015

CRIP EATIN BREAD posted:

its useful when you have something that will get called very infrequently, or is some sort of special endpoint that you dont want integrated into your applications.

especially if it just does stuff like call AWS API endpoints

yup.

At Job-2 we had 2 Lambdas that were run on a cron with long-rear end timer (one was ran hourly, the other once a day), whose job it was to run some queries against other AWS services and then optionally do some short-lived stuff. It was very needs suiting for that.

We also had a crazy overengineered data pipelines on Lambda + S3 + SQS (I think?) so that the pipelines could in theory scale almost indefinitely. Last I heard, it never needed to serve more than 5 requests per second :shrug:

Xarn
Jun 26, 2015

Bloody posted:

huh, that is mildly interesting. are there any provisions to just schedule them to run every X time? ive run into some annoying cloud use cases like that in the past when i had an app deployed to azure and i wanted to just run some code every 5 minutes that'd do some loving around that involved my database

For AWS Lambda it is super simple. When you set up a Lambda, you have to provide something called trigger -> when it should be launched, and what kind of data message should be passed to it when it starts (e.g. you can have a Lambda that runs when someone uploads a new file to an S3 bucket to a specific path).

One of the possible triggers you can have is just scheduled notification.

Xarn
Jun 26, 2015

tef posted:

git pull --autostash --rebase


I knew about --rebase, but not about --autostash.

Thanks!

Xarn
Jun 26, 2015
You should really learn enough to follow hackbunny's posts, they are amazing. (Assuming you care about Windows and systems programming :v:)

Xarn
Jun 26, 2015
I know exactly 1 thing about games programming, and that is to use quaternions to avoid gimbal locks.

The fact that this apparently puts me ahead of some professionals in the field (I still run into fps games that have this problem in TYOOL 2018) is weird :v:

Xarn
Jun 26, 2015
terrible programmer disclosure:

I know absolutely nothing about web and my knowledge of SQL ends at simple joins

Xarn
Jun 26, 2015
wchar was a mistake, but I have hopes for SG16

Xarn
Jun 26, 2015
That cookie preference poo poo broke down with "not all of our partners support https" for me. :suicide:

Xarn
Jun 26, 2015

gonadic io posted:

I don't think it's a typo just lovely wording
// outer loop
for I = 0..n {
// inner loop
for j = 0..m { butts }
}

You know that the inner loop gets run n times

E: it sounds like it's setting you up for deriving that your algo is O(n^2)

Yeah this.

Bloody posted:

welcome to the real world where nothing is proofread

My course materials were proofread.

Because I paid my own money to have people do it :v:

Xarn
Jun 26, 2015

Kevin Mitnick P.E. posted:

i'm going to assume that you also think XML parsers should uncontrollably vomit everywhere when encountering \0 so i hate you now


Kevin Mitnick P.E. posted:

put a vptr in your struct and now it is a class

i haven't thought about it much but it seems possible that c is a better language to write c++ than c++ is. having to write the features yourself limits the number that get used


Kevin Mitnick P.E. posted:

rust is for brain damaged c++ people whove gotten indoctrinated that their #1 job is making the compiler happy. then "wow memory safety, amazing". meanwhile everyone else is :rolleyes:

How can you be so wrong?

Xarn
Jun 26, 2015

Shinku ABOOKEN posted:

vscode is normie as hell and that’s why it’s the best one out of these

Xarn
Jun 26, 2015

AWWNAW posted:

I use Fira code

with ligatures

Also known as "going overboard" the font.

And the <= ligature is super wrong. :colbert:

Xarn
Jun 26, 2015
Well, they introduced JS so... :shrug:

Xarn
Jun 26, 2015
schema-less formats are bad though

Xarn
Jun 26, 2015

fritz posted:

i put an explicit "return" at the end of a c function with return type void

You are in the right thread my friend.

Xarn
Jun 26, 2015

Jabor posted:

often the things i need to debug involve them happening a whole bunch of times, but is only going wrong one of those times. so if you wanted to use a debugger, you'd either have to come up with a conditional breakpoint expression that only triggered in the failure case (and if you knew enough about the problem to be able to write that, you probably don't need to step through it in a debugger - often the problem only becomes apparent well after the point you want to start investigating values), or work through all the non-failing cases first before you get to the interesting one.

so it's easier to add a bunch of logging, reproduce the issue, then read the entrails to divine what went wrong

Time Travel debugging. Just capture a trace of failed case and then replay it until you figure it out.

Xarn
Jun 26, 2015

Kevin Mitnick P.E. posted:

"template metaprogramming is worth it to avoid a 16-byte overheard wrapping an int into an EpollFd"

Unironically yes.


Kevin Mitnick P.E. posted:

POD doesn't apply to classes I think. that's the other difference between structs and classes

Nah.

Xarn
Jun 26, 2015

gonadic io posted:

working on it :(

:same:

In our defense, we literally started in November and had a ton of other things that needed to be done before spinning up the environment. :v:

Xarn
Jun 26, 2015

Kevin Mitnick P.E. posted:

what got me started though, is when you were pearl clutching about an fd wrapper having a vtable and how it was so much better to write and maintain code to avoid that

i really like the fd example because no matter how skinny you make it in userspace the kernel still has a struct file, which, aside from being vomit-inducingly bloated by c++ standards, includes a vtable pointer

Agreed, the fact that there is a part that is slow means we can make every part slow.

Have you heard the good word of Electron yet?


--------------
gently caress that's a terrible start of new page

Xarn fucked around with this message at 13:30 on Dec 5, 2018

Xarn
Jun 26, 2015
C++ standard library is good :colbert:

As long as you avoid std::string, formatting via streams, any attempts at i18n and other things I am forgetting right now. :v:

Xarn
Jun 26, 2015
Real talk, I actually use Python a lot for scripting and when I don't care for efficiency, and I am completely ok with the fact that my scripts need orders of magnitude more cycles than a proper code would.

At the same time, I make my living by writing software that needs high-throughput and already needs 70+ gigs of ram when using strongly typed ints that need only 4 bytes of memory, so yes, I am kinda sceptical of the "just 16 bytes overhead, who cares" approach.

Xarn
Jun 26, 2015

Kevin Mitnick P.E. posted:


"but my code is very important and does things with bytes and it really really matters how fast i shuffle records from disk to ram and back. a factor of 2x is competitive advantage". nope, you're just ignoring the opportunity cost of using c++, the algorithmic and architectural improvements you could have made but didn't while preemptively optimizing every line you touch. i'm sure it's very satisfying to know that every byte is doing the work of a word and you've bled every bubble out of the pipeline, but it doesn't matter and it's not worth it


Slowing down our code so that it takes twice as long in computation is literally adding an hour of runtime....

Xarn
Jun 26, 2015

Krankenstyle posted:

lmao try doing string manipulation in latex

youd thnnk that it would have some stuff built in, but not really. the best you get is like car/cdr and some lexical ordering that can be cobbled together for more userfriendly functions

or you could use any of a number of packages that may or may not break if used with other packages, who knows! :shrug:

I just had flashback to writing my thesis, make it stop.

Adbot
ADBOT LOVES YOU

Xarn
Jun 26, 2015

Kevin Mitnick P.E. posted:

ok. doesn't matter

:thunk:

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