#💻︱programming

1 messages · Page 8 of 1

dusky fern
#

@graceful axle released npm package for unofficial CubeCraft data API 🥳
Now its easier to create bots with CC related functions using node js (CubeCraft Data bot already uses it!) ✅
Just run "npm i cc-data-api-wrapper" and here you go! Examples avaliable below 😁
Happy coding ❤️

brazen cypress
#

It is multiplayer

#

Hahahah

solar igloo
brazen cypress
#

Thanks!

cursive kiln
#

excuse me how do you get the developer badge on discord??

hard roost
#

You make a bot, use it slash commands once a month

little bear
plucky root
#

I own a CubeCraft Brazilian server (obviously not official). I made a bot that translates the announcements into Portuguese instantly as soon as they are posted. They are translated in an announcement channel, so the translation is also instantly published to the Brazilian community that is on my server. I recently added a system where the bot can edit the translated announcement message if it is edited here as well. If it is deleted here, it will also be deleted on my server. But it only works if it is deleted/edited within a period of 30 days, so as not to overload the bot with too much information. The only downside is that the announcements are not always translated correctly. Some changelogs barely make any sense. The bot translates using Google Translate

#

About the custom emojis like cuberightarrow, I'm thinking of having the bot replace them with similar ones inside my server, but nothing's come off the drawing board yet. Not even sure if I'm actually going to add this

spring tiger
#

That's pretty awesome @plucky root . Have you considered using an AI model API such as GPT to do the translation, rather than google translate? Apparently it is more accurate, worth experimenting with

plucky root
#

Yes, I did. But I ended up coming to the conclusion that it's better for me to use a service dedicated exclusively to translation, not an AI model. I'll spend some time looking for a better API

#

but anyways, thx for the suggestion. I'm always open to new ideas

hard roost
#

You can look into DeepL, they most likely have an api with a free tier (with some kind of restrictions ofc)

#

Oh yeah deepl free tier is more than enough

plucky root
#

I'll research about

hard roost
#

Also I believe bots should be able to custom emojis

plucky root
#

only if the bot is on this server

hard roost
#

After you have translated it, you replace :name: with name:emoji_id

hard roost
plucky root
#

i'll try

hard roost
#

Nevermind just poopy discord code as usual

proud acorn
#

Bannable

dusky fern
# unborn dust Does it work on Java?

On java you have to use api without wrapper (because we not have one yet) but thats possilbe still, read more about that api here:
https://www.cubecraft.net/threads/bedrock-online-leaderboards-and-api-unofficial.344404/

vital summit
#

@drowsy terrace You should make some links available in this channel

#

like github, sourcebin, npmjs

quiet arrow
#

Github is pretty sure

fluid steeple
fluid steeple
#

or both

fluid steeple
#

how does it work?

dusky fern
fluid steeple
#

is it headless

#

thats really cool

dusky fern
fluid steeple
#

wow

#

is the leaderboard open source

#

i wanna make it look nicer

dusky fern
hushed sleet
#

Anyone has any tips for start on Python? It can be anything

burnt fable
# hard roost Kinda silly. Assuming this is bot run on a vps, you cant host gpt yourselves and...

The api call pricing for openai is actually fairly reasonable, I imagine with our changelog/announcements volume you wouldn’t be spending more than 10$ a month on it. Likely less than they pay for the VPS itself.

That being said there are some advantages because the models know what Minecraft is, so if the prompt to the model gives the context of what this is and relates to, and asks for it to write it in another language rather than just 1:1 translate it, the results should be pretty decent.

I found it when using it to translate its way better than google translate if you ask it to write it in the other language but not directly translate, as then it’s effectively writing the same story/message but using all of the local languages way of writing and describing things, rather than taking the English way and changing the words.

fluid steeple
#

Thats one very smart way to do that

hard roost
teal plaza
#

Hi

slender lynx
#

like for any player

slender lynx
dusky fern
slender lynx
#

I wish

minor roost
#

Bring back old update

vital summit
worn pagoda
#

System.out.print(“pleace fix the server fast”);

west seal
#

Output

vital summit
#

If someone knows a package to convert bedrock packs into java or java to bedrock, please inform me here.

hard roost
#

Oh man wasn't even remembering wrong, i knew this was asked before

hard roost
#

There's an api on the same GitHub org

vital summit
#

@sweet barn You made PackConverter?

sweet barn
#

parts of it yes

vital summit
#

like

#

npm i

sweet barn
#

no

#

packconverter is a java project

vital summit
#

D:

sweet barn
#

most was based on an old javascript one tho that no longere xists

vital summit
sweet barn
#

write the discord bot in java 😉

vital summit
#

I am writing in JS

#

some part of it is in kotlin

#

hm

hard roost
spring tiger
#

no, it would be better to give helpful advice rather than throwing a google link. already told you that previously, that is what this channel is for.

#

if you're not happy about that you don't have to participate here.

hard roost
#

How is saying "there's an api on the same github org" not helpful?

#

I'm literally googling for him? Giving him options?

#

Do you want me to directly link the repositories? They need to do somethings on their own. Me sending a google link adds a couple clicks and scroll wheel

vital summit
#

I just didn't inform anyone that I was need npm package ☠️

hard roost
#

You're good no worries
(the one on their github is indeed an npm package, you'll need yarn though)

mighty brook
#

I am develop my server in minecraft
If one know how i can get the colour name like eggwars whene you are in the pink team your name is pink

random summit
#

hello

#

fnice

quiet arrow
#

Can't really tell you how/where to look, without knowing what you're making it in though :)

