• Breaking News

    Friday, May 3, 2019

    Away from computers for 2 months. Help me read books and come back even smarter! learn programming

    Away from computers for 2 months. Help me read books and come back even smarter! learn programming


    Away from computers for 2 months. Help me read books and come back even smarter!

    Posted: 02 May 2019 07:35 PM PDT

    Could you give me some books that would help me learn everything about computer science so that when I come back I will be super set? I want to learn everything about web development from front end to back end and since im going to get bored even get the beginner books! I just need everything so that when I come back from my hiatus I will know everything about Full-Stack web development.

    Thanks for the help!

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

    Why would you ever want to create a data structure without random access?

    Posted: 02 May 2019 05:17 AM PDT

    From what I understand sequential access is like removing 10 of the top cards in a card deck when you want the 11th card, and random access is taking the 11th card out of cards that are arranged in a line.

    I don't understand the utility of sequential access. Why would linked data (linkedlist) ever outperform data with an index(array)? If you want to go to your friends house, you drive to his address - you don't look inside every house in the country. If I want tomato paste, i go in the pantry - I don't open every drawer in the house.

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

    Javascript book?

    Posted: 02 May 2019 08:11 PM PDT

    I am currently taking online classes - as a complete beginner - and everything has been clicking well with html and CSS. Hasn't come super easy, but I've been able to figure it out and LOVE when something clicks and I figure out the correct code. (again, I knew nothing about a month ago.) We've moved into Javascript and I am having a hard time. I think the instructions are clear, and I can replicate what they're asking me to do, but nothing is "clicking" as to the overall concept. I understand what html and CSS does on a basic level, but I'm not getting it with Javascript. Are there any resources out there that just give a general overview that aren't tutorials? I'm not looking for more exercises, but more of a why "this does that" if that makes sense.

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

    [C++] writing begin() and end() functions for a Binary Search Tree iterator

    Posted: 02 May 2019 02:24 PM PDT

    Hi, I have a few questions regarding writing an iterator class for a binary search tree.

    So my node class needs to implement two functions,

    begin() and end(), for in-order traversal of my BST (starting at the leftmost node).

    So regarding the begin() function:

    Should I just recursively traverse the tree from its root node until I reach its leftmost node and then return that as my iterator class? Would that be the correct way of implementing it?

    Oh, and end() should point to the element after the rightmost element in the tree, right? But how would that work with the == operator, for instance, if it's just pointing at nullptr?

    Thanks in advance.

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

    I have zero programming experience, I want to make an album rating algorithm, how would I go about doing that?

    Posted: 02 May 2019 08:17 PM PDT

    I'm kind of obsessed with albums and rating albums. I want to make an album rating algorithm. Basically a program that calculates different averages, weights them, and ranks albums, and responds when you add new albums. I'm probably sounding crazy, my bad.

    It would be something like this:

    There's two weighted ratings to each album, that make the overall album rating: the total song rating and the general album rating.

    Each song has several sub ratings. The mean of these ratings determines the overall song rating, then the mean of all the overall song ratings is the total song rating for the album.

    Also, the album itself would have sub ratings, and the mean of those ratings would be the overall rating for the general album rating

    Then, those two categories would be weighted and combined to make the final score.

    How would I program this? Most important, how would I program a responsive list that adapts the rankings according to new data? Could I make some sort of online database as well?

    I'm sorry if this is not explained well, thank you in advance!

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

    Basics: GitHub and Source Control

    Posted: 02 May 2019 08:16 PM PDT

    Hello!

    Sharing the materials we had for our recent workshop with the goal of teaching enough foundational knowledge to get a beginner programmer started on Github and understand basics of source control.

    It consists of a presentation and exercises you can follow along to apply the discussed concepts when the presentation says so.

    The intended audience is for a beginner who does not know what source control is, or why it's needed. Topics covered include what branches and pull requests are. The user can then research the more advanced stuff later or as needed as they continue coding on projects.

    Hope somebody finds these useful 🙂

    Edit:

    Prerequisites to do the exercise are to install the following on your machine: 1. Git 2. IDE (Visual Studio Code if you don't have one already)

    Edit 2:

    Workshop content starts at slide 25.

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

    [How to Code: Simple Data] BSL: Help on "sinking stones" problem

    Posted: 02 May 2019 11:19 PM PDT

    Hi, so after like 8 hours of struggling I managed to solve 1 of the 2 questions on the quiz. I'm doing this on self-study so not much people to refer to. Basically this is the problem statement:

    Complete the design of a function that takes a list of blobs and sinks each

    solid blob by one. It's okay to assume that a solid blob sinks past any

    neighbor just below it.

    Basically there are a list of "solid" and "bubble", and I need to move every "solid" below 1 "bubble" or none.

    I am able to get all the tests pass, except for the ones that have multiple consecutive "bubbles", or "solid", such as this test:

    (check-expect (sink (cons "solid" (cons "bubble" (cons "bubble" empty))))

    (cons "bubble" (cons "solid" (cons "bubble" empty))))

    My output:

    (cons "bubble" (cons "bubble" (cons "solid" '())))

    Expected output:

    (cons "bubble" (cons "solid" (cons "bubble" '())))

    As you can see, due to recursion, my "solid" will run twice because it meets "bubble" twice. My idea is that I could either:

    1. Loop from back to front, because "solids" will fall to the bottom, however, I can't code this out. In C and Python we can create an back-to-front loop, but there is no such functionality in BSL without:
      1. Recursing to the end of the original list, once hit empty
      2. Proceed to swap every side-by-side copy of "bubble" with "solid"
      3. Insert the swapped copies to the front of the list by creating a new list, swapping the copied list's first entry with the new entry, and joining the two copies with the rest of the copied lists.

    but as you can see, this will get really messy, especially when I haven't learned any proper way to "store" variables in BSL, and also ways to execute multiple statements. So I was wondering if there is a way to get a "front-to-back" loop work?

    This is my code:

    ;; ListOfBlob -> ListOfBlob

    ;; produce a list of blobs that sinks the given solid blobs by one

    ;; !!!

    (define (sink lob)

    (cond [(empty? lob) empty]

    [(string=? "solid" (first lob))

    (cons (first (swap lob))

    (sink (rest (swap lob))))]

    [else (cons (first lob)

    (sink (rest lob)))]))

    ;; ListOfBlob -> ListOfBlob

    ;; swap the first element of the lob with the second element of the lob

    ;; if second element is not empty

    ;; If the second element is also "solid", then swap second with third first,

    ;; and so on

    ;; !!!

    (define (swap lob)

    (cond [(empty? lob) empty]

    [(empty? (rest lob)) lob]

    [(string=? (first (rest lob)) "solid")

    (swap-blob (cons (first lob) (swap(rest lob))))]

    [else (swap-blob lob)]))

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

    Python - operation precedence

    Posted: 02 May 2019 07:22 PM PDT

    Hi all, I am trying understand what

    b, a = a, b % a 

    does and why it does not produce the same results as

    b = a a = b % a 

    nor does it produce the same result as

    a = b % a b = a 

    Its doing something different. What is it doing?

    Thanks.

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

    Should I document a JS/TS project the same way I'd document a Java project using JavaDoc?

    Posted: 02 May 2019 10:32 PM PDT

    Might be a bit of a strange question, but this is my first time working on a big JS app.

    When I'm working in Java I'll document everything - interfaces, classes, enums, methods and their params and return types.

    I've recently started working on a Vue.js app. Another company developed it for us as a kind of prototype and aside from a readme, it's pretty much entirely undocumented. It's made up of 'views' (.vue, single-file components) and 'services' which are TypeScript modules containing classes, enums, some static utility methods and some global variables (which we're stuck with as it's built on some older code).

    So this was undocumented when I took over. I think the Vue components are self-explanatory anyway, but the services can get quite complex and there's a ton of them so I've been struggling to learn how it all works and how everything fits together.

    I'm considering going through all these modules and documenting them the same way I'd document a Java program - describe what classes represent and are used for, what methods do, params and return values etc. Both because I think it'd help me learn what's going on, and I feel like it needs documenting.

    But basically, I just want to know: is this overkill? I've never really seen JS code documented with anything more than a few inline comments before. And since it's TypeScript, extensive documentation might not be as important.

    Just looking for some insight from people with more experience than me.

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

    What is your skillset?

    Posted: 02 May 2019 09:42 PM PDT

    I'm curious how lots of job ads require one person to know multiple languages when one language is hard enough to be really good at. So what skills do you use to do your job? For example [html, css, php, javascript] or maybe [java, spring, hibernate, maven]. You can be specific and tell which versions, frameworks etc. you know. Or softwares you use too

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

    What are the basics of programming?

    Posted: 02 May 2019 11:49 AM PDT

    I'm currently reading about data structures on a website. It says here "before going deep into data structure, you should have a good knowledge of programming in C, C++, Java or Python".

    Now I'm like "well hold on there sparky, if I can know how to program "good" without knowing data structures and algorithms then where the hell does one start to learn exactly how to program good??"

    Obviously I'm new and don't know jack squat about this here programming, I need someone to tell me, what exactly is the first step if not data structure??

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

    [Java, JSTL] Dynamic dropdown list doesn't populate

    Posted: 03 May 2019 12:32 AM PDT

    I've made a list of clients for and wanted to use the method/function again in another jsp. I'm having trouble figuring out why the drop down doesn't populate. It's pretty simple stuff similar to what I've before, yet it's not working. I'm new to JSTL stuff and have been doing research/googling, but have hit walls making even simple examples work.

    I wonder if my annotations are off, something I haven't used a lot (I sometimes get the error "Neither BindingResult nor plain target object for bean name 'command' available")? I'm posting the relevant code so this doesn't turn into a novel, files are short anyways.

    I get a nice drop down, but nothing inside of it. I'm not sure what big or small thing I'm missing, but it's driving me nuts.

    In the controller...

     @RequestMapping("/admin/clientList") public String showClients(Model model) { List<ClientConfig> clientList = clientConfigService.getClientConfig(); model.addAttribute("clientList", clientList); return "clientList"; } @RequestMapping("/admin/Metrics") public String metrics(Model model) {//, BindingResult result){ Date today = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime(today); cal.add(Calendar.DAY_OF_MONTH, -30); Date today30 = cal.getTime(); //finish code for 30 days List<ClientConfig> clientList = clientConfigService.getClientConfig(); model.addAttribute("clientList", clientList); //List<ActivityLog> metricList = activityService.getActivityLog(clientid, "", today, today30); //model.addAttribute("metricList", metricList); return "metrics"; } 

    In my jsp where the drop down doesn't populate in METRICS.JSP using admin/Metrics OR admin/clientList...should I/would it be better be backing the table with javascript like I do in the code snippet below this one...even though I've seen many examples without any javascript? All my tags are there, haven't forgotten any tag libs.

     <!-- drop down --> <div class="form-style"> <table> <tr> <td> <select name="/admin/clientList" style="width: 260px"> <!-- admin/Metrics doesn't work --> <c:forEach items="${clientList}" var="ClientConfig"> <option value="${ClientConfig.clientid}"> </c:forEach> </select> </td> </tr> </table> </div> //here I'd take the selected client and display their info in a table like in the working example below 

    This is a code snippet from the CLIENTLIST.JSP using /admin/clientList that works perfectly to populate a table....yet I can't get it to work in a drop down....

     <c:forEach var="clientList" items="${clientList}"> <tr> <td><c:out value="${clientList.clientid}"></c:out></td> //in the script tag //datatable in the script tags that fill the above code $('#cTable').dataTable({ "dom" : '<"clients-toolbar">frti', "iDisplayLength" : -1 }); 

    Thanks in advance.

    submitted by /u/Red-Droid-Blue-Droid
    [link] [comments]

    For programmers / aspiring programmers, what "programming" path did you choose and why?

    Posted: 03 May 2019 12:30 AM PDT

    Im sure some of us aspiring programmers here don't know what "programming" path to choose. We just like to create stuff, be it a game or a database. We don't have a clear goal like " I want to be a data scientist " or " I want to be a full stack developer". But still worried about our future.

    What is your advice for us aspiring programmers?

    Or share your experience when you pick your "programming" path.

    I hope this will be used as a reference for others because I certainly will.

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

    2.8 GPA, 4 classes away from graduating, is getting a remote job impossible?

    Posted: 02 May 2019 03:25 PM PDT

    Hello all!

    First off, due to certain circumstances with my health, My once 3.8 gpa has now dipped to a 2.8 :( Anyway, I've been thinking alot about how below 3.0 gpas can effect CS majors. And due to my health ailment, I would want to look for a remote job. Most of the remote jobs I've seen so far are requiring at least 1 years worth of experience. I haven't even had an internship yet, let alone a year under my belt. What would you guys recommend for me in terms of even trying to one day get a remote internship and or job. All advice will be helpful!

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

    What types of jobs do computer systems and computer architecture feed into? What subfields overlap?

    Posted: 03 May 2019 12:04 AM PDT

    I'm a freshman at UMich and I know that our department is really strong in computer architecture/computer systems which seems to be why we have a good computer engineering program so I'm curious what type of jobs these topics actually feed into. Is it mostly just chip design at companies like Intel and Nvidia?

    I was also wondering if any areas that are connected with AI/ML/data analytics since I've been working on a few projects using these technologies and would love to find a way to merge multiple areas of CS.

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

    How to find balance between image quality and web page performance?

    Posted: 02 May 2019 08:16 PM PDT

    Currently I'm in the middle of creating my personal website and I was wondering how much compression is too much? If I were to compress an image as far as it goes, it looks...bad but at the same time I don't want my visitors to suffer through huge file sizes either. Is there a way to find balance?

    So far I have different sized images for different devices (360p to 4k), I'm using progressive jpg (wanted to use webp but apparently apple doesnt support it well), as welll as cdn and gzip.

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

    [C#] Help to conceptualize lookup/mapping functionality.

    Posted: 02 May 2019 11:01 PM PDT

    Hello,

    Sorry for the crappy title.

    I'm a beginner level programmer trying to develop a windows application to facilitate a specific task in my day-to-day work life. One part of the application needs to search and find information in an Excel file in a specific pattern. The pattern will be chosen by the user from a drop-down or similar control. The user should also be able to specify a custom pattern and save that to retain the pattern between sessions. Below I describe how the find method will work.

    private string FindInfoFromExcel(string input) { //usedRange has already been defined Excel.Range findRange = usedRange.Find(input); if (findRange != null) { int columnNumber = findRange.Column; //usedWorkSheet has already been defined. This will return the //Excel column name e.g. A,B,C et.c. in the form $A$A. string columnName = usedWorkSheet.Columns[columnNumber].Address; return columnName; } else return "NoMatch"; } 

    After this I want to use the columnName string to return a user defined string from another method. The user will have previously mapped what string should be returned from what column. Different users might want a different number of columns to generate different strings.

    My question is: how should I do this lookup/mapping so that the mapping is user-customizable and retained between sessions in a good and efficient way?

    I've considered just using a .txt as an embedded resource and formatting it in a way that I can easily programmatically read and write to it, but I'm unsure of how embedded resources work and if they will be visible and editable from the "outside" (which I would prefer to avoid).

    Is there another way which is better and considered good or standard practice?

    Thank you.

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

    B.A. History + M.S. Data Analytics + Self taught Python?

    Posted: 02 May 2019 10:48 PM PDT

    I know this is a pretty specific scenario, and a tough question to answer with a firm yes or no. But, given the scenario of the title, do you think it would be difficult to get a job as a Data Engineer or Data Scientist? The only thing that concerns me is my lack of a formal Comp Sci background. What do you guys think of that route?

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

    What should I use for browser test automation, Node.js or Golang?

    Posted: 02 May 2019 06:48 PM PDT

    Hello!

    I want to make a software for data analysis of several websites, I currently work in PHP with Symfony, but for this project I'm thinking about which programming language to use if Go or Node.js, since I have to do scraping and automatic test simulation in browser.

    For me it would be easier Node.js since I have a little knowledge of it, but I'm also very curious to learn Golang the problem I'm seeing seems to be that Node.js has better support for the tasks I want to make, also when I finish my app I would like to convert it with Nw.js or Electron.

    I have been reviewing the same for Go and I see we have

    https://github.com/chromedp/chromedp,

    https://github.com/asticode/go-astilectron,

    but in Node.js I see:

    https://nwjs.io/

    https://electronjs.org/

    https://github.com/GoogleChrome/puppeteer,

    so in my opinion for the task I want to do seems that Node.js has better support and their libraries seem to be more advanced, but I'm still in doubt .

    What do you think the language should use?

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

    Any suggestions for a comprehensive HTML/CSS course?

    Posted: 02 May 2019 10:18 PM PDT

    I've searched on my own, but a lot of resources, especially those in the FAQ, tend to just cover the bare minimum basics and then you have to figure the rest out and search as you need it.

    My criteria:

    • Writing-oriented, not just videos. (Make it's easier to create notes)
    • Includes responsive design
    • Covers semantic code

    For some context, I'm already at an intermediate level with HTML/CSS and at an advanced level with the DOM, but I'm looking to re-review HTML and especially CSS. I don't want to have to watch hours of videos to find gaps, I would rather read about them. It doesn't matter to me if the course is free or paid. I'm happy to pay for quality.

    Thank you for any help!

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

    I made my first open-source software! May I have some feedback? :)

    Posted: 02 May 2019 03:25 AM PDT

    Hello, I am new to software development and today I created my first software! The software is called "titus-pitch-generator"(lame i know lol). It receives a music note as input and generates a wav file and play it so the user can use it for tuning. (If you don't know what to input just type a capitalized letter from 'A' to 'G')

    Could you guys please take a look and give some feedback on how to improve on this piece of software? Thx in advance. https://github.com/titusngiscoding/titus-pitch-generator

    Edit: I made a portable version of my software for windows with the embeddable python interpreter (no installation of Python required) https://github.com/titusngiscoding/titus-pitch-generator/releases

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

    Python Tic Tac Toe Game

    Posted: 02 May 2019 04:58 AM PDT

    Hi, I'm new to Python and I have this code for a multiplayer tic tac toe game (that I made for a university assignment for my introduction to python class), but it's not really working since when you play the game again, it doesn't detect a win/lose or tie... I have tried everything but I can't get it to work properly. Can anyone please help me?

    I have also tried (unsuccessfully) to create a leaderboard, so any tips on that would be much appreciated too!!

    # variables board = [" ", " ", " ", " ", " ", " ", " ", " ", " "] game_running = True winner = None cur_player = "x" # functions # start the game from now on def replay(): while game_running == False: playagain = input("Would you like to play again? (Enter yes or no) ") if playagain.lower() == "yes": resetboard() resetgame() #start_game() #boardcopy(board) #start_game() elif playagain.lower() == "no": print("You have finished the game.") break else: print("Sorry, I didn't understand... Could you repeat your answer? ") def resetboard(): '''game_running = True winner = None # cur_player = "x"''' # newboard = list(board) board[0] = " " board[1] = " " board[2] = " " board[3] = " " board[4] = " " board[5] = " " board[6] = " " board[7] = " " board[8] = " " showboard() def resetgame(): game_running = True winner = None # cur_player = "x" while game_running: turn(cur_player) checkgame() nextplayer() if winner == "x" or winner == "o": print("player", winner, "has won the game") replay() elif game_running == False: print("It's a tie!") replay() def start_game(): showboard() while game_running: turn(cur_player) checkgame() nextplayer() if winner == "x" or winner == "o": print("player", winner, "has won the game") replay() elif game_running == False: print("It's a tie!") replay() def showboard(): print(board[0], " | ", board[1], " | ", board[2], " | ", " 1 | 2 | 3") print(board[3], " | ", board[4], " | ", board[5], " | ", " 4 | 5 | 6") print(board[6], " | ", board[7], " | ", board[8], " | ", " 7 | 8 | 9") def turn(player): print(player, "it's your turn.") position = input("Choose a space from 1 to 9: ") # make sure the space is empty # valid or other variable valid = False while not valid: while position not in ["1", "2", "3", "4", "5", "6", "7", "8", "9"]: position = input("Make sure the number is from 1-9! ") position = int(position)-1 if board[position] == " ": valid = True else: print("Please choose another one, the one you chose is already taken! ") board[position] = player showboard() def checkgame(): checkwhowins() checktie() # checkboard() # playagain() def checkwhowins(): global winner columnwin = checkcolumn() rowwin = checkrow() diagonalwin = checkdiagonal() if rowwin: winner = rowwin elif columnwin: winner = columnwin elif diagonalwin: winner = diagonalwin else: winner = None def checkrow(): global game_running row1 = board[0] == board[1] == board[2] != " " row2 = board[3] == board[4] == board[5] != " " row3 = board[6] == board[7] == board[8] != " " if row1 or row2 or row3: game_running = False if row1: return board[0] if row2: return board[1] elif row3: return board[2] else: return None def checkcolumn(): global game_running column1 = board[0] == board[3] == board[6] != " " column2 = board[1] == board[4] == board[7] != " " column3 = board[2] == board[5] == board[8] != " " if column1 or column2 or column3: game_running = False if column1: return board[0] if column2: return board[1] elif column3: return board[2] else: return None def checkdiagonal(): global game_running diagonal1 = board[0] == board[4] == board[8] != " " diagonal2 = board[2] == board[4] == board[6] != " " if diagonal1 or diagonal2: game_running = False if diagonal1: return board[0] if diagonal2: return board[2] else: return None def checktie(): global game_running if " " not in board: game_running = False # game will finish because the board is full return True else: return False def nextplayer(): global cur_player if cur_player == "x": cur_player = "o" elif cur_player == "o": cur_player = "x" start_game() 
    submitted by /u/puckbo
    [link] [comments]

    Smooth communication between Raspberry Pi and Arduino.

    Posted: 02 May 2019 09:59 PM PDT

    Hello Everyone.

    I am currently working on a project to receive data from an Arduino to Raspberry Pi. I had managed to successfully establish serial communication between the two devices. However, I am getting responses on my Raspberry Pi terminal such as:

    1234

    45

    Activate

    541236

    Activate

    345789

    Activate

    34

    1234

    Deactivate

    232

    444

    Deactivate

    This is just an example of what I am getting. The numbers may not correspond to the text that follows. My goal is to set up a code that prints out Activate when the read value from Arduino is more than 600000 and print Deactivate otherwise. I have tried using the int() and long() functions but they only produce results until a certain point and stops at certain numbers to print the following example:

    ValueError: invalid literal for long() with base 10: '5\n5176'

    Is there a way to smoothly display the numbers on the terminal without it separating into more than one line as stated above? Also, do notify me if I am posting in the wrong subreddit. I am still a beginner in coding/programming and do not know the right categories my questions or posts may fall under.

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

    Stupid easy html css? on adding fonts

    Posted: 02 May 2019 09:53 PM PDT

    So I put a link tag <link> in my head element in html? and then I can add the font to css selectors like normal using font-family:whatever; ? can I add a library of fonts or only one per link?

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

    No comments:

    Post a Comment