On open-source developers/software. A thank you, some questions, and how to give back.

Learn Programming - 15 min 25 sec ago

What's good everyone.

So I'm just working on a little project I've finally started coding, rather than just thinking about starting it for like 2 years(I know I'm not the only one), and I've already employed the help of 3 or 4 different libraries.

You know... I read the documentation, I read the licences, clearly someone has put time, passion, blood(probably), sweat and tears(undoubtedly) in to creating these libraries from the ground up -- sometimes for pretty niche circumstances or purposes. For that I am endlessly thankful. But also a little wary...

Often times the licences to these open-source softwares grant every right to the user. Modify it, sell it, use it commercially, privately, redistribute it. Basically do whatever you want with it, like the MIT licence. Usually, the one and only stipulation being that you must include the software's original licence indicating its open-source-ness.

These are amazing contributions to the development world (big ups) and are often the unsung heroes in a lot of the websites/software we know and love, Bootstrap being the biggest example off the top of my head. Why reinvent the responsive wheel when someone is offering it to me for free?

But what happens when I incorporate some open-source piece in to my software and then the author decides to change the licence terms. Am I screwed at that point, I guess I just re-write their software myself. Is it even worth using open-source libraries in commercial products because of the possibility of this happening?

On giving back, I do what I can. Shouting out the @developer(s) on their social media platforms, even though I'm pretty sure that 99% of my friends on social media have no idea what I'm talking about lol. Donating a few bucks to the project when I'm able to always feels like a solid way to give back -- on that note, one day when I can afford it I will buy a Sublime Text Editor license lmao.

Just curious to see how open-source code works in to other peoples' work, and even to hear from some open-source devs on their motivations!

Thanks for reading, everyone.

TL;DR -- Open-source software is amazing, confusing, can be scary and definitely underappreciated. What kind of O-S software do you use?

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

[C] How does the memory address of a struct work?

Learn Programming - 17 min 24 sec ago

When dealing with a struct, does each individual element have its own memory address? or does the entire struct have a single memory address connecting to each of its elements? If I have a function that accepts a pointer and I want to pass the struct type to the function and use scanf to prompt the user to input the value, do I stilll need an ampersand? How will it look?

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

How can i re-create this with just html+css?

Learn Programming - 20 min 21 sec ago

The website is I tried to inspect element it and reverse engineer but i'm stumped...I just started learning html and css days ago and the way this site is set-up is the direction i wold like to go in for my first site. If someone could walk me step by step i would be grateful. When I inspect element, i'm seeing the transform: translate 3d y value changing, but i don't know how to automate it... Please write it out but also let me work for the answer if that's possible

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

Calculating web development costs using WEBMO

Learn Programming - 38 min 26 sec ago

I'm in a "big" project of my university (like a thesis, but not a thesis) where I have to define a more or less complex web application, build a prototipe and estimate the costs of developing the full web application.

The thing is that I found this paper that talks about the WEBMO model (based on COCOMO II) which presents a method to calculate the development costs, basically the method is:

  1. Count and classify web object predictors and multiply them by the corresponding weight according to the complexity (just like in table 4).
  2. Transform the number obtained in 1. into #KSLOC using table 7.
  3. Use the equations at the end of the 3rd page to get the estimation for the effort and time needed to develop the web application.

But I had a doubt about the example shown in the paper... what bothers me is that in the table 4 it says that 16 HTML lines represents 17.98 percent of the effort to finish this proyect (because 16 * 4 = 64, which is 17.98 percent of 356, the total size of the proyect), which then it's said it's a 5 month proyect in the 4rd page, WTF? 16 HTML lines? it's a typo? or they were referring to 16 HTML files?

Besides that I have tried to find the factors that multiply the number of XML, HTML, and query lines in low complexity, high complexity and number of scripts in high complexity in the web object calculation worksheet, but the problem is that what I've found has other multiplying factors, for example in this book it says that an average multimedia file has a weight of 2, but in the example of paper that I previously put the weight for the same item is 5, not 2.

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

Why when I fork something on Github, am I not getting the latest version?

Learn Programming - 48 min 41 sec ago

I am attempting to fork this repo:

And on it you can see the following directory:

src add samr21 5 months ago

But when I fork it, I don't get that version, I get a much older version:

src Added email contact and website to about dialog and help text 2 years ago

I checked that I am looking at the same branch as that tripped me up earlier when directories seemingly disappeared entirely, but that's not the issue.

I also see this notification on the fork: This branch is 3 commits behind mattairtech:arduino.

And that may be the source of my issue, but I can't seem to update the fork so it's not behind. I tried the "pull request" button, but the wording of what I get back sounds weird:

mattairtech:arduino is up to date with all commits from scswift:arduino. Try switching the base for your comparison.

That sounds like what I'd call a push, not a pull, but admittedly I'm unfamiliar with all this stuff. Shouldn't it say that scswift:arduino is up to date with all commits from mattairtech:arduino? (Which it appears not to be, but that's besides the point.)

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

c++: bit confused about dynamic_cast