delicate valve
#

Is there anyway that I can change Knockback and PVP combats in my world?

#

Well once I did it for sumo with instant health and instant damage but it is not working anymore

abstract scroll
delicate valve
mighty brook
mighty brook
vital summit
#

impossible

#

without mods

#

I've tried same thing

#

I used Smelly Ranks

#

mod

#

i don't really remember its name

mighty brook
vital summit
#

but its not really thing u need rn

lean oracle
#

For anticheat of a server (to counter autoclickers) what would be better, cps cap or repetive click detection

minor roost
lean oracle
#

alr thankjs

winter gazelle
#

alot of people would get banned from going over the cap

minor roost
#

hes likely making his own server

minor roost
#

that would depend on how it would be implemented

#

if it just cancels clicks that happen less than 50ms or 100ms after the last or smth, the cheaters wouldn't really be cheating anymore

elfin relic
#

Guys

#

I have problem

brisk badge
#

okay

elfin relic
#

I cant play parkour why

#

Can someone help

#

Ple

#

Pls

brisk badge
elfin relic
#

Im saying i cant play parkour in cubecraft and why

brisk badge
#

Practice makes perfect

hard roost
#

2nd pinned message

elfin relic
#

I dont kidding

true mantle
brisk badge
#

You don't specify your problem enough.

true mantle
#

It will get back online as soon as its playable

elfin relic
#

Why closed

true mantle
#

I assume you play bedrock tho because I think you should be able to play parkour on java not sure

true mantle
elfin relic
#

Ok

minor roost
#

how to fix cubecraft:
shutdownJava();

burnt bridge
#

true

bronze echo
#

Guys I’m programming a hamster what should I call it

vital summit
minor roost
cyan crypt
woven tangle
#

Hampter

burnt bridge
#

Hampter

hard roost
#

Hampter

true palm
#

Hampter

vital summit
#

Hamster

bronze shard
#

rabbit?

hallow magnet
#

also isn't it just Player.displayName(Component.text(player.getDisplayName()).color(NamedTextColor.YOUR_COLOR));

vital summit
#

no plugins for mc bedrock

#

its not coding thing

hallow magnet
#

oh yo talking about bedrock ok

vital summit
#

Minecraft commanr

hushed sleet
#

Why you might ask

#

Cuz it's cruel

bronze echo
#

Noted 😎

polar token
#

What languages are best for programming stuff? Like games

#

Dam

#

I only know a bit about python lmao

fallow canyon
brisk badge
#

^ most game engines use c# or c++, but c# is a little easier to get your head around :p

woeful zephyr
#

and with godot you can also use c#/c++/other langs once you get the hang of it and want to branch out

polar token
lilac tree
vital summit
#

Hello I am making a command that checks if user has passed discord OAuth2 to continue using the bot. I need help, bot is in JS :)

brisk badge
#

Then ask your question!

#

@vital summit :)

vital summit
#

like

#

if(user.isAuthorized) or smth

#

in JS

vital summit
#

No response? 😭

brisk badge
#

I have very little discord bot development experience, so I can't help you here

quiet arrow
# vital summit How can check if user passed OAuth2

Can you be more specific? If someone is using your bot, they're logged into discord. If you want to requests perms from their account (email/avatar/...) you can use OAuth to get them. You'll probably need to set up a little website/api for discord to respond to. I've never used it so not 100% sure. But it won't be something you can check for over the discord API.

hard roost
#

Idk man looks like discord api to me

fetch('discord api', {
            headers: {
                authorization: `${tokenType} ${accessToken}`,
            },
        })
#

I cant put the actual url cuz goofy blanket ban of urls bans it

#

Idk why y'all are saying that it is not possible to get discord data from discord api

#

discord oauth2
nah bro that uses some 3rd party api

quiet arrow
#

I don't think that is remotely what they're trying to do

#

You also won't be helping or encouraging many people with that tone, which this channel is for...

minor roost
vital summit
minor roost
#

Yes

vital summit
#

No

#

I found one discord-oauth2

#

but

#

idk how to use it

#

tryna find out

quiet arrow
#

It is probably worth explaining what you're trying to do with it, rather than directly how to do it with this. You might be in need of something else, or someone here might know of a good example for the specific thing you're trying to do

hard roost
vital summit
#

Bruh, for now I have to care about my hosting

#

oh wait

vital summit
# quiet arrow It is probably worth explaining what you're trying to do with it, rather than di...

So it's a command that registers a user's Xbox account(gamertag) and adds it to data saver (mongo db in my case), to avoid people from giving gamertags that they don't own, I got an idea to make bot check xbox gamertag in their discord connections, but to make bot to get connections, user must authorize their account into my bot (Sorry I don't really know how to explain all this stuff 😭 )

#

I didn't know that I must go so far

#

But since I already started-

#

Its literally xbox account linking system just like cubecraft's but easier

#

Bot also gives a role if the gamertag they provided in the command is in any leaderboards

#

Soon it will be able to give vip rank roles if /profile command will be added to cubecraft, then all the work goes to FreezeEngine and Sterdy's cubecraft API

quiet arrow
#

I'm on phone, but scrolling through it quickly. I think it has an example and is what you need

vital summit
stable stone
#

@tropic nymph

gleaming raptor
#

First today!

untold dagger
#

I spent a lot of time on that gtk3 port!

lusty hare
#

hey uh

#

does anyone know on where the create world button sound is defined in sound_definitions.json or sounds.json?

#

i don't have any leads to it

spring tiger
#

