• Breaking News

    Saturday, March 30, 2019

    I Built A Site To Provide Better Explanations To Coding Interview Problems learn programming

    learn programming

    I Built A Site To Provide Better Explanations To Coding Interview Problems learn programming


    I Built A Site To Provide Better Explanations To Coding Interview Problems

    Posted: 29 Mar 2019 09:24 PM PDT

    Hi all,

    Late last year, I did a round of interviews with big tech companies. During preparation, I realized that there were tons of sites with whiteboarding interview questions, but not a lot of well-explained ones. I decided to build https://algodaily.com, intended to be the easiest place on the internet to prepare for technical interviews.

    Every challenge is walked through step by step, and includes quizzes that help with recall. Every challenge is written in JS, which is IMO the best language for new programmers since it can easily be run and tested in the browser. I also recently wrote this article about technical interview prep.

    I encourage you guys to check out the site and leave feedback. It would be greatly appreciated as I try to build a better resource for web developers who want to level up!

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

    Free Programming Books

    Posted: 29 Mar 2019 12:33 AM PDT

    Free e-books compiled from Stackoverflow posts : https://goalkicker.com/

    Note : I'm not the author

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

    Modern Labor (the code bootcamp) is a Scam and Should Be Illegal

    Posted: 29 Mar 2019 07:19 AM PDT

    There have been a couple of posts on here recently about Modern Labor, but I think everyone is drastically underestimating how shady this company is. So I want to be the first to broadly proclaim to the world: Modern Labor is a scam. Not just a bad deal, not just another crappy code school, but a scam. Full stop.

    I learned about Modern Labor by applying for a job as a junior engineer I saw on Indeed. They then told me I would be "hired," and tried to convince me to sign an income share agreement where I'd have to pay them a portion of my salary of my next job.

    Yes, you're reading that correctly.

    The job posting was pretty vague, but mentioned that they company needed a junior engineer, and they were paying $15/hr. That's not much, but having attended a bootcamp (Flatiron School) and having a hard time getting a job (their hiring stats are bullshit, by the way) I was pretty willing to do anything it took to be paid to write code. The "fellowship" did indeed pay $15/hr, but after going through the interview process you learn it also _included a clause where they would force you to sign an income share agreement and pay 15% of your salary for the two years after you were done at the job_. You'd have to pay that percentage of income no matter what that work was, as long as it paid more than $40k. What if you next job doesn't pay $40k? They wait until you find one that does.

    So if you take this "job" they pay you $10,000. If you then end up as a car mechanic making $90k/yr you pay them back $27,000. Even if you only end up making $50k/yr (a pretty shitty job) you still pay back $15k over two years - an effective 25% APR. Credit card rates on a loan to get you to a low salary.

    If you end up as a junior engineer in the Bay Area making $120k? Yeah, you'd pay back $36k.

    So, shitty marketing that should probably be illegal (how do you report people like this to the bodies that govern higher education or labor?) That's one step down the rabbit hole.

    Now they've rebranded so it seems like those job postings were just a lame marketing exercise for a Lambda School or App Academy clone. A school on an income share agreement, ok that's not that bad, but then it gets worse. According to their Hacker News post they "pay you to learn to code" with one important caveat: There are no teachers, no instruction, and a curriculum that "...is open source." Literally: "Some of it's from places like Freecodecamp, which is available for free." That's not a company, it's a high interest loan while they force you to do FreeCodeCamp or you get cut off.

    I think I've made my point pretty clear. Modern Labor advertises a job, bait and switches you to sign an income share agreement for their "school" with no teachers, and cuts you off if you don't do your FreeCodeCamp lessons.

    Avoid.

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

    Best Lua Resource to learn AI..?

    Posted: 29 Mar 2019 08:48 PM PDT

    Are there any recommended books or tutorials/websites online that is the best place or places to go for AI in Lua?

    I am interested in AI in terms of Video Game AI that progressively gets better and better the more Generations have gone by. In other words as others know of it a "Bot" that plays a game for you (In my case simple Flash Games or even Googles Offline T-Rex Game).

    My end goal is to start making AI for Robotics and not games... but games seem like a good start for easier testing.

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

    How to become a better programmer

    Posted: 29 Mar 2019 09:08 PM PDT

    So I understand that programming is a skill like any other, but I'm having trouble understanding how I would go about practicing it. For example, I am a big fan of basketball and to get better at that, it just requires hitting the gym and practicing the same move or shot over and over and getting the reps in. Programming is different in that it's not a physical skill. How would I go about practicing programming so that I can be confident enough to solve anything that comes my way?

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

    If bootcamps aren't the way

    Posted: 29 Mar 2019 08:10 PM PDT

    What's a good program to follow that will possibly make you hire-able?

    I'm having a hard time making this decision. At first I thought bootcamps were a great idea as long as they were fair priced and could get you a job in the industry, but there seems to be a lot of negative feedback on this. With Universities it seems all that they are teaching is Cs fundamentals and other outdated things while making you take all these other bs classes that more then likely won't carry on over to work. A path that also seems very long and expensive...

    All I really wanna do is learn and get a decent pay job to get started with my life.

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

    Is this solution O(N) time and O(1) space?

    Posted: 29 Mar 2019 08:56 PM PDT

    Recently I came across this problem from Daily Coding Challenge:

    Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.

    For example, the input [3, 4, -1, 1] should give 2. The input [1, 2, 0] should give 3.

    You can modify the input array in-place.

    The last line gives me the hint that you perform some kind of bucket sort knowing that you'll have at most n-1 buckets (first going through and counting the number of positive integers, probably). I couldn't figure that out, but I came up with this solution in python, which uses an integer bitmap:

    def missing_positive(arr): bitmap = 0 for i in arr: if i > 0: bitmap |= 2 ** i for i in xrange(1, len(arr)): if not (2 ** i) & bitmap: return i return len(arr) print(missing_positive([3, 4, -1, 1])) # -> 2 print(missing_positive([1, 2, 0])) # -> 3 print(missing_positive([3, 2, 3, 1])) # -> 4 print(missing_positive([1, 2, -4, 0, -2, -3, -3, 5, -2, 4])) # -> 3 

    And it seems to work. My question now is about the complexity of this.

    It has 2 O(N) loops, so it runs in O(N) time. But the size of the bitmap is dependent on N, so it's not exactly O(1) time, but in practicality it is. That was my thought.

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

    Learn how to make fast websites from Google expert

    Posted: 29 Mar 2019 08:50 AM PDT

    Hey community!

    I'd like to launch new frontend related project — something like TEDx for developers. Basically it's online talks with Q&A session, but with experts from Google, Microsoft, Babel etc.

    Now I got into an accelerator, trying to validate the idea. This is the first announced talk. Does this look promising? Would you sign up for the talk like this?

    https://dogetalks.com/web_performance

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

    Do you need a powerful computer to be a programmer?

    Posted: 29 Mar 2019 11:36 PM PDT

    I'm an high school student who is looking to study IT engineering at university, and I'm already studying on my own html and css. I've got an old desktop pc and I'm going to buy a laptop for the university. The question is: do I really need a powerful pc just to write some code for a website or a small game? Also I'll probably buy a MacBook since lot of people on YouTube seems to prefer that for programming

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

    Problem saving in jEdit

    Posted: 29 Mar 2019 08:17 PM PDT

    Hey guys, whenever I try to save something with jEdit, i get an error, which says:

    The following I/O operation could not be completed: C:\Program Files\jEdit\testing.c: Cannot save: C:\Program Files\jEdit#testing.c#save# (Access is denied)

    I have tried saving under other names, and I get the same error. I am on windows 10, and using jEdit 5.5. I would appreciate some help!

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

    Quick story about the programmer's mind set

    Posted: 29 Mar 2019 04:38 PM PDT

    Hi all. This will be a short story about myself, a programming student.

    I am a safety specialist (mainly your humble security agent) at a fairly large IT company in Dublin. A few days back one of my managers (there are 6 managers for a 3 people sized team), knowing I am into computers asked me to remove duplicates from a long column in a .CSV file he had. Using Excel, as this is important.

    I did a quick Google search and I found I can use UNIQUE function that sadly wasn't available on our work computers. Will this stop me? Hell no. I sat a bit and I came with a solution. A gamey, shady solution mind you, but a solution.

    I wrote an IF function that would compare each cell with the previous cell. If the equality was confirmed it would input in a separate column a "0" and if not, would input in that column the unique value. Then you use a filter to take all the zeroes away and there you go. The guy came in, I showed him it's working, taught him how to do it himself and all in all, a satisfying experience.

    However, a few minutes go by and another manager rings me telling me that apparently, there is a "REMOVE DUPLICATES" button in Excel. Ah. Alright, good to know.

    Who needs a simple button when you can write your own complicated solution, am I right?

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

    I decided to opensource my side-project for making cool graphics. I think it is a good project to look through for new c++ programmers

    Posted: 29 Mar 2019 11:30 PM PDT

    Here is the GitHub link:
    https://github.com/AbdullrahmanAlzeidi/ALZparticles

    Feedback is more than welcome :)

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

    Newbie question about arrays and reads. How is the "in" function quicker at finding a string item in an array than looping is? (Using Python)

    Posted: 29 Mar 2019 06:43 PM PDT

    I'm doing this exercise to help me understand the pros and cons of arrays as a data structure and how it works with memory. I'm using Python 3, so from here on out I'm going to use the word "list" to mean array.

    Let's say I have a 18MM+ long list called animal_list. Each item in this list is also a list, which contains three animal strings. Most of the lists look like this:

    ['cat', 'dog', 'human'] 

    A few lists, however, contain a blank string(s):

    ['', 'monkey', 'horse'] ['zebra', '', ''] 

    Let's pretend I want to move all lists containing blanks to a new array. Here's some loop code:

     my_new_list = [] for row in animal_list: for item in row: if item == "": my_new_list.append(row) break 

    And here's some code simply using the "in" method (line 3):

     a_newer_list=[] for row in animal_list: if "" in row: a_newer_list.append(row) 

    The loop code takes twice as long! (I actually did test this on a list with 18MM+ lists and timed it. The first reliably takes ~3 seconds, and the second ~1.5 seconds)

    My questions:

    1) How is python's "in" function quicker? In my head, I'm imagining that the implementation of this method does something similar to what my loop code is doing, but surely that can't be true, given that it's 2x quicker.

    2) Is this example, done in Python, equivalent to the how the larger idea of arrays (as a data structure) work in memory? Or is this not at all representative of how arrays work? Because I'm trying to see with my own eyes why, for example, array insertions are O(n).

    3) I could have probably answered #1 myself if I knew where to begin looking in the python code where the "in" method is located, but since it's such a common word and furthermore only two characters long, I'm having a hard time googling for help. Can someone point me in the right direction?

    Thanks!

    EDIT: I know, I use "function" and "method" interchangeably in this post to describe in, but I'm not sure which one is correct.

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

    KPSI rug/carpet

    Posted: 29 Mar 2019 07:46 PM PDT

    I want to make an android application first, then move to iOS. I need an app that will take a picture of the back of any rug and approximately give the Knots per square inch. I have some image processing knowledge but need help getting started. Any help would be greatly appreciated! Thanks 🙏🏽

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

    How do I open text files and stream in using Swift?

    Posted: 29 Mar 2019 07:34 PM PDT

    I'm used to working with C++ where you would simply declare an ifstream variable, open("file.txt"), and stream in through that variable. How can I do this in swift? I'm trying to convert a project over to Swift; but I am stuck on this fundamental problem. Also I do not have a Mac, so I've been using this online compiler. Can I even open a text file with a online compiler?

    https://www.onlinegdb.com/online_swift_compiler#

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

    Recommendations for executing code quickly for simple learning / testing?

    Posted: 29 Mar 2019 07:25 PM PDT

    I know asking this will seem very lazy, but so be it. Typically when working on my projects, I work with varying editors/IDEs like vscode+embedded terminal, pycharm, and vim. However, sometimes when I want to brush up on a language and want to go through a tutorial, I just want a window I can line up next to chrome/pdf of book and use to quickly edit and execute new changes to the code. I know there's CLion but it's also a bit annoying to use due to the tremendous amount of enterprise stuff I don't really need. So, does anyone know of something along these lines? a quick, efficient and lightweight but robust editor/IDE for many languages?

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

    React.js / Semantic UI multipage checklist app RadioButton Group issue

    Posted: 29 Mar 2019 07:24 PM PDT

    Hello All,

    This is my first post on this subreddit, so I do apologize in advance. English isn't my first language and I'm not 100% knowledgeable on the formatting practices of this subreddit.

    I've been studying programming / web dev for a couple of months now. I'm currently building a web app with React.js and Semantic UI for my job to automate a checklist I have to complete all the time.

    I've been having an issue with the radio buttons in my child component. In my first page (or first child component) I had to include a few text inputs. The text inputs are updating and saving the state values as planned. Unfortunately as soon I began using radio buttons in my 2nd page for the checklist portion, the values aren't updating my states in my parent component.

    I've also been having an issue on my UI where if I can select the 'yes' radio button and then the 'no' radio button, but I can't go from 'no' to 'yes'.

    I've pasted below my parent component. As you can see I've creates my states component in the parent element. The state I'm having issues with is radioGroup 21.

    MainForm.jsx import React, { Component } from 'react'; import ProjectInfo from './ProjectInfo'; import PersonalDetails from './PrelimInspection'; import Confirmation from './Confirmation'; import Success from './Success'; class MainForm extends Component { state = { step: 1, projectNumber: '', projectName: '', numberOfSystems: '', buildSheet: '', controlPhilosophy: '', projectLayoutDrawing: '', projSoftwareValidation: '', CppDrawing: '', radioGroup21: '', } nextStep = () => { const { step } = this.state this.setState({ step : step + 1 }) } prevStep = () => { const { step } = this.state this.setState({ step : step - 1 }) } handleChange = input => event => { this.setState({ [input] : event.target.value }) } render(){ const {step} = this.state; const { projectNumber, projectName, numberOfSystems, buildSheet , controlPhilosophy, projectLayoutDrawing, projSoftwareValidation, CppDrawing, radioGroup21 } = this.state; const values = { projectNumber, projectName, numberOfSystems, buildSheet, controlPhilosophy, projectLayoutDrawing, projSoftwareValidation, CppDrawing, radioGroup21 }; switch(step) { case 1: return <ProjectInfo nextStep={this.nextStep} handleChange = {this.handleChange} values={values} /> case 2: return <PrelimInspection nextStep={this.nextStep} prevStep={this.prevStep} handleChange = {this.handleChange} values={values} /> case 3: return <Confirmation nextStep={this.nextStep} prevStep={this.prevStep} values={values} /> case 4: return <Success /> } } } export default MainForm; 

    Pasted below this text is my child component where I'm trying to set the state of radioGroup21 through radio buttons.

    import React, { Component } from 'react'; import { Form, Button, Radio } from 'semantic-ui-react'; import { throws } from 'assert'; class PrelimInspection extends Component{ saveAndContinue = (e) => { e.preventDefault(); this.props.nextStep(); } back = (e) => { e.preventDefault(); this.props.prevStep(); } render(){ const { values } = this.props return( <Form color='blue' > <h1 className="ui centered">System Installation</h1> <Form.Field inline> <Form.Field>System Properly Supported</Form.Field> <Radio label = {'Yes'} name = {'radio21'} value = {'Yes'} onChange={this.props.handleChange('radioGroup21')} defaultValue={values.radioGroup21} /> <Radio label = {'No'} name = {'radio21'} value = {'No'} onChange={this.props.handleChange('radioGroup21')} defaultValue={values.radioGroup21} /> </Form.Field> <Button onClick={this.back}>Back</Button> <Button onClick={this.saveAndContinue}>Save And Continue </Button> </Form> ) } } export default PrelimInspection 

    I've been getting a fault on my console when I render my application. I've been reading articles about controlled vs uncontrolled input elements, but I have not had any success or clarification on the issue(s).

    The fault states:

    Checkbox contains an input of type radio with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props.

    I've tried removing the value tag and the defaultValue line in my Radio elements, but no luck. I've tried creating constructor(props) in my parent element but I still kept having issues.

    As said above, this is my first post on this subreddit and do apologize if I haven't followed proper formatting.

    After a few days of trying, researching and debugging without success any help or directions would be greatly appreciated.

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

    Is it possible for me to modify an Arduino code utilizing the Wire library and use it on a Raspberry Pi?

    Posted: 29 Mar 2019 09:34 PM PDT

    Hello everyone,

    This is my first time using the reddit page to post questions. Forgive me if I breach any rules and do notify me first before doing anything drastic. If needed, I will remove my post and would appreciate anyone giving me advise on the correct subreddit page to post my questions. I'm writing this disclaimer now because I experienced some heavy handed action from the Raspberry Pi forum which got me banned for a month for asking a simple question not related to their rules.

    My question for the community is that I need some advice on a Raspberry Pi project I'm working on. I'm using Linux as my software and I program with Python 3 and C++ languages. I wanted to ask if there is a way to run an AD7746 24-Bit Capacitance-to-Digital Converter on a Raspberry Pi. Since all the codes online only specifically states that it is used with Arduino, I have tested with Serial communication and i2c communication. Right now I just want to know if there are ways to directly run the C++ AD7746 code through the Raspberry Pi without having to connect it to an Arduino. Is the Pi capable of utilizing the Wire.h library from the Arduino or can I modify the code to suite Python controls? I'm still a beginner at this so my questions may sound unprofessional. Forgive me for that.

    I would appreciate any advice to move forward or any knowledge from people who have done a similar project.

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

    Necessary languages to make an online blog?

    Posted: 29 Mar 2019 11:45 PM PDT

    I want to make a niche blog but I'm not sure what languages would be necessary. I figure the usual HTML, CSS & JS for the front end but I'm not sure what would be the best for the backend of a project like this. Also anything else that might be necessary? Thanks!

    submitted by /u/600jasper
    [link] [comments]

    Searching in a rotated sorted array problem on leetcode is beyond me

    Posted: 29 Mar 2019 03:49 PM PDT

    Every time I try writing code for this problem I'm off somewhere.

    Is there a thought process or pattern that I should be aware of when approaching this problem?

    I am trying to use a variation of binary search but I don't understand how to hit each condition. Is there a good way to figure out how I can make sure I'm hitting each condition?

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

    How to push local DB to Heroku in Rails

    Posted: 29 Mar 2019 10:56 PM PDT

    So I try the command

    heroku pg:push DATABASE_URL mylocaldb --app thawing-inlet-53876 

    Which gives me the output

     ▸ Unknown database: mylocaldb. Valid options are: DATABASE_URL 

    I've already created mylocaldb with the command

    heroku pg:pull DATABASE_URL mylocaldb --app thawing-inlet-53876 

    Because when I run the above command again it gives me the output

    createdb: database creation failed: ERROR: database "mylocaldb" already exists 
    submitted by /u/NegativeDisplay
    [link] [comments]

    Can anyone explain why a "dummy" variable is used here (merging two LinkedLists)

    Posted: 29 Mar 2019 10:47 PM PDT

    This is an efficient method for merging two linkedLists right here (Java):

     public LinkedNode merge(LinkedNode a, LinkedNode b) { LinkedNode dummy = new LinkedNode(0); LinkedNode tail = dummy; while (true) { if (a == null) { tail.next = b; break; } if (b == null) { tail.next = a; break; } if (a.val <= b.val) { tail.next = a; a = a.next; } else { tail.next = b; b = b.next; } tail = tail.next; } return dummy.next; } 

    Can anyone explain why a dummy node:

    LinkedNode dummy = new LinkedNode(0); 

    here ? Why won't they just make a tail variable:

     tail = new LinkedNode(0); 

    here and use that to return the linkedList? Why is a dummy variable needed ? I'm asking because

    return dummy.next; 

    is used and I don't know why. Thanks for the help

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

    [c++] Help : IDE fails to compile simple c++ code

    Posted: 29 Mar 2019 10:36 PM PDT

    https://stackoverflow.com/questions/55428410/facing-c-error-clang-error-linker-command-failed-with-exit-code-1-use

    Following Simple compiles well in terminal but not in IDE. ( tried Eclipse , Clion )

     // pointType.h #ifndef H_PointType #define H_PointType class pointType { public: void setPoint(double x, double y); void print() const; double getX() const; double getY() const; pointType(double x = 0.0, double y = 0.0); protected: double xCoordinate; double yCoordinate; }; 
    

    No comments:

    Post a Comment