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

04-22-2017 , 04:57 PM
Not quite sure how to parse those three queries, but it seems possible the first (whatever "myquery" in the where clause is doing) just calls rand() less often (than say the third which has to call it on all rows). Probably need to look at some explains to be sure.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 05:19 PM
Quote:
Originally Posted by RustyBrooks
Every entry in table B has an entry in table A. But there can be many Bs for each A. In theory, each A could hold a large amount of data - but in practice they don't. That is, each entry in A has a description, title, and a few other things, but 99.9% of them have no description or title.
Definitely break the title / description into it's own table if you can. Those nulls are a lot of memory and likely causing a lot of speed issues.

I know it's counter to conventional wisdom, but I've found normalizing as aggressively as possible will help a lot with speed. I basically like 4nf and k->v tables, then denormalize after that. Table width has a large impact, IME.

Quote:
This would be easier than denormalizing and probably faster. But if I'm going to do this, I think it would be even easier to just make an index table. Like say there are 5 columns I search. For each row, I add 5 rows to the index table. Each row has a search value, type, and the id of the row it came from (so I can eliminate duplicates)

I'll have to still do full table scans of the index table, and it'll be 5x as many rows, but the data will be much more compact in the sense that it'll only contain fields that I'm searching, which might help.
It sounds possible, You could probably just run an after insert query and update the table accordingly.

****

Order by / limit is a general little trick for speeding up "most recent" queries.

http://use-the-index-luke.com/sql/pa.../top-n-queries

The speed up could be a bug if you aren't inserting smaller numbers in the later rows of the table.

edit to add this link, regarding like queries.

http://use-the-index-luke.com/sql/wh...ormance-tuning

Last edited by daveT; 04-22-2017 at 05:24 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 05:20 PM
Anyone know at a high level how deploying a docker-compose app works with AWS?

I have 2 docker based "apps" using docker-compose, one is rails + postgres, one is sinatra + dynamodb.

So locally, I just run
Code:
docker-compose up
to develop, which builds a local dynamodb/postgres instance for the apps to interact with. But in production AWS I imagine Id be connecting to RDS for postgres and AWS already handles dynamodb, so neither of these local containers are needed. Is there some normal way to handle this? I imagine it quite common, but pretty much every AWS/Docker tutorial doesn't really mention working with a DB image.

Sorry for word soup, just messing around with this stuff atm, trying to find best practices
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 06:28 PM
Quote:
Originally Posted by iversonian
Larry, what do the best students in your class have in common? Something that I might be able to tell from talking with them for an hour?
This is something I've been thinking a lot about.

I'm not sure if all bootcamps are similar to General Assembly, but I think they likely are.

If I was interviewing someone from a bootcamp I would look to make the discussion conversational and not really let them realize the questions I'm asking conversationally are the things I am looking for, but people who 'get it' will understand why you are doing it.

What you want to find out is if they are one of the people who others go to for help. There are 4-5 people in our class who are helping others a lot. The other day we had 2:30 of free time to work on whatever and I ended up using the majority of it helping the guy next to me.

When the 4-5 helper people need help they read the documentation, ask each other, and ask instructors, in that order. These same people are also the ones who are continuing to improve their projects after it was due. On average, these are the people who I would target if I'm hiring from a bootcamp. Someone who can explain how they built things, "built a few functions, one that does X, Y, Z, etc. etc." Some thought process about why they built them that way, ways they might be able to improve them.

There are then 2-3 people who work more independently and figure out ways to get things done quickly, can explain why their stuff works, but may not be able to look at someone else's code and understand exactly how it works. These people impress me because when I'm not sure what to do I end up writing things out and reading to get ideas. They seem to just brute force right away and end up with lots more code, that isn't efficient, but that does provide a solution. I think these people might be hard to distinguish but would be potentially great hires. You have to help them build things in a way that conforms to your team, but they have natural ability to solve problems that is awesome.

There are then about 50% of the population who probably intern/very junior level. They will be coached up on what to say but it's going to be very superficial. A lot of these people probably shouldn't be straight up developers/engineers. I can't imagine you would really be tricked that they are one of the other groups. It should be pretty clear.

The final 10-20% are kinda hopelessly lost and would be good at like a .edu where the department has a website that hasn't been upgraded in 10 years and they are looking to build or maintain a new one.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 06:43 PM
Does previous work/educational experience have predictive power for what group they would fall into?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 06:51 PM
Quote:
Originally Posted by PJo336
Anyone know at a high level how deploying a docker-compose app works with AWS?

I have 2 docker based "apps" using docker-compose, one is rails + postgres, one is sinatra + dynamodb.

So locally, I just run
Code:
docker-compose up
to develop, which builds a local dynamodb/postgres instance for the apps to interact with. But in production AWS I imagine Id be connecting to RDS for postgres and AWS already handles dynamodb, so neither of these local containers are needed. Is there some normal way to handle this? I imagine it quite common, but pretty much every AWS/Docker tutorial doesn't really mention working with a DB image.

