r/LearnToCode • • Mar 31 '22

learning JS, other broadly used languages?

3 Upvotes

So I'm using exercism to learn javascript (I'm broke and can't afford bootcamps or classes right now) i know i also need to learn some tools of the trade like node.js (i do have a bit of experience with that) and proper code formatting as well. In curious if there are other languages you might suggest learning as well. I was thinking python and ruby on rails, with css and html as well. I want to be well rounded enough to take the shotgun approach when i eventually begin job hunting. Any suggestions for a budding learner?

Thank you!


r/LearnToCode • • Mar 16 '22

FreeCodeCamp: Code for Free with Quincy Larson | Outside The Code EP3

Thumbnail
youtube.com
3 Upvotes

r/LearnToCode • • Feb 08 '22

I made a discord community for software engineers (Focusing on GREAT resources)

3 Upvotes

Hi,

I daily share with my friends cool articles or books around software engineering such as frontend, backend, DevOps, system design, and computer science. This is a community that I created yesterday so it's not completed yet, but a week from now there will be so many high-quality resources that you may enjoy ⚡

Join now please 💜

https://discord.gg/2wApWXYc


r/LearnToCode • • Feb 06 '22

How do you compute for angular spring physics for physics joints in game engines?

3 Upvotes

I'm working on fixing Godot's physics joints. Currently, it uses Euler angles and it doesn't help me in building active ragdolls for my game. I heard that using quaternions is the way to go. So I decided to write my own code to make it use quaternions instead. This is what I have working so far in my prototype in GDScript (c++ pending):

func _ready():
    baseBTOrig = body_a.global_transform.basis.inverse() * body_b.global_transform.basis

func _physics_process(delta):
    apply_rot_spring_quat(delta)


func calc_target_orientation(Abasis:Basis):

        #node B's actual initial Transform that follows node A around in             
        current global space
	var baseBTOActual = Abasis*baseBTOrig

	var qx = Quat(Abasis.x,rest_angle_x*PI/180.0)
	var qy = Quat(Abasis.y,rest_angle_y*PI/180.0)
	var qz = Quat(Abasis.z,rest_angle_z*PI/180.0)
	
	var qBTargRo = qz*qy*qx# Quaternion node B Target Rotation
	var BTargetBasis = Basis()
	BTargetBasis.x =  qBTargRo*baseBTOActual.x
	BTargetBasis.y =  qBTargRo*baseBTOActual.y
	BTargetBasis.z =  qBTargRo*baseBTOActual.z

	return Quat(BTargetBasis)
	

"""
Thanks to:
	DMGregory: https://gamedev.stackexchange.com/questions/182850/rotate-rigidbody-to-face-away-from-camera-with-addtorque/182873#182873
	and
	The Step Event: https://youtu.be/vewwP8Od_7s
	For the calculations
"""

func apply_rot_spring_quat(delta):# apply spring rotation using quaternion
	if Engine.editor_hint:
		return

	var bAV = Vector3()# Node B Angular Velocity
	var aAV = Vector3()# Node A Angular Velocity
	var bI    # Node B inverse inertia tensor
	var aI    # Node A inverse inertia tensor

	if body_b.is_class("RigidBody"):
		bAV = body_b.angular_velocity
		bI = body_b.get_inverse_inertia_tensor()
	else:
		bAV = Vector3(0.0,0.0,0.0)

	if body_a.is_class("RigidBody"):
		aAV = body_a.angular_velocity
		aI = body_a.get_inverse_inertia_tensor()
	else:
		aAV = Vector3(0.0,0.0,0.0)
		
        #Quaternion Node B Transform Basis
	var qBT = Quat(body_b.global_transform.basis)

	#Quaternion Target Orientation
	var qTargetO = calc_target_orientation(body_a.global_transform.basis) 

	var rotChange = qTargetO * qBT.inverse() #rotation change quaternion
	
	var angle = 2.0 * acos(rotChange.w) 
    
	#if node B's quat is already facing the same way as qTargetO the axis shoots to infinity
	#this is my sorry ass attempt to protect the code from it
	if(is_nan(angle)):
		
		if body_b.is_class("RigidBody"):
			body_b.add_torque(-bAV)
		if body_a.is_class("RigidBody"):
			body_a.add_torque(-aAV)
		return

        # rotation change quaternion's "V" component
	var v = Vector3(rotChange.x,rotChange.y,rotChange.z)        

	var axis = v / sin(angle*0.5)# the quats axis

	if(angle>PI):
		angle -= 2.0*PI

	#as node B's quat faces the same way as qTargetO the angle nears 0
	#this slows it down to stop the axis from reaching infinity
	if(is_equal_approx(angle,0.0)):
		if body_b.is_class("RigidBody"):
			body_b.add_torque(-bAV)
		if body_a.is_class("RigidBody"):
			body_a.add_torque(-aAV)
		return

	var targetAngVel = axis*angle/delta
			
	var tb_consolidated = (stiffnessB)*(bI*targetAngVel) - dampingB*(bAV)
	var ta_consolidated = -(stiffnessA)*(aI*targetAngVel) - dampingA*(aAV)

	
	if body_b.is_class("RigidBody") and body_b != null:
		body_b.add_torque(tb_consolidated)

	if body_a.is_class("RigidBody") and body_a != null:
		body_a.add_torque(ta_consolidated)

