Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

08-21-2017 , 12:14 AM
Quote:
Originally Posted by RustyBrooks
There is so much about mysql I don't know. I need to find a community of experts or some kind of really good tuning instructions either online or in a paper book.

Today I ran into something weird... For a while if you had a query like
select * from users where username='foo' or user_id in (2, 3, 4)
and you had an index for username and an index for user_id, it wouldn't use both of them. Supporting both indexes in OR was added about 5.0 I think. Even now it doesn't always choose properly.

But I found out today that my query, which is more like
select * from users where username='foo' or user_id in (select user_id from other table)
it DOESN'T use the user_id index.

Now I'm getting ready to try a bunch of different approaches, like, 2 queries with a union, hard-coding the results of the in-clause into the query, and so forth, and I guess see which ones shake out as the best with my data.
Try forcing MySQL to use the index on that query is see if the optimizer is going loopy or if it is choosing correctly. https://dev.mysql.com/doc/refman/5.7...dex-hints.html

Some indexes aren't going to fit in the allocated blocks and could be too expensive for an index to be used.

Here's a bit on optimizing:

https://dba.stackexchange.com/questi...ended-settings

They also reference this git here. Seems like it's maintained: https://github.com/major/MySQLTuner-perl
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-21-2017 , 12:34 PM
When debugging things in react it's pretty awesome how there are so many levels of complexity to the point the solution you find on SO/github rarely relates directly to what you are doing.

It seems like for every tricky issue you come across you get to be pretty creative and find cool solutions vs being able to copy/paste code and expect it to work.

That said, I feel like there's a major opportunity to write blog posts about this stuff. Any post you read from before 2017 is usually not even still relevant.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-21-2017 , 01:34 PM
Quote:
Originally Posted by Larry Legend
When debugging things in react it's pretty awesome how there are so many levels of complexity to the point the solution you find on SO/github rarely relates directly to what you are doing.

It seems like for every tricky issue you come across you get to be pretty creative and find cool solutions vs being able to copy/paste code and expect it to work.
That's a bug, not a feature.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-21-2017 , 07:19 PM
Pretty sure I've fixed the mysql hanging transactions problem. We have a celery backend that runs async tasks. One of those tasks uses mysql.

Unlike the webservers that have an implicit cleanup after every web request, a celery worker can and does hold on to a sql connection for a long time, and if there's no explicit close, the rollback never occurs.

So I added a python context manager and added it to every celery task. I'll have to remember to keep on top of those. Researching whether there's a way to have an automatic on-celery-task-complete hook.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-21-2017 , 07:28 PM
And there is. I should have looked first.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 12:11 AM
random annoyance: in numpy the interface for an n-zero array is np.zeros(n), but i keep typo'ing it as np.zeroes(n)

i LOVED heroes of might and magic growing up, and never actually had to pluralize zero in writing until using numpy...figured "zeroes" would be same as "heroes", but nope, apparently "zeros" is actually more common. ****ing english

https://engli******ackexchange.com/q...l-form-of-zero
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 12:13 AM
I have seen zeros and zeros and zeroes before. Don't get me started on indexes vs indices.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 09:38 AM
Would it be possible to automate running a search, clicking a few links, seeing if a checkbox is selected and if a page contains a string, and returning to the search box, iterating over a list of search terms?

I feel like Burp or Zap proxies could probably handle most, if not all, of this.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 10:53 AM
Quote:
Originally Posted by Noodle Wazlib
Would it be possible to automate running a search, clicking a few links, seeing if a checkbox is selected and if a page contains a string, and returning to the search box, iterating over a list of search terms?

I feel like Burp or Zap proxies could probably handle most, if not all, of this.
https://en.wikipedia.org/wiki/Headless_browser
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 12:12 PM
Quote:
Originally Posted by Noodle Wazlib
Would it be possible to automate running a search, clicking a few links, seeing if a checkbox is selected and if a page contains a string, and returning to the search box, iterating over a list of search terms?

I feel like Burp or Zap proxies could probably handle most, if not all, of this.
There are lots of test frameworks that do this. Robot, Protractor, Selenium, etc.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 12:45 PM
Cheers, thanks guys
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 01:17 PM
Quote:
Originally Posted by RustyBrooks
I have seen zeros and zeros and zeroes before. Don't get me started on indexes vs indices.
Zero is one of those many English Language anomalies where 'os' and 'oes' plural forms are both correct.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 01:39 PM
English is a fairly crazy language. Consider indexes vs indices. indices is "correct" if you go by the Latin rules. indexes is acceptable also. But the very notion that you would borrow a word from a language, and then use THAT language's rules to form plurals is bonkers. Most other languages do not do that - they borrow the word, usually bastardize it to fit their phoneme set, and then use their own language's rules to conjugate, pluralize, etc. Which makes those languages easier, because there are actually rules. [I should say, easier in that sense - many languages are as hard to learn, or harder, than english]
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 04:25 PM
Had an interesting conversation with a doctor. May be a business idea for you enterprising types.

Inventory in doctors offices and hospitals is a complete and utter mess. They want the system to do the following:

Count bottles from N to zero

Count the pills in the bottles from N to zero

Use a scan gun to read UPCs.

Yeah, even the last one isn't even possible to find. Get the biggest system out there, and they require you to scan SKUs, which is... I'd say this is common sense, but a shocking amount of inventory systems in all levels in all industries fail at this simple realization.

