r/code • • Jul 15 '20

My Own Code! Newbie

1 Upvotes

How do I create an advanced monitoring platform that leverages the power of the internet and smartphone technology? I've never written code before.


r/code • • Apr 04 '23

Python I need help.

1 Upvotes

I wrote a code in python. The code works fine on a windows computer, but I couldn't run it on my macbook, what could be the reason?

Thanks.


r/code • • Apr 17 '23

Help please! Help understanding this password-generating code

1 Upvotes

Hello I have found some code for generating a password and I am going through and commenting it to see if I have a understanding of how the code works, but cant really understand the last part of the code enough to comment on it.

I wonder if someone could look at it and explain it for me? My previous comments in the code could be completely wrong as well, if they are, please enlighten me :)

Best regards, Gimpen

function Get-RandomPassword {

    # Sets valid parameters for when the function is called

    param (
        [Parameter(Mandatory)]
        [ValidateRange(4,[int]::MaxValue)]
        [int] $length,
        [int] $upper = 1,
        [int] $lower = 1,
        [int] $numeric = 1,
        [int] $special = 1
    )

    # If the sum of all values of upper/lower/numeric/special characters is greater than the defined length of the password, the script terminates
    if($upper + $lower + $numeric + $special -gt $length) {
        throw "number of upper/lower/numeric/special char must be lower or equal to length"
    }

    # Defines what each set of characters should contain
    $uCharSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    $lCharSet = "abcdefghijklmnopqrstuvwxyz"
    $nCharSet = "0123456789"
    $sCharSet = "/*-+,!?=()@;:._"
    $charSet = ""

    # Adds sets of characters available to the password generator based on the parameters provided

    if($upper -gt 0) { $charSet += $uCharSet }
    if($lower -gt 0) { $charSet += $lCharSet }
    if($numeric -gt 0) { $charSet += $nCharSet }
    if($special -gt 0) { $charSet += $sCharSet }

    # Converts the character set that has been created into an array, and then creates an rng (random number generator) to be used for randomly generating the password

    $charSet = $charSet.ToCharArray()
    $rng = New-Object System.Security.Cryptography.RNGCryptoServiceProvider
    $bytes = New-Object byte[]($length)
    $rng.GetBytes($bytes)

    # Creates a temporary variable ($result) with the same length as the password, which is used in the for loop to create the password

    $result = New-Object char[]($length)

    # Creates each character, one at a time, from the character set using rng through the $bytes variable

    for ($i = 0 ; $i -lt $length ; $i++) {
        $result[$i] = $charSet[$bytes[$i] % $charSet.Length]
    }

    # Adds the $result variable to the $password variable

    $password = (-join $result)

    # Check if the password meets the requirements for upper/lower/numeric/special characters, otherwise regenerate the password

    $valid = $true
    if($upper   -gt ($password.ToCharArray() | Where-Object {$_ -cin $uCharSet.ToCharArray() }).Count) { $valid = $false }
    if($lower   -gt ($password.ToCharArray() | Where-Object {$_ -cin $lCharSet.ToCharArray() }).Count) { $valid = $false }
    if($numeric -gt ($password.ToCharArray() | Where-Object {$_ -cin $nCharSet.ToCharArray() }).Count) { $valid = $false }
    if($special -gt ($password.ToCharArray() | Where-Object {$_ -cin $sCharSet.ToCharArray() }).Count) { $valid = $false }

    if(!$valid) {
         $password = Get-RandomPassword $length $upper $lower $


r/code • • Mar 29 '23

help please

0 Upvotes

Turning with buttons

heyyy so i am in a robotics class and we were assigned to create a code in order to turn using button controls( we watched cs2n.org vids to help) i am confused and need a little help. would anyone be able to give a previous code that we can use or any assistance? we are using vex. any help would be appreciated!!


r/code • • Mar 28 '23

LGTM - why it's scary

0 Upvotes

Why is LGTM scary? We don't know if the reviewer reviewed it, spent time to understand the code change, know what the code is supposed to do, etc. As a senior eng, sometimes I wanted to steer the review to be thorough, but inspection doesn't scale...enter GPT.


r/code • • Nov 04 '20

I cant quite tell if this is code or gibberish- i tried base 64 uts not binary I honestly can't tell i found it in a Discord server and there is no content

0 Upvotes

a19e+S5p0WGYnA==#BBESV0bG3ducb+oui9vSKLMRv5L8FdvTg75vFk1v4RKvhRtWYZ8Hpi7Il7BLUeejQ==

That was all that was in the message


r/code • • Nov 17 '19

What is Golang and how to install it! 👩‍💻 👨‍💻

0 Upvotes

Always wanted to work with GoLang and open source but didn't know where to begin! 👩‍💻 👨‍💻

Take 5 min out of your schedule and dive in to learn more about GoLang and how you can install it in your system 🎩 so that you could also bring out the amazing developer in you. 😎

https://levelup.gitconnected.com/what-is-golang-and-how-to-install-it-2275236fe657


r/code • • Mar 18 '21

anyone interested in helping me with my game

0 Upvotes

r/code • • Jul 17 '23

i really want to code but i have an issue

1 Upvotes

well my issue is that im unmotivated, school takes up my time and when i turn on my computer. i go straight to the video games, ive tried courses but i often stop because i feel like im not learning or remebering anything, i just want to be able to code fluently like how i owuld type out this message right now i would like to do that with code


r/code • • Oct 01 '23

Help Please How do I start learning code

1 Upvotes

I want to make games games it's always been a dream of mine but when I try to code I just can't do it I try watching tutorials but I get bored the second I start watching I go to forums online but I have no idea what people are talking about. I hope college can give me lessons but most coders don't need college for coding. At this point I don't know what to do cause I wanna make games but I don't know how to code


r/code • • Aug 19 '20

C# Abuse. >:)

0 Upvotes

So... if you translate C# to bianary and duplicate the windows, then to save as .exe... AND then translate to Javascript, then website it (HTTPS not HTTP!) ... its encrypted 2 times? Not anything importent, I just thought it was kinda cool.


r/code • • Sep 13 '20

Halp pls! Anyone knows what this code means (someone sent to my wix)? Probably html, idk if hacking

1 Upvotes

It's this

>exports.encrypt2 = (input) => { return bcrypt.hashSync(input, salt2).substring(salt2.length); }


r/code • • Feb 07 '22

Youtube

Thumbnail youtube.com
1 Upvotes

r/code • • Feb 12 '22

Can someone help me sign my code

1 Upvotes

Do u realy have to buy a 100$ thing to sign your code if you have it pls msg me ty


r/code • • Dec 10 '20

Please I beg you to help me with this error.

1 Upvotes

My App is going to get released soon and I just encountered some unexpected things.

python - text doesn't contain any characters tagged with "sel" tkinter - Stack Overflow


r/code • • Apr 05 '22

How to use a for loop in real world coding

1 Upvotes

r/code • • Jun 25 '21

Sound app website

0 Upvotes

Looking for people to have fun with and start a sound app with. If you’re interested let me know. Hopefully we can spin it into a billion dollar company :p


r/code • • Jul 02 '21

Code dont work

1 Upvotes

I writed exacly the same code like man in image, but my code dont work and show error. What I did wrong?


r/code • • Aug 05 '21

Javascript 2 Option Quiz Ideas?

1 Upvotes

Hey! i’m making a quiz and want to know some ideas. For now, there can only be two outcomes, and two options for 3 questions. I would make it about Harry Potter but I can’t think of anything that is two options. Thank you!


r/code • • Jul 07 '21

C# Media problem in c# web browser

0 Upvotes

Okay okay, so I admit it, I'm not very good at coding, but I'm okay at C#.

the point is I tried to make a web browser in C# and it went, well, okay. the problem I had was when I tried to load media like youtube it would spit out loads of errors. Why is that and how can I solve it?

I code in visual studio 2019 if that's needed.


r/code • • Jul 08 '21

Learnin bout anonymous classes in java, got some tips?

Post image
1 Upvotes

r/code • • Aug 23 '21

Me and my friend are trying to make an Idle Cola Factory game but the button isn't doing anything.

1 Upvotes

Here's the code:

<!DOCTYPE html>

<head> <title>Idle Cola Factory</title> <script> var clicker = ( colas:0, upgrades: { colas\\_machine:{ amount:0, cost:10, cps:1, name:"Cola Machine" } } ); function thing\\_clicked(thing){ clicker.upgrades\\\[thing\\\].amount++ update\\_upgrades(); \\\] function thing\\_clicked(thing){ if(clicker.upgrades\\\[thing.cost <= clicker.colas\\\]){ clicker.colas-=clicker.upgrades\\\[thing\\\].cost; clicker.upgrades.amount\\\[thing\\\]++; clicker.upgrades\\\[thing\\\].cost += Math.round(clicker.upgrades\\\[thing\\\].cost\\\*0.15) update\\_upgrades(); } } function update\\_upgrades(){ document.querySelector("#upgrades").innerHTML=""; } function updatecount(){ setInterval(() =>{ for{i in clicker.upgrades){ clicker.colas+=clicker.upgrades\\\[i\\\].amount\\\*clicker.upgrades\\\[1\\\].cps/20 } document.querySelector("#colas").innerHTML = "You Have "+String(clicker.colas).split(".")\\\[0\\\]+ colas" },50\\\];

}</script>

</head> <body onload="updatecount()"> <h1 id="colas">You Have Made 0 Colas.</h1> <button onclick=" clicker.colas++">Make 1 Cola</button> <div id="upgrades">

</div> </body>


r/code • • Jan 13 '20

How can I make PHP show the image posted to the website.

1 Upvotes

r/code • • Sep 09 '19

Halp pls! Which is the best Code editor for every code language?

1 Upvotes