In short my computation is:

vec3 target_ang_vel = q_rotation_axis * q_angle / delta

vec3 angular_v_b = stiffness_b* inverse_inertia_tensor_b * target_ang_vel - damping_b * body_b.current_angular_velocity

vec3 angular_v_a = -stiffness_a* inverse_inertia_tensor_a * target_ang_vel - damping_a * body_a.current_angular_velocity

body_b.add_torque(angular_v_b)
body_a.add_torque(angular_v_a)

The problem is it spazzes out when the dampening and stiffness parameters are too high and the mass of either rigid body are too small.

Moreover, I tried attaching a long square bar with a mass of 50 on the other end of the joint (like an arm). It vibrated into the 4th dimension when I tried to make it twist and flex the arm upward:

rest_angle_x = -45
rest_angle_y = 0 
rest_angle_z = 45

stiffness_b = Vec3(5000)
stiffness_a = Vec3(5000)
dampening_b = Vec3(5000)
dampening_a = Vec3(5000)

I tried doing the same thing using Godot's default joint settings. Sure it wasn't rotating the way I wanted it to but it didn't go crazy like how mine does:
Generic6DOFJoint:

angular_spring_(xyz)/damping = 5000
angular_spring_(xyz)/stiffness = 5000

Am I missing something? am I doing something wrong? I don't know where to start looking for a solution for this. I'd appreciate all the help that I can get and it would be great if someone could please point me to the right direction.


r/LearnToCode • • Jan 05 '22

How much code should I be writing daily? ( Beginner)

3 Upvotes

When I started learning code I felt like I was learning so much but soon realized it wasn't so easily translatable into writing my own code from scratch. I've been trying to write code daily to practice to reinforce what I've learnt. How much should I be coding daily? I wrote about 50 lines today and it took me awhile.


r/LearnToCode • • Nov 28 '21

Make keys for spoofer

3 Upvotes

I made a spoofer and i want to make it private so you need to put in codes to use it but im not sure how to do it so im wondering if some can teach me or tell me how. SLIT#6018


r/LearnToCode • • Nov 21 '21

Intro to Neural Networks for Beginners (MNIST Dataset) in Python!

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Nov 16 '21

I want to learn to code

3 Upvotes

Can someone please help me/ give resources on how to start to learn programming, especially websites and web apps. I know nothing, so would also need resources on how to get a domain or server and how to keep things save. Got two goals I want two active, blog or information website and a web app wich works on multiple devices probably messenger.

19, Covid hit me hard, now I want to do something and I decided to learn to code, but when I google how to I mostly find things I dont understand. I need the basics, book recommendations or online resources would be nice.

Thank you

Edit: Thank you very much, I am going to try a few of your options


r/LearnToCode • • Nov 15 '21

Want to learn coding APIs using TypeScript?

3 Upvotes

Here's a series of videos explaining the basics of writing TypeScript APIs and hosting them in a auto-scaling cluster on AWS: https://www.youtube.com/watch?v=pkMU15LJXKc


r/LearnToCode • • Nov 15 '21

Struggling To Learn Machine Learning in 2021? TRY THIS!

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Oct 30 '21

