« first day (3691 days earlier)      last day (1251 days later) » 
02:00 - 20:0020:00 - 00:00

8:08 PM
Four departments requires a few more intermediary variables
For departments A B C and D, we want a solution with:
U pairs of A/B
V pairs of A/C
W pairs of A/D
X pairs of B/C
Y pairs of B/D
Z pairs of C/D

Find any solution to this system of equations
U+V+W       = A
U    +X+Y   = B
  V  +X  +Z = C
    W  +Y+Z = D
 
Hello
 
Since there are six free variables but only four equations, there are probably many possible solutions
 
is it me, you're looking for?
 
In PyQt5 how can i use a QWidget many times in the same horizontalLayout?
 
Trying to decide whether you can always decompose an N-department problem into an N-minus-one-department problem. "eliminate the smallest department by incrementally pairing it with the largest one(s)" seems like a pretty good heuristic, but I worry it can greedily run into a dead end
Not sure if it's possible to prove one way or the other using only symbolic logic, since you need a dynamic number of steps to eliminate a department
You can't just say "let W = D-A" because you need to account for the possibility that D's population dips below C's halfway through, and you need to start deducting from C instead (WLOG assuming that initially A<=B<=C<=D)
 
8:17 PM
@Kevin four linear equations for 4 unknowns. Odds are looking good.
 
Somehow my algebra powers fail me whenever I have to consider only positive integer solutions
 
set two to zero such that the equations are linearly independent, and invert the matrix on the left-hand side
@Kevin oh right, silly Diophantine
 
diophantine problem, more like elephantine, and I am a circus peanut under its heel
 
i prefer to have the people pair themselves off
 
I have eliminated the people, they are just numbers now
HR will be pleased at how fungible I've made their resources
 
8:19 PM
fyi this was a yelp interview question my coworker had
 
too bad
 
I'm like 75% sure my elimination algorithm would work but I'm annoyed that it runs in O(A+B+C+D+...) in the worst case scenario
 
i wonder if this can be solved using machine learning or neural nets
 
ah, yes
don't forget quantum walks
 
@erotavlas sounds like a bin-packing problem to me. Compute N = total number of employees and pack two bins of size N/2 (where each block is a department of size department_size). Come to think of it, this reminds me of an old Google interview question
 
8:25 PM
Hey @roganjosh - you want to set a time/date to talk about as_blog (beer optional)?
 
I don't think it's NP hard, at least
 
@holdenweb would a controller like a BeagleBone black be any better than a pi or even an arduino?
 
doesn't sound right, bin packing sounds more like the knapsack problem
 
bin packing is a limiting case of the knapsack problem (in which every element has equal value)
 
Read the stuff that Adafruit put out about the NeoPixel. They explain why microcontrollers are better suitesd to the task.
Beaglebone = Linux = not predictably responsive.
 
8:31 PM
actually, the bin packing approach will not find the solutions in which there are three departments of sizes A,B,C such that A+B>N/2 but (A+B)-(N/2) < (N/2)-A
 
Try a close solution then swap random faulty pairs with others to see if you can randomly hit a fit?
 
8:49 PM
@holdenweb Sounds good to me. I will probably have to push back to at least Friday evening (and you perhaps have better things to do on a Friday night. During lockdown, I'm at my laptop anyway :P) because I have a client presentation to finish before then and a couple of evening calls to do through the week. What are you thinking?
 
UK evenings suit me best. ow about a week tonight?
 
That works for me :)
 
@holdenweb even with 2 PRU's to separate the workload from the interruptible cpu?(this is what the BeagleBone has on board to help with this exact problem)
I also tried hooking the strip up to my arduino uno and it has about the same refresh rate
 
I have something to do at 8:30 that night. How about 7:30?
 
9:04 PM
@holdenweb it's a date :) You can message me on my website so we can organise via email? Or I can message you
 
steve@holdenweb.com
What is your website?
 
