Open Side Menu Go to the Top

06-05-2017 , 02:26 PM
I'm experiencing what I think might be a bug with mysql. It's certainly weird.

I have a query something like

Code:
select id 
from table1
left join table2 using (foo)
left join table3 using (foo)
where id in (subquery1) and id in (subquery2)
In my test, about half the time, one of the ids is returned twice. Only one, always the same one. The id is contained in both subqueries (but so are other ids)

If I remove BOTH left joins, it will return only one result. Removing either one makes no change. Neither of the left joined tables have *anything* in them, in this case.

If I replace the subqueries with literal lists of ids, there's no problem.

Each time I re-run the test (which starts with a fresh database), it either works or it doesn't. If it works, all subsequent queries will work, if it doesn't, they won't. So it's something about the structure of the data, I think, not (just) the query.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards ? Splash Pots ? CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
06-05-2017 , 02:29 PM
Well, ok, I just ran it like 10 times and it failed every time, so it doesn't work 50% of the time. I guess I got lucky before.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2017 , 02:44 PM
Quote:
Originally Posted by Victor
at my job, somewhat often my code "runs on my local" but not on the qa or even production server. this is a problem that I am responsible for figuring out.

so ya, welcome to coding I guess.
Over time this should become less and less frequent to the point it almost never happens, or else you're doing something wrong.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2017 , 02:57 PM
I have lust in my heart for the space gray 27" super iMac Pro starting at only $4999.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2017 , 04:18 PM
Quote:
Originally Posted by suzzer99
Over time this should become less and less frequent to the point it almost never happens, or else you're doing something wrong.
ya I mean, its a joke "well, it works on my local". thats not good enough.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2017 , 11:40 PM
Quote:
Originally Posted by Grue
I'll probably wind up doing a talk about some of the challenges I've fast because its essentially what rusty says, eventually 4chan finds you.

Its a SPA app that is essentially a lobby with a list of games that are in progress/started/unstarted (needs players) that you click on to join. There's a list of players sorted by win rate in the upper right and a general chat in the lower right. In the game, there's a chat box that observers can chat in. It takes 2 seconds to register. Games last 3-15 minutes and depends on players playing honestly for their team.

So first thing is people making offensive names. Right now to delete them it takes me logging into mongo shell. And they can make a new one in 2 seconds. So whats the point of that? I made a small list of word fragments I don't want people using that are blocked. Then they use numbers or capitalizes them..

Then there's the just flat out spammers who copy/paste the N word into chat. One eventually crashed the server he did it so hard. I had to a) have a filter to disable observer chat and b) add a debounce to both gen and game chat. That seemed to work.

Then there's the people who intentionally throw games/AFK. First I added a private game and whitelist feature, but that doesn't scale well. Then I added a karma system where if 4 or more players (5-10 can play per game) hit a report button that person takes a hit and temp ban (up to perm ban) from playing. 1st off, that requires players to pay attention/read release notes. 2nd off, the griefers then just make a new account..

Now I've been hearing reports of bots. Yes, bots, for my creative common licensed game that has no real rewards besides "if you play enough your name is different colored". I mean really? Also unsubstantiated reports of cheating/dual screening.

So this week I'm adding logging of IPs to both signup and signin. I need a interval function that checks not only that new accounts don't have the same IP as a current account but that no two logged in accounts share the same IP.

But as far as I can tell there's no easy solution other than ****ing mods and a mod page right? There's a decent number of regulars who want this to be a good game so I'm sure they'll deliver but come on internet this is why we can't have good things.

I'm going to guess that eventually my $10/month DO will get hit by LOIC or something similar and then that'll be the end of it unless I spring for cloudflare or whatever the solution to that is. IDK.. whole thing is pretty offputting.
wow that sounds awful.

verifying identity, just to the point of uniqueness and without being invasive, needs a better solution than those available to us. couple imperfect ideas i've used in the past that may repel some of your trolls (though sadly some real users too, but if it gets bad enough may be worth it):