random.click

lusty hare
#

no not that

#

uh I'll send the clip

#

it's a different sound, with reverb and another sound layered

lusty hare
#

ok it's from OreUI

#

i tracked down the UI used via the language text file

#

but can't find the exact sound definition

spring tiger
#

Oreui is likely hardcoded.

lusty hare
#

pain

#

can't find it within the vanilla assets folder

#

the only thing i find in the ore ui is the language text files

spring tiger
#

Yeah it won't be in there

lusty hare
#

agony

#

OK I FOUND IT LOL

#

it's in the dist folder for whatever reason

#

assets/gui/dist/hbui

brisk badge
lusty hare
brisk badge
lusty hare
#

ah xd

#

i mean, in doom, every selection you made in the menu is literally the pistol sound

gleaming raptor
#

Does anyone know some good applications to code using JavaScript on MacOS? cakeboi

sharp crystal
gleaming raptor
quiet arrow
#

Neovim 🫢

brisk badge
#

only the sweats use vim

#

Or vimlike ides

sharp crystal
brisk badge
#

yeah she is

sharp crystal
#

I grind with phpstorm 💪

brisk badge
#

but it makes me insecure

quiet arrow
#

I did actually start using nvim for non Java stuff and it is nice

brisk badge
#

vsc it is for me

#

and eclipse for java

sharp crystal
quiet arrow
#

go away

sharp crystal
#

even though you can change it

quiet arrow
#

Eclipse 😭

sharp crystal
#

why 😭

brisk badge
#

The first ever java tutorial I watched was in eclipse so I did not really have a choice

sharp crystal
#

Have you tried github copilot already? @quiet arrow

quiet arrow
#

ye

sharp crystal
#

I love it

quiet arrow
#

It's meh

#

It wrong a bit too much for me to love it

#

Loved it while adding debug logs though haha

#

@vapid mountain also loves copilot

sharp crystal
#

look how amazing

quiet arrow
# brisk badge WHATS WRONG

I helped a friend with Java and they worked in Eclipse for school, it was not very nice to help them 😭