He was also complaining that many of these systems brag about using open source tech, yet they are not allowed to run queries along the data nor can they access the data. They need to generate reports for all sorts of things, and it didn't makes sense to him that he would have to wait forever for the companies to create a report that was likely going to be wrong and outdated by the time they finished. What is the point of bragging about open source if they hold everything hostage? Got me.

He said that everything is done by hand since the options are basically Walmart-style systems or nothing at all. He also mentioned what I said above, about how the low-paid people actually know what's going on, yet these companies seem more inclined to be ignorant of what their system should actually be doing and refuse to talk about pain points. Overall, it is cheaper and more effective to use pencil and paper.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 05:19 PM
Ok, you've got the start of requirements for one customer, what about the next customer? What about legal stuff, is this tracking who removed pills from bottles? How many scanners are needed? Just because it anecdotally sounds easy doesn't mean it's remotely easy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 06:20 PM
Wasn't saying it was easy or hard, just saying that none of the products worked as advertised. If you are going to build a product for a specific domain, at least know what that entails. That was his entire rant. Should it really easier for them to use pencil and paper, along with data entry into Excel?

Why is tracking users with N scanners difficult?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 07:52 PM
I work at a healthcare tech company and have worked in healthcare tech related companies previously.

Anyone trying to go into the industry should have their heads examined.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 07:58 PM
Quote:
Originally Posted by RustyBrooks
English is a fairly crazy language. Consider indexes vs indices. indices is "correct" if you go by the Latin rules. indexes is acceptable also. But the very notion that you would borrow a word from a language, and then use THAT language's rules to form plurals is bonkers. Most other languages do not do that - they borrow the word, usually bastardize it to fit their phoneme set, and then use their own language's rules to conjugate, pluralize, etc. Which makes those languages easier, because there are actually rules. [I should say, easier in that sense - many languages are as hard to learn, or harder, than english]
I once spoke to a chick in Europe who spoke Dutch, French, Flemish, English, German, Indonesian and Mandarin fluently, and Italian and Spanish non-fluently. I asked her what the easiest language to learn was and she said English, with Indonesian a close second. It makes sense that Indonesian is easy to learn because it is a lingua franca. But yeah, despite the oddities of English it is apparently not that hard.

It does depend on what language you're coming from though. I spent a week once doing social English speaking with Chinese people learning English in China. While Mandarin is hard coming from English, I was struck by how much harder English is coming from Mandarin. Imagine trying to learn verb conjugation rules coming from a language which doesn't even have verb tenses.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 08:27 PM
The hard parts about english are spelling and pronunciation. The grammar and verb tenses are usually much simpler than other languages.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 09:38 PM
Quote:
Originally Posted by Larry Legend
I work at a healthcare tech company and have worked in healthcare tech related companies previously.

Anyone trying to go into the industry should have their heads examined.
Very true. Just google GTIN and GS1 and FDA Labeling Requirements to see how complicated the supply chain quickly becomes in the healthcare business.

Keeps me, at least partially, in a job though.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-22-2017 , 11:26 PM
Quote:
Originally Posted by ChrisV
I once spoke to a chick in Europe who spoke Dutch, French, Flemish, English, German, Indonesian and Mandarin fluently, and Italian and Spanish non-fluently. I asked her what the easiest language to learn was and she said English, with Indonesian a close second. It makes sense that Indonesian is easy to learn because it is a lingua franca. But yeah, despite the oddities of English it is apparently not that hard.

It does depend on what language you're coming from though. I spent a week once doing social English speaking with Chinese people learning English in China. While Mandarin is hard coming from English, I was struck by how much harder English is coming from Mandarin. Imagine trying to learn verb conjugation rules coming from a language which doesn't even have verb tenses.
Used to know a Russian who spoke fluent English.

At first, he would brag about how English is the easiest language ever, that it's barely a language at all. "It would take you at least two years to make a sentence in Russian!" He married an Aussie, so had no other option but to use English at all times.

Knew the guy off and on for about 5 years. Towards the end, he was talking about how English is a horrendously difficult language to learn, even harder than Russian. I suppose it's a matter of time and exposure, but that about-face always stuck with me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-23-2017 , 09:54 AM
Following up on my last comment.

When using a lot of React packages together (Redux, Redux Form, React Router, React Router Redux, etc.) it's amazing how your config becomes seemingly unique to the point you can't really use documentation other than as a research and learning vehicle to figure out the underlying nature of what you're trying to do.

I feel like I'm learning so much so fast, but also a bit feeling like I'm learning our specific way of doing things and need to learn the underlying tech.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-23-2017 , 11:26 AM
One thing at a time, get comfortable with how the company does things then expand. You've got a lot of time unless you're thinking of doing a lot of job hopping...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-23-2017 , 12:01 PM
Nah I'll be here for a while. My boss is giving me a side project soon using d3, started learning that and it seems awesome and I wanted to learn it so that's cool.

Attaching a ref so you can control focus () in a context with all of the above and a separate renderField function that is detached from the component seems not very straightforward.

If anyone can point me to using renderField as a standalone component and passing it props and then invoking it from a redux-form and this working to attach a ref, it would be great.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-23-2017 , 12:48 PM
Almost got it working, this might be worth of a blog post.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m