|
yaoi prophet posted:probably my biggest frustration with strongly typed haskell is 'okay i want to know what the hell type this is evaluating to so i can fix it', it's easy to do that if the function i'm defining isn't used anywhere else but if it is i have to rename it to foo', let foo = undefined, and check the type of foo' sounds like a problem with haskell
|
# ? Aug 28, 2012 05:35 |
|
|
# ? May 9, 2024 13:19 |
|
one nice thing about strong typing is the code completion in your ide
|
# ? Aug 28, 2012 05:35 |
|
neways all these reasons and more are why objective c is the best programming language
|
# ? Aug 28, 2012 05:42 |
|
vapid cutlery posted:neways all these reasons and more are why objective c is the best programming language brought to you by the Love-Cox team, lmbo
|
# ? Aug 28, 2012 06:57 |
|
rotor posted:brought to you by the Love-Cox team, lmbo
|
# ? Aug 28, 2012 07:40 |
|
Is it too much to ask for a language with strong types, type inference, maybe type states, and error messages that aren't "Couldn't infer infinite type t -> t'".
|
# ? Aug 28, 2012 09:57 |
|
static vs dynamic typing isn't the problem here the problem is proper variable scoping if your language doesn't support lexical scoping, get the gently caress out
|
# ? Aug 28, 2012 11:25 |
|
yaoi prophet posted:probably my biggest frustration with strongly typed haskell is 'okay i want to know what the hell type this is evaluating to so i can fix it', it's easy to do that if the function i'm defining isn't used anywhere else but if it is i have to rename it to foo', let foo = undefined, and check the type of foo' -fdefer-type-errors http://hackage.haskell.org/trac/ghc/wiki/DeferErrorsToRuntime
|
# ? Aug 28, 2012 12:08 |
|
qfnp
|
# ? Aug 28, 2012 12:37 |
|
EVGA Longoria posted:static vs dynamic typing isn't the problem here the problem is proper variable scoping Another win for objective c
|
# ? Aug 28, 2012 15:33 |
|
Jonny 290 posted:so i taught myself more sql with perl this weekend. im scraping the local police dispatch logs, storing them in mysql and then geolocating them all. then i have a client script that calcs distance and alerts me if poo poo goes down within 1 mile radius of my house. could use this to bench test https://spotcrime.com/
|
# ? Aug 28, 2012 16:17 |
|
Jonny 290 posted:the sql bit was a little tricky b/c timestamps, incident descriptions and addresses can all be duplicated, but all 3 will never be duplicated at once, so I ended up taking an md5 of $timestamp.$desc.$addr and using that as a unique index field. Then since i'm scraping the whole page each minute and will see entries multiple times, i md5 each item and if that index exists, skip. i guess sql can do this but i didnt want to build up a bunch of huge gross queries at 2am saturday night That's cool, but md5 is not collison-resistant so their is a chance you could have the same md5 twice. A small chance, but still a chance. If your still playing around with this you might want to find a better way.
|
# ? Aug 28, 2012 17:00 |
|
or for a better use of your time, calculate the odds of a randomly occurring md5 collision
|
# ? Aug 28, 2012 17:04 |
|
yeah i knew about md5 collisions but accepted that as a limitation of my approach. if this were crit i would have used something else. gonna try dbix::class tonight. shaggar what are ur thoughts
|
# ? Aug 28, 2012 17:07 |
|
this is kind of like how every C book in the world is this giant fuckoff doorstop brick of a tome while the only one worth reading, K&R, is a thin svelte little pamphlet that still tells you every single thing you need to know about the language burn all doorstop tomes forever
|
# ? Aug 28, 2012 17:57 |
|
Jonny 290 posted:yeah i knew about md5 collisions but accepted that as a limitation of my approach. if this were crit i would have used something else. Why didn't you just make a unique constraint for all 3 fields?
|
# ? Aug 28, 2012 18:06 |
|
vapid cutlery posted:
yeah whats the problem here (im not a db guy)
|
# ? Aug 28, 2012 18:10 |
|
among other things, unique indexes on multiple very long string columns is going to destroy insert performance
|
# ? Aug 28, 2012 19:05 |
|
insert performance isn't something most yosposters are known for
|
# ? Aug 28, 2012 19:09 |
|
Hard NOP Life posted:Why didn't you just make a unique constraint for all 3 fields? i think i understand what you're sayin, but none of the fields are guaranteed unique. dispatches can go out at the exact same second, multiple dispatches can go to the same address, and they use macros for the incident description so those can match too. the best way that i could figure out to get a unique identifier for each thing that i could use later to determine if a record existed without a big sql query was to md5 the whole thing, as the one thing that will never happen is same time, same address, same description. i mean i guess i could just add a serial number field and increment it but it wouldn't be useful in any way i dont think
|
# ? Aug 28, 2012 19:10 |
|
0xB16B00B5 posted:among other things, unique indexes on multiple very long string columns is going to destroy insert performance good point, i bet the fraction of a fraction of a second will make a big difference in the dozen-odd daily inserts into this table that will never top 10k rows let's prematurely optimize the gently caress out of this poo poo
|
# ? Aug 28, 2012 19:12 |
|
Jonny 290 posted:i think i understand what you're sayin, but none of the fields are guaranteed unique. dispatches can go out at the exact same second, multiple dispatches can go to the same address, and they use macros for the incident description so those can match too. the best way that i could figure out to get a unique identifier for each thing that i could use later to determine if a record existed without a big sql query was to md5 the whole thing, as the one thing that will never happen is same time, same address, same description. in good sqls and oracle and mssql and maybe mysql you can make a unique constraint over multiple columns code:
|
# ? Aug 28, 2012 19:13 |
|
Jonny 290 posted:i think i understand what you're sayin, but none of the fields are guaranteed unique. right, but you said that the three of them together would never be the same---you'd want one unique index on all three columns, not three unique indexes. but if i was doing it i wouldn't do that to uniquely identify the rows, that would just be a constraint to stop me if i accidentally do something stupid like gently caress up a script so it inserts the same row 500 times. you know that constraint exists irl, so why not codify it in the db? you prolly do actually also want an auto-incrementing primary key here. let's say someday there's a whole bunch more poo poo that goes with any given dispatch record and you want to make a details page to view it. without that key you have to do something like this to uniquely identify the row: crime_details.php?timestamp=4:00:23&address=BUTT+ST&description=.... instead of just crime_details.php?crime_id=5
|
# ? Aug 28, 2012 19:16 |
|
Tiny Bug Child posted:right, but you said that the three of them together would never be the same---you'd want one unique index on all three columns, not three unique indexes. TBC was right, I was about to make this same post
|
# ? Aug 28, 2012 19:18 |
|
420 smoke synthetic keys all day gently caress a business key as a unique index
|
# ? Aug 28, 2012 19:51 |
|
rotor posted:insert performance isn't something most yosposters are known for let's all have a big nerdy conversation and just let this slide by! completely unacknowledged! - u
|
# ? Aug 28, 2012 19:52 |
|
trex eaterofcadrs posted:420 smoke synthetic keys all day we use a business key as key (because riak) at work because it saves us some queries: we can ask for the record we want instead of querying to see if it exists and now that leveldb has a bloom filter in riak 1.2 that might actually be more efficient than querying to see if it exists lol
|
# ? Aug 28, 2012 19:53 |
|
Tiny Bug Child posted:right, but you said that the three of them together would never be the same---you'd want one unique index on all three columns, not three unique indexes. GOT IT you own yospos owns
|
# ? Aug 28, 2012 20:13 |
|
Tiny Bug Child posted:right, but you said that the three of them together would never be the same---you'd want one unique index on all three columns, not three unique indexes. tbc actually says a right thing
|
# ? Aug 28, 2012 20:17 |
|
it is difficult to have bad opinions about database schema
|
# ? Aug 28, 2012 20:35 |
|
normalization is for faggots
|
# ? Aug 28, 2012 20:40 |
|
nah that was pretty easy
|
# ? Aug 28, 2012 20:41 |
|
0xB16B00B5 posted:normalization is for faggots
|
# ? Aug 28, 2012 20:41 |
|
0xB16B00B5 posted:nah that was pretty easy
|
# ? Aug 28, 2012 20:41 |
|
you don't really believe that
|
# ? Aug 28, 2012 20:48 |
|
scalar valued functions are great for formatting your output from your db
|
# ? Aug 28, 2012 21:09 |
|
rotor posted:insert performance isn't something most yosposters are known for
|
# ? Aug 28, 2012 21:17 |
|
nosql more like no girls
|
# ? Aug 28, 2012 21:22 |
|
salted hash browns posted:nosql more like no girls no girls.....never girls
|
# ? Aug 28, 2012 21:43 |
|
|
# ? May 9, 2024 13:19 |
|
syntaxrigger posted:no girls.....never girls I never read this thread, just came here to ally oop, find out I'm in it
|
# ? Aug 28, 2012 21:46 |