Logistic Regression From Scratch with Python 🐍 (For Beginners)

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Sep 17 '21

Interested in learning to code? Ask a recent bootcamp grad anything

3 Upvotes

Just graduated from Lighthouse Labs bootcamp, if you have any questions on what its like, or if you're interested feel free to comment!


r/LearnToCode • • Sep 13 '21

Simple 4 Steps to Get Hired as a Software Engineer

Thumbnail
youtube.com
3 Upvotes

r/LearnToCode • • Aug 24 '21

10 tips to smash the code interview

Thumbnail
loige.hashnode.dev
3 Upvotes

r/LearnToCode • • Aug 09 '21

Turning Any Image Into A Van Gogh Painting with Neural Style Transfer in Python

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Jul 20 '21

Decision Tree Classification Explained With SciKit Learn in Python

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Jun 24 '21

What Is Software Architecture

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Jun 17 '21

Building Fathers Day Gifts - Using Vue Nuxt And Deploying to Netlify

Thumbnail
youtu.be
3 Upvotes

r/LearnToCode • • Jun 09 '21

Survey- Online Coding Course Learning Experience

3 Upvotes

Hi all, I am a Master's student working on a learning design project to help people learn to code.  I would like to get your feedback and opinions on online coding courses. Please fill out the following survey if this sounds interesting to you. All data will be collected anonymously for research purposes, and will not be given to any commercial entities. It takes approximately 5 minutes to complete the survey. 

Thank you so much!

https://docs.google.com/forms/d/e/1FAIpQLSepCY9EcBDSxfvhTJp4LcG62X_ph9oMG1RI-19qfLjOxnQPYg/viewform?usp=sf_link


r/LearnToCode • • Apr 27 '21

How do I start?

3 Upvotes

I learned Kotlin. I know how it works, the basics you know. How do I begin to make an app? Like how do I know what to import or what to begin with?


r/LearnToCode • • Apr 01 '21

MIT CS Student Advice/Panel

3 Upvotes

Interested in learning what it's like being an MIT computer science student and researcher? GirlsCodeIt is hosting a Zoom panel with Shinjini Ghosh, a current junior at Massachusetts Institute of Technology, on April 4th at 2:00 pm PST. Shinjini is a highly accomplished researcher in the field of computer science and artificial intelligence and has had many impressive experiences such as placing top 4 in ISEF for 2 years in a row as a high schooler. Participants will have the opportunity to learn about her college experience, scientific achievements, and advice for those interested in pursuing a career in STEM. You will have the chance to ask the panelist any questions at the end during the Q&A segment!

If you are interested in joining this panel, sign up through this link: https://forms.gle/TwX8m3xCVN8sTiNT8

Spots are limited so sign up ASAP!

Learn more about GirlCodeIt here: https://www.girlscodeit.org/


r/LearnToCode • • Mar 15 '21

Question for beginners

3 Upvotes

Hi, I am a front-end developer with 5 years of experience. In the beginning, it was tough for me to learn to code and build apps from scratch, so it can be overwhelming for a beginner. Also, it was hard to get an interview for a job and then receive your first offer. So I decided to start helping people with that.

This is why I have two very simple questions:

  1. While learning to code and getting a job as a developer, what are the 2 biggest issues you’re dealing with?

  2. Regarding getting a job as a developer, what would you wish for more than anything else?

Thanks so much in advance - looking forward to reading your answers!


r/LearnToCode • • Mar 15 '21

Need help with this intro to Javascript problem (looping through arrays)

3 Upvotes

Hi, I have run in to a problem where I am instructed to iterate through the array using a for loop and increase each number by 2.

const increaseByTwo = [1, 2, 3, 4, 5];

// -> should print [3, 4, 5, 6, 7];

I have started with:

for (let i = 0; i < increaseByTwo.length; i++) {

console.log(increaseByTwo[i])

I am confused as to where I can update the array elements by adding 2 to each element. As far as I can tell I need to move through the array one by one until I get to the 'array.length', However I am not sure where in my {} I can do this. I appreciate any feedback or pointers you may have.

Thanks!!


r/LearnToCode • • Mar 03 '21

Gyro-web: Accessing the device orientation in JavaScript

Thumbnail
trekhleb.dev
3 Upvotes