• Breaking News

    Thursday, April 19, 2018

    The latest trend for tech interviews: Days of unpaid homework web developers

    The latest trend for tech interviews: Days of unpaid homework web developers


    The latest trend for tech interviews: Days of unpaid homework

    Posted: 19 Apr 2018 06:35 AM PDT

    Oracle sends Apple c&d to take down iOS app because it has JavaScript in the name

    Posted: 18 Apr 2018 08:40 PM PDT

    I wrote this to help Web developers learn basics of SQL joins

    Posted: 19 Apr 2018 09:24 AM PDT

    Ahh, joins. The point where you start to realize the true power of the relational database, sort of like Darth Vader and the dark side, but less dark. Let's start with the example we will be following.

    Imagine that you are back in high school. You are walking down the hall and you spot your true love. Everything slows down, your heart starts to race and you can't help but stare at the person. After 2 weeks of thinking about it, you finally decide to ask them out on a date. To your surprise, they agree! Wow this is amazing! I guess wishes do come true.

    To avoid messing up the first date, you ask all your friends to give suggestions on what to do on your first date. So, you make a little tiny survey and send it out to your friends. After a couple of days, you check the results.

    Oh, this is exciting I wonder what the suggestions are going to be like!

    Your database tables look like this:

    Table "user"

    Column Type Modifiers
    id integer Primary key not null
    first_name text
    last_name text

    Table "activities"

    Column Type Modifiers
    id integer Primary key not null
    name text
    user_id integer

    Let's start with looking at some of the data:

    Users table

    id first_name last_name
    1 Pam Beesly
    2 Dwight Schrute
    3 Jim Halpert
    4 Michael Scott
    5 Andy Bernard

    I know what you're thinking, are these people from "The Office", and yes, yes they are.

    The response are coming in super fast and they are hilarious! Just check out some of these suggestions:

    id name user_id
    1 Sky diving 1
    2 Eating ice cream until your stomach hurts 2
    3 Watching old episodes of star trek the next generation 1
    4 Long walks on the beach looking into each others eyes 3
    5 Desserts with lots of peanuts 2
    6 Rock climbing 3
    7 Biking race 1
    8 Eating ice cream until your stomach hurts 1
    9 French desserts
    10 Swimming with the whales

    Amazing! There are a few things that you might have noticed. 1. There seems to be a bug in the code. Some of the suggestions came from users that are not entered into the user table. i.e. the user_id column is blank 1. Two people registered, but never answered the question. (Michael and Andy)

    Great now that we have our data, we want to know who sent what response. To get that we will need to a join, an inner join I might add.

    Now I know what your thinking, I have never joined two tables together. How can I possibly know if it's correct? Don't worry, I will show you step by step so that we are all on the same page.

    Venn diagrams and Pancakes

    Before we go on, we want to understand why things are called they way they are. So that we can better understand their purpose. Here's an analogy.

    Have you ever tried to make two pancakes in a single pan at the same time? Sometimes, even though you try really hard, they end up merging together! Well Venn diagrams are a lot like two pancakes in a pan the just happen to merge together.

    Inner joins & Pancakes

    Now, one pancake represents a list of your friends. The other pancake represents the suggestions on a first date also known as activities. The inner join is where you put names and associate them to the activities, that's the delicious center. You essentially will know which friend suggested what.

    https://i.imgur.com/n0hEoEz.png

    This means that we will only get data that is common between the two data sets. You will not get response that don't have names and names that don't have responses. Some might call this inner part of the pancake. Haha, get it, inner for inner join. Wow.

    Beautifully delicious, isn't it?

    Let's look at this in SQL:

    SELECT * FROM users INNER JOIN activities ON activities.user_id = users.id ORDER BY activities.id; 

    Key areas to focus on would be "INNER JOIN" key words. This is what joins the two tables together, followed by the table we are joining "activities". Also, we need to tell it which columns to join together, we use the keyword "ON" for this. In this case, activities.user_id and users.id.

    After executing the SQL statement, we get the following data:

    id first_name last_name id name user_id
    1 Pam Beesly 1 Sky diving 1
    2 Dwight Schrute 2 Eating ice cream until your stomach hurts 2
    1 Pam Beesly 3 Watching old episodes of star trek the next generation 1
    3 Jim Halpert 4 Long walks on the beach looking into each others eyes 3
    2 Dwight Schrute 5 Desserts with lots of peanuts 2
    3 Jim Halpert 6 Rock climbing 3
    1 Pam Beesly 7 Biking race 1
    1 Pam Beesly 8 Eating ice cream until your stomach hurts 1

    Few of things to notice:

    1. I have ordered the data based on activity id to make it easier to follow.
    2. The data contains only people that have answered the question.
    3. Some of the people have answered question multiple times, that means they appear multiple times.
    4. Activities that did not contain a user id are excluded.

    So an inner join just gets you what is common between the two data sets and repeats where necessary.

    Left join (aka Left outer join) & Pancakes

    Suppose that you need to know all the people that registered, regardless if they answered a question or not. So, since the left pancake represents all the people, that have registered, you want the whole left side. But wait there is more! You also want the delicious center because that contains the association between the responses and the people who did answer.

    https://i.imgur.com/PmmZnaB.png

    Assuming that we start with the users table, aka the people who registered, we get every person regardless if they answered the question or not. This compared to the inner join, where every person listed has answered the question.

    Let's jump back into the SQL to see what this looks like.

    SELECT * FROM users LEFT JOIN activities ON activities.user_id = users.id ORDER BY activities.id; 

    Holy guacamole! This looks exactly the same as the "INNER JOIN" except that we have the keywords "LEFT JOIN" to make a left join. Good eye, Batman! Let's take a look at our data:

    id first_name last_name id name user_id
    1 Pam Beesly 1 Sky diving 1
    2 Dwight Schrute 2 Eating ice cream until your stomach hurts 2
    1 Pam Beesly 3 Watching old episodes of star trek the next generation 1
    3 Jim Halpert 4 Long walks on the beach looking into each others eyes 3
    2 Dwight Schrute 5 Desserts with lots of peanuts 2
    3 Jim Halpert 6 Rock climbing 3
    1 Pam Beesly 7 Biking race 1
    1 Pam Beesly 8 Eating ice cream until your stomach hurts 1
    4 Michael Scott
    5 Andy Bernard

    Couple of things to notice:

    1. Michael and Andy pop up because with a left join it keeps all the data that is contained in the leftmost table, meaning the table that's mentioned first in the SQL.
    2. Notice that not all the activities are listed. We don't see activities that are not assigned to a user.

    So in a left join, we always get all the data from the left table, in this case the user table.

    Left table Right table
    SELECT * FROM users LEFT JOIN activities on

    Right join (aka right outer join) & Pancakes

    Ok, what if you wanted to get all the responses, regardless of they have a person attached to them or not. That's a right join! You want the right pancake which represents all the suggested activities, plus the delicious center which represents the names associated to those responses. Mmmm Yummy!

    https://i.imgur.com/FL5Qqmx.png

    Brace yourself, here comes the SQL!

    SELECT * from USERS RIGHT JOIN activities ON activities.user_id = users.id ORDER by activities.id; 

    Wow, did you see that. Three SQL statements that look exactly the same just went by. It must be a glitch in the Matrix!

    Nope! The syntax is very similar, only thing that changed is that we use "RIGHT JOIN" instead of "INNER JOIN" or "LEFT JOIN". Our "ON" keyword still tells us what columns we are joining on, activities.user_id and users.id. Let's look at our data:

    id first_name last_name id name user_id
    1 Pam Beesly 1 Sky diving 1
    10 Swimming with the whales
    2 Dwight Schrute 2 Eating ice cream until your stomach hurts 2
    1 Pam Beesly 3 Watching old episodes of star trek the next generation 1
    3 Jim Halpert 4 Long walks on the beach looking into each others eyes 3
    2 Dwight Schrute 5 Desserts with lots of peanuts 2
    3 Jim Halpert 6 Rock climbing 3
    1 Pam Beesly 7 Biking race 1
    1 Pam Beesly 8 Eating ice cream until your stomach hurts 1
    9 French desserts

    Couple of things to notice:

    1. We got all the activities but not all the people who registered. In this case Michael and Andy are missing.
    2. We did get such responses such as "swimming with the whales" and "French desserts", which were entered by non-registered people.

    So in a right join, which is the other side of the table that we are joining to, we always get all the data from the right table. In this case the activities table.

    Left table Right table
    SELECT * FROM users RIGHT JOIN activities on

    How to remember left from right?

    To remember left join from right join, just ask yourself:

    What table has all the data I want?

    Left table Right table
    SELECT * FROM users [LEFT OR RIGHT] JOIN activities on

    In this case, if it's the users table It's a left join. If it's the activities table, it's a right join.

    Full outer join (all the pancakes)

    Finally, you may want all the data. So, you want all the activities and all the people who have registered regardless whether the activity has a name or if the person registered and never answered the question. That's the whole pancake, left, right and the center. Every sweet delicious bite!

    https://i.imgur.com/6oieK3k.png

    Let's jump back into the SQL.

    SELECT * FROM users FULL OUTER JOIN activities ON activities.user_id = users.id ORDER BY activities.id; 

    As with all the SQL statements that came before this one, the only thing that changed is "full outer join" instead of "left join","right join", or "inner join".

    Let's look at out data:

    id first_name last_name id name user_id
    1 Pam Beesly 1 Sky diving 1
    10 Swimming with the whales
    2 Dwight Schrute 2 Eating ice cream until your stomach hurts 2
    1 Pam Beesly 3 Watching old episodes of star trek the next generation 1
    3 Jim Halpert 4 Long walks on the beach looking into each others eyes 3
    2 Dwight Schrute 5 Desserts with lots of peanuts 2
    3 Jim Halpert 6 Rock climbing 3
    1 Pam Beesly 7 Biking race 1
    1 Pam Beesly 8 Eating ice cream until your stomach hurts 1
    9 French desserts
    5 Andy Bernard
    4 Michael Scott

    Couple of things to notice:

    1. We get all the responses. "Swimming with the whales", "French desserts"
    2. Also, "Michael" and "Andy" are also here even though they did not answer the question.

    The outer join lets us see all the data regardless if it's not included in any of the tables that it's joined to.

    Final thoughts

    Well I hope that settles that. Thanks for taking the time to read this post. Leave a comment if you have any questions.

    Edit: added Venn diagrams with Pancakes

    Edit 2: Better formatted images

    Edit 3: Just image links to imgurl

    Edit 4: Corrected examples

    submitted by /u/lightkeeper
    [link] [comments]

    HTTP codes as Valentine's day comics

    Posted: 19 Apr 2018 03:29 AM PDT

    Using the demand for talented web developers for good.

    Posted: 19 Apr 2018 12:58 PM PDT

    Hi, sorry if this is the wrong place for this it doesn't seem like it is, but I just wanted to get this idea out there and maybe start a discussion.

    I recently got a recruiting message via StackOverflow from someone at Amazon, and while I am half heartedly looking for work I turned it down with a note stating that I was not interested primarily because of Amazon's labor practices in their warehouses.

    It's bothered me for a while now that we as web developers and programmers are often incredibly well paid by massive tech companies while other staff is severely underpaid, and jerked around. This recruiting email, made me realize that if we start turning down jobs, working for these companies and citing their treatment of non tech workers as the reason, we could have incredible leverage to help improve their labor practices.

    Amazon alone employs about 90,000 people in their warehouses who make an average salary of $27,930 dollars a year. If Amazon were to invest just 1 billion/year (or 0.5% of their annual revenue) in raises for those 90,000 people it would result in a life change 39% raise for every one of them ($39,041 / year).

    I get that not everyone is in a position to just turn down a potentially good job for a cause, but many of us are and I know a lot of us are swamped with recruiting emails when we're not looking for jobs. So, to those than can please see these recruiting emails as an opportunity to make a statement that could potentially do a lot of good if enough of us do it.

    Thanks

    submitted by /u/boones_farmer
    [link] [comments]

    Self taught developers

    Posted: 19 Apr 2018 01:29 PM PDT

    What're some things you feel like you wasted time on and weren't very helpful? Also, what're some things that you think really gave you a leg up/ were very efficient for your learning? (Websites, podcasts, books, etc)

    submitted by /u/tbrown93
    [link] [comments]

    Google partners with Pluralsight to offer 60 days free access to 70+ courses (Android developer, mobile web developer, cloud architect and data engineer)

    Posted: 19 Apr 2018 06:33 AM PDT

    Developing New Website - How Difficult/How Much Would It Cost To Develop?

    Posted: 19 Apr 2018 04:07 PM PDT

    Massive apologies in advance, I do not come from a web development background so some of the terminology might not be correct and some of the ideas may not be described in the best possible way but I'll give it a go.

    I'm looking to develop a website for a business idea. However, I am trying to work out how complex the website would be to develop. If I was to proceed with the idea, is it best to find a technical cofounder with a web development background or outsource the coding, and to what cost.

    Without overcomplicating details, the website would require a basic homepage with a login portal. After logging in, a user will have an account which would be able to open a 'loot box', just like in hearthstone everyday and 'claim' what is in the loot box. In simple terms, what is contained within the loot box could link to another website, or internally in the company website depending on what reward is given. The reward given is pulled from some form of database which acts like an inventory. That is to say, entries can be added and have a finite amount, with one being deducted if a loot box containing that item is opened. Finally, and the most advanced concept would be having an associated online currency with the user account which can fluctuate depending on what the user does, but is kept track of and cannot be readily changed by the user, almost like the reddit karma system where users accumulate and can view how much karma they have.

    I have coded the statistics and a basic working model using python. Users can open a loot box containing randomly generated rewards contained within a list, but items are not yet removed from the list. However, from the script you will be able to see how the website would work.

    I'm guessing this is far too advanced for me to learn within a short period of time. Realistically, could a website like this be coded, even in its basic form with some ideas cut or would it be too expensive to pay someone to develop?

    Thanks!

    submitted by /u/RNGesusHS
    [link] [comments]

    Library or method to draw outlines of an area on an image?

    Posted: 19 Apr 2018 03:56 PM PDT

    So I'm building this web app, one function is to pull an image from the filesystem, display the image on a page, then the user will outline an area within that image in some color, so there is a rectangle of custom size overlaying the image. I will need to collect the x,y coordinates of each of the corners of the rectangle.

    I'm not too experienced with JS, I've been trying to do it with canvas and looking up how other people use canvas.

    Any thoughts? Thanks.

    submitted by /u/cadtek
    [link] [comments]

    Apple Open Sources FoundationDB

    Posted: 19 Apr 2018 11:29 AM PDT

    Quick beginner question about APIs

    Posted: 19 Apr 2018 02:38 PM PDT

    Hey guys, I'm a hack for a developer. I come from a design background. I love tapping into API endpoints and visually playing with data. However, some APIs are on GitHub where they want you to npm install stuff. Why? What do I need to download? Doesn't it just use that .json endpoint in the Inter-space that automagically refreshes all the time? Why don't you just give me the endpoint?

    submitted by /u/steveonphonesick
    [link] [comments]

    How is the nosql landscape nowadays?

    Posted: 19 Apr 2018 03:53 AM PDT

    A while ago there were quite a few controversies surrounding MongoDB and CouchDB and I was happy with my Relational DBs so I didn't really look into them much.

    I was hoping to hear from anyone using these things as I've just seen another project recommending it. In particular these sorts of questions:

    1. Have you ever lost any data? Or had any issues with integrity?
    2. What is your use-case? Why do you use them?
    3. How do you prevent data duplication?
    4. Do you use a hybrid solution or is your full stack document-oriented.

    Thanks.

    submitted by /u/rich97
    [link] [comments]

    My website domain URL is redirecting to “my search info .com”

    Posted: 19 Apr 2018 02:27 PM PDT

    I can't get to my website anymore, it just directs me to an ad. I've tried on multiple devices, in multiple browsers.

    I use WordPress and Bluehost. The issue seems to occur mainly on my phone and iPad. My PC still takes me to my website.

    Any suggestions?

    submitted by /u/AppKnow
    [link] [comments]

    What do you all use for invoice management?

    Posted: 19 Apr 2018 10:14 AM PDT

    Back in the day I used daylite and billings to manage my invoices but now just use google drive.

    submitted by /u/peb7268
    [link] [comments]

    How to combine like entries in a database?

    Posted: 19 Apr 2018 01:40 PM PDT

    Hey, webdev! I'm currently working on a grocery list app for my wife. The app is going to be pretty simple. There's going to be a list of recipes, and when she clicks on an item, it'd return all the ingredients for that recipe. The ingredients list grows as she continues to click on more recipes. See screenshot

    I'd already built out that functionality, my goal now is to combine duplicate items in the list. For example, one recipe calls for 2 ice cubes, and another recipe calls for 3 ice cubes. Instead of "ice cubes" appearing twice in the list (as it does now), I would like for it to appear just once, but have the quantities combined (5 ice cubes). My ingredients database looks like this.

    I've been playing around with JS functions like reduce and find, but I'm stuck as how the code would look like. I'm using PostgreSQL with Sequelize. And React-Redux handles the front end.

    submitted by /u/JoeJoeJoeJoeJoeJoe
    [link] [comments]

    Best way to deploy a website using git?

    Posted: 19 Apr 2018 07:35 AM PDT

    I'm currently developing a website on my local machine, and at the moment I've set up a rather simple self hosted git repository on a ubuntu digital ocean droplet. I don't do anything special with it. I just simply develop on my local machine, push the changes and that will be that.

    I think it's time for me to start getting into the full powers of using git but I'm starting to feel stressed because I honestly don't know where to start. I've read good things about GitLab but the deployment from it is just beyond me. It mentions something about using a kubernetes cluster but I've never heard that in my life. It seems that the more I read into using git from development to production, the more I get confused.

    Can anyone point me in the right direction?

    submitted by /u/slothinspace
    [link] [comments]

    Feedback on landing page

    Posted: 19 Apr 2018 01:26 PM PDT

    Hi!

    I just put up a landing page for a side-project I am working at, and would love some feedback from you :)

    At the moment (until the project is out of beta) I plan to "market" at developers, so the page might not make much sense for someone that is not a developer.

    Thank you!

    https://wiseer.io

    submitted by /u/Tallkotten
    [link] [comments]

    Is it a vulnerability if a .phar file that you use is publicly accessible?

    Posted: 19 Apr 2018 01:25 PM PDT

    I'm using an open source .phar file that anyone can get access to/read. I just tested it, if I upload this .phar file to my web server it doesn't parse(php) I'm assuming because of the file extension. The file works as expected when included in a PHP script. I'm just unsure like is this a vulnerability? I don't care about the .phar file not parsing, it's not intended to be viewed directly like that.

    I'm not sure if i should put this file in a folder that is not open to the web but a PHP script can still run it that is running as www-data eg. apache.

    submitted by /u/crespo_modesto
    [link] [comments]

    Finished Colt Steele's webdev course... How do I start?

    Posted: 19 Apr 2018 01:21 PM PDT

    The course was great even though it doesn't go into much detail on some topics. I have some questions though as to how you start a new project.

    Do you start it from scratch using html and css? You'd have to be really good at css and experiment a lot which would be rime consuming. Do you buy some template online and adjust it to your needs? If so from where? There are so many. Do you need to use a CMS? The most popular (wordpress) doesn't go that well together with nodejs and I'd probably need to learn php. Also as someone who has never worked with one before the learning curve could be big.

    submitted by /u/No_Therapy
    [link] [comments]

    Portfolio critique

    Posted: 19 Apr 2018 01:09 PM PDT

    Hi guys, I just finished building my portfolio website and I would need some feedback/critique on its overall appearance. Please be honest and harsh if needed. It will help me a lot. :)

    Thanks in advance.

    Portfolio: www.sammek.me

    submitted by /u/moritzon
    [link] [comments]

    Have you heard about Vaadin?

    Posted: 19 Apr 2018 05:32 AM PDT

    I went to a startup event yesterday and I tried out Vaadin. I never heard about them before, and only tried yesterday. Do any of you know about it? Is it a good alternative to what is already existing or is it way too young?

    submitted by /u/dl44ter
    [link] [comments]

    Built With Elixir - A place to discover projects built with Elixir.

    Posted: 19 Apr 2018 12:31 PM PDT

    Transfer "current domain owner/provider" to "different domain owner/provider" ?

    Posted: 19 Apr 2018 12:30 PM PDT

    Years ago, I purchased a domain name, call it mydomain.com from iPage.com . I now want to transfer this bought domain name so that I can access another website to manage this domain using another provider. How do I transfer the domain mydomain.com so that another site "owns" it. This new site would handle all future billing, redirections, etc.

    My site data is not on iPage, only the domain name. My actual content resides on a DigitalOcean VPS. It is used through iPage's administrative console to point to Digital Ocean servers.

    I guess my actual question, is that let's say iPage.com no longer existed, how would I manage my purchased domain name?

    submitted by /u/16o1denRatio
    [link] [comments]

    No comments:

    Post a Comment