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
Sapozhnik
Jan 2, 2005

Nap Ghost

flakeloaf posted:

char *anArray = new char[100];

OK

what's &anArray?

Nope, this is where you hosed up.

&anArray is a pointer to a pointer to your 100 chars.

That being said where did you get that other pointer, like from (&anArray)[1] or something?

Also nice 32 bit dev machine for a clown to use at etc etc

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost

MALE SHOEGAZE posted:

JawnV6 (or anyone else): recommendations on where to get started learning assembly? it's about time.

don't say reading luigi's posts

https://blogs.msdn.microsoft.com/oldnewthing/20040914-00/?p=37873

Sapozhnik
Jan 2, 2005

Nap Ghost
Learn RISC v then

Similar to MIPS except no delay slots or weird multiplication registers and in 2018 it is exactly ad relevant as MIPS ie not at all

Sapozhnik
Jan 2, 2005

Nap Ghost
i mean there's something to be said for entire $1bn-$1tn market sectors not being intel's or qualcomm's bitch but we're at least a decade away from breaking those strangleholds

it's cool in the meantime but yeah not very relevant beyond academic exercises.

Sapozhnik
Jan 2, 2005

Nap Ghost

Luigi Thirty posted:

I made a working button but idk why my app looks like windows 3.1 instead of windows 95

https://twitter.com/LuigiThirty/status/1021654799987736576

For Win95 style controls you have to pull in COMCTL32 (and you know, actually initialize it)
(For WinXP and newer style controls you also have to have a WinSxS manifest resource that specifies version 6 of the common controls library, but you don't care about that on Win95 and SxS manifests didn't exist back then).

Sapozhnik
Jan 2, 2005

Nap Ghost
I've recently had cause to poke around in the Windows Driver Framework

it's.... surprisingly not-bad????

Sapozhnik
Jan 2, 2005

Nap Ghost

a good article

quote:

What we need is a business rules engine

quote:

Initially there was hope that non-technical business users would be able to use the GUI to configure the application

this is the programming equivalent of original sin

Sapozhnik
Jan 2, 2005

Nap Ghost

cheque_some posted:

What would you recommend for someone who is a self-taught terrible devopsing p-langing programmer but want to become a non-terrible programmer


at the point where I can make a CRUD (more like cruddy) program, that does what I want it to, but how do I get to the point where it's something professional grade. like how do you learn how to architect programs and when to use a lookup table instead of just a bunch of if-statements, and architect using different controllers instead of all just in one main, and optimized code, and all that other stuff. It seems like there's tons of 'learn to program' sites like codeacademy and all that, but they never go beyond loops and if statements and arrays.

Are there any books or sites that teach you how to go from beginning to intermediate level?

make a bunch of mistakes then think about and research ways to fix them. and do the actual fixing part as well ofc

Sapozhnik
Jan 2, 2005

Nap Ghost
You must absolutely make your unit tests deterministic. So yeah hard code some plausible minimal test cases into your code. In situations where randomness is required your classes under test must take an RNG as a constructor param and you should supply an RNG that was initialized with a hard coded seed.

Definitely have test cases for edge cases like new year.

Seems like vat rates are a time series that requires a snapshot capability, so yeah build that whole time series service as a separate unit with its own separate unit tests. All else being equal you want your vat calculator (or anything else really) to have the data pushed to it instead of making it pull things.

Vat exemption, well, no universal answer for that. Maybe you want your calculator to take a TaxRegime interface and have a method on that interface that takes the invoice date and whatever other properties the tax man cares about. Then have a PrivateCustomerTaxRegime and a VatExemptRegime where the latter returns a zero tax rate for everything and have an upper layer locate a suitable tax regime given a Customer object. Then test that upper layer separately. Sounds like you have an Invoice object with an effective date, a list of line items, and your tax calc function takes an Invoice and a TaxRegime. Elsewhere you have some other function that locates a TaxRegime given a Customer which you can test separately, and some other thing above all that to execute all the steps of the process. Or maybe that is a poo poo design idk. I don't know what the entire requirements doc looks like.

So, push not pull where possible, think very hard about what your business logic should be a function of and cut the task into pieces accordingly, and let your testing plan inform your system design instead of the other way around.

Sapozhnik
Jan 2, 2005

Nap Ghost
Well in that specific case it may be better to pass a Clock, but of course it depends on the exact task at hand

Sapozhnik
Jan 2, 2005

Nap Ghost
There is no good way to use c++, only less bad ways

Sapozhnik
Jan 2, 2005

Nap Ghost

Symbolic Butt posted:

this is me reading this:

Sapozhnik
Jan 2, 2005

Nap Ghost
yeah so just set up a regular postgres rds instance and be done with it

bring lots of money

Sapozhnik
Jan 2, 2005

Nap Ghost

ratbert90 posted:

Modern C++ >= 14 is cool and good and makes C++ almost a higher level language.

If the C++ is hard to read, it's probably because of either:
1) A garbage programmer who is probably afraid of function pointers and uses threads with callbacks for everything
2) A C programmer who treats C++ as just C with classes and doesn't use it like a modern language.
3) A P-Lang developer who never learned C and tries to treat C++ as a pure P-Lang.