www.jpilkington.com I've sent you an email, though :) My website is on my SO profile and I was pestering people about it in here earlier this year so thought you'd have seen me asking questions :P
 
@Pandasncode I'm late weighing in on this, but here is a pyparsing version of your data extractor that you might look at for comparison: paste.org/112868
 
@erotavlas et al, here is an implementation of my proposed department pairer. It is "works on at least one test case" certified.
Accolades to anyone that can find an input that gives incorrect output, or to anyone that proves that it is always correct. I will not be doing either of these, as I am sleepy.
Relatedly, I wonder if there's a more efficient way to maintain the sortedness of seq within the innermost while. Decrementing the smallest element is guaranteed to preserve sortedness, but decrementing the largest element could break sortedness, requiring a pop and an insert into an arbitrary point in the list
I suppose literally popping and inserting would be better than sorting, since that's O(N) vs O(N log N). Is a constant time solution possible if I use some kind of heap?
 
@Kevin

       _
      ( |
    ___\ \
   (__()  `-|
   (___()   |
   (__()    |
   (_()__.--|
 
9:19 PM
The heapq module is no good because I need to be able to pop both the smallest and largest values
 
9:31 PM
Hmm, skiplists have average time O(log N) insertion and quick read access to both ends...! Not sure how expensive popping is though.
 
i'll take a look at it later
 
9:46 PM
github.com/google/pasta - "This is still a work-in-progress; there is much more to do. We are working on compiling the tomato sauce. Mario is working on the meatballs"
 
anyone know much about flask?
i keep getting an error log on "/api/jsonws/invoke"
but... there is no API endpoint like that at all, and it's not referenced anywhere afaict
like literally grep returns zero instances of "jsonws" in either the backend code or frontend code
 
I'm going to need quite a bit more context around that to begin to try help
 
makes sense. it's hard because i just have no idea where the error could be coming from. i've got a flask app running on some amazon hardware, w/ logs set up that spit out error messages
and every now and again get: Exception on /api/jsonws/invoke [POST] Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request()

which generically is "this URL does not exist here"
often times this happens if something someone wrote is trying to access a URL in our API that doesn't actually exist
(that is, if i ping [website]/api/pants_on_my_ants --- that error will pop up because pants_on_my_ants is not an existing endpoint)
 
At a high-level guess, it's some proxy. My first searches bring up this
 
So you're saying you're getting a request to that URL and it's not something your public app hosted on AWS makes a request to? That's just random bots making requests to publicly available sites to see if they can find things. It has nothing to do with Flask or Python.
 
9:59 PM
Oh, that ^
 
oh
well that's something i did not consider at all :l i guess i should put some filter, because it's otherwise spamming my logs
is that something i should worry about
 
What do you mean by "Amazon hardware" btw? On AWS?
 
aws yeah (i forgot the acronym for a sec. so i just said amazon hardware lol)
 
10:15 PM
mmm. At first I thought it might be some webhook inside AWS but it looks very loosely affiliated with AWS (on the marketplace here) but that route might exist if you were running it e.g. here
Best guess: testing a vulnerability they found in the library, not your site
 
i think that's a reasonable guess yeah. (ty for the help, it was bugging me for a while and i couldn't find where it could've been coming from)
the idea of some other party trying to query that endpoint outside of what i've explicitly programmed didn't occur to me. it should have lol
 
11:11 PM
@holdenweb I can confirm the issue is somewhere on the pi. I'm running the FastLED library on arduino and am not having any problems with refresh rates using generated data.
 
11:58 PM
@inspectorG4dget I've re-visited this and there are improvements to be made. I definitely stand by making the two tables, but I think there's a better query to be had. I don't think I've set you up badly with that demo, but it sucks for extensibility if you want people to add new categories from a web UI and not touch the code at all.
 
02:00 - 20:0020:00 - 00:00

« first day (3691 days earlier)      last day (1251 days later) »