Learn Programming - 1 hour 14 min ago
if (CheckingsAccount* cptr = dynamic_cast<CheckingsAccount*>(account[i])) { //if account[i] is in fact a checkings account: cptr->setTransactionFee(5); cptr->credit(0, secondAdjustment); }

I wrote this bit of code and I'm confused about the if (CheckingsAccount* cptr = dynamic_cast<CheckingsAccount*>(account[i])) statement.

So it automatically sets cptr to `account[i], and that also causes the if-statement to check to see if cptr is in fact an CheckingsAccount class?

If that's the case then does dynamic_cast return true if it's able to successfully convert a base class to a derived class?

If that's what happens and the first if-statement fails, then do both cptr and sptr point to the newly converted account object? And is this generally bad programming practice?

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

Since there is less documentation for Drupal8 I am writing blogs. I need some feedback.

Hey guys, I think there is always less to know proper documentation in Drupal so I've decided to write blogs on it by associating with a company that uses Drupal extensively I did two blogs already, I need some feedback from you guys, please let me know your thoughts thanks :) Here are the blogs:

  1. Implementing Open Graph Features Using Meta tag Open Graph Module

  2. Protecting Web Forms From Bots Using Captcha and Honeypot

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

Been learning for years, but i still feel like an idiot

Learn Programming - 1 hour 40 min ago

I have been learning programming for about 2 years. All different languages, but mainly C# and Python. The problem is, i feel like i can't really do anything. I can make a stupid windows forms app here and there, and maybe a bot in Python, but i feel like when i have an idea for something, i just can't do it. Am i just stupid and should i give up with programming and maybe find a new hobby?

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

[C] Loop passing data between child and parent process hangs indefinitely.

Learn Programming - 1 hour 49 min ago

I posted a previous thread for the similar assignment and you guys were extremely helpful, but I ran into another snag.

The program will run, and will pass data now (thanks again for that), but when running large batches of data the program will hang after the loop has run and processed few hundred times. I'm specifically testing against /usr/share/man which is about 6800 files.

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

I need a simple explanation that explains hash functions

Learn Programming - 2 hours 39 min ago

What is the purpose/benefit of hash functions?

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

Can't get Java download to play nicely with Php

Learn Programming - Fri, 03/16/2018 - 23:46

Hello, I have followed the top answer from and placed that onto a web server. I have then followed this tutorial top rated answer and implemented the Java downloader. I can run the Java application and have it start the download, I then pause the download and attempt to restart the application to continue the download, at this stage the server seems to respond with a 200 OK (you would expect I believe a 206 PARTIAL for partial download) and then a 'StringIndexOutOfBoundsException: String index out of range: -5'. Have been racking my brain trying to work this one out of the passed few hours and would appreciate some insight as to why its not working, it seems simple enough. Cheers

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

Java Issue with a while loop "NullPointerException

Learn Programming - Fri, 03/16/2018 - 23:37

Hey Guys, I have a block of code that I'm trying to run that am having an issue with. I'm trying to just get the index number of a Linked List (p) element that contains an Object (g) that has a matching string (gcmName). Below is the block of code in a method;

public int getIndex (String gcmName) { int index = 0; Node p = first;

String tName = p.g.getfName() + " " + p.g.getlName(); while (tName != gcmName) { index ++; p =; }

return index; }

If I comment out the while loop, of course the index 0 is returned which I can then send to my remove method but with the loop in there, it bombs out. It must be something small I'm missing but i'm 30 minutes in to trouble shooting. Thanks

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

How to setup a JS server that links to projects made with different languages

Learn Programming - Fri, 03/16/2018 - 23:22

Hi. I want to make a portfolio website for the projects I've done. There are some made with Django, another with pure html css, and several others with Node JS.

I have a digitalocean droplet, but i'm stuck figuring out how to have 1 central server that hosts all the other projects. Can I go about this with Node and Express? For example, the base url would be, and it would have pages such as,, etc. What about project urls in that case?,, etc.

Thanks for any help! I guess for an alternative I can deploy the projects to Heroku, but I'd like to know how to keep everything on one server.

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

[HELP] Beginner and Stuck with Compiler Issues

Learn Programming - Fri, 03/16/2018 - 23:15

Wrote a program for recursive Towers of Hanoi solution and when it was submitted to professor, there were compiling issues. I have absolutely no clue what it could be.

The issue is: "Exception in thread 'main' java.lang.Error: Unresolved compilation problem at line 49.

Bulk of the code here:

public class TowersOfHanoiRec {

static File file = new File("OutputRec.txt"); //Creates Output File static FileWriter fw; private static void discMoves(int n, String startPeg, String destPeg, String tempPeg) throws IOException { if (n <= 0) { //Could also be executed as switch cases fw.write("At least one disc is needed to execute program."); System.out.println("At least one disc is needed to execute program."); } else if (n == 1) { fw.write("Move Disc 1 from " + startPeg + " to peg " + destPeg + "\n"); System.out.println("Move Disc 1 from " + startPeg + " to peg " + destPeg + "\n"); //Base Case. When Disc is 0 move from start to dest } else { //Recursive Step for all other cases (3 Steps) discMoves(n - 1, startPeg, tempPeg, destPeg); fw.write("Move Disc " + n + " from peg " + startPeg + " to peg " + destPeg + "\n"); System.out.println("Move Disc " + n + " from peg " + startPeg + " to peg " + destPeg + "\n"); discMoves(n - 1, tempPeg, destPeg, startPeg); } } public static void main(String[] args) throws IOException { fw = new FileWriter(file); TowersOfHanoiRec towersOfHanoi = new TowersOfHanoiRec(); System.out.println("-----------------------"); System.out.println("Enter number of discs: "); //Requests input in console submitted by /u/I_Cerberus_l
[link] [comments]

Assistance Needed

Learn Programming - Fri, 03/16/2018 - 23:10

Hello reddit I’m a college junior majoring in political science. Currently I’m taking a data literacy class and am not doing so hot to say the least. Much of the class revolves around using r and r/studio. If you know how to use this any help you could offer me would help! Thanks

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

[c++] matching keys between two maps

Learn Programming - Fri, 03/16/2018 - 22:46

Essentially I'm making a program (I have to use C++98) that will join these two files based on the keys. I've tried using maps in order to do this, but I'm unclear as how to use the key from one map and search the other map using that key.

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