verify phone number (send sms confirm link via twilio or similar)
force low-permission facebook/google account link to create account. (both of them make it at least somewhat annoying to create fake accounts, so you'll effectively be offloading work to them)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 03:43 AM
Quote:
Originally Posted by kerowo
I have lust in my heart for the space gray 27" super iMac Pro starting at only $4999.
Cheaper than what I just built.

Quote:
Originally Posted by gaming_mouse
wow that sounds awful.

verifying identity, just to the point of uniqueness and without being invasive, needs a better solution than those available to us. couple imperfect ideas i've used in the past that may repel some of your trolls (though sadly some real users too, but if it gets bad enough may be worth it):

verify phone number (send sms confirm link via twilio or similar)
force low-permission facebook/google account link to create account. (both of them make it at least somewhat annoying to create fake accounts, so you'll effectively be offloading work to them)
There is a reason that chat isn't common and it isn't because someone can't over engineer a solution to a problem that shouldn't exist.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 03:47 AM
Quote:
Originally Posted by Mihkel05
There is a reason that chat isn't common and it isn't because someone can't over engineer a solution to a problem that shouldn't exist.
i'm not clear, are you saying public chatrooms are just a bad idea, period?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 06:34 AM
Quote:
Originally Posted by gaming_mouse
i'm not clear, are you saying public chatrooms are just a bad idea, period?
Yes.

The amount of engineering to going into a basic obs chat (which generally serve no purpose other than to waste your time and provide an avenue for spammers/griefers to do their thing) is absurd. Unique ID, filtering, karma system, throttling, etc. And this is just to prevent basic abuse much less drive desired outcomes. (The magical "engagement" that people think this fosters.)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 08:20 AM
Quote:
Originally Posted by kerowo
I have lust in my heart for the space gray 27" super iMac Pro starting at only $4999.
Is this the first apple shipping with 32GB ?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 09:28 AM
Not sure, haven't been tracking hardware for awhile. Thought they said the mac book pros could go that high.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 10:59 AM
Quote:
Originally Posted by suzzer99
Over time this should become less and less frequent to the point it almost never happens, or else you're doing something wrong.
Can you please extrapolate on why that is? Thanks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 11:01 AM
Well Grues games is definitely going to attract the 4chan alt righties because there's a political element to it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 12:07 PM
Quote:
Originally Posted by OmgGlutten!
Can you please extrapolate on why that is? Thanks.
Over time you should be getting your personal machine in sync with the dev environment. If you let it happen twice you probably didn't try hard enough after the first time, or your environment is changing without notice which is also bad.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 07:55 PM
Suppose that I have written two solutions to an exercism.io problem that both pass all the required tests. now i want to see which solution is faster.

theoretically, how can i go about testing 'em to see which one is faster?

when i run them in my IDE, i get a wide range of time responses just running the same code. so i might run it five times and get .34s, .45s .7s .29s .98s.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2017 , 11:40 PM
A typical solution is to run several times and take the minimum. The min should represent the best your algorithm can do - higher values are most likely from fluctuations outside your control - other processing getting swapped in, disk activity, etc. It also can help to increase the amount of times your algorithm runs per execution, because there's some "startup cost" to starting any program you write, especially if it's a scripted language (python, ruby, perl, whatever) that can be very variable
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2017 , 07:39 AM
Definitely agree about running many times (and with varied input), but I don't think I've seen the minimum being used to compare algorithms before. Depends on the use case, but typically I see/use median, 95th percentile, 99th percentile, or possibly mean.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2017 , 09:40 AM
Quote:
Originally Posted by Larry Legend
Just gave a presentation to our class on redux and killed it.

Feel like I genuinely was able to get more than half the class understanding it in my 15 mins.
redux is pretty awesome. really like being able to save state.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2017 , 10:11 AM
Great post today about stock options

https://danluu.com/startup-options/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2017 , 11:38 AM
Quote:
Originally Posted by OmgGlutten!
Suppose that I have written two solutions to an exercism.io problem that both pass all the required tests. now i want to see which solution is faster.

theoretically, how can i go about testing 'em to see which one is faster?

when i run them in my IDE, i get a wide range of time responses just running the same code. so i might run it five times and get .34s, .45s .7s .29s .98s.
whatever language you're using will have benchmarking facilities, or else third party libraries that provide them. those facilities will run the code blocks you're comparing many times and average them. you could write your own version of that, ofc.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2017 , 06:57 AM
Just wondering theoretically if it's possible to count the assembly instructions or something to get a consistent and completely objective result?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2017 , 07:05 AM
Quote:
Originally Posted by Gullanian
Just wondering theoretically if it's possible to count the assembly instructions or something to get a consistent and completely objective result?
It's probably one of those things that IS theoretically possible - but is practically impossible with our current knowledge / technology.

It's not just assembly instructions - it's also how the instructions are able to be processed/optimized by the hardware. The actual data being processed would influence the result as well. Ordered or mostly-ordered data might perform very differently than random data. Things like resource usage would matter as well. A resource intensive algorithm might perform better theoretically based on pure code - but perform poorly in practice because of the machines the its running on or based on other programs that are running.

I think there are just too many factors for us to account for to get a consistent and completely objective result in most cases.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2017 , 09:19 AM
Sounds like a job for machine learning! Let the machines tell us how fast they are, what could go wrong?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2017 , 10:53 AM
Quote:
Originally Posted by jjshabado
Definitely agree about running many times (and with varied input), but I don't think I've seen the minimum being used to compare algorithms before. Depends on the use case, but typically I see/use median, 95th percentile, 99th percentile, or possibly mean.
I do wonder how much this matters though. The numbers he's showing seems within a typical deviation and I'm guessing this is all small inputs. Taking minimum(A) -vs- max(B) would be bad, of course.

Discounting manually checking Big O, etc.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-08-2017 , 11:00 AM
I first heard of the idea of using the min from the python timeit module docs, and it makes sense to me - provided, I guess, that each time you run it, it's doing "the same thing", like, sorting more or less the same list, or whatever. If you're randomly choosing the length of the list or the order of the list, then no, something like average will be more useful.

But if you're doing "the same" thing over and over, then the minimum should represent the best the algorithm can do, without pollution from other things in the system you don't have much control over.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards ? Splash Pots ? CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m