sharp crystal
#
#[AllowDynamicProperties] class Database
{
    function __construct()
    {
        $this->db = new PDO('mysql:host=localhost;dbname=zf', 'root', '');
    }

    function getRow($sql)
    {
        $stmt = $this->db->query($sql);
        return $stmt->fetch(PDO::FETCH_ASSOC);
    }

    function getRows($sql): false|array
    {
        $stmt = $this->db->query($sql);
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }

    function getCol($sql): false|array
    {
        $stmt = $this->db->query($sql);
        return $stmt->fetchAll(PDO::FETCH_COLUMN);
    }```

This is way too easy 😭
#

All i have to do is press on tab

quiet arrow
#

I don't think I like php very much

sharp crystal
#

Understandable

vapid mountain
#

Meh, I'm not sure I love it, but I'd definitely rather have it than not.
It can be super cool and useful sometimes where it just knows what method you want next, but then other times it can try to predict too much and gives you like +10 lines when you only want 1.

brisk badge
#

I know I don't like php very much

#

I don't know why, but I have some deep hate against syntax's that use the dollar sign

quiet arrow
#

It also has been hallucinating some stuff for me

brisk badge
sharp crystal
brisk badge
sharp crystal
#

i just need php for laravel

quiet arrow
#

I don't like the web very much anyway, thinking about UI makes my brain hurt

brisk badge
#

It is NOT elegant

sharp crystal
#

😂😂

sharp crystal
#

love to do back-end, but whenever I have to do front-end, it's just terrible xD

brisk badge
#

I have a mate to do the front end for me

sharp crystal
quiet arrow
#

@sharp crystal I will have php and laravel at school this year 🤣

loud adder
#

bro who learns php now a days

celest pagoda
#

?

quasi oasis
low folio
#

C# is much closer to me

gleaming raptor
#

Hi y'all, me again...
Does anyone know of a way to store a letter in JavaScript without using strings?

#

🥺

spring tiger
gleaming raptor
#

Thank you!

delicate moss
quiet arrow
#

Nahww I thought you said Racket

tranquil ice
quasi oasis
#

ouu

halcyon talon
#

dab

gleaming raptor
#

Does anyone know a good way to compress images while keeping them fairly high-res?
Sorry for asking so many question but I'm working on a big project and I'm awful at coding.

slender lynx
#

because compressing it does take out the quality

#

I've used sharp and it's been pretty good. Very overkill for my usage but it worked

brisk badge
slender lynx
#

yeah ik

tawny sigil
#

@peak stag

quiet arrow
#

Copilot is so smart

bold fable
remote tree
#

Hi

#

What is the right place to learn programming bedrock server for beginners

gaunt orbit
#

the CB beta update is good but it kicks the player out and leave it with disconnected from the server

rigid peak
#

Who studies python right now?

quiet arrow
#

I had it two years ago at school

rigid peak
#

That's pretty cool

lusty pagoda
#

After taking an introduction to java within 1 month, I can say programming is hard (for me)

brisk badge
#

It is for everyone

#

And if not, you are not challenging yourself enough;)

lusty pagoda
#

I did pass it tho 🙂

#

Passing by single dimensional arrays and methods, it was easy tbh

minor roost
#

hi im new to coding a wanna be a bedrock server developer how to learn coding or what is the right place to learn?
❤️

flat scarab
#

🥚

minor roost
verbal nest
#

Hey

rain willow
brisk badge
vapid mountain
rain willow
#

really, they looked like growing when they got closer to the player

vapid mountain
# minor roost <@504783725209321475> can you help me

Hey, sorry, I'm afraid I don't know much about coding for bedrock servers. We use a java server even on our bedrock platform, so we write everything in java using a custom fork of spigot. If you're just wanting pure bedrock, then you'll have to start learning C++.

vapid mountain
#

Oh sorry, you said growing, not glowing. XD
Nope, they're not being scaled. Just a trick of perspective.

rain willow
#

but im willing to see what you guys can do with display entities

vapid mountain
rigid peak
#

We'll make the best programming!

inland cove
#

i am pinged O.o

#

am I needed?

spring tiger
#

🤨

sharp crystal
#

@inland cove hello! how to code?? 😳

inland cove
#

I place blocks

sharp crystal
#

Wow

oak locust
grim sundial
#

guys which programming language should I learn?

warped prairie
#

c++ prob

covert hazel
#

Depends what you wanna use it for

lavish siren
#

Hello World

lavish siren
lavish siren
quiet arrow
#

@sharp crystal agrees

#

Hottest language on the planet

sharp crystal
#

its still weird tho.

quiet arrow
#

😆

valid coral
#

Hey guys?

#

Whats up?

#

Ohi? Is somebody online?

#

No-yes, the answers no....

fallow canyon
steel forum
fallow canyon
balmy plaza
brisk badge
#

Does anyone know how to disable these "search tips" (in gray) in VSCode?

brisk badge
#

Worked! Thanks :D

#

That was annoying me for a while

brisk badge
hard roost
#

vscode slander not tolerated

spring tiger
#

just use all the IDEs then you can never have a problem 😉

plain pebble
#

memory hog

spring pendant
#

Intelijidea and Eclipse are W

lavish siren
# fallow canyon For Bedrock, probably, but shouldn't claim that I know that when I haven't worke...

here is a lot of server softwares

  • galaxite using Dragonfly engine which is written in GO language - it's their own software
  • inpvp (mineville) probably using MiNET that's language is written in C# language / for sure they used
  • hive have java engine
  • some servers running on pocketmine-MP written in PHP language i think because it's/was the most popular server software for bedrock and have huge amount of plugins that you can choose
  • other smaller servers can use nukkit that's written in java and also have some free to use plugins
quiet arrow
#

There is one in Python LMAO

tranquil ice
#

Cloudburst is under historical projects 🥲

hard roost
#

💀

unborn dust
#

You get banned using a riptide trident. Why so? Fast movement of the trident?

minor roost
merry dune
#

M

chrome pilot
#

h

rancid garnet
#

If i want to develop minecraft servers what language should i learn

#

And what else i might need for any minecraft server

minor roost
minor roost
#

Java is developed in java doge

sharp crystal
#

laravel is amazing

dry ermine
#

Probably the one pain I had was

The SQL PAIN

sharp crystal
dry ermine
#

Sqlite3

#

Through cmd

quiet arrow
#

squeel

dry ermine
#

💀

#

Dis respecting

sand sigil
#

fr

vapid mountain
#

Same honestly.

I'm like "I make game do stuff... I no no how network stuff work..." monkey_look monkey_look_away

steel minnow
#

Facts

plain pebble
#

Anything but OOP MA_ThrowRocksAtJohn

agile ravine
sharp crystal
quiet arrow
#

I will have to for school

dry ermine
#

It's fub

#

Fun

#

Especially java

plain pebble
#

I rather stick with functions

#

I only use classes and such if they are in a library like discord.js

quiet arrow
spring tiger
#

go gopher!!

quiet arrow
#

I've tried go again, and it's been absolutely amazing. Love it very much

spring tiger
#

I really want to get into it more. I like strict typing languages

quiet arrow
#

Yeahh, same

spring tiger
#

I'm still a sucker for python. But I have strict typing rules enabled and I try and use the newest features that they add for typing

quiet arrow
#

Go is really easy syntax as well. Do have to write / import some very basic functions but I found I very calm to write and read

quiet arrow
spring tiger
#

Honestly. Wish it was the python default. Rather than the language allowing non-typing for compatibility.

quiet arrow
#

I do want a union / sum type in go

spring tiger
#

But I guess they have to cater to how many billion versions they have

spring tiger
#

I shudder

quiet arrow
#

I don't even understand how people code without (strict) types tbh, keeps confusing me. And then your lsp is kinda useless

spring tiger
#

What would you rather, Python 4, or Python 3.14159265359

quiet arrow
#

Damnnn, that's a though question

#

🐍 🥧

brisk badge
hard roost
quiet arrow
#

The errors as type is amazing. The actual handling is a bit verbose and it'd be great to have syntax to do an early return if something errors without the explicit check

foo := try bar() 
// instead of
foo, err := bar()
if err != nil {
    return err
}

Something like that, but I don't really mind it. Way better than raising errors

#

Would also like nil checks to be at compile time. Such that you can't do dumb stuff

spring tiger
#

Yeah thats the beige flag I think for go. you have to handle errors if something might raise them. you can't really ignore them

quiet arrow
#
foo, _ := bar()
``` 🤣
#

But that's just stupid

spring tiger
#

Yeah not great hahaha

#

my girlfriend does golang in her software engineering work. and they have a custom linter that forbids _ for errors

quiet arrow
#

haha, very fair

#

I think the default one only puts a warning on it

plush walrus
#

oh my god php is so great

#

imagine remote code execution by just uploading a file and then viewing it

#

oh wait-

dry ermine
#

😂

#

He messed up

limber galleon
#

Add luckyblock egg wars

steep dagger
#

I gotta write PHP every day it has the best type system

#

everything is mixed

sharp crystal
brittle raven
#

Hi

dry ermine
#

Elli

#

Ello

faint knoll
marble yew
#

cursed

faint knoll
#

Fr

minor roost
#

what language is the cubecraft mods coded in

quiet arrow
#

Java

steel forum
minor roost
#

lol

minor roost
quiet arrow
minor roost
#

oh

#

cool

winter crow
#

Otherwise half the servers features wouldn’t be there

night hinge
#

Bun 1.0

stark horizon
#
package me.doggo.bridges.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class KillCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;

            // Check if the player has permission to use the /kill command
            if (player.hasPermission("bridges.kill")) {
                player.setHealth(0.0); // Kill the player by setting their health to 0
                player.sendMessage("§cYou have been killed!");
            } else {
                player.sendMessage("§cYou do not have permission to use this command.");
            }
        } else {
            sender.sendMessage("§cOnly players can use this command.");
        }

        return true;
    }
}
#

