[Javascript/Web] Can anyone give me a good link/ELI5 to how to create restricted login, and verification email for website? via /r/learnprogramming


[Javascript/Web] Can anyone give me a good link/ELI5 to how to create restricted login, and verification email for website?

I'm working on a project, and I need users to make accounts here. I am going to restrict them to only my college's email for registration and whatever password they choose, and I need to verify that the email is valid.

I have no idea how to securely work with passwords, or do email verification.

Would Google oAuth be a good way to go about this? I don't know much about that tbh.

Submitted September 30, 2016 at 07:03PM by welc0meToTheMachine
via reddit http://ift.tt/2dLSWqd

Wrong answer for test case #3 in Day 2 of Hackerrank (Python 3) via /r/learnprogramming


Wrong answer for test case #3 in Day 2 of Hackerrank (Python 3)

code:

mealCost = float(input()) tipPercent = int(input()) taxPercent = int(input()) tip = mealCost * (tipPercent/100) tax = mealCost * (taxPercent/100) sum = mealCost + tip + tax sum = round(sum,1) print('The total meal cost is {} dollars.'.format(int(sum))) 

All test cases pass except the final one.

Submitted September 30, 2016 at 07:18PM by CanadianHoser
via reddit http://ift.tt/2dGhpKE

[PHP] How do I store a CSV into an array? via /r/learnprogramming


[PHP] How do I store a CSV into an array?

So I have a .txt file that has the months stored in it like this

 

1, January, 31  

2, February, 28  

3, March, 31  

….. and so on

 

I'm trying to read in that .txt file and store it into an array, which I will be using to populate a table. However, it seems as if my array isn't being fully populated. Only the first 3 indexes are being filled. So when I create the table and populate the rows with that array, I only get the first row 1 Janurary 31, and the rest of the rows have errors Undefined offset: and the index of the array. What am I doing wrong?

$lines=array(); $fp=fopen('calander.txt','r'); $lines = (fgetcsv($fp)); fclose($fp); 

Full code

Submitted September 30, 2016 at 06:19PM by momo2477
via reddit http://ift.tt/2du1zBk

[Python]Created variables for the Mars presentation on Tuesday and could use some ideas on how to manipulate or create better variables. via /r/learnprogramming


[Python]Created variables for the Mars presentation on Tuesday and could use some ideas on how to manipulate or create better variables.

Hey guys so I just did this at like 11pm and I'd love some advice and ideas on how to continue and use these variables to do some calculations.

##Booster variables print("Booster Variables") boosterLengthMeter = 77.5 print("Booster Lenght =", boosterLengthMeter,"m") boosterDiameterMeter = 12 print("Booster Diameter =", boosterDiameterMeter,"m") boosterDryMassTon = 275 print("Booster Dry Mass", boosterDryMassTon,"t") boosterPropellantMassTon = 6700 print("Booster Propellant Mass", boosterPropellantMassTon,"t") raptorEngines = 42 print("Raptor Engines", raptorEngines) boosterSeaLevelThrust = 128 print("Booster Sea Level Thurst", boosterSeaLevelThrust, "MN") boosterVacuumThrust = 138 print("Booster Vacuum Thrust", boosterVacuumThrust, "MN") boosterAccelerationKMH = 8650 boosterAccelerationMPH = 5375 print("Booster Accelerations", boosterAccelerationKMH, "km/h or", boosterAccelerationMPH, "mph") sevenPercent = .07 print("Booster Return to landing site, using", sevenPercent, "of total booster propellant load for boostback burn and", "landing.") boosterBoostback = boosterPropellantMassTon * sevenPercent print(boosterBoostback) print("This calculation figures out how much fuel is needed", "to guide the booster back to the pad. Price per ton is", "hopefully going to be $140,000 per ton. So.") boosterCostPerTon = 140000 print(boosterBoostback * boosterCostPerTon) print("Ship Variables") shipLengthMeter = 49.5 print("Ship Length", shipLengthMeter, "m") shipMaxDiameter = 17 print("Ship Max Diameter", shipMaxDiameter, "m") shipRaptorEnginesSeaLevel = 361 shipRaptorEnginesVacuum = 382 print("3 Raptor Engines at sea level =", shipRaptorEnginesSeaLevel, "lsp") print("All 6 Raptor Engines in vacuum =", shipRaptorEnginesVacuum, "lsp") shipVacuumThrust = 31 print("Ship Vacuum Thrust =", shipVacuumThrust, "MN") shipPropellantMassTon = 1950 tankerPropellantMassTon = 2500 shipDryMassTon = 150 tankerDryMassTon = 90 shipCargotoLEOTon = 300 tankerPropellanttoLEOTon = 380 grossLiftOffMassTon = 10500 liftOffThrustMN = 128 liftOffThrustTon = 13033 vehicleHeightMeter = 122 expendableLEOPayloadTon = 550 fullyReusableLEOPayload = 300 print("Ship Propellant Mass =",shipPropellantMassTon,"t", "Tanker Propellant Mass =", tankerPropellantMassTon,"t", "Ship Dry Mass =",shipDryMassTon,"t","Tanker Dry Mass =", tankerDryMassTon,"t", "Ship Cargo to Low Earth Orbit =", shipCargotoLEOTon,"t", "Tanker Propellant to Low Earth", "Orbit =", tankerPropellanttoLEOTon,"t", "Gross Lift off", "Mass =", grossLiftOffMassTon,"t", "Lift off Thrust MN =", liftOffThrustMN,"MN", "Lift off Thrust Ton =", liftOffThrustTon,"t", "Vehicle Height =", vehicleHeightMeter, "m", "Expandable Low Earth Orbit Pay Load =", expendableLEOPayloadTon, "t", "Fully reusable Low Earth Orbit Payload =", fullyReusableLEOPayload, "t") 

