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

02-06-2019 , 12:52 AM
Quote:
Originally Posted by blacklab
yeah, I accidentally removed a bracket when shortening it up for easy consumption.

I've been parsing json for a while and had never seen something like that where there was data in a key name rather than a key. Just seemed wrong and with 40,000 items in the json it adds 40,000 rows of data, just seems like a waste.

Speed or size really shouldn't be an issue as this will just run once a week. I politely asked if we can change it, but no big deal if they don't.
Yeah it's clearly designed to be able to pluck an item by ID - like a noSql DB.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2019 , 12:55 AM
Quote:
Originally Posted by RustyBrooks
I don't so much think that "CS degrees are worthless" as I do that "CS degrees are more like math degrees (or maybe physics) than engineering"

It's a bit like giving a guy a degree in physics and then sending him out to build a bridge. He's got all the elements he needs, in a way, but he's not really prepared for the demands of the job, and he knows a lot of stuff that isn't really going to be useful in this case, but was hard to learn.
Yeah. A concise way to put this is that CS is taught as an academic disclipline but for the vast majority of people in the field, it's actually an applied discipline.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2019 , 10:53 AM
suzzer you are wise beyond your years.
They do use this file in another application in the exact way you described.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-06-2019 , 11:02 AM
I think in HashMap.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 12:30 AM
re react: Apparently fetch doesn't really work in IE. What do you guys do? Just forget about IE? Or why not just use XMLHttpRequest, which seems compatible with everything?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 01:04 AM
It's kinda painful - you basically have to write your own pipeline and error-handling framework. I don't think it handles CORS out of the box.

Just use this polyfill: https://github.com/github/fetch

Fetch also works in node too - so you can move code between the front and back end if desired.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 01:12 AM
Yeah, I guess so. The syntax didn't seem like that big a difference, but I'm trying it and running into the CORS problem. Kind of amazing that cross browser problems are still a thing with something so common.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 01:14 AM
Fetch is relatively new. IIRC there used to be a big issue with XmlHttpRequest - something you had to do differently on IE. Or maybe even a different command on IE.

Stuff like this is why frameworks came into existence. The second you find yourself writing "if (isIE)" - it's time to start looking for a framework.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 01:23 AM
I haven't been able to get back to this project for a bit, but this is where I was using FormData and I'm changing this to not use FormData because it didn't work on IE...arg. Was there a polyfill for that too?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 01:24 AM
Yes. I thought we posted it. https://github.com/jimmywarting/FormData#readme
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 01:30 AM
Could be. I will get to that later. Some of my posts make more sense as gets anyway. And I'll make sure my forms are real forms - as discussed in my last code review .
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 08:20 PM
Quote:
Originally Posted by microbet
re react: Apparently fetch doesn't really work in IE. What do you guys do? Just forget about IE? Or why not just use XMLHttpRequest, which seems compatible with everything?
I forget about IE.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 09:50 PM
At least it's not as bad as the old days when people were stuck on IE6 or w/e with no way to upgrade w/o upgrading Windows.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 09:52 PM
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-07-2019 , 09:53 PM


We finally got going on Slack. I'm enjoying trolling my server-bound colleagues.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 04:25 AM
I decided to fire off a few resumes down to some companies in LA. And out of ten apps I already got 3 request for interviews with the recruiters the next day. It’s amazing how having just two years of experience you get so many more replies. Before as a new grad, I was lucky to get a 10% response rate.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 01:04 PM
So I have a bunch of items in an unordered list that has a scrollbar when there are too many elements and when you scroll to one end or the other an API call is sent and the next item in that direction is added to the list. I don't just put all the elements in the list to start because some day this will incredibly popular and have millions of items.

On Chrome when you get to the bottom of the scroll it gets all bouncy. It's like the scroll bar is an AR-15 and the bottom is a bump stock. This doesn't happen on the top and it doesn't happen on either top or bottom on Firefox.

Anyone run into something like this and have a good solution?

Google suggests that people have run into it and not had a good solution. It's not like this is IE and I can just say "forget about Chrome". I'm planning on doing something so that there is no scroll bar and I accomplish scrolling by onClick or onMouseover something instead, I guess.

It may be that I can do something as far as timing on adding and removing items from the list.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 01:22 PM
I don't know the answer but it reminds me of a very common problem with hardware buttons, which is that at the time you press and release them, they will actually bounce between off and on rapidly. So whatever is responding to the button should not respond instantly, but instead should wait a tick. This is called "debouncing" and basically you wait until you detect that the button has been pressed for a complete interval. Usually pretty short, 5 or 10 milliseconds is fine.

So maybe instead of triggering loading the next one the instant you hit the bottom, wait until you've "been" at the bottom for a fixed short period and then load?

No idea if it'll help or not. Just a thought.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 01:35 PM
Quote:
Originally Posted by Barrin6
I decided to fire off a few resumes down to some companies in LA. And out of ten apps I already got 3 request for interviews with the recruiters the next day. It’s amazing how having just two years of experience you get so many more replies. Before as a new grad, I was lucky to get a 10% response rate.


Why are you leaving your current job?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 01:41 PM
Quote:
Originally Posted by RustyBrooks
I don't know the answer but it reminds me of a very common problem with hardware buttons, which is that at the time you press and release them, they will actually bounce between off and on rapidly. So whatever is responding to the button should not respond instantly, but instead should wait a tick. This is called "debouncing" and basically you wait until you detect that the button has been pressed for a complete interval. Usually pretty short, 5 or 10 milliseconds is fine.

So maybe instead of triggering loading the next one the instant you hit the bottom, wait until you've "been" at the bottom for a fixed short period and then load?

No idea if it'll help or not. Just a thought.
That's a good idea and even if it doesn't work it may be helpful. I put a little sleep function in there and if I make it sleep for half a second I can watch the bounce in slow motion. It might be easier to fix if I can watch it this way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 01:49 PM
Quote:
Originally Posted by RustyBrooks
I don't know the answer but it reminds me of a very common problem with hardware buttons, which is that at the time you press and release them, they will actually bounce between off and on rapidly. So whatever is responding to the button should not respond instantly, but instead should wait a tick. This is called "debouncing" and basically you wait until you detect that the button has been pressed for a complete interval. Usually pretty short, 5 or 10 milliseconds is fine.

So maybe instead of triggering loading the next one the instant you hit the bottom, wait until you've "been" at the bottom for a fixed short period and then load?

No idea if it'll help or not. Just a thought.
When I've run into problems similar to what micro is describing in the past they were examples of this kind of debouncing problem. That is, I had some logic that was adding or removing something from the DOM based on scroll position, but if the threshold was near the bottom of the scrollable page it could bounce between states rapidly. Debouncing the events should help.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 02:22 PM
I have a node express question.

I get back a nested object from an api and I need a deep piece of data.

heres the structure

body:{
token: 'somestring'
_links:{
target:{
href: 'anotherSTringIWant'
}
}
}

So I can get the token easily enough with

ParseJsonString.getValue(body, 'token', next)

But getting the nested string does not work the way I would expect

ParseJsonString.getValue(body, '_links.target.href', next);
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 02:32 PM
I've not used Express but the docs suggest that you might just use a JSON parser on the raw body, and then refer to <parsedBodyVar>._links.target.href. Once you've deserialized it you don't need a helper method to refer to nested data. I'm not sure if Express provides a helper function for getting a deep path into an object, although libs like lodash have that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 02:46 PM
Are you using body-parser?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-08-2019 , 02:50 PM
I figured it out. was doing something stupid.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m