• Breaking News

    Sunday, January 6, 2019

    Announcement: Rules overhaul learn programming

    Announcement: Rules overhaul learn programming


    Announcement: Rules overhaul

    Posted: 06 Jan 2019 01:42 PM PST

    Happy new year everybody!

    To kick off the new year, we've decided to clean up our rules: mostly consolidating existing ones and condifying a few unwritten ones.

    Here are the new rules. These rules also link to a few new sections to our posting guidelines.

    Here's a changelist:

    1. New rule ("No spam or tasteless self-promotion") and new wiki section ("Self-promotion").

      We previously handled spam on an ad-hoc basis: we make a judgement call based on the post, the poster's comment history, and the community's reaction. This new rule codifies these informal heuristics and sets a few new requirements: e.g. we now explicitly expect the resource is high-quality, mandate that paid resources include a free sample...

      This new rule likely won't change how we moderate on a day-to-day basis: spammers are gonna spam no matter what we do. Rather, we think this rule will help people who legitimately do want to contribute, but keep falling afoul of our unwritten expectations.

    2. New rule ("No off-topic posts") and new wiki section ("Allowed topics")

      We also previously handled off-topic posts in an ad-hoc way; this rule again codifies our informal heuristics.

      In short, we want to skew towards leniency. There are many topics that straddle the line between learning programming vs some other tech topic: questions about the command line, web design, using an IDE or some other programmer tools... In many cases, it's unclear even to us mods exactly where the best home for some question is: we certainly don't expect beginners to do a better job!

      So, we've decided we're ok with us becoming a home for these "straddling" questions -- or at least a first stopping point. If somebody asks one, please either just answer the question or leave a comment like "This seems like a better fit for /r/cscareerquestions" directing them to the right place.

      Reports should be reserved for cases where the post is blatantly off-topic and should be removed: for example, if OP is asking for tech support ("how do I use MS word?"), legal advice, and so forth.

    3. Provisional new rule: "Do not ask exact duplicates of an FAQ question"

      This new rule is an experiment to try and reduce the number of low-effort questions we get. We plan on starting by enforcing this rule in a very narrowly scoped way: we'll likely forgive questions that are similar but not exact duplicates of FAQ questions, for example. Depending on the results, we may widen, change, or remove this rule entirely.

    4. Deleted rule: "Any external resources linked to should be up-to-date and correct"

      We're removing this mostly due to space constraints: reddit's subreddit rule UI currently allows a max of 10 rules. We picked this rule because we rarely received reports for it, and we almost never acted on the reports did get: either people would report the post as spam instead or they'd leave tons of good follow-up comments criticizing the post that we wanted to preserve.

    5. Modified rule: "No app/website review requests" now explicitly whitelists for code reviews

      We originally added this rule because we saw too many posts that were secretly promoting something under the guise of a review request. This ended up being a little heavy-handed: we saw people discouraging beginners from posting code reviews, which we're actually fine with.

      So, we're keeping this rule but added a clause explicitly whitelisting code review requests, along with a new section in the wiki on how to ask for a code review. Any suggestions on what to add there are welcome, of course.

    6. Modified rule: "No referral links" is now "No indirect links"

      The old rule had no real philosophy behind it: it disallowed referral links and clicktrackers mostly out of distaste. The new rule is that we forbid any "indirect" links where the intermediary page adds no additional value. So, URL shorteners, click-trackers, and referral links are not allowed as before, but this rule now lets us disallow things like links to tweets or half-hearted blog posts that contain only a link to the actual resource. It also explains why Udemy coupon codes are ok: the discount adds "additional value".

    7. Expanded rules: "No abusive or derogatory comments" and "No complete solutions" (and new wiki sections)

      Both of these rules have stayed mostly the same, but have received additional commentary and examples: the former rule links to the new Acceptable speech and conduct section of the wiki; the latter links to a revamped Offering help section.

    8. Deleted rules: "No Reddit bot tutorials or questions" and "No 'recommend hardware' questions"

      Both of these rules now fall under the umbrella of "No off-topic questions". Hardware recommendation questions are also now no longer allowed as per the new "Do not ask exactly duplicates of FAQ questions" rule.

    9. Modified rule: "No piracy" is now "Do not promote illegal or unethical practices"

      It always felt weird to call out specifically and only piracy.

    Questions? Comments? Suggestions? Concerns?

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

    The best thing about learning to program is no longer seeing targeted ads on depression

    Posted: 06 Jan 2019 08:24 PM PST

    Everything is now about programming.

    Oh, and I'm happy :)

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

    Finally I've Completed the freecodecamp

    Posted: 06 Jan 2019 02:11 AM PST

    Hi there,
    I am hooria, i am 13 year old and I started freecodecamp in July 2018 and completed the whole freecodecamp curriculum in december 2018. on the average of 2 hour code daily

    here is the proof of completion:
    Freecodecamp profile

    For those of you who are just starting out their journey to web development and programming in general, Here are a few things I'd like to say

    • freeCodeCamp teaches you programming via hand-on practical approach. Complement it by reading good articles or official documentations or a book if you want in depth knowledge about certain frameworks or technology.

    If you are new i wish you best of luck

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

    What's the best way to share programs between home pc and laptop?

    Posted: 06 Jan 2019 07:06 PM PST

    Is it best to just use a repository like github or a cloud service? I just don't want to email the same few files back and forth over and over as I edit them or copy and paste code.

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

    JSON data not printing correctly

    Posted: 06 Jan 2019 11:48 PM PST

    When you run the script and search 'murus' the "States:" data (system['states']) is repeating and not syncing with the rest of the JSON data. Please run the script to see what I'm talking about. I've been struggling with this all day, anyone know what I should do?

    import requests space = '----------------------------------' systems_api = requests.get('https://eddb.io/archive/v6/systems_populated.json').json() def systems_data(system): print('System: %s' % (key)) print('Distance: %.4f' % (value)) print('States: %s' % (system['states'])) print(space) while True: sys_results = {} search = input("Search: ").upper() for system in systems_api: if search == system['name'].upper(): sys_search_x = float(system['x']) sys_search_y = float(system['y']) sys_search_z = float(system['z']) for system in systems_api: if search == system['name'].upper(): print() print('Current system: %s' % (system['name'])) for state in system['states']: print('State: %s' % (state['name'])) print(space) continue distance = ((float(system["x"]) - sys_search_x)**2 + (float(system["y"]) - sys_search_y)**2 + (float(system['z']) - sys_search_z)**2)**0.5 sys_results[system['name']] = distance for key, value in sorted(sys_results.items(), key=lambda x: x[1], reverse=False)[:20]: systems_data(system) elif search == 'EXIT': break else: continue break 
    submitted by /u/kurotheactivist
    [link] [comments]

    Help for MVC5 web application Programming.

    Posted: 06 Jan 2019 11:47 PM PST

    HI, I am a beginner in MVC programming and want to create a responsive web Page for Employee Login. Please help with the code snippets in MVC5

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

    Are there any React.js resources which are NOT "Make a ToDo App" or "Just Write What I am Writing and Make an App?"

    Posted: 06 Jan 2019 08:00 PM PST

    I started off with just reading the documentation at https://reactjs.org but got confused after a few pages. I saw that Brian Holt's (btholt) React tutorial is extremely popular, so I tried keeping up with that. I got through about half the course and understood it pretty well until he starts doing the API stuff from PetFinder, which was a tad bit confusing since he doesn't explain what does what very well at that part. I haven't continued that yet after the "Routing"

    I then hopped around on a bunch of other people who either followed the "Write what I am writing" method or "Let's make a Todo app just follow my instructions" or didn't really explain things well.

    Last tutorial I tried was Traversy Media's React.js Crash course. While it was explained pretty well, I'm still iffed about making a Todo app.

    I have a few ideas of projects I could make, but are there any other react tutorials which don't do Todo apps and explain things well? I want to get some more fundamentals under my belt before I venture off on creating my own shit.

    Thanks!

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

    Asp.net login problems

    Posted: 06 Jan 2019 11:38 PM PST

    I successfully hosted a sample asp website on aws. I can login on my phone and laptop but can't login via incognito tabs. The login page just refreshes with out any error and resets the username and password.

    Some of my friends can't even login with any browser on there phones.

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

    Where to start

    Posted: 06 Jan 2019 11:24 PM PST

    Hi, I´m relatively new in programming, but I learn it in school and in my freetime.

    For my "real first" project I want to read out a website, change with those information my outlook calender and send an notification to my phone.

    I think I could run this script on my Raspberry Pi 3 B+, but what programming language should I use and where to start.

    Thanks in advance

    (PS: sorry for my kind of bad English, I´m from Germany)

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

    What is this split() function doing here (Need help on understanding this algorithm) ?

    Posted: 06 Jan 2019 11:24 PM PST

    This code is a solution to an algorithm where you count the number of times a website has been visited and split the input to where we organize it like this:

    Input: ["9001 discuss.leetcode.com"] Output: ["9001 discuss.leetcode.com", "9001 leetcode.com", "9001 com"] 

    Here is the solution

    class Solution { public List<String> subdomainVisits(String[] cpdomains) { Map<String, Integer> counts = new HashMap(); for (String domain: cpdomains) { String[] cpinfo = domain.split("\\s+"); String[] frags = cpinfo[1].split("\\."); int count = Integer.valueOf(cpinfo[0]); String cur = ""; for (int i = frags.length - 1; i >= 0; --i) { cur = frags[i] + (i < frags.length - 1 ? "." : "") + cur; counts.put(cur, counts.getOrDefault(cur, 0) + count); } } List<String> ans = new ArrayList(); for (String dom: counts.keySet()) ans.add("" + counts.get(dom) + " " + dom); return ans; } } 

    What is going on in line 6: ?

    String[] frags = cpinfo[1].split("\\."); 

    I did not know you can split an array at a specific index ? I tried doing this in a simple program with no for loop and I get an error. I don't know why it's being split at one index ?

    Does also anyone know what the .getOrDefault() method is doing on line 11 ? It just returns the value to where a specific key was mapped ? Why would I need to do that ?

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

    Need help deciphering Automatic Backward Elimination in R from Udemy's Machine Learning A-Z

    Posted: 06 Jan 2019 11:24 PM PST

    Hi

    I am doing the course Machine Learning A-Z from Udemy. In Lecture 54 of Section 5, Automatic implementation of Backward Elimination in R is discussed (attached below)

    BackwardElimination <- function(x, sl) { numVars = length(x) for (i in c(1:numVars)){ regressor = lm(formula = Profit ~ ., data = x) maxVar = max(coef(summary(regressor))[c(2:numVars), "Pr(>|t|)"]) if (maxVar > sl){ j = which(coef(summary(regressor))[c(2:numVars), "Pr(>|t|)"] == maxVar) x = x[, -j] } numVars = numVars - 1 } return(summary(regressor)) } SL = 0.05 dataset = dataset[, c(1,2,3,4,5)] backwardElimination(training_set, SL) 

    Could someone please help me out with Lines 5 and 7? I understand that in Line 5, we are finding the maximum coefficient from the regressor model but, what action is the combine function and "Pr(>|t|)" doing after that? In Line 7, we are finding the position of all the coefficients of the regressor model but I am facing similar issues with the combine function.

    Thanks

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

    How to integrate Google Calendar into an Android app?

    Posted: 06 Jan 2019 07:31 PM PST

    I'm having a bit of trouble figuring out how to connect my app with Google Calendar. The app has a user sign in using Google Sign-In. I'd like my app to be able to create events in the user's Google Calendar, but I'm not sure how to do this. I've read up on the Google Calendar API as well as the Calendar Provider repository but I'm still thoroughly confused on what to do. Any help would be greatly appreciated!

    submitted by /u/roshie-548
    [link] [comments]

    How to Design & Deploy a Review Blog from Scratch?

    Posted: 06 Jan 2019 11:04 PM PST

    Hey guys, this is an alt and my first time. Hope you are well who reads this!

    I want to build my own blog/site from scratch where I review stuff. I have carefully outlined my review process, and I want to have several fields that I just input my notes into and it automatically will post my review.... a sort of partial CMS type of application. I don't care about any hardcore CMS features like localization or multi-platform stuff really though.

    BTW, I know this is crazy and I should just use a pre-built CMS of some type, but I want the project and experience under my belt. I'm an unemployed dev, not a blogger.

    So I'm going through this app in my head.... I'll need a basic UI for editing that tells a server to POST some changes to a DB. My SQL is mediocre to poor and I want some experience, so I want to store the reviews in a SQL server.

    1. What kind of options do i have to deploy SQL servers online? I want something easy, cheap, and fast.

    Any time i look into GCE or AWS, they present me with enough options and payment plans and differently named whatchamacallits that I can't really wrap my head around what's what. What's the basic SQL online server I should look at? I seriously doubt I will be getting lots of traffic but you never know. I have another site deployed on a heroku free account and that site is PAINFULLY slow. I also don't have much money though. Maybe I could afford a dollar a month? I don't know what these type of things normally cost because all the options are so convoluted.

    1. Whats the easiest, cheapest, cleanest way to handle comment sections? I'm looking preliminarily into disqus but I'm not sure how well that will handle the dynamic generation of new pages from my "CMS". I want to run ads on the site (mostly for the experience) and I'm not sure how disqus will play along with that either. I also, as outlined above, am very poor. It looks like disqus only gives API access to their "pro" tier subscribers. I am also considering writing this myself too but it seems like a bit of an undertaking of its own.

    1. Just a one or two word answer for me: how to run ads? Is there some google thing I should pop into a sidebar? thanks.

    1. What on earth am I going to do about images? Is there an AWS API that I can use to create new folders inside buckets? And then upload .JPG's to the new folder? And then add the new link from my S3 filepath to the DB table for the article? Shit I'm way over my head here

    TBH I'm thinking a lot about this project and I'm pretty sure it's way above my head. If you have any tips or tricks I should know, advice, or cruel words of discouragement please let me have them.

    EDIT: just to be clear, I want to explicitly define what I want to build & what each review should contain:

    1. A UI for me for uploading, creating and editing new reviews. It will have pre-defined fields for inputting numbers 4 and 5 below
    2. A live-updating home-page that lists maybe the five newest reviews or something like that.
    3. Each review should have a unique URL like https://site.com/reviews/name_of_thing_1
    4. Each review should have several sections of writing.
    5. Each review should have several pictures.
    6. Each review should have ads
    7. Each review should have a seperate comment section
    8. Later on I want to let users search for old reviews maybe with some kind of auto complete (I want to write myself with tries)

    EDIT2: I want to build the server in node and the site to be generated in react btw... DB i couldn't care less which language. open to suggestions

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

    Finding motivation to code

    Posted: 06 Jan 2019 03:01 PM PST

    I've learnt python 3 and started c#, and I enjoy coding, but I seem to get distracted and end up not practicing for long periods of time. Anything I can do to stop this? Thanks.

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

    Landing my first job

    Posted: 06 Jan 2019 10:13 PM PST

    I am wondering what everyone's opinion would be on an opportunity at a startup as a Linux Engineer intern. They haven't received finding yet for the company but will be soon. Would you recommend taking this job? It would be my first job using my CIS degree since graduating in March of last year. Please let me know your opinion or if you have had any experience in this area.

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

    Best rescource to learn c++ pointers/recursion

    Posted: 06 Jan 2019 12:20 PM PST

    I have two weeks to learn about these topics from scratch and I've been told they are hard to understand and get. I need to know these for the class I'm taking.

    Can someone post good tutorial videos/guides/books etc that do a good job of teaching them.

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

    Are there resources you would recommend for Dynamic Programming?

    Posted: 06 Jan 2019 09:54 PM PST

    I am trying to learn DP. More specifically I am looking for tutorials where we first come up with the brute force solution/recurrence relation and the tutorial shows us how to convert that into a DP solution.

    The ideal tutorial I am looking for should have the following:

    • Recurrence relation or brute force solution is clearly defined
    • We are clearly shown based on the recurrence relation how to set up the cache - what size it should be, how to set up base cases etc
    • The tutorial should focus on different DP problems with different types of recurrence relations and how to optimize it.
      • For example the recurrence relation for a problem like Bytelandian gold coins the recurrence relation is f(n) = max(n, f(n/2)+f(n/3)+f(n/4)) which can be translated into max(n/(2i * 3j ), f(i+1,j)+f(i, j+1)+f(i+2,j)) to make it more efficient since the first has an n complexity while second would have a logn2 complexity which is much better.
      • For a problem like the above I am looking for a tutorial that covers everything from the initial recurrence relation to how the relation can be optimized to how to set up the cache for the problem, how and where to fill in the base cases and what direction to fill in the table.
    • I do not want it to be too theoretical - I am more concerned with the problem solving aspect and any math in the tutorial should be directly related to solving or optimizing the problem.

    Almost all the tutorials I have seen online so far start by filling the DP table without really going over how they got to that point and why they are filling the table that way. I am looking for something a bit more comprehensive. Thanks.

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

    Are the discouraged resources accurate?

    Posted: 06 Jan 2019 09:44 PM PST

    A good friend of mine who is about to graduate from CS. Is very smart and TA several courses etc used Bucky's video and cplusplus.com

    He's a very good programmer. So I was going to use those resources to learn but idk why it's looked down upon?

    Idk what to do. I feel like I'll have to give them a try and decide for myself

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

    Recursion in Javascript

    Posted: 06 Jan 2019 09:38 PM PST

    I started reading Eloquent Javascript. I know this book has some mixed reviews from this community personally I like the book. Anyways I got to the part about recursion and I was confused as to what the code snippet is actually doing. This program is to find the sequence of operations it takes to find the target.

    function findSolution(target) { function find(current, history) { if (current == target) { return history; } else if (current > target) { return null; } else { return find(current + 5, `(${history} + 5)`) || find(current * 3, `(${history} * 3)`); } } return find(1, "1"); } console.log(findSolution(24)); Output: (((1 * 3) + 5) * 3) 

    I get all the code except the part where the find function is called inside of itself as well as return find(1, "1"); outside the find function?? When it falls to the else block and the find function is called is it starting back at the top of the find function again? I hope I explained this well enough. Thanks in advance.

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

    Can someone explain And, Not, and Or. for Python 2.

    Posted: 06 Jan 2019 09:16 PM PST

    I am currently in a course and i cant really understand how the boolean operators And, Not and Or works

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

    Has anybody taken Zell Liew’s “Learn Javascript” course? Is it worth it?

    Posted: 06 Jan 2019 01:08 PM PST

    Hey guys! So as the title states already, I'm kinda on the fence to purchase Zell's JS course. I just wanted to get a review of it and whether it was worth the price he asks for ($495). Please keep in mind that I want reviews to this specific course only and not other JS books/courses.

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

    Anyone else drop Python?

    Posted: 06 Jan 2019 08:40 PM PST

    I wanted to really learn programming properly, and no doubt will always be 'trying' to learn. I got caught up in a lot of the Python spin...doing ML in five lines of code and all that fun stuff. Then I stopped. Now, don't get me wrong...Python has many great features making it a simple language to pick up. It has a lot of flexibility and a lot of applications. These advantages I feel are also a disadvantage too. I have since switched to focusing my attention on Kotlin and C++. As I get deeper in to learning to learning programming I feel that I want to have a more structured and traditional journey.

    I am interested to find out if anyone else has moved away from the fastest growing programming language in favour of anything else and the reasons why.

    By the way, I do a bit of Python here and there. I am not anti, just finding my own way.

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

    Help following serialization logic

    Posted: 06 Jan 2019 02:18 PM PST

    I cloned a passport.js example repo on github and see this code in /passport/index.js:

    ``` const passport = require('passport') const LocalStrategy = require('./localStrategy') const User = require('../database/models/user')

    // called on login, saves the id to session req.session.passport.user = {id:'..'} passport.serializeUser((user, done) => { done(null, { _id: user._id }) })

    // user object attaches to the request as req.user passport.deserializeUser((id, done) => { User.findOne( { _id: id }, 'username', (err, user) => { done(null, user) } ) })

    // Use Strategies passport.use(LocalStrategy)

    module.exports = passport ``` On the deserializing method I believe passport is coded to query the database, find the correct user, and take some action (authenticate a login, logout etc). A comment says that this method attaches the info to req.user

    I am having trouble understanding the .serializeUser() method. I see this comment for it: // called on login, saves the id to session req.session.passport.user = {id:'..'} How does it know the correct user to save? I see it passes a local to represent that user. But I don't understand where it comes from.

    I guess if the front end is sending form data then passport knows to save the username that was keyed to a certain property elsewhere? I see this in LocalStrategy.js which passport is set to use on the key routes:

    const strategy = new LocalStrategy( { usernameField: 'username' // not necessary, DEFAULT },

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

    Resources on Scrum, Jira, and Agile

    Posted: 06 Jan 2019 08:05 PM PST

    What are good resources to catch up on these concepts and technologies? I wanna bridge the gap when I get my first job

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

    Where to get an overview of AI/ML

    Posted: 06 Jan 2019 09:28 AM PST

    I am a first year CS student and I want to learn about AI/ML. I honestly know almost nothing about it and I would like to read/watch a video to learn more. I'm looking for something kinda short (2-3h?) that would give me a quick overview of what AI/ML is, how it works, what programming langage it mostly uses, etc. I have found a lot of classes about AI/ML, but they are usually quite long and recquire you to do some programming (which is great to learn and I do want to do that eventually), but I would prefer to start with an overview that would help me understand how and for what AI/ML are used today.

    Thanks!

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

    No comments:

    Post a Comment