You need a C++ guy who knows C and P-Langs, and has embraced C++ as a modern language.

Either way, modern C++ is cool and good.

counterpoint: no

Sapozhnik
Jan 2, 2005

Nap Ghost

ratbert90 posted:

I like modern C++ and think it has it's place.
I also really like Python and think it has it's place.

PHP can go gently caress right off though. :colbert:

this is like the "i listen to everything except rap and country" of programming opinions

Sapozhnik
Jan 2, 2005

Nap Ghost
i got as far as emulating a mips cpu and a memory controller and sketched out some gpu register access dispatching for a psx-based arcade board before going "lol why the gently caress am i doing this i have a dozen other side projects withering atm"

it did get a decent way through the boot ROM though, right up to the point where it would activate display scanout

Sapozhnik
Jan 2, 2005

Nap Ghost

CRIP EATIN BREAD posted:

this thread made me look into that emulator101.com page and now im designing UIs for a debugger in ANSI C.

thx, thread

Why not implement a gdb remote debug interface

Sapozhnik
Jan 2, 2005

Nap Ghost
:ssh: java 10 has local variable type inference

Sapozhnik
Jan 2, 2005

Nap Ghost

DONT THREAD ON ME posted:

today i'm getting serious about c. gonna do the basic data structures and algos for however long that takes and then move on to c++.

dont do c++ its super bad

otoh c is fine for what it is

Sapozhnik
Jan 2, 2005

Nap Ghost
there are places where you cannot avoid doing c++ (e.g. video games) because it is entrenched. there's nothing you can do in those circumstances but otherwise do not voluntarily use c++

Sapozhnik
Jan 2, 2005

Nap Ghost

redleader posted:

i'm extremely jealous of how motivated you are to do things

Sapozhnik
Jan 2, 2005

Nap Ghost
god i really can't imagine actually voluntarily choosing to use c++ in 2018 when literally any other workable option is available

Sapozhnik
Jan 2, 2005

Nap Ghost
Git's ui sucks but ugh yeah cmon people at least try

Not gonna expect people to push immaculate rebaded change sets polished to a shine on the lathe of git interactive rebase but at least get the basic stuff right

Sapozhnik
Jan 2, 2005

Nap Ghost
anybody remember transmeta

their technology was pretty cool apart from the unfortunate aspect that it didn't actually do anything useful

Sapozhnik
Jan 2, 2005

Nap Ghost
if there was a gamedev union and that union wasn't toothless then i'd totally work in game dev. the technical challenges seem very fun and interesting

Sapozhnik
Jan 2, 2005

Nap Ghost
What is an ecs

Sapozhnik
Jan 2, 2005

Nap Ghost
Com is surprisingly decent as long as you stay well away from com automation

The registry stuff is a pain but that's about it

Sapozhnik
Jan 2, 2005

Nap Ghost
I was writing perl way past its prime purely because I was annoyed at the lovely postgres driver situation in python that seemingly only got resolved fairly recently

Sapozhnik
Jan 2, 2005

Nap Ghost
Still don't understand why people use vue instead of react

Protip redux is poo poo but nobody is forcing you to use it, it's a totally independent thing

Sapozhnik
Jan 2, 2005

Nap Ghost
Yarn add react-dom

Then I guess press whatever button in vscode compiles your jsx typescript down to browser JavaScript

Or if that's too much work let $ = React.createElement

Sapozhnik
Jan 2, 2005

Nap Ghost

TheFluff posted:

if you want a more expressive type system for your serialization format, just use protobufs. of course, it's not as portable, but that's the price you pay for complexity. in both xml and json you soon land in having to serialize almost everything as a string anyway.

how aren't protobufs portable

Sapozhnik
Jan 2, 2005

Nap Ghost

Kevin Mitnick P.E. posted:

intellij generates all my compareTos, toStrings, and hashCodes

maybe autovalue should do that for you instead

Sapozhnik
Jan 2, 2005

Nap Ghost
why does postgres use neither mmap nor O_DIRECT in addition to having its own page cache

Sapozhnik
Jan 2, 2005

Nap Ghost
orms are bad sprocs are worse

bye

Sapozhnik
Jan 2, 2005

Nap Ghost
It's OK to be whitespace?





Yeah I got nothing

Sapozhnik
Jan 2, 2005

Nap Ghost
Make a servlet filter that passes a subclass of httpservletrequestwrapper down the chain. Cache your request body there

Sapozhnik
Jan 2, 2005

Nap Ghost
I'll just do a little bit of heroin nodejs, I'm a strong-willed person, I'm just going to see what it's like then stop.

Sapozhnik
Jan 2, 2005

Nap Ghost

Luigi Thirty posted:

terrible programmer status: risc-v business

:frogon:

Sapozhnik
Jan 2, 2005

Nap Ghost
C++ has the worst goddamn standard library, hopefully we can at least agree on that

Love to have a string type and text formatting routines that are completely and utterly worthless

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
People don't though, that's the problem

Some are even perverted enough to use boost

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