Submitted September 30, 2016 at 06:21PM by treverflume
via reddit http://ift.tt/2cRHJTc

Have an idea for an app or a website? I developed a neat “coming soon” template that will help you build a following before you launch. Any feedback would be greatly appreciated! via /r/learnprogramming


Have an idea for an app or a website? I developed a neat “coming soon” template that will help you build a following before you launch. Any feedback would be greatly appreciated!

Hey everyone. I need some feedback on my latest project. Here's the repo on GitHub:

http://ift.tt/2driBnz

My big questions are (1) is the documentation clear, and (2) does the template function how you want it to.

There are a lot of "lead page" services out there, but they are all either too costly or not very good. The only good one was LaunchRock, but they changed their service about two years ago and it was really a step backwards.

I wanted to create something that would (1) be free, (2) be self-hosted, and (3) be accessible to absolute beginners.

I'd love to hear your thoughts and feedback. What things do you like about it? What additional features would you like to see? Are there any issues you encountered when setting up your own launchbox? My intent is to implement the suggestions as they come in.

Bottom line, there's no reason why there shouldn't be a free, high-quality lead generation page that anyone can self-host and use. I need your help building it.

Submitted September 30, 2016 at 06:31PM by ulysses_mcgill
via reddit http://ift.tt/2ddUhEe

Looking for ideas or helpful articles on programming a virtual memory. via /r/learnprogramming


Looking for ideas or helpful articles on programming a virtual memory.

Hey all, I consider Python a hobby and have never gone to school for programming. I'm just looking for a bit of direction. Currently I am starting a project to create a digital memory. By that I mean a database that I can access to retrieve info like I access my actual memory. What I am wondering is what would be a good way to access the data.

 

For instance say I watched a French TV show 2 years ago but can't remember the name. I'd like to be able to look it up in this database, based on anything I can remember about it. Say "french", "Cancelled mid season", or "Brad Pitt Cameo". Alternatively I'd like to be able to look up the name if I only remembered that and get "french", "Cancelled mid season", or "Brad Pitt Cameo".

  My thoughts so far are make every word or "idea" like a cell in your brain. "Cells" would have connections to other cells(ie. "Brad" would have a connection to "Pitt" one to "Actor"). Some sort of dictionary with weighed connections. These connections could be reinforced when used or when other topics were connected to them. But having everything contain all it's links seems a bit heavy. So I'm debating how to store the link information efficiently.

  I guess what I am asking is how would you manage/search a database of info that can have all sorts of user defined tags, isn't uniformly fitted into specific categories, and a user could be searching for a tag not the main info. Does anyone know any sources that talk about programming this sort of virtual memory? Or a general framework for this.

Submitted September 30, 2016 at 06:34PM by alphaspec
via reddit http://ift.tt/2dCkOhf

Started a Java course on Monday, where can I look to finding “extra” challenges? via /r/learnprogramming


Started a Java course on Monday, where can I look to finding “extra” challenges?

So I'm doing a Udemy course on Java, and I'm loving it so far. Generally speaking, in each unit of the course it ends or comprises a challenge with what was just taught. I feel like I'm not very intelligent and need to make up my own challenges, obsessively until I completely understand the logic behind every single symbol / all the syntax etc. Granted, I just barely started, but as things get harder, I'm wondering where I can look to find more challenges regarding the topic I'm currently covering.

Like for example, the lesson I just finished was on method overloading and I had to make up 10 or of my own challenges before I felt like I actually understood it. I'm not the smartest guy, but I have very OCD tendencies and get obsessed with understanding things before I can move on otherwise I develop slight anxiety and frustration with learning.

Submitted September 30, 2016 at 06:35PM by mildpupper
via reddit http://ift.tt/2ddW7F6