• Breaking News

    Tuesday, December 3, 2019

    I'm a senior developer with major performance anxiety when it comes to interviews. You're a learner who knows some stuff, but has lots of questions. I propose we help each other! Details in post. learn programming

    I'm a senior developer with major performance anxiety when it comes to interviews. You're a learner who knows some stuff, but has lots of questions. I propose we help each other! Details in post. learn programming


    I'm a senior developer with major performance anxiety when it comes to interviews. You're a learner who knows some stuff, but has lots of questions. I propose we help each other! Details in post.

    Posted: 03 Dec 2019 01:31 PM PST

    In short, if you're struggling with a problem, or you have an answer but you don't understand it, I say we help each other out! Let's video chat and screen share about it. I'll do all the work, you just have to watch me struggle as I try to think/talk/program under another person's judgemental gaze.

     

    I have a degree in CS from a prestigious university, and about 7 years professional experience as a software developer. I've interviewed a few times, but video interviews turn my brain to mush and my nerves to mom's spaghetti.

     

    I'm in the U.S.A, in Central Standard Time. My preferred languages are Ruby, Javascript, and Python, but I'm willing to use (almost) any language.

    Send me a PM if you're interested and we'll figure out a time.

    Thanks,

    Jimbabwe

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

    My First technical Interview SPOILER: I didn't pass

    Posted: 03 Dec 2019 08:17 AM PST

    tl;dr What is the best way to go about learning how to problem solve with code and study for these interviews?

    So yesterday I got the not so good news that they are pursing other candidates, while discouraging, the experience was humbling. It made me realize that I'm not as confident of a programmer as I thought and that I need to go back and hit the books. There's a lot to technical interviews that I really hadn't anticipated and the experience is left me with a slightly clearer path of which way I need to focus my efforts on, so for the interview veterans in the subreddit I have a few questions that hopefully will help me and the others looking to get into the field full time.

    What are the most important aspects to mastering the technical interview process?

    When I'm studying technical questions there are often times (on HackerRank or LeetCode) when I find myself really stuck on a question I start looking at the discussions and see how other people solved the problem but I feel like that doesn't help me at all because I'm not coming to the answer myself, I'm using others as a reference but there are just some problems that no matter how hard I think on, the syntax and process just doesn't come to me. I realize now that just gluing libraries together and hoping they work isn't going to cut it, So I need a different approach to studying and learning to be able to confidently pass these interviews. I'm primarily a python developer but feel free to drop resources for other languages on the subject as well.

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

    Success guide for beginner software developer/architect/engineer

    Posted: 03 Dec 2019 02:00 PM PST

    The title might create an impression that I'm going to list a set of things that will guarantee success. It's not what this post is.

    I thought I could share some advice for folks who start their path in the software development or IT infrastructure management and operation fields, starting with interviewing to actually doing your job. I constantly observe people missing opportunities and getting poor performance reviews because they're not following some of the advice below.

    But who am I to give this advice? Well, it's Reddit/internet, I'm just an anonymous poster, so take any advice with a grain of salt. Including mine. If you're inclined to believe what I say, this advice is based on:

    • dozen years in software development and architecture in contributor and management roles
    • hundreds of interviews (as an interviewer) and dozens (as an interviewee)
    • tens of offers received over the past 10 years (when I was searching for jobs) for high-level IC and IC/management positions
    • love and passion for software development and desire for every professional out there to grow, develop and start mentoring

    One thing worth mentioning: some (around 50%) advice I'm providing here was given to me by someone else at some point in my career. Some of it happened a long time ago, some - a couple of months ago. What I'm trying to say (take it as first piece of advice) - never stop learning and never think you know everything. People around you won't stop surprising you.

    Let's just jump into the actual things I wanted to rant about. It's not a complete list by any means. Some things you might even disagree with. I'm just trying to share the patterns/behaviors I believe to be the major contributors to my personal professional success and that of other people working with/under me.

    1) Interviews.

    • Please come prepared. Read about the company. Ask questions.
    • If you're doing remote interviews - be ready and check your audio/video in advance. Get a decent webcam and mic.
    • Look at your resume. Look at EACH WORD/technology. If I ask you right now "how did you use X?" or "why did you decide to implement Y?" are you able to answer in detail? If not - get it off your resume.
    • When you don't understand the question - say so. Ask for an explanation. Stop inventing answers. Good interviewers are there not to evaluate your knowledge of every pattern or every algorithm (if that's what they're doing - you don't want to work there), they're there to understand how you think and how fast you adapt.
    • If you don't know the answer - stop guessing, be honest. Let the interviewer know and ask if they would like you to try and guess/think about it.
    • Talk more during interviews. When you're thinking about the problem - let the interviewer know what you're thinking and where you're going with it. Don't sit there like a koala with mouthful of leaves.
    • A lot of you read "resume best practices" online and now plug in numbers/percentages everywhere to tell how your work improved the business. Good for you. But please, if you have a number there, be ready to answer the "how did you measure that?" question.
    • Stop jumping to the code immediately. If you're asked a technical question - talk abstract first. Synthesize the problem down to an abstract question. Think about real-life examples. Let's assume you're asked to "invert binary tree". Don't start writing pseudo (or real) code. Talk about it first. Draw the binary tree, demonstrate that you understand the question. Explain what inverting actually does to the binary tree.
    • Show interest in general, about the questions, the tech, the people. If you get a question that you were not able to answer - go home, research it, message (or email) the interviewer/recruiter (you can always ask for their LinkedIn to message) after the interview with answers, explanations.
    • If you got an offer ALWAYS negotiate (unless you're 100% satisfied by it). Don't be a jerk about it though. I'd recommend having at least two offers (or one offer and one close call) before negotiating. Then you can be honest - "I really like the company, I'd like to work with you because X, Y and Z but unfortunately the offer does not quite match my expectations/market and other offers I've received. Would it be possible to adjust the offer (by N dollars/with a specific benefit/add signing bonus/to match the market rate)?"

    It's worth mentioning that a lot of the interviews are, truly, bull feces and interviewers are asking questions they've googled minutes ago. It's always going to happen once in a while - accept these interviews as "necessary evil".

    2) Work ethic

    • Never say that existing code/solutions/architecture is done wrong. It may be wrong/sub-optimal, but there may be reasons for it. Sometimes getting a piece of shitty code out is more financially relevant than making it nice, solid, testable. At the end of the day - everything we do is designed to make money for the company, one way or another. That's the main goal. Not writing the best code or having the best coverage. Making money and preventing money loss.
    • Code reviews are great and necessary. If you think otherwise - fix your mindset. Read about why it's important.
    • When starting work on something (new project/ticket/fix/build) always boil your work down to a problem statement (literally, 3-4 sentences; like a story) that you're solving. Make sure that the problem statement is correct, run it by the requestor/peers/managers. Focus on solving just this problem
    • If you made a mistake - always admit it. Make sure that your "I was wrong" or "I made a mistake" is seen/heard by everyone involved with the issue. "I'm wrong" is one of the most used phrases in my vocabulary.
    • If you have a discussion (argument) with your peers about something (code correctness, architecture choice, solution design, etc.) - always politely defend your point until both parties agree. If your "opponent" convinces you that they're correct - admit it. Explicitly, state "I was wrong, you're right" and thank for explanation. If you think you're almost never wrong - fix your mindset. To add:
    • At the same time never state your peer/colleague were wrong if that's what the conclusion of your discussion is. Yes, technically they might've been wrong (there's no argument with just one party in the wrong and you know it). Be thankful for their input and letting you to bounce your ideas off of them. Confirm that they agree with the solution, thank them and move on.
    • Keep your promises/deadlines. This is easy to say, I know. But if you promised to do something - do it. Whatever it takes. But most importantly - learn how NOT to promise. Get a habit of making every deadline you commit to at least 3x of the time you think you need to get it done. You're probably still going to be late.
    • Learn to pick your battles (it's personal for everyone, some people are always going "with the flow", some people are always trying harder - figure out what works for you)
    • Do not jump to solutions/implementations. When you have a problem and know just the tool to solve it we tend to come into the conversation with it [the tool/pattern/etc] in mind. Stop doing it. Abstract the problem away and describe the solution in common language. Describe the "services" and "features" of the solution. Think about the interfaces. Only when everyone agrees on high-level approach start thinking about implementations and tools/patterns to solve each piece of the puzzle.
    • See something - say something. If you see something that might be incorrect/inefficient - let people know.

    3) Software development/engineering recommendations

    • Above I said "Sometimes getting a piece of shitty code out is more financially relevant than making it nice, solid, testable". That is true. But there are certain things that you should never do:
      • Stop putting secrets (passwords/keys) as clear-text in your code. Whether it's your code at work or your personal repo on GitHub - stop it. Interviewers do look at personal GitHub repos linked in the resumes. If I see something like this in your personal repo that you decided to share with me - as an interviewer I will immediately prejudge you.
      • Stop hard-coding values that you might want to change in the future. Use configuration-supplied values and implement best practices for configuration management in your language/framework/tool.
      • Stop making useless code comments and unclear/random commit messages. It's worth your time to provide concise and detailed comments and relevant commit messages.
    • If you decide to take a shortcut/not implement something/implement something in a "non-best practice" way - leave a comment. Explain why.
    • Document. Document everything. Write more documentation then code. Edit: documentation is not necessarily code comments. Architecture docs, guides, best practices, meeting notes, interface annotations, endpoint descriptions - all of that falls under documentation. Basically the point I'm trying to make is: start with documentation, describe what your code/system/solution is supposed to do, why it's needed, what types of problems it is solving (and what types of problems are out of scope); make sure to provide sufficient code documentation; write down discussion results and meeting notes to have a reference; if someone shares some insider expertise with you - don't just use it, write it down and share it if it's not shared already.
    • Don't assign blame. If you're debugging/trying to fix an issue don't ask "who did that?". The only question worth answering: "how do we prevent this type of error from ever happening again?"
    • If you're doing something similar (writing the same code/performing the same action/triggering the same process) manually for the 2nd time - something might be wrong. If you're doing it for the 3rd time - something IS wrong. Stop right there. Automate it. Move on.
    • Think outside of the box. When solving a problem consider involving other teams/technologies. The number of times I've seen people spending ridiculous amounts of time to do something that is already solved is overwhelming.
    • Do not reinvent the wheel. If there's an open-source (that's important) library/module that solves the problem for you - don't hesitate to use it instead of implementing your own (as long as it aligns with company policy and security/compliance requirements). But (very important but) go through the 3rd-party code, write your own tests for it if possible and always be prepared to fork it and maintain it yourself (that's why open-source is important). It's almost always more time-consuming to write your own solution but if you have to - look at other open-source solutions first for inspiration. You might notice patterns/solutions used by the author(s) that are better than things you had in mind.
    • It's a bit harder when the solution is a commercial product. Here you need to think twice about the cost, support cost, expertise and maintenance - think and consult with your peers, other teams, procurement team (if you have one) to determine whether it's worth the money. Sometimes I've seen companies that choose to implement their own solution and spend a large amount of money/time on it to gain "freedom" down the road. Others pick commercial solutions because they value their time more than actual dollars. Each way has its time and place.

    4) General

    • Learn source control (Git). Learn it very well.
    • Spend time on understanding HOW and WHY things work the way they work. If you're learning a new language/framework/tool - read all the documentation you can find.
    • If you're reading documentation/book/article and see a word/concept/phrase you do not understand - learn what it is.
    • Read all the release notes for your main languages/frameworks/tools. Pay attention and understand major changes and improvements as well as reasons behind maintainers decisions to add a feature/function, use-cases for new features/functions and their limitations.
    • Learn general development principles. Learn what SOLID is. Learn what are the common software development patterns. Learn when to use and not to use them. Understand pros and cons of each. Even if you're a sysadmin, learn it.
    • Take ownership of problems. If you need help/assistance from others to solve it - keep politely "bugging" people if they're not getting back to you. Don't just let things sit there and get forgotten.
    • If you don't know how a certain thing works/might work - it's very often more effective and time-efficient to just quickly test it. "What would happen if X occurs?" - instead of trying to figure the answer out by going through the code or trying to find it in documentation (unsuccessfully) - just try it. After trying it make sure you COMPLETELY understand WHY it happened. I like to say: you should be able to keep answering the "and how it does that?" type of question until you get to "and then the code is executed on the CPU" or "and then the system produces a result" type of answer. That's when you've gone deep enough.
    • If you're a developer, learn and understand the DevOps portion for your language/framework. Understand how your code is compiled, packaged, published, deployed and upgraded. If you're a DevOps/sysadmin - learn and understand the development portion. Understand how devs pick what to work on, how they do reviews, what's the branching policy.
    • For any new system/sub-system you work on ask yourself these questions: "what happens if the system it's running on dies?", "how is the system going to scale with 1000x more load/users", "how are other users going to interact with my system?".
    • Stop over-optimizing. If your code/system works fine - leave it be. Until you start noticing potential issues in your monitoring. Which leads to the next point:
    • Monitor everything you can. If you're writing code - think about a way of monitoring its performance. From the very beginning. If you're building systems - think about all the metrics you need to monitor. Again, from the start.
    • Backup everything you can. Code - back it up. Data - back it up. Settings - back it up.
    • Figure out the tools/IDEs you prefer using (or you're required to use by the company), read the documentation and spend time going through the settings. Each single one. Understand what they do. Configure correctly. Export and backup the settings.
    • Always remember: you are easily replaceable. As talented as you might be, as knowledgeable in a niche area as you might be - there's always someone better. Don't try to "hoard" knowledge to ensure job security. It does not work long-term. Be honest and try to make it easy for whoever comes after you.

    Edit: added "(as long as it aligns with company policy and security/compliance requirements)"

    Edit: added the "Read all the release notes" item

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

    Beginner guide to web scraping with Python and thoughts about approach to learning programming

    Posted: 03 Dec 2019 09:29 AM PST

    DISCLAIMER: It might be seen as self-promotion, but I really want someones thoughts on the way I present things

    I created a beginner tutorial for web scraping in Python and I wanted it to be very friendly for someone who is starting with programming in Python.

    Two years ago, when I was very active on UpWork, I earned almost 2k dollars by doing scraping jobs and it is a skill through which I learned a lot about networks and programming in general. Don't get me wrong, I have a degree in a computer science, but have a lot of friends who want to switch careers and started writing mainly for them. Then I realized, why not get some more insights in how to format my blog posts and what could be done better. I worked as student demonstrator prior to my career in industry and I think I understand the struggles of people who start learning.

    Please don't be too harsh :)
    https://brainsdrains.com/web-scraping-with-python-and-selenium-beginners-guide/

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

    I've been given an Interesting opportunity.

    Posted: 03 Dec 2019 12:29 AM PST

    So my thing is networking. Me and software aren't great friends but I'll route and subnet your small office network faster than you can say "Hey I think the server is down". That said, I've been asked a favor from a family friend. He owns a lot of farmland in my home country of El Salvador and wants to know if I can make him a program he can use offline to keep track of his cow's. That's it. Just to keep track of the age of his cow's and of they're making milk or not. He's willing to pay me handsomely but my only programming knowledge is some HTML/CSS and a bit of VB. I've given him one of my old THONKpads to use but once this program gets made it's done. No big fixes. My thought was "oh just make an Excel spreadsheet" but it's going to be farmhands inputting the data so simplicity is key.

    All I'm asking is recommendations on programming languages to learn, methods and procedures, and possible templates for me to do this.

    I'm young and I gotta learn as much as I can.

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

    How can I learning Programming and/or computer language away from my computer?

    Posted: 03 Dec 2019 10:51 PM PST

    I work with my dad and we drive job to job. So in between jobs I want to sharpen my programming skills. Are there any apps, websites, small books, podcasts, etc to practice/learn between jobs?

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

    Worth taking the edx cs50 course if you won't finish it before the end of 2019

    Posted: 03 Dec 2019 08:36 AM PST

    I'm not pursuing the certificate but would likee to finish properly. But, I don't want to wait a month to start.

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

    Feeling behind due to constantly comparing my work to others.

    Posted: 03 Dec 2019 09:58 PM PST

    So, I'm getting close to completing my fall semester as a Sophomore Comp Sci major. And as these semesters go by, I can't help but notice how many better programmers there are. And I can't help but feel so behind when I see/hear about what they did/do.

    For example: One of the required classes I am currently taking is about object orientated programming with C++. We are all assigned a final project that where we implement a library system. Feeling generally confident with myself I start building a base class called library and derived classes for the three categories required. I build the functions required, test them, yada yada, you know just following the assignment syllabus requirements and I finish. However something that bothered me was how I created three separate vectors to hold objects of the three different categories. I thought that it would be better to somehow have 1 but I could not figure out how. Feeling somewhat defeated by this, I decided to just turn it it, since it did fulfill all the requirements (as far as I could tell).

    The next day, I see a coworker ( I intern at my schools IT department) who also took the class. I asked if he also had three vectors, but he said he only had one. A little confused and upset, I asked how. And from what I was able to understand, it included using class templates, virtual functions, and having the vector be composed of pointers to the base class (I think?? He explained it a little too fast). Throughout all this I just felt absolutely stupid, since most of these methods he talked about I learned in class, I just had no idea how to implement them in this project or had a strong understanding of them in the first place.

    I want to use these opportunities of comparison to learn how to be a better programmer but I seem to focus more on how his/her methods work better.

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

    Humble Bundle book package for Data Science

    Posted: 03 Dec 2019 01:17 AM PST

    Today I've bought a Humble bundle deal of data science, some other people might appreciate and find useful here as well probably: https://www.humblebundle.com/books/data-science-no-starch-books Happy learning! 🤓 *I'm not associated by any means with the seller

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

    Real programming languages?

    Posted: 03 Dec 2019 09:49 PM PST

    I've learnt 3 languages so far (python, java c#) but my dad says these are not "real" programming languages unlike c, c++, sql and php(which he knows well), he says there isn't a large market for python, java or c# especially making enterprise software, but i am still clueless what i wanna do in the complete IT field, what are you guys thoughts about this?

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

    (C) Linked Lists are confusing the hell out of me

    Posted: 03 Dec 2019 09:06 PM PST

    The question that i'm doing requires that I make a linked list. The Linked list has a length of 20 and the integers that are in the list must be randomly generated numbers between 0-100. The linked list must then be sorting in ascending order and printed. The sum of the list and average of the list must also be calculated. Here's what I have:


    #include <stdio.h>

    #include <stdlib.h>

    #include <time.h>

    typedef struct ListNode {

    int data; // node data struct ListNode *nextPtr; // pointer to next node 

    } ListNode;

    ListNode*newNode(int data, ListNode *next){

    ListNode *n=(ListNode *) malloc(sizeof(ListNode)); n->data = data; n->nextPtr = next; return n; 

    }

    void SortNodes(struct ListNode *head){

    int num, temp; struct ListNode *Start; struct ListNode *p = NULL; if (head == NULL) //checks if list is empty return; do { num =0; Start = head; while(Start->nextPtr != p) { if(Start->data > Start->nextPtr->data) { temp = Start->data; Start->data = Start->nextPtr->data; Start->nextPtr->data = temp; } Start = Start->nextPtr; } p = Start; } while(num); 

    }

    int main(){

    srand(time(NULL)); ListNode *head = NULL, *List; ListNode *temp = head; List = head; for(int i=0;i<20;i++){ List = newNode(rand() % 101,List); } SortNodes(head); printf("Sorted list: "); temp = List; int sum = 0; while(temp !=NULL){ printf("%d ",temp->data); //prints the value of data at each node sum +=temp->data; temp = temp->nextPtr; //sets temp to next node in list } printf("\n"); float average = sum/20; //calculates average printf("The sum of the list is: %d\n",sum); printf("The average is: %.2f\n",average); 

    }


    The printed list is not sorted and I have no idea what to do. I don't fully understand how the head node works, like I understand that it's supposed to point to first part of the linked list but how do i make it do that?

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

    Need help understanding a function

    Posted: 03 Dec 2019 11:47 PM PST

    https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectBivariateSpline.ev.html

    I can't quite understand the documentation, it seems vague.

    I understand what RectBivariateSpline does, but what does 'dx' and 'dy' do? Do they give the derivative over the arguments or what?

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

    beginner

    Posted: 03 Dec 2019 11:38 PM PST

    I'm just beginning to learn java and I'm wondering if there's any like tips you guys have or like any sites where I can learn programming languages on my own time not just at school.

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

    Main naming convention?

    Posted: 03 Dec 2019 01:45 PM PST

    I'm taking an online Java II class and my instructor seems adamant about us not naming our Main literally "Main". Is this a common pet peeve?

    What else do you call it? Do you reckon it would be acceptable to call it, say StackMain (in this example the assignment is to make a class called Stack to do stuff)? Of course I could ask him, but if this is a common programming pet peeve I figure I'll get an answer quicker through reddit

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

    SVG fill Colour weird number? Style='fill:%232e3141%3B'

    Posted: 03 Dec 2019 02:35 PM PST

    Hi guys does anyone know how this number defines the colour? I'm trying to change the colour of a wrapper but everything I've read says the fill is supposed to be a hex number or colour name. I've managed to change it to purple by randomly changing numbers but I have no idea how to get it to the colour I want!

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

    Simple For loop question

    Posted: 03 Dec 2019 11:08 PM PST

    for ($x = 0; $x <= 10; $x++) {

    echo "The number is: $x <br>";

    How do i exclude certain numbers from being outputted, for example 4 and 6?

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

    I found a guy that had the same basic problem as me on stack overflow, but I can't understeand the answer

    Posted: 03 Dec 2019 02:23 PM PST

    I'm pretty new to programming, I know some basic stuff and started watching a tutorial about making basic 2d games in c++ using the sdl library. The youtuber doesn't explain how to install that library, so I think it should be pretty easy to do so.

    found a guy that had the exact same problem(we even followed the same guide), but I can't understand the answer, can anybody help?

    https://stackoverflow.com/questions/23635719/compiler-cant-find-sdl

    This is another thread I found usefull:https://stackoverflow.com/questions/34121370/how-do-i-add-libraries-to-codelite-projects

    I think I managed to put in the right paths, but I have no idea what to put in the library name field, whatever I write I get this error:

    C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -*WHATEVER NAME/PATH I PUT IN"l

    collect2.exe: error: ld returned 1 exit status

    If i don't put anything it there it just gives this error anytime I try to use a sdl command:

    C:/Users/Utente/Desktop/uni/Game/Game/src/src/graphics.cpp:6: undefined reference to `SDL_CreateWindowAndRenderer'

    I'm sorry if it my sound as a dumb question, but I really can't manage to do it by myself

    I reposted the question because I found this thread with the same problem and tought it would make it easy for anybody willing to help me to do so. SOrry for bad english, not my main language

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

    Ruby Increment Duplicates

    Posted: 03 Dec 2019 11:03 PM PST

    Im writing a ruby program that imports csv data, generates usernames and if theres a duplicate username it appends an incremented value to the end. for example if there are 3 usernames "Bob" then "Bob1", "Bob2", and "Bob3" will be put in the username array rather than "Bob","Bob","Bob". Im having trouble with the duplicate portion. I have a useername array with all the values and a username variable that appends to the username array so i figured i could just iterate through the usernames array and check for matches to the username variable then if they match increment it. But i cant figure out how to make this work. any help is much appreciated.

    here is the code:

    require 'csv'

    #create array variables

    f_name = []

    l_name = []

    usernames = []

    user_name = ""

    #read from csv file

    #create usernames

    table = CSV.parse(File.read('employeedata.csv'), headers: true)

    table.each do |i|

    user_name = i["last_name"] + i["first_name"][0] + i["first_name"][f_name.length-1]

    usernames << user_name

    for x in 0..usernames.length do

     if user\_name == usernames\[x\] puts user\_name end 

    end

    end

    ###puts usernames

    #populate first and last name arrays

    f_name << table["first_name"]

    l_name << table["last_name"]

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

    Should I introduce data redundancy to avoid SQL joins?

    Posted: 03 Dec 2019 10:32 PM PST

    Let's suppose I have the following three tables: User, Product, ProductVariation.

    A User can have many Products. A Product can have many Product Variations. It's obvious to me that Product table should have user_id column to reference User table. It is also obvious to me that Product Variation table should have product_id column to reference Product table. What is NOT obvious to me is whether ProductVariation table should have user_id column to directly reference User table.

    The benefit of data redundancy: Easy to check whether product variation belongs to a user (for security). Also easy to query for product variations without performing joins.

    The drawback of data redundancy: I'm introducing redundancy in data. Potentially, I need to maintain two sets of indices in ProductVariation table: one for primary ID and another for user_id column. Not sure if maintaining extra indices will be expensive over time.

    Which approach would you take?

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

    Is this a good skill to learn if I want to work from home as a mom?

    Posted: 03 Dec 2019 02:57 PM PST

    I have been reading these forums and some have said they do freelance work while the majority have full time jobs. I am looking for a career change so i can be home for my kid. Would it be viable to learn programming for a couple years while my kid is in nursery school and look for freelance work after that?

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

    C Language - Input and Output File

    Posted: 03 Dec 2019 06:25 PM PST

    I had to create this code where I have an input file, and the code reads information off of that, and then takes that information and forms a new output file that displays the information correctly and has some information that is also calculated in the code. The problem is that my program does not produce any information at all on the output file. It creates it, and I can see that it is getting into the input file, but it does not do anything other than that.

    The input file follows as:

    1 Suits 0300 100 092

    1 Coats 0200 060 065

    1 Shirts 1000 012 013

    2 Dresses 0400 060 065

    2 Coats 0185 184 200

    2 Shoes 0600 040 030

    3 Jeans 0200 040 035

    3 Shoes 0200 030 034

    4 Jeans 0300 042 043

    where the first column is the department number, the second thing is the item, the third the quantity, the fourth the cost price, and the fifth the sale price.

    And here is the code:

    #include <stdio.h> #include <stdlib.h> void print_row(FILE *file, float *total_cost, float *total_market) { char item_name[15]; int quantity; float cost_per_item; float sales_price_per_item; FILE *outF; fscanf(file, "%s%d%f%f", item_name, &quantity, &cost_per_item, &sales_price_per_item); fprintf(outF, "%8s%9d", item_name, quantity); fprintf(outF, "%12.2f", cost_per_item); fprintf(outF, "%8.2f", sales_price_per_item); fprintf(outF, "%17.2f", quantity * cost_per_item); fprintf(outF, "%12.2f", quantity * sales_price_per_item); *total_cost += quantity * cost_per_item; *total_market += quantity * sales_price_per_item; } void print_dept(FILE *file, int *dept_name, float *total_lower) { float total_cost = 0; float total_market = 0; int i = *dept_name; FILE *outF; print_row(file, &total_cost, &total_market); fprintf(outF, "\n"); while(fscanf(file, "%d", dept_name) != EOF && *dept_name == i) { print_row(file, &total_cost, &total_market); fprintf(outF, "\n"); } fprintf(outF, "%7s", "Total"); fprintf(outF, "%39s%.2f", "$", total_cost); fprintf(outF, "%4s%.2f", "$", total_market); float lower; if (total_cost < total_market) lower = total_cost; else lower = total_market; fprintf(outF, "%6s%.2f", "$", lower); *total_lower += lower; } int main() { FILE *file, *outF; int dept_name; float total_lower = 0; if((file = fopen("blinn.dat","r")) == NULL) { printf("Can't open file blinn.dat"); exit(1); } else if((outF = fopen("blinn.dout","w")) == NULL) { printf("\n\t\tCan't open output file..."); exit(1); } else { file = fopen("blinn.dat","r"); outF = fopen("blinn.dout", "w"); fprintf(outF, "\n\t\t\t\t\t Blinn Discount Apparel Company"); fprintf(outF, "\n\t\t\t\t\t\t Inventory Evaluation"); fprintf(outF, "\n\t\t\t\t\t\t\t 11/01/2001"); fprintf(outF, "\n\n\t\t\t\t\t Unit Cost\tExtended"); fprintf(outF, "\n\t\t Quantity Cost Market Cost Market Lower Cost"); while(fscanf(file, "%d", &dept_name) != EOF) { if(dept_name==1) { fprintf(outF, "Mens Dept\n"); print_dept(file, &dept_name, &total_lower); } if(dept_name==2) { fprintf(outF, "\nLadies Dept\n"); print_dept(file, &dept_name, &total_lower); } if(dept_name==3) { fprintf(outF, "\nGirls Dept\n"); print_dept(file, &dept_name, &total_lower); } if(dept_name==4) { fprintf(outF, "\nBoys Dept\n"); print_dept(file, &dept_name, &total_lower); } fprintf(outF, "\n%24s", "Inventory at lower cost"); fprintf(outF, "%47s", "$"); fprintf(outF, "%.2f\n", total_lower); } fclose(file); fclose(outF); } return 0; } 
    submitted by /u/6ingy
    [link] [comments]

    Need some advise

    Posted: 03 Dec 2019 10:10 PM PST

    Hi! So I'm a junior in college and I've been studying programming for about 1-2 years now. I'm pretty interested in programming but sometimes, the homework get too hard, even though some of them are easy. I've taken only a semester in java and C and right now I'm learning algorithms in class. As of now, I feel like I haven't really delved much in understanding some of the things Java has like JUnit and inheritance and Pointers in C. I also struggle with doing medium level algorithms in Hackerrank by myself and tend to need someone to point out my mistakes before I can move on. I watch a lot of youtube videos and look up stuff online but I'm pretty sure that while I understand what they're saying, I don't exactly retain it. Are there any advise that you guys can give me about learning more about programming or getting better at it? There's also the part where I get discouraged by the amount of time I have to work on a code. Thank you!

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

    I feel very stupid, and I know I'll be laughed at, but...

    Posted: 03 Dec 2019 06:01 PM PST

    I can not, for the life of me, change the color of the text or background in my HTML file. I have everything in my assignment done except this, but it's just not working.

    I need to use the colors: DE5354 530000 A11313 Or 7E0000

    The file can be found at https://www.w3schools.com/code/tryit.asp?filename=G0KGGUQTZ5IG

    Is anyone can give me a hand, it would be so greatly appreciated.

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

    Regex in Notepad++

    Posted: 03 Dec 2019 09:43 PM PST

    [looking for a buddy] anyone want to study for AWS associate certification exams?

    Posted: 03 Dec 2019 09:40 PM PST

    Hey all,

    25 M working as a data engineer in the US. While I use Python and Java on a daily basis for my job (data mining, setting up ETL pipelines with AWS and REST APIs), I am looking to expand my skills and apply for more devops/data engineering and software engineering roles. As such I would like to pursue the associate AWS level certifications.

    Looking for a study buddy or two if anyone wanted to join! We can discuss our learnings, and do some practice exams together. I am using Linux academy training paths, and found a website where we can buy 10 practice exams for a nominal cost. Other resources are most welcome as well.

    Preferably a buddy in the US due to ease of timezone collaboration. I am in the West Coast (bay area/Sacramento) if anyone wanted to meet in person. I am an outgoing person and a hardworker. Looking to expand my professional network as well!

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

    No comments:

    Post a Comment