does anyone know how to do this easier?

plush walrus
#

It seems pretty straightforward to me already

minor roost
wintry steppe
wise hound
#

basically just made a theme for this website i used to play around on a lot

stark horizon
quiet arrow
# stark horizon does anyone know how to do this easier?

You can put the cast in the instanceof HoloShrug
And use early returns instead of nesting for readability but that's just preference I suppose.

If you're going to make a lot of commands I'd look for some sort of command library that parses input for you, and adds it automatically so you don't have to put it in that weird file

stark horizon
steep dagger
#

I love how that looks nothing like python

#

your python code is weird lookin bro I think it needs fixing

#

GUARD STATEMENTS 💂‍♀️ 💂‍♀️ 💂‍♀️ 💂‍♀️ 💂‍♀️ 💂‍♀️ 💪

minor roost
#

how does it work integrating the code into the game

#

like how do you do that?

stark horizon
#

i’m making it for a server

stark horizon
#

blockwars sweat smh

steep dagger
#

server owner?!?

stark horizon
#

i haven’t released it publicly yet

#

currently in private beta phase

steep dagger
#

:0

#

does it have blockwars

stark horizon
#

Pringle tried to do that on OpFFA

#

Assault and Dreamer played it once i think

#

nobody else really did

keen maple
#

@stark horizon omg

stark horizon
keen maple
#

Hoi

steep dagger
#

he never really finished it

royal trench
#

@quiet arrow hello

quiet arrow
royal trench
# quiet arrow

since our nice conversation this morning I have a question about programming

quiet arrow
#

👀

royal trench
#

might be a really clear answer but me and my classmate cant seem to figure it out

#

we need to split an array of numbers into seperate arrays but it's an uneven amount of numbers

#

so 1 array needs to be 1 longer perhaps

quiet arrow
#

Euh, yeah

#

Can probably take slices

#

And the middle will be floor/ceil/round of len/2

royal trench
#

We've managed to split an array into 2 parts when there are an even amount but uneven we haven't quite figured that out

quiet arrow
#

middle := math.Floor( len(array)/2)
part1 := array[:middle]
part2 := array[middle:]

spring tiger
#

tidy

lusty pagoda
#

that is def not java

#

what is it?

quiet arrow
#

I had nothing specific in mind, speudo code banter

#

But I think it'll work in go and python kinda

lusty pagoda
#

so you're coding without knowing the language?

royal trench
quiet arrow
royal trench
#

now onto threads

quiet arrow
#

Syntaxed differently?

lusty pagoda
#

can't join these convos
barely know java and barely passed the intro

#

i scored 67% on mid and final

royal trench
#

I'm coding in Java btw

plush walrus
royal trench
plush walrus
#

hi

royal trench
#

k

brisk badge
faint knoll
#

Great, but do you know, you can actually shorten codes simply based on the syntax the code has to offer?

#

🗿👍

#

Let's take an example

#

The ?: operator in java

#

Shorter than using if statements

#

in certain cases

brisk badge
#

Yes?

#

But there is no difference, other than a faster way to write it

faint knoll
#

If you don't understand your code later on (due to its complexity) how'd you even proceed with the thing later on?

#

For example, when you wish to make changes to your algorithm or a part of it

quiet arrow
faint knoll
quiet arrow
#

I don't think you understood what I meant

faint knoll
#

Ok explain then

#

👍

quiet arrow
#

I'm saying they're both the same thing, one is just syntactic sugar (other, purely syntax; no actual code changes)

#

There are things to think about when writing in different languages, using that operator is not one of them

faint knoll
#

Now let's say, you want your algorithm to change such that when, here, (a == true) then you will print "C" instead.

#

Will you scroll through the entire if-else thing just to forget at the end what you wanted to do?

#

XD

quiet arrow
#

If you have that many if else branches, you shouldn't be using if else

#

Maybe a switch is a better idea

faint knoll
#

Right

#

That's where syntax comes

quiet arrow
#

Which is actually a different thing

faint knoll
#

Readability

#

Nah, same thing, only the purpose is different

#

Both provide conditions

#

But the type of condition and the structure changes

#

You can't also speak English to a machine yk, unless, a voice assistant is there

brisk badge
#

@faint knoll what is your point?

quiet arrow
#

If else branches, and a switch are different things. They don't perform & behave the same. A single if else and the ternary operator are different syntax for the same stuff

faint knoll
#

My point is, in a program, both syntax and algorithm equally matter

faint knoll
brisk badge
faint knoll
#

