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

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:

Adbot
ADBOT LOVES YOU

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
there's so many questions, like how is it harder to parse arrays than json objects :psyduck:

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


ugh I just realised that this reporting component I rewrote has a) got out of hand and is probably at least as complex as what it replaces (though still better imho) and b) an assumption I made way back about the model structure is wrong and certain things I'm encountering now would be easier if I hadn't done that.

now the question is do i:
a) refactor
b) brute force a solution and leave lots of comments saying "todo:sorry"
c) drink

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

Powerful Two-Hander posted:

ugh I just realised that this reporting component I rewrote has a) got out of hand and is probably at least as complex as what it replaces (though still better imho) and b) an assumption I made way back about the model structure is wrong and certain things I'm encountering now would be easier if I hadn't done that.

now the question is do i:
a) refactor
b) brute force a solution and leave lots of comments saying "todo:sorry"
c) drink

I vote both a) and c).

gonadic io
Feb 16, 2011

>>=

Powerful Two-Hander posted:

ugh I just realised that this reporting component I rewrote has a) got out of hand and is probably at least as complex as what it replaces (though still better imho) and b) an assumption I made way back about the model structure is wrong and certain things I'm encountering now would be easier if I hadn't done that.

now the question is do i:
a) refactor
b) brute force a solution and leave lots of comments saying "todo:sorry"
c) drink

b+c always. Its a lifestyle choice

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Symbolic Butt posted:

there's so many questions, like how is it harder to parse arrays than json objects :psyduck:

oh my it got better. After making the change the franchise partners got back to a relations person (thankfully i don't have direct contact with anyone) and said "postman no work now, it says syntax error :saddowns: "

:tif:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
people doing the emulator 101 thing: what's the ac flag in the condition codes?

nm: auxiliary carry, apparently. also this manual is the best resource i've found:

http://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf

DONT THREAD ON ME fucked around with this message at 14:07 on Aug 15, 2018

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

gonadic io posted:

b+c always. Its a lifestyle choice

also brute forcing a solution may lead you to a more optimal path to refactoring

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

MALE SHOEGAZE posted:

people doing the emulator 101 thing: what's the ac flag in the condition codes?

nm: auxiliary carry, apparently. also this manual is the best resource i've found:

http://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf

I thought it stood for adjust carry

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

MALE SHOEGAZE posted:

people doing the emulator 101 thing: what's the ac flag in the condition codes?

nm: auxiliary carry, apparently. also this manual is the best resource i've found:

http://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf

yeah, it's for doing bcd arithmetic (which was a thing people did back in those days, 'cos converting a binary number to decimal in order to display it is pretty expensive when you don't have a hardware divider)

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
another emulator 101 question: has anyone tried integrating the diagnostic tool referenced here?

http://www.emulator101.com/full-8080-emulation.html

I'm not really sure what it's supposed to do, and I'm not sure if I'm on track with it or not. I'm running the bin file, and it's not quite what the author describes. The first instruction is not ORG 00100H, it's a JMP; it looks like the bin has been updated to work without needing to modify it but I'd imagine the author would have updated the tutorial were that the case. But it's possible they didn't, I've found a few other inconsistencies.

So far I'm just hitting unimplemented opcodes which is expected, and I think I'm on track since it's not jumping into nonsense, but I'm not sure. I implemented the print code the author describes, but I don't really understand what it does. I assume it prints diagnostic information if an opcode isn't implemented correctly.

DONT THREAD ON ME fucked around with this message at 14:27 on Aug 15, 2018

CPColin
Sep 9, 2003

Big ol' smile.
That page is confusing because the author switches between talking about the ASM file and the BIN file a few times. The ORG 00100H instruction is in the ASM file and tells the assembler to offset the assembled BIN file by 0x100, presumably to leave room for CP/M subroutines like the one at 0x05 that prints stuff and one at 0x00 that exits the process.

I haven't tried that diagnostic code yet, though, because I keep refactoring stuff so I can implement all these MOV instructions easier!

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
What's a good random side project for RUST? I've been blanking on this for like 24 hours, now.

Bloody
Mar 3, 2013

I blanked on it for a year then saw an excuse to use it at work

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Bloody posted:

I blanked on it for a year then saw an excuse to use it at work

Hmm... maybe I should replace our python script that spins up infrastructure repos for drone with a RUST executable.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


gonadic io posted:

b+c always. Its a lifestyle choice


Symbolic Butt posted:

also brute forcing a solution may lead you to a more optimal path to refactoring

yeah i think it's gonna be b then c then a

which means more testing but i can make somebody else do that

also the problem is that I created the report object model as having a list of columns and a list of filters, where filters are applied to columns. really, i should have had the filters as being part of the column object but i didn't because not all columns have filters and in some cases we only want to render the filters for certain columns and then post this back as a list of filters, then for some reason instead of just mapping those filters back to the column model leaving some columns as unfiltered, i decided to treat it as a separate list entirely and i cant remember why.

i mean, that same mapping between a filter and its related column object basically has to be done at some point regardless so this is probably just changing when its done, but it would be clearer from an object model point of view.

Powerful Two-Hander fucked around with this message at 15:38 on Aug 15, 2018

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Finster Dexter posted:

Hmm... maybe I should replace our python script that spins up infrastructure repos for drone with a RUST executable.

that would be a fine use case for rust. I would focus on getting up to speed with how rust does error handling (Result, Try/?, Option, and monadic combinators), it should be helpful for your use case (and it's a place where rust really shines, but the language feels super awkward til you figure it out).


CPColin posted:

That page is confusing because the author switches between talking about the ASM file and the BIN file a few times. The ORG 00100H instruction is in the ASM file and tells the assembler to offset the assembled BIN file by 0x100, presumably to leave room for CP/M subroutines like the one at 0x05 that prints stuff and one at 0x00 that exits the process.

I haven't tried that diagnostic code yet, though, because I keep refactoring stuff so I can implement all these MOV instructions easier!

that makes way more sense.

DONT THREAD ON ME fucked around with this message at 15:37 on Aug 15, 2018

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


ugh i just realised if i dont do this now then i can't do it later because the objects are gonna get serlialised and saved to a db, so if i change the object model i then have to parse the old model into the new one and it's bad enough that i already have to do that for converting from the current model where some genius decided that rather than store an actual list of selected options, they'd concatenate it all into a single string that I then have to decode.

Powerful Two-Hander fucked around with this message at 16:27 on Aug 15, 2018

my new dog
May 7, 2007

by Nyc_Tattoo
https://github.com/search?p=2&q=%3Awq&type=Commits

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

cinci zoo sniper
Mar 15, 2013




Triglav
Jun 2, 2007

IT IS HARAAM TO SEND SMILEY FACES THROUGH THE INTERNET
i wanna write terrible programs for money that go fast and dont use a lot of ram

is knowing only c decently employable or do the businessmen really mean c++ when they write "c/c++"

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
lmao

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Triglav posted:

i wanna write terrible programs for money that go fast and dont use a lot of ram

is knowing only c decently employable or do the businessmen really mean c++ when they write "c/c++"

businesses want agile, fast and cheap programs

realistically you may want to look into embedded something

VikingofRock
Aug 24, 2008




Bloody
Mar 3, 2013

Triglav posted:

is knowing only c decently employable

extremely

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

MALE SHOEGAZE posted:

another emulator 101 question: has anyone tried integrating the diagnostic tool referenced here?

http://www.emulator101.com/full-8080-emulation.html

I'm not really sure what it's supposed to do, and I'm not sure if I'm on track with it or not. I'm running the bin file, and it's not quite what the author describes. The first instruction is not ORG 00100H, it's a JMP; it looks like the bin has been updated to work without needing to modify it but I'd imagine the author would have updated the tutorial were that the case. But it's possible they didn't, I've found a few other inconsistencies.

So far I'm just hitting unimplemented opcodes which is expected, and I think I'm on track since it's not jumping into nonsense, but I'm not sure. I implemented the print code the author describes, but I don't really understand what it does. I assume it prints diagnostic information if an opcode isn't implemented correctly.

actually it turned out the page is wrong. the bin file does not contain the ORG 00100H op, but the instructions are written as if it does. so you need to adjust the offsets accordingly if you want to skip the DAA tests.

I'm not sure if you need to adjust the stack pointer as he says, I think it's correct without adjustment.

CPColin
Sep 9, 2003

Big ol' smile.

MALE SHOEGAZE posted:

actually it turned out the page is wrong. the bin file does not contain the ORG 00100H op, but the instructions are written as if it does. so you need to adjust the offsets accordingly if you want to skip the DAA tests.

I'm not sure if you need to adjust the stack pointer as he says, I think it's correct without adjustment.

"ORG 00100H" is a directive to the assembler to put the first byte of code at 0x0100; it doesn't make it into cpudiag.bin and isn't an operation the CPU knows about. But you're right, the instruction to initialize the stack pointer does appear to be correct already:

000000a0 52 52 4f 52 20 45 58 49 54 3d 24 31 ad 07 e6 00 |RROR EXIT=$1....|

Those three bytes translate to "LXI SP,#07ad", which is what the author says it should be. I don't know why the author's trying to set the byte at address 368 (or why they use decimal for that address only), but the non-offset equivalent at 0x0070 is already 0x07, so who knows what happened there. That's the 7 in this bit of cpudiag.asm:

code:
BYTO2:	ANI	0FH
	CPI	0AH
	JM	BYTO3
	ADI	7
Learning a lot by looking at this crap, whee!

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender

Triglav posted:

i wanna write terrible programs for money that go fast and dont use a lot of ram

is knowing only c decently employable or do the businessmen really mean c++ when they write "c/c++"

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

redleader
Aug 18, 2005

Engage according to operational parameters

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

https://github.com/search?q=dongs&type=Commits

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

CPColin posted:

"ORG 00100H" is a directive to the assembler to put the first byte of code at 0x0100; it doesn't make it into cpudiag.bin and isn't an operation the CPU knows about. But you're right, the instruction to initialize the stack pointer does appear to be correct already:

000000a0 52 52 4f 52 20 45 58 49 54 3d 24 31 ad 07 e6 00 |RROR EXIT=$1....|

Those three bytes translate to "LXI SP,#07ad", which is what the author says it should be. I don't know why the author's trying to set the byte at address 368 (or why they use decimal for that address only), but the non-offset equivalent at 0x0070 is already 0x07, so who knows what happened there. That's the 7 in this bit of cpudiag.asm:

code:
BYTO2:	ANI	0FH
	CPI	0AH
	JM	BYTO3
	ADI	7
Learning a lot by looking at this crap, whee!


oooh, so the problem is that all the branch targets are off because of the directive, so you need to shift everything down so that it starts at 0x100.

which is what the author says, but i didn't get it.

DONT THREAD ON ME fucked around with this message at 22:06 on Aug 15, 2018

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
well, it runs

(spot the mistakes)

DONT THREAD ON ME fucked around with this message at 23:14 on Aug 15, 2018

Stringent
Dec 22, 2004


image text goes here

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

MALE SHOEGAZE posted:

(spot the mistakes)


:v:

(I'm sorry, but if you're going to softball them in like this...)

Captain Foo
May 11, 2004

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

Peeny Cheez posted:



:v:

(I'm sorry, but if you're going to softball them in like this...)

the mistake is u

using amberpos wtf

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

i do it to own the libs

necrotic
Aug 2, 2005
I owe my brother big time for this!

MALE SHOEGAZE posted:

oooh, so the problem is that all the branch targets are off because of the directive, so you need to shift everything down so that it starts at 0x100.

which is what the author says, but i didn't get it.

yeah that took me a while to figure out. its even more unclear when you get through that rom as it calls a BDOS function, which if not implemented will end up moving the PC to 0x0005 and moving forward with gibberish.

ive been using this reference for cpm/bdos whenever things cross over to that side, a bunch of diagnostics end up needing at least the print functions.

edit: right, thats the FOR_CPUDIAG ifdef on that same page you linked before. those print branches are BDOS functions 2 and 9 on the page i just linked.

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.

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

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

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