• Breaking News

    Monday, April 23, 2018

    I have been drawing comics that explain programming concepts - and I'm seeking collaboration in remaking the series. learn programming

    I have been drawing comics that explain programming concepts - and I'm seeking collaboration in remaking the series. learn programming


    I have been drawing comics that explain programming concepts - and I'm seeking collaboration in remaking the series.

    Posted: 23 Apr 2018 10:49 AM PDT

    Hello All,

    For the past 4 months, I have been drawing comics that explain simple programming concepts. You can find the ones I've made on my website:

    https://prairieworldcomicsblog.wordpress.com/programming-series-in-order/

    Feel free to read them! But do note: I'm thinking of redrawing the series, only in a true collaborative effort. I thought of doing the effort in the Ars Technica Open Forums, or in some other format elsewhere.

    But seriously: I'm screaming for true collaboration in the process of building the programming comics, as opposed to just going in alone and blind - and just getting heavy criticism all the time. If you think my work has great potential, I encourage you to take part in collaborating with me to make some great comics on this subject!

    Edit: So people wish to understand the collaboration process I'd create:

    I would be the head artist and leader of the collaboration project, and you would be the educators, programmers, and readers who would collaborate with me. The steps in this process would be the following:

    1. We would discuss the topics I'd be making comics on, and the order they should be in.

    2. I would use all that information to build a script for each page, and we would discuss each script, one-by-one.

    3. I would draw each comic in pencil, and we would discuss them similarly to the scripts.

    4. I would ink out and do any minor corrections on the work, and show the results to check before publishing it on my website.

    I have a more lengthy description and guidelines in a collaboration document I have written, of which you can find here.

    I'm still figuring out the tools and webpages we'll use to collaborate. Some have suggested using github to shape the scripts, and I've been wondering about using a dedicated subreddit as a place for communication for this process. Feel free to give ideas on this!

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

    Adding to my Github dos and dont's

    Posted: 23 Apr 2018 06:06 PM PDT

    I am a computer science student and do not have many projects to my name, and recently have been given much more lengthy projects in school. I want to put them on my GitHub since most potential employers will ask for them, but I want to know things I should make sure I should have and things that I should avoid doing. Can you help me Reddit?

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

    In what programming language are programming languages written in?

    Posted: 23 Apr 2018 06:49 PM PDT

    No, I did not think about this question on 4/20 lol

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

    Visual C#, ListBox Control

    Posted: 23 Apr 2018 07:48 PM PDT

    Hi everyone,

    I'm attempting to create a ListBox with song names. I can't get them to display. It's the first time I've ever done this. Am I going about it wrong? Any help is greatly appreciated.

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace MyTunes { public partial class Form1 : Form { public Form1() { } private void tunesListBox_SelectedIndexChanged(object sender, EventArgs e) { //InitializeComponent() InitializeComponent(); this.tunesListBox.Items.AddRange(new object[] { "Song1", "Song2", "Song3", "Song4", "Song5", "Song6", "Song7", "Song8", }); } } } 
    submitted by /u/islandb0y
    [link] [comments]

    Does anyone doing front-end web development want to keep progress with eachother?

    Posted: 23 Apr 2018 07:13 PM PDT

    Maybe we can join a discord and chat everyday to make sure that we stay on top of our stuff?

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

    Learning Computer Science

    Posted: 23 Apr 2018 09:23 PM PDT

    A good guide about learning computer science all the way from beginning to end

    https://www.afternerd.com/blog/learn-computer-science/

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

    Looking for an online buddy to study algorithm for job interviews

    Posted: 23 Apr 2018 08:00 PM PDT

    Hi,

    I am preparing for developer interviews and I was hoping that I could pair with someone who is also preparing for interviews and studying algorithms. We can work on algorithm problems remotely using colabEdit or something.

    I feel that the exchange of ideas and seeing different ways to solve a problem would be helpful. Please message me if interested with:

    • email
    • availability (I am available from 7:30 PM - 11 PM Pacific weekdays - flexible on weekends)
    • start date (hopefully soon)
    • coding language preference (I do javascript)
    • comfort level with algorithms (I'd say I can do easy to medium problems on leetcode)
    • anything else that I should know

    Thanks.

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

    [C/C++] - Trying to read in a text file from a zip file using zlib/minizip.

    Posted: 23 Apr 2018 07:46 PM PDT

    This for a little graphics program I'm writing. The idea is simple enough. have a zip file in my executable's directory with a few shaders in it. I want to be able to open that zip file, find the shader file I'm looking for, and read it into a character string.

    I can read the shader in, but I have major problems adding a null terminator '\0' to the last element of my char array. Every time I so much as access an element from my char array, Visual Studio gives me an access violation. I can't touch anything without it going crazy in debug. If I run the program outside of debug, my shaders work, but I get Debug Assertion Failed: _CrtIsValidHeapPointer(block) error when I exit.

    I'm still relatively new at C/C++, so I'm positive this is an issue with how I'm storing/accessing data. But the documentation for minizip is basically nonexistent, so I'm really out of options here. Can anyone help me out?

     const char *path = "res.zip"; unz_file_info info; zlib_filefunc_def ffunc; // open zip file unzFile uf = unzOpen(path); // open desired file in zip file const char *fName = "res/shaders/basic.shader"; unzLocateFile(uf, fName, 1); unzOpenCurrentFile(uf); unzGetCurrentFileInfo(uf, &info, NULL, 0, NULL, 0, NULL, 0); // read in file int err; char *buf = (char*)malloc(info.uncompressed_size + 1); do { err = unzReadCurrentFile(uf, buf, info.uncompressed_size); } while (err > 0); // add null terminator ASCII symbol--also where all the errors are happening buf[info.uncompressed_size] = '\0'; // this prints the shader exactly how it appears in the text file! std::cout << buf << std::endl; 
    submitted by /u/AggravatingMagician
    [link] [comments]

    Learn python

    Posted: 23 Apr 2018 11:31 PM PDT

    What are the best free online resources to learn python from beginner to expert?

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

    Trying to find out what I'm lacking

    Posted: 23 Apr 2018 11:08 PM PDT

    I'm a CS major probably graduating this semester with around 3.7-3.8 GPA so I would say school wise, my programming skill/CS knowledge is good enough. Unfortunately, whatever I learned in school does not seem to be translating well to practical work skills.

    Currently, I have an internship at a company that produces a Windows desktop application. My job is to fix the bugs/new features that are sent my way. However, I'm having difficulties understanding the code and coming up with code to fix the problem.

    Initially I thought the reason might be the code quality. The product has been written since 15-20 years ago, I've been told it's over 300,000 lines, old code isn't removed but commented out, code isn't documented much besides having the bug number and title, etc. Due to the relatively large and relatively old code base and code being commented out, I've had trouble finding what section of code I should be modifying. Since code isn't documented much, I try to set a breakpoint within functions to figure out how I should be using them. And setting a breakpoint and making it hit is always difficult for me since I can't find where I shoudl be setting the breakpoints.

    However, it's been 3 months and although I do have some general ideas about certains parts of the code, I still have difficulties reading and writing code. Other coworkers are doing fine, even the newer employees whose only been around 1-2 years. I thought that the old code could be part of the problem, but even when working with newer code that been recently written, I still have trouble reading and writing code. At this point, I'm pretty certain there's something I'm missing. I've taken 20-40 hours to fix 2-5 hours bugs and I think once I've reached close to 50 hours for a 3 hours estimated bug. And those fixes ended up being small as well.

    I've worked with other people's code in school with group projects and tutoring other students from lower division CS courses and did fine with that. I've also written my own code and did fine with that. Of course everything I've done was on a much smaller scale compared to work, but I've expected that I'd be able to transition smoothly over time, which I haven't. It's like I have a venn diagram of school skills and work skills and while there are some in common, there are some crucial skills in the work skills set that's not in the school skills.

    Has anybody experienced this and if so, what was the problem and how did you overcome it? If not, does anyone have any advice for me? I don't even know where to start in order to improve myself since I don't even know what I'm missing/doing wrong.

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

    Visual C#: Am I doing the label output correctly?

    Posted: 23 Apr 2018 11:00 PM PDT

    I am getting errors trying to output information into a label and was wondering what I am doing wrong. The code is below.

    lblOutput.Text = String.Format("The total is : " + {0}, total); 

    Any help with this is appreciated!

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

    Why do people hate PHP?

    Posted: 23 Apr 2018 10:59 PM PDT

    Just curious, from most that I've seen, people bash the language. Why so?

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

    I need my arrays to interact, but don't know how to do it right.

    Posted: 23 Apr 2018 04:58 PM PDT

    So I'm trying to write a simple program for weight lifting. It finds out a users one rep max for a given lift and multiplies it by a set integer. So on week one, day one, the program would grab the deadlift max that the user entered and multiply it by the week one percentage (7/10) and then receive the product, and then know what to lift. On week one, day two, it would grab the squat and multiply it by week one. On week two, day one, it would grab deadlift again but this time multiply it by the week two percentage.

    So far I have it taking the data from the user and displaying the data on a separate page. I feel like in order to do the rest I needed to create two arrays, a "lift" array that gathers the maxes previously recorded, and a "week" array which is the different percentages for the different weeks.

    Ideally I would be able to click a workout tab and be directed to a page asking which lift they were doing and which week they were in, and then return the correct result.

    I'm new at this, so I'm going to post what I think is the relevant code and if I need to post more I will.

    also in my code ORM stands for one rep max.

    public class RepCalculator extends ORM { private ORM oneRepMax; public RepCalculator(ORM oneRepMax) { this.oneRepMax = oneRepMax; } public int Lift() { int lift[] = new int[4]; lift[0] = oneRepMax.getDeadlift(); lift[1] = oneRepMax.getSquat(); lift[2] = oneRepMax.getOverheadpress(); lift[3] = oneRepMax.getBenchpress(); lift[4] = oneRepMax.getBentoverrow(); int week[] = new int[5]; week[0]=(7/10); week[1]=(75/100); week[2]=(8/10); week[3]=(825/1000); week[4]=(85/100); week[5]=(1); } } 
    submitted by /u/Pocketfullofbugs
    [link] [comments]

    Should I include methods I do not use?

    Posted: 23 Apr 2018 07:09 PM PDT

    I'm working on my first real coding project, and throughout my course so far we have generally included methods for retrieving the parameters of custom objects we have created. For example, for a proposed class Clock, we would have something like the following

    public class Clock { int hours; int mins; int secs; public Clock(int h, int m, int s) { hours = h; mins = m; secs = s; } public int getHours() { return hours; } //Similar methods for getting mins and getting secs } 

    Now, I am using a similar Clock object in my project. I only need the getHours method, but is it considered a good habit to include getters for mins and secs anyways? Or am I misguided, and this is a waste?

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

    What issues do beginners have with learning C#?

    Posted: 23 Apr 2018 10:49 PM PDT

    The answers here will be used in my Fundamentals of C# youtube series.

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

    [Java] Dispose of an object that moves X distance from a specified point?

    Posted: 23 Apr 2018 06:53 PM PDT

    I'm currently trying to finish my 1st year final project, which is a 2D Java version of the board game Crokinole(it looks like this).

    Basically, I need to dispose of the circular puck objects if they contact the outer line of the board, but I'm not exactly sure how.

    This is what my "board" currently looks like

    I have a radius variable, though I fear it may not be right:

    int radius = (int)(Math.min(d.height,d.width) / 2); 

    Would it be something as simple as

    if(puckObject.getX() > radius || puckObject.getY() > radius) puckObject.setActive(false); 

    I figure I can use the same basic framework for calculating scores, since each ring has its own point value, I could do something like

    if(puckObject.getX() < distanceFromCenter || puckObject.getY() < distanceFromCenter) teamOnePoints += 15/10/5 

    Thoughts? Opinions? Tell me I need to study harder? Any and all feedback is greatly appreciated!

    EDIT: Just noticed a "setActive()" method in the graphics package that my teacher requires us to use, so that would be how I dispose of the object. Edited code to reflect. The question about the veracity of my logic still stands as is, though.

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

    Visual C#, Restaurant Keeping Total

    Posted: 23 Apr 2018 10:35 PM PDT

    Hello everyone,

    I am trying to keep a running total of all food items selected in my program.

    However, in the errors I am getting "Total is declared but never used."

    I have total calculated throughout the program but I don't get why Visual C# is telling me it's never used.

    Enclosed is the code. Any help is greatly appreciated.

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; //Name: //Input: Selections from ListBox //Output: Price of selections namespace Restaurant { public partial class Form1 : Form { double total; public Form1() { InitializeComponent(); } private void saladCheckBox_CheckedChanged(object sender, EventArgs e) { if (saladCheckBox.Checked) { total = total + 0.75; } } private void potatoCheckBox_CheckedChanged(object sender, EventArgs e) { if (saladCheckBox.Checked) { total = total + 0.50; } } } } 
    submitted by /u/islandb0y
    [link] [comments]

    [C] Visual studios giving unexpected output from simple code.

    Posted: 23 Apr 2018 06:20 PM PDT

    Hello I'm writing a database for a phonebook, and Ive stumbled upon an issue with this simple code.

     #include <stdio.h> struct Contacts { char first_name[15]; char last_name[15]; long phone_number; char type_phone[4]; }; int main() { struct Contacts c1; c1.phone_number = 6473567854; printf("%li", c1.phone_number); return 0; } 

    in visual studios, my output is some random number negative number and in the online compiler, I get my phone number.

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

    Visual C#, Summing Price Totals in a ListBox

    Posted: 23 Apr 2018 09:52 PM PDT

    I am creating this program that sums the totals of songs selected from a menu. I quite can't get how to assign each song a value of 0.99 and get a running total. Can someone please show me how it is done? I have Googled this topic but have found things that are close but not quite related, such as summing numbers that are in a list.

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace MyTunes { public partial class Form1 : Form { public Form1() { const double SONG_COST = 0.99; InitializeComponent(); this.tunesListBox.Items.AddRange(new object[] { "Song1", "Song2", "Song3", "Song4", "Song5", "Song6", "Song7", "Song8", }); this.tunesListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; } private void tunesListBox_SelectedIndexChanged(object sender, EventArgs e) { //InitializeComponent() double costTotal; lblOutput.Text = "Cost is: " + costTotal; } } } 
    submitted by /u/islandb0y
    [link] [comments]

    [Python] How can i push items from one stack to another?

    Posted: 23 Apr 2018 09:45 PM PDT

    I have two stacks, stack1 is empty, stack two has the numbers 1-10 :

    stack1 = ArrayStack([]) stack2 = ArrayStack([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) 

    How can i push the even numbers from stack2 to stack1? Stack2 should be empty afterwards and stack1 should contain even numbers.

    My guess would be to do something like this:

    for item in stack2: if item % 2 == 0: stack1.push(stack2.push(item)) else: stack2.pop() 
    submitted by /u/Zelnz
    [link] [comments]

    [C] Generic bubble sort help

    Posted: 23 Apr 2018 09:35 PM PDT

    EDIT: I have it working now! Thank you all for your help!

    Hello.

    I am trying to implement a bubble sort with void pointers. It all compiles and works almost correctly, but it is putting the largest integer in the array to the front of the array instead of the end. I've tried a few different things and nothing seems to work. I'm sure it's some small thing that I'm overlooking, just need a second set of eyes!

    my code:

    #include <stdio.h> #include <stdlib.h> void swap(void *a, void *b) { int* aPtr = (int*)a; int* bPtr = (int*)b; int temp = *aPtr; *aPtr = *bPtr; *bPtr = temp; } int compare(void *a, void *b) { int aPtr = *(int*)a; int bPtr = *(int*)b; return aPtr < bPtr ? -1 : (aPtr > bPtr); } void bubbleSort(void** arr, int n) { int i; int j; int *ptr = ((void*)&(*arr)); for (i = 0; i < n; i++) { for (j = 1; j < n; j++) { if (compare(&ptr[i], &ptr[j]) < 0) swap (&ptr[i], &ptr[j]); } } } void printArray(int arr[], int size) { int i; for(i = 0; i < size; i++) { printf("%d ", arr[i]); } printf("\n"); } int main(void) { int arr[] = {3, 4, 5, 6, 4, 3, 1, 2}; int n = sizeof(arr)/sizeof(arr[0]); printArray(arr, n); bubbleSort((void*)arr, n); printArray(arr, n); return 0; } 
    submitted by /u/Ryhol88
    [link] [comments]

    C++ - trying to learn how to use friend classes but my super basic program is raising errors but don't know why

    Posted: 23 Apr 2018 05:38 PM PDT

    Trying to learn how to use friend classes. So I wrote a tiny piece of code to try and let a method (punch) from the Dawkins class change the value of a member of the Harris class by adding friend class Dawkins; to the Harris class.

    But I get an error error: invalid use of incomplete type 'class Harris' on line 17 (the one with the ***** in the comment)

    #include<iostream> using namespace std; // class declarations class Dawkins; class Harris; // Dawkins class definition class Dawkins { public: Dawkins(); void punch(Harris&); int health; }; // Dawkins constructor Dawkins::Dawkins() { health = 100; } // Dawkins punch method definition void Dawkins::punch(Harris &h) { h.health -= 5; //****************************** } // Harris class definition class Harris { friend class Dawkins; public: Harris(); int health; }; // Harris constructor Harris::Harris() { health = 100; } int main() { Dawkins Richard; Harris Sam; cout << "Sam's health: " << Sam.health << endl; Richard.punch(Sam); cout << "Dawkins hits Harris with his rock-hard knowledge of evolutionary biology" << endl; cout << "Sam's health: " << Sam.health << endl; cout << "Sam would fight back but he but he didn't believe he had the free will to do so" << endl; } 

    What am I doing wrong?

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

    trying to read images with Cimg in c++, Cimg cannot recognize file format of png

    Posted: 23 Apr 2018 08:31 PM PDT

    hi there! I'm new to programming and am trying to put together a project for my C++ intro class - the concept is to read in an image file and produce a color palette with the given image.

    I am running into a problem using the Cimg library where trying to read in an image, even with copy/pasted example code, produces the error "failed to recognize format of file 'test.png'". I'm using a Windows 10 Education OS and compiling my code with Code:Blocks. Any idea what I might be missing? My Cimg header file is included properly and files are in the right location and properly named. A suggestion online was to link gdi32 as it's not done by default in Code::Blocks, but that hasn't changed the error.

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

    C program that prints even / odd characters from a string help?!

    Posted: 23 Apr 2018 08:29 PM PDT

    i have to use pointer arithmetic to determine if a character is even or odd but I have no idea how. (i also cannot use a string library for this project)

    first, i've declared my strings str[10] even[5] odd[5] //now setting my pointers *p = str; *e = even; *o = odd; //now i'm guessing i have to use a for loop that will move the characters from str[10] and copies into the even[5] and odd [5] string so how would that look like using pointer arithmetic? 
    submitted by /u/mangogummy
    [link] [comments]

    No comments:

    Post a Comment