Sorry for word soup, just messing around with this stuff atm, trying to find best practices
Too late to edit:
https://docs.docker.com/compose/exte...ample-use-case

seems like a decent start
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 07:49 PM
Quote:
Originally Posted by PJo336
Anyone know at a high level how deploying a docker-compose app works with AWS?
I haven't read your link yet, but the short answer is "it doesn't"

docker-compose is used to orchestrate the starting of several containers. You don't need to use docker-compose in AWS to do this, you just use AWS.

You can do it manually by setting up a task for each container, referencing the container by it's docker url, and optionally setting the entry point if you don't want the default one. You can also specify env vars and stuff like that.

The "good" way to do it, if you want to call it that, is cloud formation. You make a giant json file that describes your whole service, and you can deploy that via the API (that's what we do) or via the aws web interface.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 08:54 PM
Quote:
Originally Posted by iversonian
Does previous work/educational experience have predictive power for what group they would fall into?
The closer this is to a horizontal move or some notable previous success in something. A discussion I had with a classmate on friday was that people who have the attitude "wow software developers make so much money I should learn to do it" seem to be less strong than the "I've always loved technology and I would regret not learning this", "it's about time i finally get more technical because UI design without code is limiting" type people.

But there is at least one person in the class who may be considered an underdog on paper that would be a really solid hire. She was a college bball player tho and seems very sharp and confident so she would likely be pretty obviously competent based on that, and would be able to explain her code well and methods of solving problems.

I find the biggest challenge for people is probably reading documentation. I think once you can use documentation, stack overflow, github, etc. To quickly figure out what you need to know, it seems like you are on a very hirable path.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 11:18 PM
'await' keyword looks pretty badass - https://derickbailey.com/2017/04/18/...ons-heres-why/

Especially if you can write your code so all your error handling bubbles up to some top level.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-22-2017 , 11:22 PM
I immediately close blog posts that use es5.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 12:53 AM
var tags are about as cool as those big-ass brick HP laptops we make the contractors use
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 02:30 AM
Is everyone using `let` now? I feel behind the times.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 02:48 AM
const or let, never var

no more breaking out of block scope

Can anyone think of a legitimate coding reason to use var (that doesn't involve interacting with some legacy code you can't change)?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 02:54 AM
Quote:
Originally Posted by RustyBrooks
I haven't read your link yet, but the short answer is "it doesn't"
Arg, crummy to hear when its my task at work lol.

Quote:
docker-compose is used to orchestrate the starting of several containers. You don't need to use docker-compose in AWS to do this, you just use AWS.
So are you saying Docker really only serves its purpose locally and on dedicated raw VM type deployments like Digital Ocean?

Quote:
The "good" way to do it, if you want to call it that, is cloud formation. You make a giant json file that describes your whole service, and you can deploy that via the API (that's what we do) or via the aws web interface.
Im a bit confused here, you are talking about without Docker correct?

Heres pretty much the entirety of my assignment:
Use Docker and Elastic Beanstalk to deploy a Sintra app to production

k.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 10:48 AM
Quote:
Originally Posted by suzzer99
'await' keyword looks pretty badass - https://derickbailey.com/2017/04/18/...ons-heres-why/

Especially if you can write your code so all your error handling bubbles up to some top level.
I haven't used async/await much in ES/JS yet but I've been using it in C# for some time and it's insane how useful it is. I was somewhat skeptical at first since I've always promises very natural and explicit promise-chaining didn't seem like a big burden but once you get used to async/await, explicitly chaining and aggregating promises, not to mention error handling, feels like being back in the stone age.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 11:34 AM
Quote:
Originally Posted by Larry Legend
So in this bootcamp they are spending a lot of time teaching us about classes/inheritance/prototypes, etc. (Which are also a major source of wasted time as these concepts are pretty intuitive and shouldn't take much explanation, but people ask for this stuff to be repeated 10 times to them).

I mentioned this to my friend and he said he never uses them. He said this is basically what OOP is, and he doesn't do it, but I shouldn't take his word for it, I should ask someone who loves OOP and think for myself.

My instructor basically responded that there is a lot of functional programming vs OOP out there. Which makes sense, but it seems like the "best" pattern would be to do some of both. So surely there are times to use both?
that stuff is most certainly not intuitive to most ppl. I had to practice it some to understand it but I do learn better by doing, so I sat down and would try to model things in object oriented fashion.

and I would def disagree that classes and inheritance arent useful. like, I would be shocked if the smarter and more experienced ppl in here agreed with that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 01:12 PM


The scary part to me is that this is even possible. I though Apple completely sandboxed all apps?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 01:21 PM
Quote:
Originally Posted by Victor
that stuff is most certainly not intuitive to most ppl. I had to practice it some to understand it but I do learn better by doing, so I sat down and would try to model things in object oriented fashion.

and I would def disagree that classes and inheritance arent useful. like, I would be shocked if the smarter and more experienced ppl in here agreed with that.
Not sure how you've planned your Sunday, but this question on Google is a massive rabbit hole full of nuanced arguments.

Be sure to click every link featuring the writings of someone named Alan Kay, who doesn't like the term object-oriented.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 03:52 PM
can you post the links dave? or am I missing something...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 04:17 PM
Quote:
Originally Posted by PJo336
So are you saying Docker really only serves its purpose locally and on dedicated raw VM type deployments like Digital Ocean?
No, I'm saying docker-compose is really only used locally. I mean, there's nothing to stop you from spinning up an EC2 instance, installing docker and docker-compose on it, and running docker-compose there. But I don't think that's how most people do it.

Quote:
Im a bit confused here, you are talking about without Docker correct?

Heres pretty much the entirety of my assignment:
Use Docker and Elastic Beanstalk to deploy a Sintra app to production
No, with docker, but not directly. AWS supports starting up instances that just point to a docker container and start it. It's called "EC2 Container Service" or just "ECS". It doesn't really take the place of docker, it takes the place of docker-compose.

Cloud Formation is basically a config file that orchestrates all the nonsense behind this but you can also create all the config manually yourself in the interface. You can also start with manul and move to cloud formation, because the manual config makes json config files for you under the covers.

I don't know much about elastic bean stalk, tbh. In fact I don't do the above stuff myself, except that I'm responsible for managing the cloud formation templates for the services I work on. Someone else does the actual interfacing with amazon part.

Locally, we use docker-compose. We have the ability to both use the exact same containers we use in prod, or to use subtly different ones. For example we can spin up a system with the whole 9 yards - nginx, uwsgi running our python app, etc. Or, I can just start a simple container that just runs a debug version of django. For day to day stuff I do the latter. When trying to pin down a prod problem I tend to do the former.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 04:28 PM
Quote:
Originally Posted by Victor
can you post the links dave? or am I missing something...
You could start here:

https://encrypted.google.com/search?...%20programming

The topic is wide-reaching and there are great arguments on both sides of the debate. An excerpt from the perl.org link:

The Java Creator was once asked what he would change when he reinvent Java today. He answered that he would remove inheritance. Also Google's Go Designer did not implement inheritance. And now that leads to the question. What is wrong with inheritance?

I would consider the creators of Java and GoLang pretty smart people. Alan Kay is credited at the inventor of object-oriented programming.

It's a difficult topic and not one that I really know the answer to. I use polymorphism*, so I guess I'm on the "pro" side.

*and yes, polymorphism is a part of FP.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 09:32 PM
Quote:
Originally Posted by Victor
that stuff is most certainly not intuitive to most ppl. I had to practice it some to understand it but I do learn better by doing, so I sat down and would try to model things in object oriented fashion.

and I would def disagree that classes and inheritance arent useful. like, I would be shocked if the smarter and more experienced ppl in here agreed with that.
Interface inheritance ('implements' relationship) is useful and should be used all the time. Implementation inheritance ('extends' relationship) is occasionally useful but should generally be avoided by application developers in most cases. If you're developing frameworks/libraries though, avoiding implementation inheritance can be difficult at times though it depends on the range of meta-programming facilities available in the language. My experience is that generally code reuse is code reuse and most of the problems with implementation inheritance isn't with OOP or inheritance, but with code reuse in general - junior and mid-level engineers in general try too hard to reuse code when it's inadvisable and result with abstractions that are fragile and lack meaningful boundaries.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 10:34 PM
Quote:
Originally Posted by Victor

and I would def disagree that classes and inheritance arent useful. like, I would be shocked if the smarter and more experienced ppl in here agreed with that.
i probably agree with that, though the specifics of what you mean matter a lot.

but i'm comfortable with the statement that implementation inheritance (ie, inheritance as a form of code re-use) is at best never necessary, and in fact usually harmful.

if you want to post some (simplified) version of code where you think inheritance was a necessary or elegant solution, i'm happy to show you how i'd rewrite it.

this video is a decent short summary: https://www.youtube.com/watch?v=wfMtDGfHWpA
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 10:37 PM


Which begs the question - how long does it normally take to boot an Open SSH server? Ugh.

I had a brief flirtation with wanting to learn this stuff at a nuts and bolts level (linux, CI/CD, docker/kubernetes). I think it's over now. I'll stick with knowing what I want from the developer POV, and let someone else fight with the scripts and VMs.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-23-2017 , 10:38 PM
Quote:
Originally Posted by gaming_mouse
i probably agree with that, though the specifics of what you mean matter a lot.

but i'm comfortable with the statement that implementation inheritance (ie, inheritance as a form of code re-use) is at best never necessary, and in fact usually harmful.

if you want to post some (simplified) version of code where you think inheritance was a necessary or elegant solution, i'm happy to show you how i'd rewrite it.

this video is a decent short summary: https://www.youtube.com/watch?v=wfMtDGfHWpA
Heh - I was going to post that same vid. That guy is great.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m