Right, and that is why syntax changes with the purpose

#

Syntax must match with the algorithm you have

#

Or else your efforts would feel pointless like this

#

Never overcomplicate your program, keep it simple so that you understand it later on (in simple terms)

brisk badge
#

Yes, but I doubt how much the ternary operator improves readability in comparison to

else return Y;```
faint knoll
#

return (a)?x:y;

#

one liner code

#

😉

brisk badge
#

Oneliners are rarely the most readable

faint knoll
quiet arrow
#

I hate it

faint knoll
quiet arrow
#

I need my braces HoloWinkLove

faint knoll
#

Then you don't know syntax

#

-\•_•/-

brisk badge
#

class Main{public static void main(String args[]) {System.out.println("Hello World!"):}}

faint knoll
#

Bruh where's the syntax preference

#

Ternary operators are meant to be written in single line

#

💀

#

Ok tell me one thing

#

Why do we use methods other than main methods?

#

To shorten our code? To make it simpler? Right?

quiet arrow
brisk badge
#

Reusability

#

Mainly

faint knoll
#

There's syntax

#

If you didn't wanna rely on syntax and just write everything in main

#

There u go, only logic no syntax

#

And then programmer like :if it works, let it be

#

O and a funny meme

#

To wrap it up

#

Don't forget the semicolons in java

#

☺️

brisk badge
#

Where is the funny meme

#

:(

faint knoll
#

Bruh the semicolon meme

#

Watch some programming jokes on insta man

#

Now ded chat

sharp crystal
#

fesa->delete(); @quiet arrow

quiet arrow
faint knoll
#

end;

sharp crystal
sharp crystal
#

thats painful

#

seriously

faint knoll
#

Indeed

sharp crystal
#

that broke my brain

faint knoll
#

Amazing

sharp crystal
#

i hope you dont code like that

faint knoll
#

Now I have full control over ur bren

faint knoll
sharp crystal
#

but thats not syntax

#

at all

faint knoll
#

That was just an example

sharp crystal
#

syntax would say

faint knoll
#

Of bad syntax

quiet arrow
#
(if (eq? a #t)
  (display "A")
  (display "B"))
sharp crystal
#
if(hi) { ```
faint knoll
#

nah

sharp crystal
faint knoll
#

(hi)?:;

quiet arrow
#

Nasty high level languages

faint knoll
sharp crystal
faint knoll
#

Java

sharp crystal
#

lol

faint knoll
#

l0l

quiet arrow
#

yeah but mine is in lisp so yeah

#

Can't beat that

sharp crystal
#

yk

faint knoll
#

Good

sharp crystal
#

i have coded for 14 hours today

#

and had an error

faint knoll
#

After I am over with my primary studies I'll learn many languages

#

You guys already at college also we here have huge stress in school

sharp crystal
#

I figured after 2 hours

#

that I made a typo

faint knoll
#

Use debugger

#

Bruh

#

Use breakpoints to analyse

sharp crystal
#

i aint talking about java rn

#

not every lang has it

faint knoll
#

Oh

sharp crystal
#

like php

faint knoll
#

That's sad

#

I will make a php debugger lol

#

Sounds cool idea

sharp crystal
#

Lol

faint knoll
#

Haha

sharp crystal
#

good luck with debugging divs party_cube

faint knoll
#

Ok

#

I have a plan

#

Idk in how many years will I be knowledgeable enough

#

To achieve this feat

#

But I have an algorithm

#

Ig

sharp crystal
#

its prob not hard to make

faint knoll
#

Ok

#

The thing is idek php

steep dagger
#

Best syntax language ever made

vapid mountain
# quiet arrow I need my braces <:HoloWinkLove:1026035005455085603>

Ooooh sorry girl, don't ever look at my code then. ♥️
I'd remove the brackets from a try-catch if I could but unfortunately java doesn't support that... yet.

If it's a simple "should the variable equal this or that" then ternary operators are fantastic, but when you start using them in casts or for objects which implement multiple similar interfaces in order to access the methods in them?
That becomes much less readable and opens you up to having to rewrite it all anyway if you ever change the inheritance of those objects.
It's better practice to keep ternary operators to simple results.

But yeh, got an 'if' which only does one thing? Yeetus deletus those brackets, or don't, either is fine but if I have to work on your code I will be removing them.
Just, whatever you do, don't put them on their own lines 🤢
That's gross and we can't be friends.

quiet arrow
#

You're awake sooo late 😟

quiet arrow
gritty shadow
#

I didn’t know that this channel still exists...

vapid mountain
quiet arrow
#

I can't even keep my eyes open at midnight

#

I did play star rail with one eye till one thought 😭

gleaming raptor
vapid mountain
vapid mountain
gleaming raptor
frosty hill
#

hell

faint knoll
#

I heard java awt is being deprecated. So my concern is, what alternative should I use instead of .addActionListener(this); for swing class buttons?

#

Or java will keep this thing for buttons in awt package?

#

Oh, and also, will the Font class in java awt stay?

faint knoll
#

Any help pls? Really need help for my school

stark horizon
#
package me.doggo.bridges.Utils;

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;

import java.util.HashSet;
import java.util.Random;

public class TeleportUtils {


    public static HashSet<Material> bad_blocks = new HashSet<>();

    static{
        bad_blocks.add(Material.VOID_AIR);
        bad_blocks.add(Material.AIR);
    }


