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.
 
  • Locked thread
JewKiller 3000
Nov 28, 2006

by Lowtax

Lutha Mahtin posted:

doobie??? sequel???? :getin:

smoke two joins before you smoke two joins

Adbot
ADBOT LOVES YOU

JewKiller 3000
Nov 28, 2006

by Lowtax
what happened to my post, did the forums eat it

edit: oh there it is

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Sapozhnik posted:

Hmm? Explain, I'm curious. Always assumed FP alus were horribly complex beasts

fake edit: what happens if you feed it a stray cat denormal or other such weird input

first of all, you'll notice that it's a pretty constrained format. we're not talking ieee 754 here.

computers essentially multiply via long multiplication - to work out A * B, you work out A * 2, A * 4, A * 8 etc., and add together the ones that correspond to set bits in B.

so the size of your multiplier is based on how large B could be (which dictates how many bits you might need to add together). if you wanted to support bitmaps up to 511x511, you'd need 9 bits, which means your multiplier would need to add together 9 different numbers. that's a huge amount of circuitry required! (the other option is to do the adding up over multiple cycles, re-using the same bits of circuitry, which is also complicated and still pretty big.)

with this floating-point scheme, your multiplier only needs to add three different numbers, which is way smaller. then you just need a shifter on the front to apply the exponent, which is also pretty small.

silvergoose
Mar 18, 2006

IT IS SAID THE TEARS OF THE BWEENIX CAN HEAL ALL WOUNDS




schranz kafka posted:

they do, and we have to use Litmus for testing, and outlook is the worst poo poo of all of them. i'm using foundation framework for emails which is making it slightly less horrible, but not by much

You're not on my team, are you? Cause yeah foundation, litmus, etc. The worst is exact target, really.

FamDav
Mar 29, 2008

Shaggar posted:

its just gross to use a schemaless "database". it takes longer to develop with cause you have to manually handle all the validation and enforcement that a schema normally does. you also cant discover a schema so you have to basically document it externally which is totally stupid and error prone.

its not a dynamo db problem, its a schemaless NoSQL problem.

use the dynamodb mapper library, or just use aurora my dude

josh04
Oct 19, 2008


"THE FLASH IS THE REASON
TO RACE TO THE THEATRES"

This title contains sponsored content.

Luigi Thirty posted:

i've got a weird problem here with C

the reference to the jaguar's vram is
code:
extern uint8_t *jag_vidmem;
the equates file defines the blitter's memory window pointer register as

code:
typedef volatile uint32_t	vuint32_t;

#define A1_BASE 	(vuint32_t *)(BASE+0x2200)	/* A1 Base Address */
I have this macro I'm using for assigning longs to 32-bit registers

code:
#define MMIO32(x)   (*(vuint32_t *)(x))
but I can't seem to get it to cooperate and write the address to the vuint32_t* register? i tried casting jag_vidmem to a void* and vuint32_t*, my compiler just says invalid types for assignment?

code:
	MMIO32(A1_BASE)		= (void *)jag_vidmem;
	MMIO32(A1_PIXEL)	= (0 << 16 | 0);
	//etc etc...

i know you solved this some other way, but just looking at it it looks like your MMIO32 macro is dereferencing the pointer, so it'd come out with type vuint32_t rather than vuint32_t *?

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

holy poo poo jaguar is the best console

Xarn
Jun 26, 2015

Pie Colony posted:

what i've generally found was PRs above a certain threshold of lines changed are just confusing, and the feedback received is more superficial (e.g. stylistic comments) than substantial (e.g. architectural comments). i basically try to never make PRs over ~150 lines, even if that means features are launched in a turned-off state.

semi-related, a good way to find out if you are breaking down your tasks enough is if all/the majority if your tasks are estimated at 0.5 - 1 points

The commit was "enabled new warning and swept the codebase for it".

Could it have been broken down? Yes. Would it be worth it? Maybe.
...
Did I want to bother? :v:



Also, I had legitimate commits that once squashed down to atomic change had like 2k changed files and 10k changed lines. It couldn't have been split apart because it included a complete rework of how our build system resolved includes.

We reviewed the hell out of the script automating the change though.

toiletbrush
May 17, 2010
If you ever write a book I promise to buy it.

Terrible programmer SQL question - are triggers safe from race conditions? Like if you had...
code:
CREATE TRIGGER NoMoreThanTenButtesTrigger
BEFORE INSERT ON ButtesTable
FOR EACH ROW
EXECUTE PROCEDURE check_less_than_ten_buttes();
...is it guaranteed that no rows can be inserted between the BEFORE check being ok and the INSERT running? There's other/better ways to do this, I'm just curious.

Shaggar
Apr 26, 2006

FamDav posted:

use the dynamodb mapper library, or just use aurora my dude

aurora is MySQL. :barf:

I'm just gonna switch it to azure sql since its not much more expensive

FamDav
Mar 29, 2008

Shaggar posted:

aurora is MySQL. :barf:

I'm just gonna switch it to azure sql since its not much more expensive

I was going to say use the postgres version but it's still in open preview :(. I personally have no qualms with MySQL but that's more about spending too much time learning it's bs,

gonadic io
Feb 16, 2011

>>=
tps: still writing groovy

Result<Butt> result = getButt() // no error
Butt butt = result.get() // GroovyCastException

ahhhh

quiggy
Aug 7, 2010

[in Russian] Oof.


gonadic io posted:

tps: still writing groovy

Result<Butt> result = getButt() // no error
Butt butt = result.get() // GroovyCastException

ahhhh

this seems bad, op

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
it's almost like taking the type safety away from a language makes it worse?!?

Soricidus
Oct 21, 2010
freedom-hating statist shill

gonadic io posted:

tps: still writing groovy

why

the only place I've met groovy is in gradle, and I only touch that when I absolutely can't get away with quietly using maven

fritz
Jul 26, 2003

gonadic io posted:

tps: still writing groovy

Result<Butt> result = getButt() // no error
Butt butt = result.get() // GroovyCastException

ahhhh

what is one 'supposed' to do in this situation

gonadic io
Feb 16, 2011

>>=

Legacy code. We're removing it slowly (apart from the times where we add a bunch to it for new features because they require parts we haven't moved out yet)

fritz posted:

what is one 'supposed' to do in this situation

My code was actually correct, the problem was that the method getButt was defined like:
Result<Butt> getButt(...) {
Return new NotButt
}
Which was somehow not erroring and was succeeding fine until I tried to call any of butts methods

So when I tried to assign NotButt to a Butt after the method call, I got the exception.

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

fritz posted:

what is one 'supposed' to do in this situation

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Wheany posted:

holy poo poo jaguar is the best console

Jaguar programming manual posted:

Blitter Pointer Read Registers are at the wrong address

Description: The blitter pointer registers, which are written at addresses $F0220C and $F02230, appear for read at $F02204 and $F0222C. This error was also present on version 1 silicon.

Workaround: Read them at the incorrect addresses.

Carthag Tuek
Oct 15, 2005

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




lmao :shepface:

Sapozhnik
Jan 2, 2005

Nap Ghost
are you sure this console wasn't secretly designed by Microchip Technology

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

toiletbrush posted:

If you ever write a book I promise to buy it.

Terrible programmer SQL question - are triggers safe from race conditions? Like if you had...
code:
CREATE TRIGGER NoMoreThanTenButtesTrigger
BEFORE INSERT ON ButtesTable
FOR EACH ROW
EXECUTE PROCEDURE check_less_than_ten_buttes();
...is it guaranteed that no rows can be inserted between the BEFORE check being ok and the INSERT running? There's other/better ways to do this, I'm just curious.

Yay I get to be the first to respond!

First this is a classic check-then-act race condition and running in a database doesn't save you. You need to follow the same design considerations as in other programming languages. It's simple to see how two simultaneous insert statements can pass the check at 9 records, and then both proceed with the insert, leaving you with 11 butts in the table.

