• Breaking News

    Monday, February 5, 2018

    How it was done in 1959 learn programming

    How it was done in 1959 learn programming


    How it was done in 1959

    Posted: 04 Feb 2018 01:48 PM PST

    A great video on how building and running a program was done around 1960 (way before even my time): https://www.youtube.com/watch?v=uFQ3sajIdaM

    Lots of other great videos on that channel about restoring this old technology.

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

    First time hackathon ideas?

    Posted: 04 Feb 2018 01:25 PM PST

    I am attending my first university hackathon in a couple weeks, but I have no idea what to build for it. The theme for the hackathon is: "Hacking for a better world". I think because the topic is so broad I am having trouble with coming up with a specific idea. I have experience in web development, app development and game development, and have made some side projects before (mostly games though) so I'm not a completely inexperienced programmer.

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

    Dynamic programming, recursive solutions?

    Posted: 04 Feb 2018 06:20 AM PST

    Hello sub,

    I'm trying to get a grasp of dynamic programming. Supposedly, according to our lectures, it's divide and conquer with a table. And indeed this does seem to be the pattern.

    1. Recursive solution
    2. Memoization for often encountered subproblems.

    I've been looking at stuff like the knapsack problem and the longest common subsequence.

    I'm having trouble with coming up with a recursive solution, especially for optimization problems. How does one come up with a recurrence for a brand new, never seen before problem? Is there a pattern, a template to use? So far, it just seems like it's pulled out of thin air, ala Feynman solution.

    Thanks in advance...

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

    A Beginner's Programming Language running in the Browser

    Posted: 04 Feb 2018 07:06 AM PST

    I have made a beginner's programming language running in the browser. A small tutorial with graphics and animation is included. There are also some sample programs, such as sorting, Monte Carlo methods, etc.

    It's aimed for beginners, for whom Scratch is too childish and Python is too complex. To use it productively you need a modern browser, a not too small screen and a keyboard. So please don't vote it down, if you try it with a mobile phone.

    https://kabas.online/

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

    Are there any languages where you write code on a mobile device?

    Posted: 04 Feb 2018 08:58 PM PST

    I travel a lot for work (19 hour trips), and am wanting to do something productive with that time, so I'm wanting to learn a programming language. I have a laptop I could use, but the battery life sucks on it, so I was wondering if there's any languages where you can practice all the coding on a mobile device.

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

    I have an abstract class with no methods or variables that implements an interface with one method. Why don't I get an error when implementing the interface's method in that class?

    Posted: 04 Feb 2018 04:01 PM PST

    public interface Animal{ public abstract int getAge(); } public abstract class Dog implements Animal{ } public class Lab extends Dog{ int age=5; @Override public int getAge(){ return this.age; } } 

    Sorry I meant to say why don't I get an error when I don't define the method "getAge" in the abstract class "Dog" when it implements "Animal"?

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

    Recommendations for Problem Solving Books/Courses

    Posted: 04 Feb 2018 12:44 PM PST

    Anyone have any recommendations for books/courses on the structure of problem solving?

    As a computer programmer lots of times I find solutions to problems by just googling the question and finding someone else who figured it out. I think this in itself is a useful skill for a developer. But I think to really reach the highest level of understanding, you have to know how to solve problems form the ground up.

    The fundamentals of problem solving, especially in relation to programming, really interests me. I feel like there must be some good courses or books that cover this topic, and maybe even do it with a programming focus.

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

    Is the following C++ function's Time Complexity O(n^3) ?

    Posted: 04 Feb 2018 07:07 PM PST

    void init(int n) { for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) dp[i][j] = -1;
    }

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

    c++ vector of structs and reading from a file

    Posted: 05 Feb 2018 12:20 AM PST

    So, I have a file that I'm reading from which includes players names, then space followed by the team name [Christian_Ponder KC]. For this, I made this struct:

    struct qb_info { string player; string team; }; 

    Then, in main, I'm reading everything in one string vector:

    string str; vector <string> players_and_team; qb_info player_info; vector <qb_info> player_data; while(!data_file.eof()) { data_file >> str; players_and_team.push_back(str); } 

    Then, If the index is even, its going to be a player, so I call the struct and store in player and push it in the vector of struct and if its odd it will be the team:

    for(int i = 0; i < players_and_team.size(); i++) { if(i % 2 == 0) { player_info.player = players_and_team.at(i); player_data.push_back(player_info); } else { player_info.team = players_and_team.at(i); player_data.push_back(player_info); } } 

    But when I print it, everything is printed twice:

    for(int i = 0; i < player_data.size() / 2; i++) { cout << player_data.at(i).player << ", " << player_data.at(i).team << endl; } 

    Here is the output:

    Aaron_Rodgers, Aaron_Rodgers, GB Alex_Smith, GB Alex_Smith, KC Andrew_Luck, KC Andrew_Luck, IND Andy_Dalton, IND Andy_Dalton, CIN Austin_Davis, CIN Austin_Davis, STL Ben_Roethlisberger, STL Ben_Roethlisberger, PIT Blaine_Gabbert, PIT Blaine_Gabbert, SF Blake_Bortles, SF Blake_Bortles, JAC Brandon_Weeden, JAC Brandon_Weeden, DAL Brian_Hoyer, DAL Brian_Hoyer, CLE Brock_Osweiler, CLE Brock_Osweiler, DEN Cam_Newton, DEN Cam_Newton, CAR Carson_Palmer, CAR Carson_Palmer, ARI Case_Keenum, ARI Case_Keenum, HOU Chad_Henne, HOU Chad_Henne, JAC Charlie_Whitehurst, JAC Charlie_Whitehurst, TEN Chase_Daniel, TEN Chase_Daniel, KC Christian_Ponder, KC Christian_Ponder, MIN Colin_Kaepernick, MIN Colin_Kaepernick, SF Colt_McCoy, SF Colt_McCoy, WAS Connor_Shaw, WAS Connor_Shaw, CLE Derek_Anderson, CLE Derek_Anderson, CAR Derek_Carr, CAR Derek_Carr, OAK Drew_Brees, OAK Drew_Brees, NO Drew_Stanton, NO Drew_Stanton, ARI EJ_Manuel, ARI EJ_Manuel, BUF Eli_Manning, BUF Eli_Manning, NYG Geno_Smith, NYG Geno_Smith, NYJ Aaron_Rodgers, NYJ Aaron_Rodgers, GB AJ_McCarron, GB AJ_McCarron, CIN Alex_Smith, CIN Alex_Smith, KC Alex_Tanney, KC Alex_Tanney, TEN Andrew_Luck, TEN Andrew_Luck, IND Andy_Dalton, IND Andy_Dalton, CIN Austin_Davis, CIN Austin_Davis, CLE B.J._Daniels, CLE B.J._Daniels, HOU Ben_Roethlisberger, HOU Ben_Roethlisberger, PIT Blaine_Gabbert, PIT Blaine_Gabbert, SF Blake_Bortles, SF Blake_Bortles, JAC Brandon_Weeden, JAC Brandon_Weeden, HOU Brian_Hoyer, HOU Brian_Hoyer, HOU Brock_Osweiler, HOU Brock_Osweiler, DEN Cam_Newton, DEN Cam_Newton, CAR Carson_Palmer, CAR Carson_Palmer, ARI Case_Keenum, ARI Case_Keenum, STL Charlie_Whitehurst, STL Charlie_Whitehurst, IND Chase_Daniel, IND Chase_Daniel, KC Colin_Kaepernick, KC Colin_Kaepernick, SF Colt_McCoy, SF Colt_McCoy, WAS Dan_Orlovsky, WAS Dan_Orlovsky, DET Derek_Anderson, DET Derek_Anderson, CAR Derek_Carr, CAR Derek_Carr, OAK Drew_Brees, OAK Drew_Brees, NO Drew_Stanton, NO Drew_Stanton, ARI EJ_Manuel, ARI EJ_Manuel, BUF Eli_Manning, BUF Eli_Manning, NYG Geno_Smith, NYG Geno_Smith, NYJ 

    Could someone point me to the right direction of what I'm doing wrong?

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

    [Homework] Converting from Different Floating Point Formats

    Posted: 05 Feb 2018 12:03 AM PST

    Hi, I seem to have taken erroneous notes in class and am at a loss at how to perform a floating point format conversion in the homework. There are several repetitions of the problem and I would appreciate it if someone could help explain 1 example so I can solidify my understanding as I work through the rest of the problems.

    I've got bit patterns in format A (1 sign, 5 exponent bits, 3 mantissa bits), and am trying to approximate them as close as possible in format B (1 sign, 4 exponent bits, 4 mantissa bits) as well as state their decimal values in each format.

    The example value in the book is 1 01111 001 (decimal value of -9/8), and this is approximated to 1 0111 0010 in format B.

    What I have so for: For the first, it will be negative and the mantissa value will be 8. The bias will be 15. The equation to put it all together is (-1)s * (1 + m) * 2e. How does the book get -9/8? Due to my poor notes I have no idea how to calculate e. I also don't understand how I'm supposed to get a 8 in the denominator with the stated equation.

    The conversion between formats seems pretty simple as I just truncate/add trailing zeros.

    Thanks so much!

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

    Asynchronous PHP: How?

    Posted: 04 Feb 2018 11:38 PM PST

    I never used something like AJAX or JSON. Is that used to program asynchronous with PHP?

    I am learning Laravel by the way. And have some experience in other MVC frameworks. And i know OOP. And have like 3 years of leaning experiences.

    Yes i know i am late with learning AJAX/JSON.

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

    Question about string cutting

    Posted: 04 Feb 2018 06:13 AM PST

    Hi all, I'm currently writing a program which will display the weather by webscraping, I've gotten to the stage at which I can get it to display : '[<span class="summary swap">42˚ Partly Cloudy.</span>]'. I need it to just display '42˚ Partly Cloudy'. Any suggestions?

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

    [C] sscanf returning 0

    Posted: 04 Feb 2018 04:49 PM PST

    i have a char * containing a string

    char * reg; reg = "$t0"; int found = 0; int num = -1; char symbol; char regtype; found = sscanf(reg, "%c%c%d", symbol, regtype, num); 

    sscanf returns a 0. Im pretty sure that is is the format specifiers that i am getting wrong. can anyone point me in the right direction?

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

    What is wrong with my reheaping (bubbling up/down) methods?

    Posted: 04 Feb 2018 10:24 PM PST

    Here is the code:

    private void reheapUp() { int i = numItems; while(i > 0 && items[i].compareTo(items[i / 2]) > 0) { swap(i, i / 2); i = i / 2; } } 

    and

    private void reheapDown() { for(int i = 1; 2*i <= numItems; i++) { if(items[i] == null) { break; } else if(items[2 * i] != null && items[i].compareTo(items[2 * i]) > 0) { swap(i, 2 * i); } else if(2 * i + 1 >= numItems && items[2 * i + 1] != null && items[i].compareTo(items[2 * i + 1]) > 0){ swap(i, 2 * i + 1); } } } 

    This is an array-based implementation of a heap. swap(a, b) swaps the elements items[a] and items[b].

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

    Question about 'The Pragmatic Programmer' book

    Posted: 04 Feb 2018 11:45 AM PST

    Hey everyone, today I started reading the book titled 'The Pragmatic Programmer'. The book is described on wikipedia as "an influential book in software engineering".

    But, because it is written in 1999, I am wondering if it still relevant our days and worth being read.

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

    Would Docker help me declutter my local PC?

    Posted: 04 Feb 2018 12:34 PM PST

    As I try out different languages and tools, my home PC is getting more and more cluttered. I have Python2, Python3, Node, and Ruby all installed on Windows 10 and I haven't touched databases or different ruby versions yet. Would Docker help me run the occasional script or app without having to install the required software/interpreter?

    I was looking at Docker and VM software in an effort to get some of that uninstalled - especially the things I don't use so often now like Ruby. I googled and tried a few things but the learning curve is steep enough that I figured I'd come here for some advice before putting in the hours.

    I tried throwing everything into WSL for a while but missed the Git integration and linting in VSCode.

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

    Fetch a table from an HTML site with jsoup

    Posted: 04 Feb 2018 02:38 PM PST

    Hi all

    I'm working on app that should fetch a table from an HTML http address. This table is a specific object among other objects available on the same page.

    I'm using jsoup library to grab the HTML page and I know their is an option to set something up to fetch only a specific object. The table I would like to get is a dynamic table and changes weekly.

    I read I can use Element for that but I'm not sure how to achieve this.

    Unfortunately this site doesn't have any mobile version so Webview is not an option. API is also not available.

    The address is below. Be glad for some help. Thx!

    http://www.haifa-stadium.com/Football_Matches

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

    Fastest C code to find large perfect number challenge

    Posted: 04 Feb 2018 01:06 PM PST

    This code does 0.004seconds compared to 80 seconds from http://www.sanfoundry.com/c-program-perfect-number/ so around 20000 times faster for 8589869056 perfect number. Can it be faster?

     #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include <time.h> bool oddperfectnumbercheck(long long unsigned int *oddnumber); void displayresult(bool result, long long unsigned int *number); void calculatesum(long long unsigned int *number, long long unsigned int *sum); bool oddperfectnumbercheck(long long unsigned int *oddnumber){ //1953 J. Touchard if (((*oddnumber -1) %12 == 0) || ((*oddnumber - 9)%36 == 0)){ return true; } else{ return false; } } void displayresult(bool result, long long unsigned int *number){ if (result == true){ printf("%llu is PERFECT NUMBER", *number); } else{ printf("%llu is NOT PERFECT NUMBER", *number); } } void calculatesum(long long unsigned int *number, long long unsigned int *sum){ long long unsigned int i = 2; long long unsigned int othermultiplier, othermultiplierpre = 0; while (*sum <= *number){ othermultiplier = (*number / i); if (*number - (i * othermultiplier) == 0){ if (othermultiplier == i){ *sum = *sum + othermultiplier + i; return; } if (othermultiplierpre == i) return; othermultiplierpre = othermultiplier; *sum = *sum + othermultiplier + i; } i++; } *sum = 0; return; } int main() { long long unsigned int i, num = 0; long long unsigned int sum = 1; printf("Enter any number to check perfect number: "); scanf("%llu", &num); clock_t begin = clock(); if(num %2 != 0){ if (oddperfectnumbercheck(&num) == false){ displayresult(false, &num); return 0; } } calculatesum(&num, &sum); clock_t end = clock(); double time_spent = (double)(end - begin) / CLOCKS_PER_SEC; printf("%f",time_spent); if(sum == num) { displayresult(true, &num); } else { displayresult(false, &num); } return 0; } 
    submitted by /u/piettjan
    [link] [comments]

    Is there an advantage to NoSQL when working with small scale?

    Posted: 04 Feb 2018 03:49 PM PST

    From what I understand, NoSQL was created out of the necessity of big Web 2.0 companies when they realized traditional RDBMS could not scale.

    If, however, I were to create a small software that does require a database, say only running on one machine and no more than 2 concurrent users, would I have an advantage to NoSQL?

    In short, if I'm not Google, should I care about NoSQL?

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

    Help with git/github

    Posted: 04 Feb 2018 06:00 PM PST

    So, I'm trying to start my blog on Github Pages. I want to use this theme: https://github.com/ppoffice/hexo-theme-icarus. The installation page for it (https://github.com/ppoffice/hexo-theme-icarus/wiki/Installation) tells me to clone it.

    I had never worked with git command line before, so if I simply clone my repo to my pc files, use cd to move to it, then use the git clone line, I'll clone the repository into my files, and it'll show there correctly. But, those changes won't be represented in github. I've tried using push, add, commit, but none of those work, as I'm not really sure how to do it.

    I know I should learn git, but I don't want to do it now. I just want to keep studying what I'm studying now, and keep a simple blog. What do I have to do to actually install that theme?

    I'm really frustated and can't think straight, so if this is too confusing please let me know and i'll try to word it differently.

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

    Building a JSON API in Go

    Posted: 04 Feb 2018 05:45 PM PST

    I recently built a JSON API in Go and I also built a tutorial on how to do it! Hope it helps some people who've been interested in the Go programming language.

    Let me know if there are any similar tutorials you'd like me to write in the future!

    https://pragmacoders.com/building-a-json-api-in-golang/

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

    Preparing for a position of tech lead

    Posted: 04 Feb 2018 03:01 AM PST

    I have an experience of more than 6 years but I have to admit I never worked on a project from beginning nor made critical decisions regarding architecture etc.

    I want to expand my knowledge and skills further and I am ready to work hard for it, below I am posting one of the job requirements for such a role as advertised my a company:

    • Must have outstanding coding skills and should be very strong in Javascript, and Node and React, Redux and Express

    • Self motivated and someone who would not shy away from taking ownership and responsibilities in a challenging environment

    • Good understanding of businesses, prioritization skills

    • Participate in the design and development of high-performance business applications, from requirements analysis to production (ability to showcase live work).

    • Constantly improve software quality (evaluate and incorporate new libraries, tools, and technologies; code reviews; refactoring; testing; etc.)

    Maybe not this job but given a timeframe of 6 months, how could I prepare myself for such roles?

    PS: Should I apply here anyways? at worst I will be rejected but I will know what they expect.

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

    Finding an experienced web and program developer

    Posted: 04 Feb 2018 09:28 PM PST

    I really want to be a developer and doing stuffs like coding like everybody else. I'm learning it from the start by myself, but it's really necessary to get to know with an experienced coder in order to ask for advices and to make friend with. Anyone can help me please? P/s: I'm just a teenager and I speak English as my second language only (but it's fine for chatting purposes). Really needs help from the experienced and passionate!!

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

    (Help) Looking for Programming Course in Singapore (Offline & Part-time)

    Posted: 04 Feb 2018 09:24 PM PST

    Hi All,

    Good day. I am looking for a programming course in Singapore. I have tried the online programming course but it didn't work for me.

    Language that I prefer to learn: - Python - Javascript

    Prefer Learning Mode: - On campus

    Course Date: - only Saturday & Sunday

    Budget: I am lack of budget and looking for courses with SSG funding (I am SG PR)

    Purpose of learning: - I have some programming background and want to learn more.

    Please advice. Your time and help are greatly appreciated.

    Thank you

    Steven

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

    Best place to learn C++?

    Posted: 04 Feb 2018 01:46 PM PST

    So I'm trying to do the Stanford 106B but it's really difficult because a lot of the Stanford-libraries are broken, which makes it pretty much impossible to do the assignments. Is there anywhere better than Stanford that I can learn C++ (covers recursion, pointers, data structures) for free?

    Thanks!

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

    No comments:

    Post a Comment