    public static Location generateLocation(Player player){

        Random random = new Random();

        int x = random.nextInt(100) -50;
        int y = 80;
        int z = random.nextInt(100) -50;

        Location randomLocation = new Location(player.getWorld(), x, y, z);

        while(!isLocationSave(randomLocation)){   // loop for save location
            randomLocation = generateLocation(player);
        }
        return randomLocation;
    }

    public static boolean isLocationSave(Location location){

        int x = location.getBlockX();
        int y = location.getBlockY();
        int z = location.getBlockZ();

        Block block = location.getWorld().getBlockAt(x, y, z);
        Block below = location.getWorld().getBlockAt(x, y -1, z);
        Block above = location.getWorld().getBlockAt(x, y +1, z);


        return !(bad_blocks.contains(below.getType())) || (block.getType().isSolid()) || (above.getType().isSolid());
    } // Checks if location is safe

}```
#

does anyone know how to generate negative coordinates differently?

#

atm it has a range from -50 to 50 because of the -50 at the end

faint knoll
#

What do you want it's range to be?

stark horizon
#

but there is probably an easier way to do that

faint knoll
#

Btw you can use Random class

stark horizon
faint knoll
#

Ok idk any easier way to generate random numbers

#

All I know you gotta use some formulas:)

brisk badge
#

Keep in mind that 100 is exclusive, so you will never get 50 in this case.

#

The general function for getting random numbers in range is
random.nextInt(max - min) + min;

lusty pagoda
#

Question

#

What is better to generate a random number
Using the Math.random
Or using the import java.util.random
?

#

For beginners ^

#

Cuz I'm having trouble remembering the math.random long equation

brisk badge
#

the util.random class is easier

#

there is not really a better or worse one

lusty pagoda
#

Not like a better or worse one

brisk badge
#

its like
int r = (int) (Math.random() * (max - min) + min);

faint knoll
#

Anyone can pls tell if listeners and Font class will be deprecated in awt package or not

brisk badge
#

vs int r = random.nextInt(max-min)+min;

lusty pagoda
sharp crystal
#

code on paper?!

quiet arrow
brisk badge
lusty pagoda
#

yes

faint knoll
#

Exams

brisk badge
#

damn

lusty pagoda
#

I had a test where I had to write 3 large codes on paper

quiet arrow
#

Yeah, my exam last year was also on paper

sharp crystal
#

that must be terrible

lusty pagoda
faint knoll
quiet arrow
#

And it was python, you indent python correctly on paper lol

lusty pagoda
#

But good for memorizing everything

#

No it was java

quiet arrow
#

It's useless

lusty pagoda
#

:-:

faint knoll
quiet arrow
#

My lsp will memorize everything for me

faint knoll
lusty pagoda
faint knoll
#

Ok may I pls get my answer now

#

🙂

brisk badge
lusty pagoda
quiet arrow
faint knoll
#

@lusty pagoda the Random number generators work on a pseudo random series

faint knoll
quiet arrow
#

In the class documentation

sharp crystal
#

@quiet arrow In laravel

quiet arrow
#

Idk what you're using, but consider switching if it doesn't do that

sharp crystal
#

there's this amazing feature

faint knoll
#

Cuz mine's not showing class documentation

quiet arrow
faint knoll
faint knoll
#

I will have to install 😦

#

🙃

faint knoll
#

They use to make the series

quiet arrow
#

What are you using currently 👀

faint knoll
quiet arrow
faint knoll
#

Btw I have ms visual also

#

But I am using BlueJ rn

brisk badge
faint knoll
faint knoll
#

ok...

quiet arrow
#

Use build in functions, if they are provided to you. They'll be more efficient than anything you'll write (most likely)

faint knoll
#

Well, my pc still runs many (all) awt codes without an issue. But some of my school computers show that awt package itself will be deprecated

#

That's why I got confused. Ok thx anyways

sharp crystal
#

@quiet arrow

#

do you use xampp for php?

quiet arrow
#

idk

#

I don't use php

#

I had one lesson this year and it was c#

mellow current
#

Plzz
Koi cray texture pack link bhej do

faint knoll
#

First

#

Anyways

#

What is api server

sharp crystal
#

Why is that vulnerable ? @bold fable

faint knoll
#

Cuz I don't think I'll be needing it

#

¯_(ツ)_/¯

quiet arrow
bold fable
#

There is a PASSWORD()

sharp crystal
faint knoll
quiet arrow
#

What the form would be calling

sharp crystal
#

because this is not vulnerable at all

faint knoll
#

Nah I don't need it, or I'll find a way through

#

Thanks mate

#

Had GitHub English been easier

bold fable
#

But probs with alter users

spring tiger
#

I suppose its only vulnerable if you're not salting your passwords when they're added to the table

sharp crystal
quiet arrow
#

Don't use password() in sql btw

bold fable
quiet arrow
#

This function is deprecated in MySQL 5.7 and is removed in MySQL 8.0.

bold fable
#

Stupid algorithm

quiet arrow
#

Then why are you saying there is one ..

sharp crystal
#

it hashes the password

quiet arrow
sharp crystal
#

anyways

faint knoll
#

Anyways

sharp crystal
#

im currently working on a password reset system

#

it's a pain

#

as the mail server refuses to work

faint knoll
#

Wait we can incorporate our mail into our program?

#

Dream come true situation

#

If only our school taught these

faint knoll
bold fable
quiet arrow
#

@sharp crystal L muted lol image

faint knoll
#

O uh

#

L ig

sharp crystal
#

Is w3schools

#

blocked

faint knoll
#

Everything

sharp crystal
#

well lets try it

#
#

omg it is not!

sharp crystal
faint knoll
#

Let's try sending Google homepage

#

O thx

#

But first let's test

#
#

Success

bold fable
faint knoll
#

Now the w3schools thing

#

Php so overpowered

sharp crystal
#

yes

#

its amazing

faint knoll
#

Wish java and php merged

#

Life would've been easier for me

sharp crystal
#

NONONO

#

NONONONONONO

faint knoll
#

🔥

sharp crystal
#

that would be terrible

faint knoll
#

That is amazing

#

Schools will actually start teaching things

sharp crystal
#

What subjects do you have

bold fable
faint knoll
bold fable
sharp crystal
faint knoll
#

I still need to know php 😭

#

Long way ahead

#

Php totally different syntax, <php ?>

sharp crystal
faint knoll
#

Yea that

#

Ok man, me go learn php bye

sharp crystal
#

@bold fable these are the packages i usually use for websites;

#
    "devDependencies": {
        "@headlessui/react": "^1.4.2",
        "@inertiajs/react": "^1.0.0",
        "@tailwindcss/forms": "^0.5.3",
        "@types/node": "^18.13.0",
        "@types/react": "^18.0.28",
        "@types/react-dom": "^18.0.10",
        "@types/ziggy-js": "^1.3.2",
        "@vitejs/plugin-react": "^4.0.3",
        "autoprefixer": "^10.4.12",
        "axios": "^1.1.2",
        "laravel-vite-plugin": "^0.8.0",
        "postcss": "^8.4.18",
        "react": "^18.2.0",
        "react-dom": "^18.2.0",
        "tailwindcss": "^3.2.1",
        "typescript": "^5.0.2",
        "vite": "^4.0.0"
    }```
