• Breaking News

    Sunday, September 29, 2019

    C++ Not understanding what I'm doing wrong with pointers Ask Programming

    C++ Not understanding what I'm doing wrong with pointers Ask Programming


    C++ Not understanding what I'm doing wrong with pointers

    Posted: 29 Sep 2019 07:59 PM PDT

    Not sure if this is enough to ascertain what I'm doing wrong, but this is the function that's not working:

    https://codeshare.io/arML1E

    The assignment is to create a doubly linked list of objects and be able to add to the front and back of the list, search, and display the list. For some reason the if(pointer == head){} part of the above appears to work fine. I tried to use the debugger and follow the code, and to me it looks like it's skipping the "tail->next == NULL;" line.

    I believe it successfully DELETES the node, but once I try to display it, it crashes

    Here's the display list function (works fine until I attempt to use it after deleting & replacing the tail):
    https://codeshare.io/aYx7Mm

    I'm sure there's about a million places I could've done something wrong, so here's the full code for 3 out of the 5 pages if the above links didn't help. I can provide the driver/class files but I don't think either of those are the issue

    list class implementation: https://codeshare.io/50zxNN
    list class header: https://codeshare.io/axM71N
    list node definition: https://codeshare.io/2WZkMy

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

    Apart from a degree, what programming certifications are worth getting?

    Posted: 29 Sep 2019 03:21 AM PDT

    TLDR; I've seen that microsoft offer some relativetly cheap exams and certifications, are they recognised or worth getting?

    I'm a engineer and considering shifting into a programming career path. At work, I often create relavietly complex python scripts. (we outsource IT, it's expensive and often takes too long). So I'm often a solution for small projects.

    However I have no qualifications in this field, my degree is mechanical engineering. What can I do to improve my CV to make me more employable? Thanks

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

    Stuck on a Java question!

    Posted: 29 Sep 2019 07:43 PM PDT

    I'm doing this online Java class and I'm stuck on this question "Assume that the ArrayList arr has been declared. Write a statement that assigns the next to last element of the array to the variable x, which has already been declared." and I'm finding "x = arr[arr.length-2];" but apparently it isn't the right answer.

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

    Beginning Java Project Help Using Scanner Class for Drawing Panel

    Posted: 29 Sep 2019 03:14 PM PDT

    These are the instructions:

    For the first part of this project, you will create a program that draws a pattern similar to a "bullseye", except that it will made out of concentric squares instead of circles. The squares will be drawn in alternating colors. The user will create a custom color for the pattern by specifying the amount of red, green, and blue used to draw it. The user will also specify the number of squares in the pattern. The innermost square will use the custom color specified by the user. The next square will use an "inverted" version of the custom color. The square next to it will use the custom color, the next square the inverted color, and so on. The largest square will be outlined in the inverted color, if it was drawn using the custom color, and vice-versa. If there is only one square, the pattern will consist of a single square drawn using the custom color and outlined with the inverted color.

    Your program must be named SquarePattern. Prompt the user for a number of rows between 1 and 12. Convert numbers below 1 to 1 and numbers above 12 to 12. Then prompt the user for the Red, Green, and Blue (RGB) values used to create the custom color for the pattern. These values should be between 0 and 255 – convert numbers below 0 to 0 and numbers above 255 to 255.

    Use the DrawingPanel class provided by the textbook to create a drawing panel (canvas) with a width of 650 pixels and a height of 650 pixels. Then draw a pattern with the given number of squares alternating between the custom color and the inverted color. An inverted color is created by "negating" each of the three color values. A color value is negated by subtracting it from 255. For example, if the R value for a pixel is 0, its negated value would be 255. If the R value is 120, its negated value would be 135. The innermost square is colored with the custom color and the remaining squares alternate between using the inverted color and the custom color. The largest square is outlined in the inverted color, if it was drawn using the custom color, and vice-versa. The innermost square should be 50 pixels wide. Each successive square should be 50 pixels wider. The (x, y) coordinates used to draw the innermost square should be (300, 300).

    I am not sure how to begin this program do I need to make a Scanner Class before Drawing Panel? Any help would be appreciated thank you! :) I am also how to make the user input if it is below 0 to go to 0 or if it is above 255 to go back to 255.

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

    How do I replace a float with a string? PYTHON

    Posted: 29 Sep 2019 03:42 PM PDT

    I made a chart of trig functions given the degrees 0 to 360 with increments of 5. I rounded each function in the print statement and tried using the replace function with "INF" when tangent (or the other functions) is greater than x amount. (if tangent > 1000),, (str.replace(tangent,"INF")). How do i get around this? I just want all of the big numbers of the chart to say INF rather than 1.6e32342 or whatever. New to programming

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

    Can you please help me settle a work debate about developer compensation?

    Posted: 29 Sep 2019 09:20 PM PDT

    The guys I work with have been having an almost year-long debate which revolves around the way in which developers are currently compensated. Basically, do we get paid enough for our efforts? And are we paid for the right output?

    In an effort to put this debate to rest, on a whim I created this really quick 5-question survey. It takes less than 2 minutes to complete, and I would seriously be ever so grateful if any one of you devs out there could spare the time to quickly complete it.

    If you're interested (and if I get enough responses), I can do up a follow-up post with the results.

    Many many thanks in advance.

    P.S. I promise I'll pay this forward by taking every survey that comes my way over the next year!

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

    Autonomous Design Structure

    Posted: 29 Sep 2019 02:54 PM PDT

    Hi everyone,

    I am designing a system used for autonomous tracking of objects relative to our boat. We are currenlty using cameras (but will eventually expand to lidar and sonar) to calculate the distance of objects, and want to use a kalman filter to predict the path of the other boats/buoys.

    My question is how to design the map structure for storing the location of other objects. Our input information for other objects will be the type of object we seez the distance, and the bearing to it. As everything is relative to our current position at our boat, would it be best to calculate a relative x,y for all of the objects? Or would it be better to just store the time we found it, the bearing, and the distance. The problem is that if we calculate x,y, then it will almost immediately be out of date if our boat is moving.

    Any tips/ideas?

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

    Is Node worth it for a little project?

    Posted: 29 Sep 2019 08:02 AM PDT

    Hi, I have got to do a little backend for a website that displays gallery of images, uploading, deleting and changing order will be main functions of this. Is it worth to use Node? I have never done it so I guess I would learn something new and would get some cool project to put in the resume. Thoughts?

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

    Logic Question: mark-up language interpreter data structures

    Posted: 29 Sep 2019 01:53 PM PDT

    First of all, my computer science professor sucks and won't respond to my email about this. I thought he'd like that I enjoy coding in my free time but whatever.

    Fuck you Tim, you only ever talk about how you worked at IBM. Half your students don't know how iterative loops work. You teach at a community college, not MIT, get to the fucking lesson and stop breathing so heavily into your god damn microphone.

    This is more an experiment than anything. I'm trying to make a simple markup language for Graphical UIs (is this the right sub?). I'm writing it in a very memory-inefficient language for this kind of thing, it's called GML. It's a proprietary language for the Game Maker IDE, but I've been writing in GML since I was a kid, and I know it backwards and forwards. The problem I'm having is a logic one, and doesn't require knowledge of the language, if you can write an answer in any language I'll be able to understand it.

    I'm struggling to understand how to efficiently create a system where children and parents and siblings can be easily referenced.

    Here's a sample of the code I want interpreted:

    <Window : position = (100 , 100) dimension = (256 , 256) show-exit = (true) background-color = (gray) border-color = (black) padding = (16) overflow = (scroll)> <Text position = (0 , 0) dimension = (192 , 192)> This is Text! </Text> </Window> 

    So the code parses through this string and looks for the '>' character then saves the data structure to a controller object as long as the element string does not contain a '/' in the first character. What I need next is a simple, easily understood method of creating references to parents, children and siblings

    Do I create a global variable holding an array, that holds an array of arrays?

    How do I tell my interpreter how to create and assign these 'generations'?

    I'm not the sharpest bulb on the menorah and when I think about how to create arrays referencing children, parents, and siblings my brain starts hurting.

    Does anyone have any reading recommendations or examples of mark-up language interpreters?

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

    Will you ever feel ready for becoming a freelancer?

    Posted: 29 Sep 2019 07:35 AM PDT

    Hey everyone,

    I started coding in 2013 while being in a CS major in University. I did pretty well when it comes to grades, but it everything was comparably easy because you had tons of resources online and plenty of time to learn everything. But I still wouldn't call myself a good programmer. I now work as a developer for a big ERP software company but I still feel like I have no clue what I am doing. I've been there for 10 months and I'm still pretty slow when it comes to developing. The other guys are all way better programmers which is totally fine for me (I don't want to be the best). But I was wondering if you will ever feel like being a fairly decent programmer? My overall goal in life is becoming a freelancer to be able to travel the world, work from home and still make more money than now (My wage is incredibly low) - but I feel like I am years away from having those skills. When is the right time? I don't feel qualified for so many freelancing jobs because I don't have that much experience and I fear that I will be all by myself not having someone to help me when I'm struggling with a specific task. Did someone here maybe felt the same when starting out? I think I would be way more confident by having the possibility to do "simple tasks" first. But who would pay for that? And how would those tasks even look like?

    I wish you all a wonderful Sunday.

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

    Does anyone experience an antisocial mindset after coding for a long time?

    Posted: 29 Sep 2019 10:52 AM PDT

    I find that when i sit down and code for a couple hours or more, socializing becomes a very foreign concept to me. I can't comprehend much that other people say and i can't think of how to respond to anything. This kind of transforms its self into anxiety. Programming just pulls me into this frustrating mindset, and i was wondering if anyone else experiences this and maybe has a solution to my problem.

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

    Word Scrapers .PDF

    Posted: 29 Sep 2019 10:18 AM PDT

    would anyone happen to know where I can find a programmers whose brain I can pick?

    I am trying to start an insurtech tool for the industry and I am looking for individuals that have some experience with word scrapers and building word libraries.

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

    Where to start?

    Posted: 29 Sep 2019 09:50 AM PDT

    Hi. So I recently got into programming by learning the basic of Python. I also learned HTML and CSS, and just started learning JavaScript, to see what can I do with web development. I have an idea for a project similar to OneNote. A kind of a notes/wiki app that I could use across multiple platforms.

    My question is, what languages/frameworks would you recommend for me to start learning in order to work towards this goal? I would like to be able to make something that would work on both Windows 10, Linux and possibly Windows 8. I heard about electron, but there seem to be a lot of people dissing on it because the apps are not native and use too much memory. I also heard about .NET core and about it having some multi-platform capabilities, but then I have a hard time finding information on that.

    Hope my question is not stupid. I am a bit overwhelmed with all of this, but I'm trying to find my way through.

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

    CLI,CMD,Prompt Question.

    Posted: 29 Sep 2019 07:01 AM PDT

    Is knowing someone's prompt line from their cmd screen or terminal a security risk?

    so like this is their prompt "name@dekstop-computername" or "C:\users\windowsname>" or any other directory.

    Thanks

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

    C++ what type of STL container to use to save data with string and ints

    Posted: 29 Sep 2019 06:08 AM PDT

    I have a data set of name, age, dob, weight, and height.

    But raw data is only given like `name, age, 19` , `name, dob, 03081990`, ... , so I have to read it through to save it into `STL container` as whole `name, age, dob, weight, and height.`.

    I am not allow to create a class, so I just have to save them all in the container. Also, it has to be easy to find `who is the heaviest` or `who is the tallest`.

    I have came up with `multimap` , something like `multimap<string,vector<int>> data` but I'm not sure if it would work out well.

    In this situation, what STL container would be the best choice?

    Any suggestions are welcomed!

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

    What is a framework and how different frameworks differ in the same language? I always thought the language itself dictated their capabilities, but some told me the framework is just as important. ELI5 please.

    Posted: 29 Sep 2019 04:56 AM PDT

    No comments:

    Post a Comment