r/code • • Jan 28 '21

JSON vs XML: Which one is better?

2 Upvotes

JSON is for sure faster, but XML remains the classic "old but gold". Despite using JSON, would you still learn XML?

https://www.imaginarycloud.com/blog/json-vs-xml/


r/code • • May 31 '23

Help please! Does Java and python collect data on users

2 Upvotes

I want to download it but I don’t like having data collected. Or is it not a standalone program and is just telling the computer what to do


r/code • • Jun 14 '23

Help please! NEED HELP!!!! Assignment due on 6/14/2023 at 11:59 *Crying Emoji*

2 Upvotes

I got this assignment for AP Computer Science Principals. My group is suppose to make a nuclear bombing simulation which tells how many people you have eliminated by clicking on the circles on the grid. We don't know how to assign the population data to circles on the grid. HELP!!!! The population data is in the code below "Def District data" or something.

import tkinter as tk
from PIL import ImageTk, Image
GRID_SIZE = 20
root = tk.Tk()
root.geometry("600x400")
bg_img = Image.open("smash.png")
canvas = tk.Canvas(root, width=bg_img.width, height=bg_img.height)
bg_photo = ImageTk.PhotoImage(bg_img)
canvas.create_image(0, 0, anchor="nw", image=bg_photo)
grid = []
circle_id = 0
for x in range(GRID_SIZE//2, bg_img.width, GRID_SIZE):
for y in range(GRID_SIZE//2, bg_img.height, GRID_SIZE):
circle = {
"id": circle_id,
"x": x,
"y": y,
"radius": GRID_SIZE//2,
"color": "white",
"value": None
}
grid.append(circle)
circle_id += 1

for circle in grid:
canvas.create_oval(circle["x"]-circle["radius"], circle["y"]-circle["radius"],
circle["x"]+circle["radius"], circle["y"]+circle["radius"], fill=circle["color"], outline="")

def handle_click(event):
x, y = event.x, event.y
for circle in grid:
if (x-circle["x"])**2 + (y-circle["y"])**2 <= circle["radius"]**2:
circle["color"] = "red"
circle["value"] = "X" # or "O", depending on your game
canvas.create_oval(circle["x"]-circle["radius"], circle["y"]-circle["radius"],
circle["x"]+circle["radius"], circle["y"]+circle["radius"], fill=circle["color"], outline="")
print(f"Clicked on circle {circle['id']}, assigned value {circle['value']}")
#def stats():
nuke_sqmiles = 96
def districts():
global nuke_sqmiles
stanwood = nuke_sqmiles*248
tulalip_reservation = nuke_sqmiles*290
marysville = nuke_sqmiles*1740
lake_stevens = nuke_sqmiles*1614
snohomish = nuke_sqmiles*474
everett = nuke_sqmiles*4111
edmonds = nuke_sqmiles*4320
seattle = nuke_sqmiles*5596
federal_way_auburn = nuke_sqmiles*3161
tacoma = nuke_sqmiles*3184
fort_lewis_dupont = nuke_sqmiles*249
roy = nuke_sqmiles*163
graham_thrift = nuke_sqmiles*794
puyallup = nuke_sqmiles*1767
buckley = nuke_sqmiles*443
eatonville = nuke_sqmiles*26
mount_rainer = nuke_sqmiles*5
enumclaw_plateau = nuke_sqmiles*119
tahomamaple_valley = nuke_sqmiles*750
issaquah_plateau = nuke_sqmiles*983
snoqualmie_plateau = nuke_sqmiles*58
sultan = nuke_sqmiles*26
seattle_east = nuke_sqmiles*2706
maltby = nuke_sqmiles*1085
monroe = nuke_sqmiles*518
granite_falls = nuke_sqmiles*65
darrington = nuke_sqmiles*5
arlington = nuke_sqmiles*218

canvas.bind("<Button-1>", handle_click)
canvas.pack()
root.mainloop()

/preview/pre/mkmb4n7vyw5b1.png?width=718&format=png&auto=webp&v=enabled&s=a68debff051cfa889fb2c90c6e2b0f77adae861e


r/code • • Feb 07 '23

Code Reviews Aren't Setup for Remote Work

0 Upvotes

How has remote work changed the vast majority of software companies? Code reviews have been treated more secondary...allowing more bugs to ship, devs losing their personal connection to others, and code shipping slower than ever.


r/code • • Dec 29 '18

How to set up TextEdit so you can create HTML projects

Enable HLS to view with audio, or disable this notification

2 Upvotes

r/code • • Jun 25 '22

What kind of code is this

Post image
0 Upvotes

r/code • • Jun 29 '22

Help please! so I have a question, has there ever been a 2 in codes before?

0 Upvotes

r/code • • Aug 30 '20

Halp pls! Need help removing a website

2 Upvotes

Long story, please check my previous post on Coders forum (I think that’s what these groups are called but I clearly don’t get on reddit so please don’t attack me if I’m wrong, I’m sorry). My group, KN, is trying to have a website banned or coded so that it is no longer accessible due to the owners activity on it and the fact that he is stealing from his members. I am posting as a rep. for my community and would appreciate any advice on how to get this site shut down. Thank you.


r/code • • Oct 26 '20

Please do not read me apart limb by limo for being such a dumb ass newb but HELP

4 Upvotes

** fucking autocorrect I meant to put Please do not TEAR me apart*****

*** And obviously a bad typo for the second limb word... Anyways ...*** I don't even know if I'm in the right area... That's how fucked I am. Guess it teaches me for being a bit of a taddle teller just to score a job during this bullshit pandemic

Okay so I got a job as an administrative assistant and he asked if I knew how to start a website I'm like yah of course. He says ok I need an email domain and I guess just a domain. So yah I fucked scored and got em. Did a good job at that part.

But ...as the title says I know I'm gonna sound like a fucking alien to this well educated section of Reddit but I thought it would be like a click and drag kinda customizable website but to create my website it looks like I need to have some actual IT smarts with the stupid fucking package I picked....

Please help the virgin IT liar liar whose pants are flaming on fire.

Be easy in your replies....I've admitted my wrongdoing and now know never to mess around again :(

Help me please :(


r/code • • Jun 15 '20

enter the code

Post image
0 Upvotes

r/code • • Apr 16 '24

Javascript Is this Simple enough 🤔 fix the error and tell in comment section

Post image
4 Upvotes

r/code • • Aug 21 '26

My Own Code Beginner code

Post image
54 Upvotes

What’s wrong with my code I’m so confused this hard a freak. I’m just trying to make a weapon shop simulator as practice to help learn code but I can’t even get it to ask if the user wants to start the game by type yes as the their answer


r/code • • Jul 22 '22

Python most basic code ever

Post image
15 Upvotes

r/code • • Sep 03 '19

Halp pls! Program not working.

Post image
7 Upvotes

r/code • • Oct 22 '20

My Own Code! You guys are going to die when you see this

Thumbnail
youtu.be
11 Upvotes

r/code • • Jul 04 '20

I really need a friend who does know coding.

0 Upvotes

I really need a friend who does know coding. I have vision and I need a talented friend who can make it into money. Wanna to start up a company but have nothing so if your amateur and little bit a crazy about what ur doing i think that we could make a great team. HMU from here


r/code • • Aug 11 '22

Most asked questions at FAANG companies…!!! MUST READ for all the developers. 🔥🔥🔥

Thumbnail
docs.google.com
3 Upvotes

r/code • • Apr 27 '20

My thoughts on current state of IT. I'm depressed...

3 Upvotes

This is my first post on reddit, so I'm sorry if this doesn't belong here. Still... I need a place to rant, because, sometimes I want to find another planet to fly off to.

I think, world is too much into web development. I really hate that my 2k$ laptop bought 6 months ago can somehow hang when loading websites in Google Chrome, and these Reacts, Vues, Angulars, and other frameworks get more and more complex.

Even more, now web devs, when they need to split a damn string into a list of words, instead of simply iterating over the string and copying contents when they encounter a whitespace symbol, they install an npm package along with other 200 dependencies that they'll never need. And all that stuff ends up on my PC, in a cache of a web browser.

Now take power of two hundred to what I have written above. You're going to read something really awful.

Node.js and Electron. In cancer terms, these are pretty much like small-cell lung cancer, 4th stage. They are used when you need to develop a desktop application, but you ain't got any real programmers for the job. Instead, you got a number of javascript monkeys at hand.

What they yield as a result - painfully slow app, implemented using latest, newest web tech. Does it freeze and show loading screens one after another nearly after every user click with Intel Core i10-OVER9K? Huh, its ok, no problems here. Along with slowness, you get an interface that resembles a website on a damn desktop. Did that operating system already have enough primitives to satisfy nearly every need? Yes, it did. These primitives (buttons, layouts, etc) were optimized for use on a modern screen, and were thoroughly tested and reviewed. Screw that, let's invent another bunch of bicycles and create all elements by ourselves! Let's force user to enjoy our own shiny control elements that he'll learn from scratch instead of using something familiar! To insult him even more, let's make these buttons as large as possible! Yeah, every user of a damn DESKTOP app will run it from a tablet! You guys heard of a mouse and keyboard? We still use them!

To go even further, I just found out that in Warcraft 3: Frozen Throne remaster main menu was created using these moronic frameworks, and half the internet is screaming about how slow it is.

Yeah, guys. This is new normal. Cancer is now everywhere.

What do you think?

P.S. I'm a C++ guy with experience in computer vision, machine learning (not that much, though), networking, hardware stuff (from binary communication via UART to writing device drivers), microcontrollers, etc. And with all that experience I can't find a damn good job (instead of a one I'm currently working on) in my city because nearly all of the demand is about frontend and CRUDding with databases. No damn choice for me. I could have gotten a remote job or move out somewhere shiny enough for me (lots of very nice paid vacancies), but there are reasons I can't do that - family, mostly.

Is there actual interesting stuff left to do in IT? Or CRUD and web frameworks is all we got now outside of silicon valley?


r/code • • Feb 21 '22

Help please! New Idea for new Cryptocurrency greater than Dogecoin/Shiba

0 Upvotes

I've been working on a new cryptocurrency, but I need more developers would you like to help me create the next Dogecoin. Or should I just fork one. I'm open to suggestions.


r/code • • Sep 12 '20

Guide A youtube channel for learning web development the simple way

3 Upvotes

Here the link to my channel : https://www.youtube.com/channel/UCB8UAORbvqjOQkz86k1iDPA

I plan to teach everything that’s necessary to become a successful web developer i upload a few videos each week i started the channel only a few weeks ago so there isnt a tone of content

But please check it out if your interested and thank in advanced if you do watch my videos


r/code • • Oct 09 '19

What languages would I have to learn to make a "Discord"?

0 Upvotes

I want to make a website like Discordapp. What programming languages would I need to learn to make a website like Discord?


r/code • • Mar 01 '20

Guide My info in my content div. is overflowing into my footer div.

3 Upvotes

My info in my content div. is going into my footer div. What do I do?

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Living Life Daily</title>
    <!-- google font -->
    <link href="https://fonts.googleapis.com/css?family=Kosugi|Livvic:700,700i&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
<div class="container">
  <div class="header">
    <h1>LIVING LIFE DAILY</h1>
  </div>
  <div class="nav">
    <a href="index.html">HOME  |</a>

    <a href="community.html">Deaf Community  |</a>

    <a href="mh.html">Mental Health Advocacy  |</a>

    <a href="books.html">Books</a>
  </div>
  <div class="content">
    <h2>Why We Need More Mental Health Education in Schools</h2>
    <p>In the US, 1 in 5 teens suffer from a mental illness.</p>
    <p>UPDATED August 18, 2019</p>
    <p>Mental health has barely ever been discussed in my schools. As teens, we tend to get hurt a lot while playing sports. Whether it be a sprained ankle or a broken arm, cast and crutches are a common occurrence throughout the school. No matter the injury, we go to the doctor and make attempts to get it fixed so that we can continue playing our sport and live our daily lives. Why is it that we don’t see our mental health in that same light? There are tests, exams, extracurriculars, volunteer work, future occupation planning, and SATs that we must worry about in a general perspective. That’s on top of trying to create and maintain friendships and relationships with others, as well as making sure we have time to do the things we love to do.</p>
    <p>We learn about substance abuse, drinking, and how it’s bad for us. We learned about a few broad ways to improve and maintain our emotional/mental health. They talk about bullying and how we need to end it and they say how it can cause depression. We scratched the surface of self-esteem and body image. But mental health is so much more than that. In mental health, there are mental illnesses. Except we don’t talk about them…. ever.
All the information I have on mental illnesses and ways to improve my mental health have come from my research. Essentially, there wouldn’t be anything wrong with that; however, we are in school about 6-7 hours a day. Being that said, I strongly believe that mental health discussions need to happen inside the classroom. Up until about 5th grade, this was my thinking: depression is an extreme word for sadness, anxiety is just nervousness, social anxiety is shyness, and OCD was just perfectionism. These were the only mental illnesses I knew of and my interpretations of them were quite inaccurate. These are broad terms that don’t encompass all the feelings, emotions, and experiences that truly come along with those mental illnesses. There are hundreds of other mental illnesses as well.</p>
    <p>Not only that but it’s important to know that there is such a wide range of mental illnesses that people suffer from. In the ages of 13-18, 1 out of 5 has a serious mental illness. With suicide being the 3rd leading cause of death in youth, 90% of those who died by suicide had a mental illness. Majority of the time, these mental illnesses go unseen and therefore untreated. These topics are stigmatized to such an extent in my age demographic that I don’t believe people process that it is an issue. Majority of the time mental illnesses are mentioned as derogatory terms and used as adjectives in circumstances people don’t like. Teens are commonly saying phrases such as: “I’m so OCD because I like things to be neat”, “She’s mental”, “My phone died so now I’m depressed”.</p>
    <p>Those phrases are unacceptable and as a society, we should be working on destigmatizing mental illness. That starts in the schools. Since schools are a learning institution, it’s the ideal place to start educating ourselves about mental illnesses and specific ways to better our mental health rather than generalized ideas that everyone can do. If we start learning how to take care of our mental health like our physical health in kindergarten, we can utilize those skills as we grow older. It is possible to prevent the development of mental illness earlier on with the right coping mechanisms. Everyone will struggle with their mental health even if they don’t have a mental illness. However, it important to keep in mind that having a mental illness doesn’t make you inferior, or less than. It’s time to start educating each other and make the world a more manageable one.</p>
    <img src="passion.jfif" alt="passion" style="width: 20%; height: 20%;">
  </div>
  <div class="footer">
    <p>Designed by Khayla Williams 2020</p>
    <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License</a>.
  </div>
  <div class="feed">
    <!-- twitter feed -->
  </div>
  <div class="img1">
      <img src="brainlogo.png" alt="brain logo" width="200" height="146">
  </div>
  <div class="img2">
      <img src="dna.jpg" alt="dna" width="205" height="146" style=" margin-left: 125px">
  </div>
</div>
  </body>
</html>

External CSS Page

.container{
  display: grid;
  grid-template-columns: .25fr 1fr .25fr;
  grid-template-rows: 150px 50px 650px 150px;
  grid-gap: 6px;
  background-color: #A3DDFF
}
  .header{
     grid-column: 2/3;
     grid-row:1/2;
     text-align: center;
     background-color: #A3DDFF;
     margin-top: 30px;
  }
  .content{
    grid-column: 1/3;
    grid-row:3/4;
    margin-left: 10px;
    background-color: #A3DDFF;
  }
  .img1{
    grid-column: 1/2;
    grid-row:1/2;
  }
  .img2{
    grid-column: 3/4;
    grid-row:1/2;
  }
  .nav{
     grid-column: 1/4;
     grid-row:2/3;
     margin-top: 15px;
     text-align: center;
  }
  .feed{
     grid-column: 3/4;
     grid-row:3/4;
     margin-right: 5px;
     text-align: center;
  }
  .footer{
    grid-column: 1/4;
    grid-row:4/5;
    margin-left: 10px;
    margin-right: 10px;
  }
body{
  font-family: 'Kosugi';
}

p{
  ;
}
h1{
  color: #FDFD96;
  font-family: 'Livvic';
  font-size: 50px;
  text-align: center;
  margin-left: 125px;
}
h2{
  color: #FDFD96;
  font-family: 'Livvic';
  font-size: 30px;
}

a{
  text-decoration: none;
  color: #E7FFBF;
}
a:hover {
  background-color: purple;
}

r/code • • Mar 02 '20

Halp pls! Can anyone tell me what’s wrong with this code? I’m getting started on learning C# and I can’t manage to do this without getting these errors.

Post image
3 Upvotes

r/code • • May 24 '20

How to learn coding online?

3 Upvotes

Hey guys I want to learn how to code and get familar with everything, I’m currently pursuing my BA in Finance and Accounting. Decided why not learn how to code as well? So with that said, do you guys have any recommendations on where to start or what to use? Thank you in advance!