bold fable
#

Actually (want) to do/doing cyber security so web dev no no pls haha, encryption 🙌

bold fable
sharp crystal
#

good luck!

faint knoll
#

Omg, php can both read and write mails

#

Basically bypassing paid cloud service

bold fable
faint knoll
#

That's it I'm making my own php server

sharp crystal
bold fable
sharp crystal
#

let me know

faint knoll
#

Amazing

#

EA stuff

sharp crystal
#

@faint knollare you actually going to learn php?

gleaming raptor
#

Hello coders

faint knoll
#

Actually from today night

#

I'll start

#

Yeah, cuz now I am free

brisk badge
faint knoll
#

Php captcha: Are you a real php?

#

Bot, probably: No I am java

brisk badge
#

How are your ternary operators going?

faint knoll
#

?:

#

(my honest reaction)

steep dagger
wintry field
#

.

faint knoll
#

guthib

minor roost
#

If I wanna make a Minecraft server

#

What should I do?

quiet arrow
#
hard roost
# minor roost What should I do?

You find computer
You find a server.jar file that suits your needs (most likely paper)
You open up your ports on the computer
Run the file with the optimal arguments

#

Bim bam boom a piece of cake

quiet arrow
#

--nogui

#

💯

still sentinel
#

Oh

faint knoll
stark horizon
lusty pagoda
#

been having this for a while and still don't know how did it appear

sharp crystal
lusty pagoda
sharp crystal
lusty pagoda
#

i am not trying to paste a command

sharp crystal
#

or execute whatever program you're trying to open as administrator

lusty pagoda
#

it appears as soon as i open my laptop

sharp crystal
#

hmm

hard roost
lusty pagoda
hard roost
#

search task scheduler, open it

lusty pagoda
#

what next?

hard roost
#

you should see a bunch rows, yes?

#

look at the triggers column and if it says "when a user logs on", take a peek what it does

lusty pagoda
#

sorry for delay

#

was taking care of the cats]

#

1 sec

hard roost
#

do you know what xmrig is?

lusty pagoda
#

it just started appearing everytime i login

#

i thought it's somewhere in the files but couldn't find anything

hard roost
lusty pagoda
#

not lately

#

the last thing i installed was epic games store, from there i got Valorant and 911 Operator

hard roost
proud parcel
#

anyone wanna look into why cubecraft has been consistently laggy

cyan igloo
#

ximena

#

@quartz sigil

#

watch stream

#

they made a rocket league bundle

#

out of u

plain pebble
#

I like how it looks

faint knoll
plain pebble
#

I don't follow my rules

faint knoll
#

Retrieving access_token...

#

Hacking your discord account...

#

Getting your information...

plain pebble
#

😭

faint knoll
#

Selling to gov-

#

Making profit...

#

👍

plain pebble
faint knoll
#

Thanks for helping out this poor guy

#

Now I can take my own loans

plain pebble
#

congrats

faint knoll
#

🔥👍

brisk badge
faint knoll
plain pebble
vital summit
#

what npm package

lusty pagoda
#

Thank you so much!

hard roost
#

Cool

steep dagger
vital summit
plain pebble
vital summit
#

Ooo cool

stark horizon
minor roost
#

BC java suck

hard roost
#

debatable, but why did you ask for java then

stark horizon
#

but well, idk about bedrock

quiet arrow
stark horizon
#

I just found my brother’s laptop from 2009 which has 4gb of ram and an intel pentium with windows 7 atm

#

would it be better to use an other operating system or just stick to windows 7?

proven rain
#

Depends what you want to do with it. If you wanna give it a new life, I'd put a Linux distro on it and replace the hdd with an ssd (if it even has a hard drive, obviously)

#

Basic tasks like editing word documents and being online just work. Though you're not gonna have a good/easy experience with fonts...

pure geode
#

guys I PASSED MY COLLAGE FINAL YEAR EXAM