• Breaking News

    Monday, April 2, 2018

    CodeClippet.com is useful for keeping code snippets organized as you learn! learn programming

    CodeClippet.com is useful for keeping code snippets organized as you learn! learn programming


    CodeClippet.com is useful for keeping code snippets organized as you learn!

    Posted: 02 Apr 2018 12:50 PM PDT

    I found https://CodeClippet.com and find it useful for saving working bits of code and organizing them into folders. I thought others might like the way it works and find it useful for keeping different bits of code safe and easy to access :D

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

    What's the best way to learn python online for free?

    Posted: 01 Apr 2018 11:42 PM PDT

    I tried to learn python a few years ago but struggled to stick with it (used codeacademy and thenewboston tutorial videos lol). I wanna try to get back into learning it as my first programming language and i'm wondering what website or tutorials are the best that are available.

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

    RECURSION

    Posted: 02 Apr 2018 06:21 PM PDT

    Today in my journey to learn computer science and programming (python). I learned about RECURSION.... I get the gist of it, yet I do not understand its purpose? if anyone wants to give some of there real world examples that would be awesome. (please keep them simple(ish) )

    When I am learning something new in programming, it usually take me coming up with some of my own problems to solve in order to fully get it. Yet I feel a little lost on the use of concept.

    Tahnks

    submitted by /u/carter-the-amazing
    [link] [comments]

    Wanting to learn java

    Posted: 02 Apr 2018 09:09 PM PDT

    Hi I'm a 14 year old reddit user who as you can tell from the title is wanting to learn java and I honestly don't know where to start so I was wondering if anyone here could give me a few tips/ pointers on where to start, it might also help to know that I want to learn how to use java in gaming such as minecraft or any other platform that uses java.

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

    Unsuccessful self-taught programmers: what do you think you did wrong?

    Posted: 02 Apr 2018 12:42 PM PDT

    The successful self-taught programmer threads are very popular here, but I am a bit curious about those that tried to teach themselves for years and still couldn't get a job. For those people, what do you think the problem was? If you did eventually get a job, what did you have to change to make that happen?

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

    JSON and AJAX help

    Posted: 02 Apr 2018 02:31 PM PDT

    File 1 File2

    For the JSON part I tried

     var listData = ""; for(var key in data) { // listData += "<tr><td>" + key + "</td><td>" + JSON.stringify(data[key]) + "</td></tr>"; listData += "<tr><td>" + "</td><td>" + JSON.stringify(data[key]) + "</td></tr>"; } $("#jsonTable").append(listData); 

    to no avail. It gets me this which has two problems..one is that I'm getting "success" and "Retreiving data as JSON", but I should start from index 2 right? From there.. I'm just getting the string version of the JSON as <td> table data..but how do I make them into a standard table like so (I got this to work from clicking the HTML link, that part was easy to do, though it's not in the link I provided).

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

    can anyone explain arrays to me?

    Posted: 02 Apr 2018 05:39 PM PDT

    i have a programming class and i realy dont understand arrays, can anyone explain it easily to me?

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

    ELI5: Hashing/hash functions (or just links to good explanations)

    Posted: 02 Apr 2018 05:34 PM PDT

    Really just looking for a basic explanation. I get that you put a value through a hash function and you get a key that helps you look up its position... Is this really the essence of it? Am I correct in my understanding? Thanks guys!

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

    [Java] Is there a way to do this problem without using two for loops?

    Posted: 02 Apr 2018 05:32 PM PDT

    http://codingbat.com/prob/p168357 (has two 7's next to each other in array or separated by one space)

    This is what I tried below but it's missing the case where it needs to check if the last two entries in the array are 7's

    public boolean has77(int[] nums) { for(int i = 0; i < nums.length - 2; i++){ if(nums[i] == 7){ if((nums[i+1] == 7 || nums[i+2] == 7)){ return true; } } } return false; } 
    submitted by /u/kalrah
    [link] [comments]

    Why is it that O(2^n) is sometimes called "exponential time"?

    Posted: 02 Apr 2018 08:25 PM PDT

    I often hear exponential time and think en.. Is this simply a special case of anything raised to the n?

    submitted by /u/-proof
    [link] [comments]

    What's the best language to learn to read/manipulate audio (.wav files, at least)?

    Posted: 02 Apr 2018 07:39 PM PDT

    I want to make weird plugins for music. I wanted to learn Nyquist for Audacity plugins but it's based on Lisp and I wasn't satisfied with the resources available to learn lisp, also it only really works for Audacity so that's limiting. What should I learn in order to generate new audio files and read/modify existing audio files?

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

    Optimization of a Fast Fourier Transformation-based correlation function in Numpy/Scipy/etc.?

    Posted: 02 Apr 2018 05:27 PM PDT

    This might extend beyond the scope of this sub, but I'd love the help nonetheless.

    Also as a forward, I don't have a lot of extensive mathematics knowledge. I'm a sophomore in CS, and I've taken up to Calc 2 (with some other random knowledge from watching youtube vids). I've done some preliminary research on the topic, but haven't found much aside from some super-dense academic journal articles that I really don't understand.

    So I have two HUGE sets of time-based data that I need to correlate based on a time-delay. Specifically, I need to compute the lag required to maximize correlation of the two data sets.

    But since the two sets of data are so large (almost 4 million rows of data in one of the sets), I need to run this as fast as possible. I know how to do this brute-forcily and slowly, but I don't really know how to do it fast. So, not only do I need to optimize the function in a mathematical sense (maximize correlation), but I need to optimize the function in a computation sense.

    Through some research, I've found that doing a Fast Fourier Transformation-based correlation is faster than running numpy.correlate. What I'm hoping to find out is if there exists a fast way to do mathematical optimization of this function.

    Right now, my brute force method is this (using 24-hour windows of data):

    1. Starting with no time-delay between functions, calculate the correlation of the sets with the FFT function (then in future runs make the first shift the average of all shifts before it)
    2. Shift one set by x minutes, recalculate the correlation
    3. If the correlation is higher, shift up again by x minutes. If not, shift down by x*2 hour (then shift down by x minutes since you don't need to calculate the correlation of the 0 minute shift again) (Actually, I don't think this will work, so I'll probably have to look through every time delay in the entire -2 to +2 hour range)
    4. Repeat step 3 for the range of until a maximum is found in the range of -2 to +2 hours
    5. Save some information like the correlation, time delay, date range, etc. to a csv file
    6. Shift the window of data up by 30 minutes

    Then repeat all of those steps for all of the data entries (2 years worth of data). The resolution of the data is on the scale of ~15 seconds, so it's quite a lot of data processing.

    Are there any mathematical methods/functions I can use to both mathematically and computationally optimize the program and are there any numpy/scipy/etc. functions I can use to help with this?

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

    What programming paradigm should you learn first?

    Posted: 02 Apr 2018 07:35 PM PDT

    Idk if I should focus on imperative, functional or OOP. Or start with 1 and eventually learn all of them? What did you guys do?

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

    Language suggestion for a specific software idea

    Posted: 02 Apr 2018 07:29 PM PDT

    So to start off I am by no means a programmer myself. I am a chemistry major interested in creating a program to simulate chemical reactions in 3D. I want to create this simulation almost like how physics in modern video games behave. Specifically I want these simulations to run like how solidworks / CAD softwares analyze stress, heat, and fluids but on a molecular scale in which we can observe accurately.

    What language would provide the fastest and most accurate simulations given that we could use any computer hardware commercially available (modern GPUs and CPUs)?? My professors keep telling me python but I feel as though there could be better ways to approach a 3D simulation based task. Are specialized languages such as CUDA by NVIDIA worth looking into at all for this??

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

    Why is my array program not working correctly

    Posted: 02 Apr 2018 11:02 PM PDT

    import java.util.*; public class test{ public static void main(String[] args){ double[] a={1.1,5.3,3.4,8.9,0.0, 1.3, 5.2, 7.8, 9.9}; System.out.println("Initial array= "+Arrays.toString(a)); reverse(a); System.out.println("reversed array= "+Arrays.toString(a)); } public static double[] reverse(double[] a){ double[] b=new double[a.length]; for(int i=a.length-1,indexForB=0;i>=0;i--,indexForB++){ b[indexForB]=a[i]; } a=b; } } 

    This program is supposed to spit out a reverse of my array.

    Instead of it spitting out the reverse of my array its just coming out as it was put in {1.1,5.3,3.4,8.9,0.0, 1.3, 5.2, 7.8, 9.9}....What am i doing wrong.......What is wrong in this code that makes it such that it won't work correctly. Explain why its not working correctly and what I should to fix it.

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

    Ideal *nix for combining The Unix Programming Environment and The C Programming Language.

    Posted: 02 Apr 2018 10:50 PM PDT

    I want to study using The Unix Programming Environment and The C Programming Language simultaneously so I can brave future endeavors with a foundation in classic C & BASH.

    Is a *nix like OpenBSD or FreeBSD worth using for this? Or is the shell I pick more important? Should I just stick with the Linux distro I'm using?

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

    (Data Structures) Removing item from a min. Heap. Why do we often only remove the root of the heap?

    Posted: 02 Apr 2018 04:51 PM PDT

    My book is saying that removal from a heap is always from the top. But why? What if we wanted to remove an internal node? It only gives an example of removing the root of the heap.

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

    Free Web Development 101 - Live Instructor - Starts in 7 Hours

    Posted: 02 Apr 2018 10:08 AM PDT

    I know others have posted about this class in the past, but we have recently changed a bunch of stuff, so just wanted to throw this out here again.

    Our web development 101 course is starting tonight, at 5 pm Pacific Time, and you can register on our website: https://lambdaschool.com/courses/cs/web/101/. The course is live-streamed on YouTube, and we have the instructor and TAs available to answer questions and help with homework problems in Slack.

    The course covers basic HTML, CSS, and JavaScript. It culminates in a project to build a ToDo list app using vanilla JavaScript.

    If you have any questions, drop them below and I'll be happy to answer them.

    Disclaimer: I work for Lambda School, the school that is providing this course. We do hope that some students will like our teaching style and join our full course, but we do this as well to give back to the community. There is no expectation that you must join our course if you participate in our Web Development 101 course. It is free and open to everyone.

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

    Western Governors University now offering an online BS in Computer Science

    Posted: 02 Apr 2018 10:35 PM PDT

    [C++] Why is nothing getting written to my file?

    Posted: 02 Apr 2018 10:22 PM PDT

    I'm supposed to read a text file of unsorted numbers, sort them, and then write them to an output file. But when I open the file that I wrote to, the only thing on it is a bunch of zeros.

    int main() { unsigned int size = 10000000; ifstream inFile("numbers.txt"); inFile >> size; unsigned int * nums = new unsigned int[size]; for (int i = 0; i < size; i++) { inFile >> nums[i]; //cout << "number " << i << ": " << nums[i] << endl; } inFile.close(); Sort obj(size); Merge obj2(size); Heap obj3(size); Quick obj4(size); clock_t startTime, endTime; startTime = clock(); //obj4.quickSort(nums, 0, size-1); //obj3.heapSort(nums, size); obj2.mergeSort(nums, 0, size - 1); //obj.selectionSort(nums, size); endTime = clock(); ofstream outFile("numbersNew.txt"); for(int i = 0; i < size; i++) { outFile << nums[i] << endl; } outFile.close(); cout << "Sort took: " << endTime - startTime << " milliseconds" << endl; } 

    All of my code is here:https://pastebin.com/rY8QxsJy

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

    Building a server for a game written in GDScript (Godot Game Engine). What language?

    Posted: 02 Apr 2018 02:43 PM PDT

    The idea I had in my head was to make the game server in Java, but that might be tedious.

    Python? Maybe, but how does it work with GDScript? How does Java even work with GDScript?

    Any ideas?

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

    How to do stepwise refinement

    Posted: 02 Apr 2018 10:07 PM PDT

    Is there a website or way that tells you how to draw a flowchart based off of stepwise top down refinement?

    I really wanna know how to do this but don't really understand how.

    I wanna know what goes in what part of the chart.

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

    How do you create relationships in a SQLite database? How can you copy this into CoreData?

    Posted: 02 Apr 2018 01:06 PM PDT

    Hi all

    I'm making an app that was lists of workouts and exercises. I would like to begin by making an sqlite database of all the exercises and workouts. Basically I have downloaded a SQLite browser but don't really know how to proceed.

    I would like to make a table of Exercises each Exercise will have:

    • sets
    • reps
    • restTime
    • name

    Then I would like to also make Workouts which is essentially a list of Exercises. Another question I have is:

    How do I represent a Workout entitiy? Do I make it have an Exercises blob which is essentially just an array of Exercises? Do I create a table entry called WorkoutName which has a to-many relationship with all the exercises? If the latter, how do I actually do this?

    So I would like to have a many-many relationship between WOrkouts and Exercises. Each workout will have a to-many relationship (since each workout consists of >1 Exercise). But also I would like to be able to look up the reverse, ie what workout each exercise belongs to.

    So I think I've kinda got the concept down, how do I actually implement this in an SQLite database? I would like to ship this db of workouts/exercises with my app so eventually I will import it all into CoreData, but first I need to make the database.

    Any ideas on how I can make this database?

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

    Learning While Driving?

    Posted: 02 Apr 2018 09:43 PM PDT

    Hello, people of the internet

    I am about to start back up doing my seasonal job, (pool cleaning) where I am driving to different clients houses about half of the day. I also commute an hour a day to school and back. I'm wondering if anyone knows of any Web Dev audiobooks that can help me learn while I'm driving.

    I'm currently learning JavaScript and jQuery, but I would definitely be up to check out anything that pertains to website development, or even design.

    Thanks for the help

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

    College class help

    Posted: 02 Apr 2018 09:29 PM PDT

    So I'm basically going to a Community College atm and for the fall semester I want to take Intro to programming using C++. The course says it recommends to take the Intro to Computer Science class before this one but I was thinking that since it's already an introduction class I should be fine. Any CS majors here take a Intro to CS class? Or did you just go straight into the basic programming classes?

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

    No comments:

    Post a Comment