I think what you want is a Constraint Trigger that happens after the rows are inserted (but before it commits!), and rolls back that insert if there are more than 10 butts in the table.
https://stackoverflow.com/questions/37277313/run-trigger-after-transaction-not-on-each-row-postgresql-9-4

Also read up on Transaction Isolation Levels which is another kind of concurrency issue particular to databases.
http://www.oracle.com/technetwork/testcontent/o65asktom-082389.html

Shaggar
Apr 26, 2006
I'm not entirely sure but I think that trigger should lock the table after an insert to do the reads for running the proc. Depending on whats in the proc you might cause a bunch of problems.

a better solution is to use a check constraint to prevent the insert of a value over 10 or w/e you're trying to limit.

whatever the question, triggers are never the answer.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Sapozhnik posted:

are you sure this console wasn't secretly designed by Microchip Technology

it was designed by sinclair refugees and fabbed by IBM

Valeyard
Mar 30, 2012


Grimey Drawer
you should only use triggers to implement auto increment primary keys for your tables in Oracle

everything else do in your app!!!!!!

moostaffa
Apr 2, 2008

People always ask me about Toad, It's fantastic. Let me tell you about Toad. I do very well with Toad. I love Toad. No one loves Toad more than me, BELIEVE ME. Toad loves me. I have the best Toad.

Valeyard posted:

you should only use triggers to implement auto increment primary keys for your tables in Oracle

everything else do in your app!!!!!!

You should only use triggers for the shotgun in your mouth after having to deal with Oracle databases

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

moostaffa posted:

You should only use triggers for the shotgun in your mouth after having to deal with Oracle databases

Luigi Thirty
Apr 30, 2006

Emergency confection port.

moostaffa posted:

You should only use triggers for the shotgun in your mouth after having to deal with Oracle databases

toiletbrush
May 17, 2010

moostaffa posted:

You should only use triggers for the shotgun in your mouth after having to deal with Oracle databases

content: there's no way we'd do use a trigger for what we need, we're using a check constraint, but it showed up in a stack overflow answer marked as 'correct' and my spidey sense tingled the moment I read it.

Soricidus
Oct 21, 2010
freedom-hating statist shill
trigger warning: oracle databases

FamDav
Mar 29, 2008

Valeyard posted:

you should only use triggers to implement auto increment primary keys for your tables in Oracle

everything else do in your app!!!!!!

please don't use auto-incrementing primary keys. Jesus didn't die for that

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme

FamDav posted:

please don't use auto-incrementing primary keys. Jesus didn't die for that

apologies for opening a potential can of worms here, but is this a more general argument against so-called surrogate keys or just an argument against auto-incrementing ones in particular?

I'm db-curious but know nothing at the moment

JewKiller 3000
Nov 28, 2006

by Lowtax
you can use an auto-increment and regret it later, or use a uuid and regret it now

Sapozhnik
Jan 2, 2005

Nap Ghost

meatpotato posted:

apologies for opening a potential can of worms here, but is this a more general argument against so-called surrogate keys or just an argument against auto-incrementing ones in particular?

I'm db-curious but know nothing at the moment

surrogate keys are the only correct option. never ever use natural keys.

uuid keys are good and cool

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

i have a personal project using sqlite and i think that that db has an auto increment int key column whether you like it or not. ill just ignore it because i just use the db here as a cache for web api data. but if i had to rely on teammates not using the auto int column i think my blood pressure would be in a worse state

JewKiller 3000
Nov 28, 2006

by Lowtax

Sapozhnik posted:

surrogate keys are the only correct option. never ever use natural keys.

mega wrongo

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
You should always prefer natural keys to surrogate keys.

You should only use surrogate keys as a last resort.

You will never have natural keys.

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe
you can just use the keying type that works as necessary or both

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine
what's so bad about uuids?

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
they don't fit neatly together if you're using them as a clustering key

  • Locked thread