• Breaking News

    Wednesday, December 6, 2017

    You should learn CSS flexboxes, they're awesome learn programming

    You should learn CSS flexboxes, they're awesome learn programming


    You should learn CSS flexboxes, they're awesome

    Posted: 05 Dec 2017 03:50 AM PST

    Hey y'all, I'm the dude who wrote those tutorials on HTML about a month back, and got 1.2k upvotes (thanks everyone!!)

    Since then I've been writing CSS tutorials, and recently I wrote about flexboxes. They are honestly my favourite part of CSS, they are really awesome.

    If you've been putting it off for a while (or never heard of it) then hopefully my tutorial can help change that:

    https://codetheweb.blog/2017/12/05/css-flexboxes/

    I'd really love it if you checked it out, I currently do not make any money off it and am doing it to help the community ;)

    Also if you have any feedback, I'd love to see it here! Thanks everyone :)

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

    I'd like to start giving back to the community by making tutorials on web development. I'm stuck between Twitch, YouTube, or both

    Posted: 05 Dec 2017 08:57 AM PST

    My question is basically just the title. I'm a web developer with almost 8 years of experience now, in a variety of basic and bleeding-edge technologies. I'd like to give back to the community as a whole and fulfill something I've always wanted to do, make tutorials on web development. How to build X, how to get started with Y, and little tidbits I've found along the way that could be helpful.

    What I'm torn on is the platform to use. I like the idea of Twitch, having people watch me code live while I go through the process of creating a project from scratch, but I feel like it's a severely limited audience. YouTube seems like the best option, it'll give me the ability to edit and organize my videos into bite-sized segments, focusing only on the meaty content. Then I thought of a combination of both, streaming on Twitch and then using the feed to create videos for YouTube. However, that seems like it would be the biggest use of time instead of concentrating on just one, especially since I'm a beginner at this.

    Anyone have any suggestions? What do you think would be the best option?

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

    I made a basic tic-tac-toe game using python 3 and would love for you to check it out

    Posted: 05 Dec 2017 10:30 PM PST

    https://github.com/Johnmancini30/Tic-Tac-Toe Please leave feedback, especially on how I wrote code. I want to get better at writing clean, concise, readable code. To run, download python 3 at https://www.python.org/downloads/

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

    Pointer fundamental disconnect, specifically, when to use pointers

    Posted: 05 Dec 2017 07:37 PM PST

    Hi,

    I'm currently learning and actively trying to improve my knowledge of C++. I've been making a few small programs to try and learn the ins and outs and specifics of the language.

    I understand that the & is the address of operator, which returns a location in memory, however, I think my grasp on the * operator is a little shaky. I believe it is called the deference operator? I believe the only thing this operator is used for is to, when receiving an argument that returns a location in memory, you use the deference operator to see what data is contained at said memory location, correct?

    Secondly, when looking at other peoples c++ code, I've noticed that most the time, almost every variable is created as a pointer, rather than just creating and instance of an object. Why is that exactly? At what point is it worth it to not make a pointer, but instead simply create an instance of a class?

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

    Where do you get data to play with?

    Posted: 05 Dec 2017 02:55 PM PST

    I would really like to get into data analytics, but I don't know where to go for data. For example I would like to make a program that tries to guess home prices by taking real world sale prices and comparing them to features like square footage, number of bedrooms/bathrooms, area (zip code) and whatever other home features I can get the data for.

    I know that's really specific, so maybe you can't help me there. But maybe just like, some place you can go to download lots of JSON files or something to play with?

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

    Best way to learn Ruby/Rails for freelance purposes?

    Posted: 05 Dec 2017 05:40 PM PST

    I want to freelance and create web apps; am looking for a way to teach myself Ruby. Is there a specific book, like the head-first series that's better than the others? Book + Online tutorial is what I'm thinking of. For the online tutorial I've heard the Odin project is good. Anyone have suggestions on best way to dive into Ruby/Rails?

    submitted by /u/Magic-Legs
    [link] [comments]

    What are the chances Deep Mind will make all programming knowledge outside of itself redundant?

    Posted: 05 Dec 2017 11:41 PM PST

    Some people think programming will survive automation but what if it's the first to be automated?

    Should I just focus on robotics or agriculture or something else harder to generalize and leave the soft of software alone?

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

    Getting an exception error in c# for not being able to compare two elements in an array.

    Posted: 05 Dec 2017 11:12 PM PST

    For class I have to write a program that allows a user to input names and display all the names sorted in ascending order by last name. Here is a link to a picture of the code I have. I am able to get the results all printed but not once I try to sort it. https://imgur.com/YPIIrIh

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

    Whats the difference between C, C++, Objective C?

    Posted: 05 Dec 2017 11:07 PM PST

    Holiday time is coming for me as a high school student. I decided that I would like to make use of this time and learn something new. I have decided that I will start with C, even if it is a hard language to learn. I couldn't find anywhere explaining to me what the differences between all these 'c' languages were.

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

    Finding people to code with and/or a mentor

    Posted: 05 Dec 2017 04:59 PM PST

    This post was longer than I originally intended so I put TLDR; at the end.

    I have a problem that I feel like a lot of people who are trying to teach themselves something have.

    I started learning to code because I found it fun and interesting and learned some stuff from just watching youtube tutorials. The next step was actually decided I wanted to change jobs into web dev so I started to take it more seriously and took some online course, bought a book, read blogs, started lurking here, listening to podcasts (shout out CodeNewbie).

    I was learning lots and was excited to keep learning and trying new things but I felt kinda blue-balled when I tried talking to others about it because no one I know personally codes at all so they can't relate. I tried signing on to CodeNewbie's Slack channel but it still felt impersonal and I wasn't able to build a fun connection with anyone who was at my level (very beginner).

    For me talking with someone on a more personal level, rather than mass posting, helps in keeping that excitement to continue learning but also helps to clear up questions, think about things in a way I wouldn't have thought about them before, and help understand something I find confusing through talking it through with a peer.

    So I guess my question(s) to you all is, do you feel like I do? And if you have found a local "coding buddy" how did you do it?


    TLDR; Looking to meet local singles programmers to improve the learning process and have more fun. How do I do that?

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

    Making a polygon to use to frame a game level that is customize-able depending on the arguments

    Posted: 05 Dec 2017 10:57 PM PST

    So I am making a small game just using javafx and was planning on making the frames for the different levels by designing a method that built a polygon around everything. The game involves being in a cave and floating around in it. I want the levels to have a central more or less straight tunnel that has offshoots that go left and right according to my inputs.

    My plan was to do something like this:

    public void buildLevel(int levelLength,int offShoot1Loc, int offShoot1Length, string offShoot1Endtype......continue for several offshoots) { (code that makes a polygon based on the input length with offshoots of the types and positions described by the arguments, let's me many many different level frames quickly) }

    /the endtype would call separate methods to add points to make a bulb end to a tunnel or just a sudden end the same width as the tunnel and so on/

    Is this possible? I was having a lot of trouble when I tried to add points to the polygon and thought that I would be able to do it. But now I am thinking that I might have to add all the points at once? That would spoil my whole design. Should I scrap this idea and just build the levels by hand or is there a way I can apply the idea to something that doesn't try to use the polygons in this complicated way?

    Any help is greatly appreciated thanks!

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

    How Do I Split up an integer like (113451) To Test Each Digit?

    Posted: 05 Dec 2017 10:37 PM PST

    Is there any way to test each digit of an integer by getting it as an input. Like if I was to check if the first digit in the integer is greater than the fourth digit, how would I go about doing that? Like if the first digit is greater than the second digit, add them together and if not check the next digit in the integer.

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

    What's your advice on learning Swing?

    Posted: 05 Dec 2017 07:59 AM PST

    I'm in uni right now, taking Java, and this week we're supposed to learn Swing. The textbook is fucked, so I'm looking at videos on Lynda.com, and was thinking about buying the Udemy Swing course (it's like $15). Before that though, what's your opinion and/or experience with Swing? Is it commonly used in the work place?

    Is it worth putting effort into learning, or will employers want Javafx knowledge more?

    If I should learn Swing, is it worth knowing to do it from scratch (considering there are a lot of WindowBuilder/ wysiwyg tools)...

    Thanks for any help. Just now getting into GUI stuff, and it's a whole new ballgame...

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

    Any tips or guides to help understand pointers and pointer notations in C

    Posted: 05 Dec 2017 09:56 PM PST

    I'm taking a course at my university on C and I do not completely understand everything that goes on with pointers. I'm now realizing I need to know pointers quite well. Does anyone have anything that can help me?

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

    Java: When to use method and when to create a class

    Posted: 05 Dec 2017 10:59 AM PST

    So I know that creating a class will be more secure.

    When should I just go ahead and create a method in my 'main' class, and when should I create a whole new class to then invoke from my 'main' class?

    Is it only to prevent users from messing up my program?

    or is there a 'aesthetic' reason for doing this?

    I'm not trying to program a huge project as i'm just a student beginning to learn this. My project is really just solving a given maze.

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

    [c++] how can I make this more efficient?

    Posted: 05 Dec 2017 09:24 PM PST

    I have the following block of code:

    for(int seq = 0; seq < 100; ++seq) { for(unsigned int i = 0; i < 100; ++i) { while(iter < cont[seq].size()) { n = cont[seq][iter]; if (hash.count(n) == 0) { if (fifo.size() >= i+1) { pos = fifo.front(); hash.erase(pos); fifo.pop(); } hash[n] = iter; fifo.push(n); faults++; } iter++; } if(faults > oldFaults && oldFaults !=0) { std::cout << "Anomoly detected!" << std::endl; std::cout << " Sequence: " << seq+1 << std::endl; std::cout << " Page Faults: " << oldFaults << " @ Frame Size: " << i-1 << std::endl; std::cout << " Page Faults: " << faults << " @ Frame Size: " << i << std::endl; anom++; } oldFaults = faults; faults = 0; hash.clear(); std::queue<int> empty; std::swap(empty, fifo); iter = 0; } oldFaults = 0; } 

    I managed to cut my time down to .5 seconds on average. However, I am wondering if I can do better than this. I cannot think of any other way to cut the work down other than to somehow get rid of the inner while loop, which I believe makes this computation O(n3) which is garbage. Even getting this down to n2 would be preferable. However, I cannot think of any other way other than a while loop to keep track of the rows in my vector<vector<int>>, which is 100 x 1000. I need to iterate through all 1000 items in my 100 rows, and I can't think of a better way to do this.

    Any thoughts?

    EDIT: I am trying to simulate Belady's Anomaly, in this case I am building a vector of vectors of ints to hold 100 vectors of ints with 1000 random integers from 1 -250.

    I then have to run the test in a frame size of 100 by a page size of 100. Where each page takes a sequence of one of my 1000 integer containers.

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

    How do I build a map that shows partisan lean, or is similar to the 538's Presidential map?

    Posted: 05 Dec 2017 05:28 PM PST

    I want to create a map that shades based on last year's results. So a 90% Clinton district would be dark blue while a 53% Trump district would be light red. Is there a GIS software I should use?

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

    Coding Assignment Confusion

    Posted: 05 Dec 2017 05:11 PM PST

    Hi, I'm learning how to code and have a C# homework assignment and I cannot for the life of me figure out why my coding won't run properly. The problem lies somewhere in line 42. https://imgur.com/a/YaMqF . Please help!

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

    How to subtract efficiently all members of a (short*) array by a constant?

    Posted: 05 Dec 2017 08:24 PM PST

    I need to subtract all values in a (short*)array[] by a constant that never changes. This needs to be done as fast as possible. How can I do this? Is there a way to directly do it through the pointer without having to dereference and subtract and set it back?

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

    Question for Assembly on the raspPi

    Posted: 05 Dec 2017 08:16 PM PST

    Hey guys, I'm doing a little project that uses wiringPi as it's main library. I want to use a PWM signal on GPIO18 to send a signal to an Electronic Speed Controller. However, when I'm setting up the PWM on assembly, I crash the computer so hard, I have to unplug and replug... Every... Single... Time...

    I can post what I have if that helps. I also noticed if I call

    GPIO setMode PWM //I'm using the number 2 as PWM in assembly for PWM mode 

    etc from the command line, I can run the script if I'm not trying to set everything up in the script.

    Apologies in advance, on mobile.

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

    Need help with this if/else.

    Posted: 05 Dec 2017 08:08 PM PST

    My assignment was to create an if/else program that takes the name of the day of the week and gives you the number of the day. I accidentally made it the other way, it takes the days number as input and gives out the name.

    How can I make it the other way around?

    Also, yes I know it looks hideous but my professor insisted that it be written this way.

     import javax.swing.JOptionPane; // Needed for JOptionPane public class DayoftheWeek { public static void main(String[] args) { int dayoftheWeek; // Day Of The Week String input; input = JOptionPane.showInputDialog("Enter Number of day of the week"); dayoftheWeek = Integer.parseInt(input); if (dayoftheWeek == 1) { JOptionPane.showMessageDialog(null, "Day of the week is Sunday"); } else { if (dayoftheWeek == 2) { JOptionPane.showMessageDialog(null, "Day of the week is Monday"); } else { if (dayoftheWeek == 3) { JOptionPane.showMessageDialog(null, "Day of the week is Tuesday"); } else { if (dayoftheWeek == 4) { JOptionPane.showMessageDialog(null, "Day of the week is Wednesday"); } else { if (dayoftheWeek == 5) { JOptionPane.showMessageDialog(null, "Day of the week is Thursday"); } else { if (dayoftheWeek == 6) { JOptionPane.showMessageDialog (null, "Day of the week is Friday"); } else { if (dayoftheWeek == 7) { JOptionPane.showMessageDialog (null, "Day of the week is Saturday"); } } } } } } } } } 
    submitted by /u/Mikkii
    [link] [comments]

    Online links for programming classes?

    Posted: 05 Dec 2017 08:05 PM PST

    I'm trying to learn more about programming and coding and would like links to online classes that this community suggests.

    Thank you.

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

    who can help me making 3 programs in c for college?

    Posted: 05 Dec 2017 07:58 PM PST

    somebody that can guide me making 3 programs in c for my college the teacher told us to make 3 programs for our final grade and he told us to get the ideas from a really old book and i kind of dont understand everything.

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

    How do you set video source to a video on a different website; how do you scrape videos/video streams?

    Posted: 05 Dec 2017 07:54 PM PST

    I'm building a mini web-app that will grab videos from my favorite youtubers and twitch streamers, and load these videos in a video player on my app. This way I don't have to open up 5 different youtube tabs or go to twitch.tv. I'll have all my videos right in front of me. Kind of like what streamlink does, or what the Kodi media player does with addons.

    I've tried viewing a youtube page source code, grabbing the src="blob:" and setting that to my video tag. the src attribute is set to a blob 95% of the time. Setting this blob does nothing for me however, and I've learned that as far as humans are concerned, blobs are nothing anyway. It's just something for the browser.

    This leaves me to my question... how do I set my video source attribute to a twitch or youtube video? I do realize that in the case of youtube, I could use their embedded iframe that's usually under every youtube video. But I plan on turning this into a mobile app at some point in the future, leaving me with this same problem again.

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

    No comments:

    Post a Comment