#development
1 messages · Page 76 of 1
The issue I take with most high school classes is you’re not going to learn fundamentals of CS, you’re going to learn basic programming
I think it's best if you just look at online documentations rather than paying for a course that teaches less stuff on the internet
Or if you're more of a tutorial guy like me, watch youtube videos.
at my hs we have the normal programming classes that teach basic python and html and then the ap cs course that teaches java but its more math oriented
I'm crazy happy hs has high school cs now
how long has that been going on lol
<< behind the times
Mmm years lol, my father had programming in his high school
They used punch cards, they got mailed to the centralized “computer” to be run
only was available in last grade for me
oh wow thats interesting
I’m from Toronto 🙂
my hs had all of the classes except for a unity class before i got in
My high school had PHP/Visual Basic/Java classes
id be interested to see high schools with an app dev class
yeah I believe it
The issue is you need to cover design patterns properly otherwise it’s pretty useless
Lots of fumbling to build something that just “works”
haha
maybe offer it as a multi-year class
That would be cool
the logistics are probably super complicated but it'd be very cool yeah
so basically the exact equivalent of any PHP project after some thousandaire bought it and brings it to freelancers to fix
oops
wrong convo lol
lol
yeah
Would probably have to provide some base template
I'd just compartmentalize it so nobody can screw up
like you make a weapon, you make a skin, etc
But would be feasible for a motivated teacher
but the game itself is some kind of good code
could work
Sorry, that's if you were talking unity
garbled mess of an app then lol
I can't see that being compartmentalized easily
the unity class i took in hs very much felt like a beta version
most of the resources were from the outside internet (which can be good but it didnt work in my case) and the curriculum felt a bit half-baked
but it could work with some refinement
yup fair
what'd be cool is if a game circiculum actually released a game
and then the next year students worked on the next version of the same game
the class originally planned for that in group projects but covid
yeah
ah yeah
I'm glad it's so commonplace
as is there is too much demand and not enough programmers
Hmpff
if I know what you found easy even
elaborate
that's something that'll get you ahead of everyone else
it's a hard class though that you will have later most likely
so data structures is like
have you heard of linked lists?
queues? stacks?
easy
yea
then you need a real project
how about this
figure out something you want to learn how to do
and I'll do my best to guide you there
like, wanna make a game? Do you want to make a website? I dunno 😉
Can someone recommend a good guide to start using unreal engine? I just started and know basically nothing about it, my eventual goal is to recreate my neighborhood and have some climbing and shooting mechanics.
hey guys can anyone recommend a library for converting webp images to png? I've only found one that converts from png/jpg to webp
@nocturne galleon image magick?
nevermind, downloaded google's tools
and it taught me how to manually install linux software which is also cool
image magick is a library thats used for this sort of stuff
converts between all kinds of formats
commandline or header-binding with C
how come this script returns syntax error: unexpected end of file
got a new line at the end?
Try out vs code with the "shellcheck" plugin. It can squiggle all sorts of problems in your shell scripts, which is great if like me you use them a lot but author them rarely
Hi, i have considered creating a basic rock paper scissors AI in excel. Have I gone totally crazy?
I first read that as "tic tac toe" somehow. What would a rock paper scissors AI do beyond sample(["rock","paper","scissors"])?
its very hit or miss if you get a response here lol
hit or miss, I guess they never miss
Look at previous moves to predict the future. Humans are not totally random.
there are lots of dev topics i could help you with, but i have yet to touch React 🤷♂️
pretty new to less, but I'm trying to understand whats a good way, if even possible, to do something like adaptive colors in an antd designed React app, ie if an elements background has a luma > 50% use black font color, otherwise use white.
My App component imports app.less and webpack takes all variables from my-theme.less into the less-loader options.modifyVars object.
I have something like this:
//--- app.less
@import '~antd/dist/antd.less';
.@{layout-prefix-cls} {
&-header {
// this replaces 'color: @text-color;'
color: if(boolean(luma(@{layout-header-background}) > 50%), @black, @white);
}
}
//--- my-theme.less
@primary-color: 'red';
@text-color: if(boolean(luma(@{primary-color}) > 50%), @black, @white);
But, instead of overriding the color in every component I'd like to achieve something like this:
//--- my-theme.less
@primary-color: 'red';
@text-color: if(boolean(luma($background) > 50%), @black, @white);
And then have @text-color evaluated on each usage, with $background refering to that elements own or inherited background property, instead of having to override every color: @text-color; on every component in antd. This whole venture started when I noticed that the default antd layout header is dark, and using a <Title level={3} /> in it causes the text to be unreadable...
I'm trying to remove everything between /* and */. I'd need a wild card. Does anyone know what's the wild card in Atom (text editor)?
Usually you do this with a regular expression, which is a common syntax for string matching. That's probably what Atom is expecting when you put it in wildcard mode.
If you don't want to learn the syntax today, you can probably search for "regex to match a c-style comment"
const bot = new Discord.Client();
const token = 'My-Token-lol';
bot.on('ready', () =>{
console.log('This bot is Online!');
})
bot.on('message', msg=>{
if(msg.content === "HELLO"){
msg.reply('Hello Friend!');
}
})
bot.login(token);```
Basically, im setting up sole basic stuff for a bot. I was able to get the bot to go online, but when I type HELLO in a chat, the bot doesn’t respond back.
It’s supposed to respond back. •_•
What did I do wrong? And what should I fix?
Node.js btw
Teaching you troubleshooting, and how to fix your code!
Expected blabla
Check for syntax errors, compiler or interpreter usually shows the issue spot, go check what you wrote wrong.
Okay so first we have to identify the problem
My program dosen't answer to message!
Check that the program actually executed said function, if not move on to next phase
so add this into the if statement
console.log('Got through!');
Btw, it said this 👀
Problems:
‘,’ expected. ts(1005) [16, 1]
‘)’ expected. ts(1006) [16, 17]
(Last line, its the bot.login(token);
Should’ve mentioned this earlier…
that indicates a syntax error
Go check for a missing semicolon
or something
I see 2 spots but I'll let you figure it out
I’ll check rn. 🙂
I would highly recommend learning JS before making a Bot
I’ve actually been doing so on a website that teaches js. This is just a free time project to try out, so im not really getting too far into it
counterpoint: project-based learning is a pretty good way to learn a programming language, especially with something this basic
I’ll check it out. Ty for the suggestion.
i was responding to the guy before you, im saying what you're doing is good lol
Oh 👀
Late response, just read over what you said; I thought “counterpoint” was a website to learn💀
Late response, went to eat after looking for a while. Sorry.
I am unable to spot anything out of place
you are missing 2 semicolons
const bot = new Discord.Client();
const token = 'My-Token-lol';
bot.on('ready', () =>{
console.log('This bot is Online!');
});
bot.on('message', msg=>{
if(msg.content === "HELLO"){
msg.reply('Hello Friend!');
}
});
bot.login(token);```
I think I found it
Nope, didn’t work.
if(msg.content === "Hello"){
^
ReferenceError: msg is not defined
do
bot.on('message', (msg)=>{
if(msg.content === "HELLO"){
msg.reply('Hello Friend!');
}
});```
Same error : / and I copy pasted exactly what you put
hmm, try js bot.on('message', function(msg){ if(msg.content === "HELLO"){ msg.reply('Hello Friend!'); } });
const bot = new Discord.Client();
const token = 'My-Token';
bot.on('ready', () =>{
console.log('This bot is online!');
});
bot.on('message', (msg)=>{
if(msg.content === "HELLO"){
msg.reply('Hello Friend!');
}
});
bot.login(token);```
It worked! Thank you!
use go 👀
When developing Discord bots, do you use Python or JavaScript? React with the appropriate emoji. (🔵 = Python, 🟡 = JavaScript)
javascript
python is a pita sometimes
well I use typescript
with the deno runtime
Whoops I just built a bot with python…
How does this happen
I use python and it's pretty good, the choice is actually yours, whichever is easier and comfortable to you
Btw, do you guys know a full time, free hosting platform coz I cant find it, I even tried heroku and even that has its own defects for running free, like restarting and stuff like that
Nothing is free
Even self hosting technically isn't because running costs
I self host my bots
I want to eventually get them to work on kuberetes
☹️
Which OS?
Linux
Oh yeah me too
No other option lol
Well I'm running it all on a proxmox hupevisor
Which is still debian
I have a seperate computer for learning kuberetes which is off for now
Same
Which distro in linux
Ubuntu
Oh
Technically kde neon
Oh nice
Because gnome is ugly
I am using Fedora 34
You can't say that when you installed Mac like UI
Red hat based stuff is alright as well
It's customisable
Yeah
? Gnome is literally a tablet interface stock
And fedora 34 has Gnome 40 which is just plain amazin
Kde imo is much better
I actually never experienced KDE
I used to use centos for my servers but now they switched to rolling release
Fedora is rolling too
You do realize
Fedora and centos are basically very very similar
Yeah
I just hate dnf or the repo servers idk how it works but the speed is pretty low
It takes a lot of time for updates sometimes
Find a close mirror server
How can I do that?
Idk exactly
@wise jolt use fast mirror
Oh
Put in a list or severs
It will apparently find the fastest one or something like that
I'll need it in the future
Thank you, I'll check it out
Try Qovery
It's what I use
They host your bot for free on DigitalOcean and if you have an active AWS subscription, you can use their website to host your bot their too
You just need a github repo and it's advised to have your own Dockerfile
You can also host directly on github
How come I never knew about this?
Ah but no use to me
I use Python and Github doesn't support dynamic content
I found this article that I didn't read at all though: https://www.bloggerspice.com/2016/09/host-JavaScript-and-CSS-files-on-gitHub-through-rawgit.html
No?
@hazy oasis that's just static files
Yes, that's just static files
Which is fine for just info pages, but you will have no backend
Its meant for info pages
Anyone familiar with opengl3?
Trying to render a line 😅
Yeh i am
static int compileShader(unsigned int type, const std::string& source)
{
unsigned int id = glCreateShader(type);
const char* src = source.c_str();
glShaderSource(id, 1, &src, nullptr);
glCompileShader(id);
int result;
glGetShaderiv(id, GL_COMPILE_STATUS, &result);
if (result == GL_FALSE)
{
int len;
glGetShaderiv(id, GL_INFO_LOG_LENGTH, &len);
char* message = (char*)alloca(len * sizeof(char));
glGetShaderInfoLog(id, len, &len, message);
std::cout << "Failed to compile " << (type == GL_VERTEX_SHADER ? "Vertex" : "faragment") << " shader!" << std::endl;
std::cout << message << std::endl;
glDeleteShader(id);
return 0;
}
return id;
}
static unsigned int createShader(const std::string& vertexShader, const std::string& fragmentShader)
{
unsigned int program = glCreateProgram();
unsigned int vs = compileShader(GL_VERTEX_SHADER, vertexShader);
unsigned int fs = compileShader(GL_FRAGMENT_SHADER, fragmentShader);
glAttachShader(program, vs);
glAttachShader(program, fs);
glLinkProgram(program);
glValidateProgram(program);
glDeleteShader(vs);
glDeleteShader(fs);
return program;
}
void testDraw(float x1, float y1, float x2, float y2)
{
float pos[4] = {
x1, y1,
x2, x2
};
unsigned int buffer;
glGenBuffers(1, &buffer);
glBindBuffer(GL_ARRAY_BUFFER, buffer);
glBufferData(GL_ARRAY_BUFFER, 4 * sizeof(float), pos, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(float) * 2, 0);
std::string vertexShader =
"#version 330 core\n"
"\n"
"layout(location = 0) in vec4 position;\n"
"\n"
"void main()\n"
"{\n"
" gl_Position = position;\n"
"}\n";
std::string fragmentShader =
"#version 330 core\n"
"\n"
"layout(location = 0) out vec4 color;\n"
"\n"
"void main()\n"
"{\n"
" color = vec4(1.0, 0.0, 0.0, 1.0);\n"
"}\n";
unsigned int shader = createShader(vertexShader, fragmentShader);
glUseProgram(shader);
glDrawArrays(GL_LINE, 0, 2);
}
So I'm trying to draw a basic line, but I can't get anything to show 😅 Got any idea?
void Menu::Render()
{
getWindowSize();
glfwPollEvents();
// Start the Dear ImGui frame
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
if (menuShow)
{
static int counter = 0;
ImGui::Begin("Hello, world!");
ImGui::Text("This is some useful text.");
if (ImGui::Button("Button"))
counter++;
ImGui::SameLine();
ImGui::Text("counter = %d", counter);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
ImGui::End();
}
testDraw(width / 2, height / 2, 1, 1);
// Rendering
ImGui::Render();
int display_w, display_h;
glfwGetFramebufferSize(window, &display_w, &display_h);
glViewport(0, 0, display_w, display_h);
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(window);
}
Might help if I show how I try to render this aswell 😅
I was thinking maybe some of the imgui stuff might be binding another buffer , but I can't find any evidence for this. Also selecting it again doesn't do anything, so prob not...
Is there any free or cheap vps
are you in school still there are some free credits ones for people in school that you can apply for
vps providers usually free "credits" or trials
I have found it but now I am stuck with the MySQL connection string
can you give more information
I have trouble connecting it to my database
i know
They just give me the ip and the port but not the connection string the server want
create it yourself
What is the format
Microsoft has VPSes for ~3.5USD/month for their cheapest one, and if you're a student you get it for free
In JavaScript const defines a readonly, block-scoped variable, let defines a block-scoped variable and var a global variable
to be precise, const doesn't allow you to reassign the variable, while let does. But if you assigned an object into a const variable, nothing stops you from changing it's property values. And var is technically deprecated, one should use let or const instead of var.
well 'deprecated' - in a sense it is not recommended to use it, but as it is a legacy thing, it will stay in language
const and let are block scoped, while var is function scoped, which is sometimes really not what one wants 🙂
@cloud knot Var ain't deprecated 😅
read my last line
it is deprecated in meaning of 'please don't use it, even if it stays in the language'
I don't use it, but it will take many many years before deprecated
Woops 😄
this article seem to sum up why we should use let and const instead of var
https://blog.usejournal.com/awesome-javascript-no-more-var-working-title-999428999994
Yeah, I oversimplified, I know...
WAIIIITTTT you can host discord.js files on github???
no
well
you can host the files
it's literally the purpose of github
what would I use to run them?
but you can't deploy it
so I have to have one on at all times
Time to whip out a raspberry pi
hosting isn't free
I can find a way to host the bot on a raspberry pi
on a pi you can
theres always a way...
but you can turn it into a server for websites
nothing special
but still dirt cheap compared to renting room on a server
not really
if you compare hardware costs
internet costs
power
and then you have uptime
you won't get 99.9% uptime at home
The server is only 15 people...
it can
it will take awhile for anyone to notice though
just desktops
k
nas towers?
I wish
Total lab resources so far: 350 GHz processing power, 568gb ram, and 35+ TB of storage.
i suck, i only have 128+64+32+16+16+16 in my systems here 🤷♂️ .
i got more storage tho, 38TB spinning rust in one system + 3.25TB SSD, 32TB spinning rust + 64GB SSD in other (this one is just a backup of first one 😛 ).
Jellyfish is a boutique NAS company
the only good NAS i ever seen was the HP Microserver lineup, in EU they also had some crazy pricing for older models
(but i guess we should take the NAS topic to #tech-chat's)
just diy it
get a server
there
you got a NAS
i do have a DYI NAS, which is also a proxmox VM server, OMV NAS, Docker host etc. Just saying that HP Microservers were a nice middle point between DIY and low performance NAS boxes
for 150-200 euros, you got a small, 4 bay system with G1610T, 4GB RAM and often even 250GB HDD back then in ~2012-2013?
yep
I still have one
I also swapped out the PSU for a picoPSU and a dell 12V power brick
Hi, im making an artifficial neural net (in excel, but that doesnt matter for my question) wich has 3 input neurons and 3 output neurons. How many hidden layers, and how many neurons in those, do you recommend?
well... I could make it with tensorflow in 30 minutes (if not even less) but i want to do this in excel as i thereby show my understanding of the math behind. Cause, it is basically nothing more than calculus
then don't use tensorflow?
just do it raw in python
or any other lanuage
surely it would be easier than excel
THAT IS NOT MY POINT. My audience is 8th grade. They dont understand Python! Let me make it in excel
Off course it is easier. But. I. Dont. Care.
I wanna burn my time
i have 8 hours to do it
so... its not like its impossible
I feel if you try to explain in excel that will not help much with understanding
if anything python would be easier to explain
But its fun...
or if you really want students to understand, use visuals
If you want to really enrich any audience, do it in python and break down the math. The abstracting you have to do to get it to work in excel will only harm your audiences understanding
Its also an exercise for me
like 3blue1brown
You need to decide if you're doing it for yourself, or your audience then.
Im doing it for myself
Then go fire away at it. Abstract the python into excel formulas
and im not trying to explain the mathematics of it
But no one else is gong to want to help you break new ground on this because it serves no purpose
whatever
How can I set up Visual Studio Code (Linux) to run C programs
I installed the extension for C/C++ that it suggested but I still can't run a program from within VSC
Or are terminal commands the only way to do it
It's 2 am and I'm out here tryna code
Also is there a chat for coding
or am I blind
your vision serves you another day
Then this would be the appropriate chat for it, yes
i presume
vsc is not an IDE
you still need to setup a build processes
I like cmake
but for something simple you can just use gcc
gcc source.c
very basic example
ye ive already got gcc on linux here
I can access it and run programs using terminal, but I want to be able to just push the button in vsc like I could with java or python
Or does C work differently
why not just have it in terminal
that's what I do for js
extra effort
to type the commands
literally just press the up arrow
ye ik
my point is that with python or java i can just push the green play button and it runs it instantly
yeah
for python I use terminal anyway
ah
you can have a run task too
pretty sure
@rose pulsar https://code.visualstudio.com/docs/cpp/config-linux
says c++ but you can obv mod it
Compiled languages work differently
Since stuff like python is compiled at run time ( line by lime), it lets you do things easily in the IDE
Compiled languages have to be compiled first, which can often take a decent amount of time to do depending on the size and complexity of the program.
So IDE's generally don't support compiling straight to running, although some do support debugging already compiled programs
oh
ye, I think I get it now
thanks @midnight wind @slate frigate
👍
if(!args[1]) return message.reply('Error- please define second argument')
message.channel.bulkDelete(args[1]);
break;```
Java Script:
How would I make it so it deletes the actual command PLUS the number of messages I told it to delete
before the purge line you could add message.delete()
Sooo
case 'clear':
if(!args[1]) return message.reply('Error- please define second argument')
message.channel.bulkDelete(args[1]);
break;```
i mean that could work
depends on what you want it to do
I just want it to delete the trigger and then the number of messages
example:
!clear 5
- bot deletes my
!clear 5message *
*bot deletes 5 messages *
what yall think will be added into the new big update for windows? they said it will be a focus for developers,
personally i think they will build on the whole concept of 'fluent design' -- they already have a set of styles, but more control for the devs (example of a system for integration of themes across controls, animation speed, colors of one state to another etc would be appreciated)
also bringing all that to wpf instead of locking it to uwp -- they did say they are opening microsoft store up to outside of just msix packages, which means they need to expand those feature sets for parody (we know winforms are long dead so i dont expect anything there)
delete windows
make it a wine os
Or just use wsl. That’s what they’ve been putting a lot of work into
wsl is cool, but the windows bloat I need to boot inorder to use wsl annoying
What bloat? I have no increase to my boot time to use it
It’s literally just hyper v
no not, wsl, just bloat of windows vs plain linux
So rip down windows. There are dozens of clean up scripts that do a great job of slimming it down
yeah true
Saying the bloat is the reason you don’t use windows isn’t valid, compared to all the other perfectly valid reasons to use Linux.
rn I've been dual booting
The way I see it, for Linux I need to build up to the environment I like using, windows I have to strip down. Different strokes for different folks.
windows is needed for basically any engineering work
It says that there is an ambiguity between the lastPoint, any help?
What I was trying to do is make the whole thing draggable and I think it went horribly wrong
Where have I gone wrong?
private object lastPoint;
Point lastPoint;
you declared a property called lastPoint twice, once as object, then as Point
@nocturne galleon ^
can you correct it pls :3
im not too sure what im changing
i have no idea what your code is supposed to be. i am just saying you got two different variables with same name
what do i change it to
im a newbie
do i change it to object latPoint
lastPoint^
change the names...
can't have variable with the same name
programming 101
I am legit so new to this

apparently its really ez to make
anyone knows java? iam trying to learn, got a question
https://i.imgur.com/YyYCJLd.png
i want to make it so that the if statements condition is integer
like it prints out "this is an integer" if i input an integer
anyone?
I personally don't use Java, but this seems to be the solution
https://www.delftstack.com/howto/java/how-to-check-if-a-string-is-an-integer-in-java/
@brittle flume
Is there a specific reason you started with Java?
not specific but basically wana start with website/web development and everyone says java is a must have for that sort of stuff
oh no i havent thought about learning javascript, iam learning java atm
But JavaScript is for web development
oh
java should also be in there right? i have heard that you can also use that in web development
Eh, not really, you could run anything on the web backend, but client side javascript is simply said the only/best option
ah, what is java mostly used in?
Android dev is still a lot of java
Programs
but kotlin is kinda replacing
ah, well i have started on it guess i will finish this one first theb
Ye, well, I'm gonna piss off people with saying this, but Java is kinda dying
You could change to c#. Syntax is pretty much the same but you have the modern Xamarin platform
*switch
But for web development tho... JavaScript is just the one option
agreed
oh i have a nice script for this,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
namespace SkylineUI
{
public partial class Form1 : Form
{
int mp = 0;
Point mouse1 = new Point();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Thread winDrag_thread = new Thread(window_drag);
winDrag_thread.Start();
}
private void window_drag()
{
while (true) {
if ((mouse1.X >= 0 && mouse1.Y <= this.Size.Width) && (mouse1.Y >= 0 && mouse1.Y <= this.Size.Height) && MouseButtons.HasFlag(MouseButtons.Left) && (mp == 1)) {
BeginInvoke(new Action(() => {
mouse1 = this.PointToClient(Cursor.Position);
}));
mp = 2;
} else if ((MouseButtons.HasFlag(MouseButtons.Left)) && (mp == 2)) {
BeginInvoke(new Action(() => {
this.Location = new Point((PointToScreen(Cursor.Position).X - mouse1.X) / 2, (PointToScreen(Cursor.Position).Y - mouse1.Y) / 2);
}));
} else {
mp = 0;
}
if (mp != 0) {
Thread.Sleep(1);
//without this sleep -- memory* usage will be much higher due to many invoke calls, cpu usage is also minimused,
} else {
Thread.Sleep(10);
}
}
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (mp == 0) {
mp = 1;
}
}
}
}
``` (edit: missed the var at top ;-; srry)
DO i just add the previoud refernces and I'm chilling?
references?
you can literally copy paste this replacing everything
(mind you, you will need to have the event for the form mouse down .-.)
np, lemme know if it works .-.
will do
. _ . still remember the cursed night i wrote this, i have no fkn clue why this '/2' exists, according to my calculations it shoulda worked without it,
dunno how long i spent debugging that ;-;
hey everyone I'm new on the server. Was wondering if this channel is strictly for dev dev code bytes talk or do you guys share any advice about job hunting in Vancouver and remote?
I'm a recent grad so just looking for support. 🤗
I don’t know about anything specific up in Canuck land, but i do have some general tips and tricks for hiring.
I’m always available to ping
Thanks! should i dm u or is it cool to chat here?
Dm is fine
@slate frigate
@hollow basalt What's up?
const { MessageEmbed } = require('discord.js');
module.exports = {
name: 'userinfo',
descriptions: "This gives us the users information.",
execute(message, args){
const newEmbed = new MessageEmbed()
.setColor('#32e9db')
.setTitle('About Me')
.setImage(message.author.avatarURL())
.setTimestamp()
.addFields()
.setDescription('Account Creation')
.setDescription(message.author.createdAt)
.setDescription('Joined Server')
.setDescription(message.author.joinedAt)
message.channel.send(newEmbed);
}
}```
Im trying to make an embed but I cant figure out how to make it look neat
Example^
What do I do :/
.js btw
Figured it out, nvm.
are you asking me, orrrrrrrrr
@brittle flume Integer.tryParse()
oh that's right, java doesn't have that, thats C#
public int tryParseInt(String value, int defaultVal) {
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
return defaultVal;
}
}
Integer.parseInt() raises an exception if the string is not an integer
web most often NodeJS, not java
I see
Javascript not java
The 2 are nothing alike
Just the name
I see, I started learning java I guess I will finish this one first?
@brittle flume you can do web dev in java, as you can with any language
its just a matter of picking the best tools for the job
Java is heavily used on server side software, backend systems, APIs, and database applications
My favorite library in java, to provide a webservice is: https://sparkjava.com/
Spark Framework - Create web applications in Java rapidly. Spark is a micro web framework that lets you focus on writing your code, not boilerplate code.
You can make backend in java, just not any client running code
Unless there is some java -> javascript compiler thingy
I see
bet there is
but most of those projects aren't really popular

JVM completely written in JavaScript. Let's goo! /s
There's v8 in JVM, though it got removed
This section provides introductory information about the Nashorn engine and how it can be used to interpret JavaScript code in a Java application or from the command line.
I've used this before
Its quite neat.
Too bad it got removed with java 11
import javax.script.*;
public class EvalScript {
public static void main(String[] args) throws Exception {
// create a script engine manager
ScriptEngineManager factory = new ScriptEngineManager();
// create a Nashorn script engine
ScriptEngine engine = factory.getEngineByName("nashorn");
// evaluate JavaScript statement
try {
engine.eval("print('Hello, World!');");
} catch (final ScriptException se) { se.printStackTrace(); }
}
}
Okayyy I fixed my previous issue, now I basically have a question.
{name: 'Joined Server:', value: message.member.joinedAt, inline: true},
{name: 'Joined Discord:', value: message.author.createdAt, inline: true}```
How do I make this code come out as
Joined
Tue, Mar 30, 2021 2:02 AM
Registered
Sat, Feb 16, 2019 12:41 AM```
Instead of
Mon Mar 29 2021 23:02:35 GMT-0700 (Pacific Daylight Time)
Joined Discord:
Fri Feb 15 2019 21:41:14 GMT-0800 (Pacific Standard Time)```
Any tips?
.js btw
need a date formatter
should check first if its not an object
idk much nodejs libraries
you need a time and date library
unless you want to write one yourself
please don't.
I've never heard of either of those things
whatever happened to, a standard library? where everyone does it the same way :P
I mean
there is a DateTime object
it's just limited in what it can do
'tis a shit language
[${launchDate.toFormat("ccc',' MMMM' ' d ', ' H':'mm 'UTC'")}](https://www.inyourowntime.zone/${launchDate.toFormat("y-LL-dd_HH.mm_'UTC'")})```
what I need it for
and
launchDate.diffNow().toFormat("'In 'd' days, ' h ' hours, and ' m ' minutes.' ");
it was a user suggestion
there's no other one
I could find
emphasis on worked
yep
it's php..
🔥
lol
there
even supports titles
this is just what I needed
something simple
I still use Moment.js when I need more specific date formatting. Great thing about moment is that you don't have to send off the date to an external API. Naturally, this makes the API quite big...
whatever happened to UNIX and ISO 8061
my website got hit as well ...
https://techcrunch.com/2021/06/08/numerous-popular-websites-are-facing-an-outage/
Countless popular websites including Reddit, Spotify, news outlets the Guardian, BBC, Financial Times are currently facing an outage. Typically an outage of this nature occurs when a vital internet infrastructure service faces an issue. An apparent glitch at Fastly, a popular CDN provider, is thoug…
I like Luxon because it's small and just a wrapper around DateTime
Still use those when I can, just end user formatting is annoying
Shouldn't there be a backup when the cdn breaks
Whether it's an outage or not depends on your DNS. I use 1dot and and can still access Reddit like usual. Going on my mobile outside of Wifi, I get the same 503 error as everyone else
idk lol... my website in question is just using github page, and github page was also down because of it
all of my other websites that were on my VPS are still up
whats a good ide for java
intellij
intellij and the other jetbrains ides are the best ones ive used
aight, I'II try that
@brittle flume IDEA is by far the best java IDE
it fully integrates with maven, unlike many other editors cough eclipse cough
idea is IntelliJ?
IntelliJ is a platform
oh, i got IDEA community version, thats the one, i thought the name is intellij
@brittle flume IntelliJ IDEA was the original editor jetbrains worked on
but these days, the IntelliJ platform is used in all of their editors
so plugins for intellij can also be used on their other IDE's like PyCharm, or WebStorm
IntelliJ Community Edition is the one you should get
you don't need ultimate
nice!
@brittle flume afaik, the only things missing from IntelliJ is the plugins for other languages like javascript, typescript, python, php and such
as well as all the Java Enterprise integrations
database integration is also missing from community
all features, you'll never need as a noob
nice!
author of that comic never heard of localStorage 😛
so realistic that i didnt realized i dropped my own pc while playing the game
map().reduce() ftw
anyone wanna help me with a html project
i got a question
i think i understand it but i wana confirm, so here iam just taking all the values of arr variable and assigning them to the variable element?
@brittle flume for has two ways that it can be used
either you specify an indexer, for (initializer; condition; iterator)
which in code might look like:
for (int i = 0; i < 10; i++) {
System.out.println(i);
}
or you can use an iterable dataset like an array or list, or any other kind of collection
oh yeah i know about that one, 1 sec
those can be used as such:
String[] foo = {"One", "Two", "Three"};
for (String bar : foo) {
System.out.println(bar);
}
do you know how to use your debugger?
console?
you can set a breakpoint at that println
and then run the program with debug
and you can step through the loop
one element at a time
how do i add the breakpoint?
you're using intellij?
eclipse
but i do have intellij
you click left of the line in the editor
next to the number
You click where that red circle is
when your program hits this line of code while running
it will pause
and you can see what its actually doing
while running
debugger is very important, helps narrow down problems and spot potential mistakes you made
debugger itself
i need to be on intellij for this?
has a couple buttons and things you can do with it
eclipse has a debugger too
idk how to use it though, years and years ago
just make a breakpoint
and run the program with debug
the debugger should pop open in a toolbar
click on 14
@brittle flume you should actually create a new project
@brittle flume then, https://i.imgur.com/WIcgtE4.png
You can use 14 there
I'm using 1.8 (because older projects)
aight, made new project
ok did you select maven?
ok in your src directory, there should be a src/main/java
yeah
Okay, so let me briefly explain
maven is a project management tool
the entire compilation and other code libraries it may need, are defined in the pom.xml
"Project Object Model"
Its just easy, to learn this at same time
because if you ever want to use some cool libraries to build things
you'll need this
gotcha
okay so your source code is in src/main/java
its customary to make a package in here
in your case
I'd use me.nick.testproject
for companies, its usually com.google.project.subcomponent
its a way to structure your program
Example ^
aight, made the package
ok then in there
create a class
and then there's a trick: inside the class do the following:
type psvm and press TAB
that should generate one of these:
https://i.imgur.com/JZNAl3M.png
that's an entrypoint to start your program
once you have that, there will be a Green |> symbol
https://i.imgur.com/Rk9tVKl.png
oh wait can you make the class file with public static void main thing already writted
you can create a main method anywhere in your code
and tell intellij to run it
@brittle flume usually, when you start up a java program, do it like such: java -jar foo.jar path.to.the.MainClass
aight, where do i put psvm
in your main class
you have 1 class, which you pass to the java vm during startup
and itll search for a function called main
and start running your program from there
got it!
@brittle flume ok now put the following code in:
is there anyway to hide this directory like on your https://i.imgur.com/SctehDn.png
@brittle flume if you click on that
it just shows you how the program is launched
its just intellij
that's the raw command it runs
before it started
ah aight, I'II probably use intellji as main ide now, was confused a little before
@brittle flume ok now your debugger
put in this code:
public static void main(String[] args) {
String[] strings = {"One", "Two", "Three", "Four", "Five"};
for (String s : strings) {
System.out.println(s);
}
}
put a breakpoint on the println
Then run the program again, but this time with the debugger (the bug symbol)
And then it should show you this:
so currently, its inside main, on line 9
and on the right, you can see the local scope of variables that are accessible
Now you have two things you can do
you can hit the green button on the left, which will resume the program, until it hits the next breakpoint
Or
you can go through your program
line by line
With this button
if you call another function, you can also step into that function (thats the button next to it)
@brittle flume look in the top right
see the |> and bug icon
@brittle flume dont put underscores in class or method names
in fact, java doesn't really see any underscores used in field or variable names
unless
its a static constant
public static final String WELCOME_MESSAGE = "Hello and welcome!";
you don't have to do this
but if you ever show your code to someone else, they might just throw up
its just clean code in java
ah i see, i was using _ as alternative for space lol
oh you can popout the debug screen to
cool
@brittle flume classes are always uppercase
MyBlaComponent
fields and parameters as well as methods are written as camelCase
gotcha!
packages always lowercase as well
only single words
plural is bad form
use singular
got it
@brittle flume https://en.wikipedia.org/wiki/Snake_case
Snake case (stylized as snake_case) refers to the style of writing in which each space is replaced by an underscore (_) character, and the first letter of each word written in lowercase. It is a commonly used naming convention in computing, for example for variable and subroutine names, and for filenames. One study has found that readers can re...
linux kernel is written like that ^
so i was using snake case?
ye
@brittle flume its just conventions
java uses only for static constants, or enums (which are static constants after compilation)
@brittle flume lol my largest project for my gameserver
this provides a proxy server, backend, persistence engine for roleplay profile and savegame, as well chat.
For Minecraft
xD
20k classes?!?!?
no
you did manually?
20k lines of code
lemme see how many classes
oh man
yeah I forget
takes
like half a minute
to compile
(thats maven btw)
@brittle flume lemme see when this project was started
@brittle flume its still being developed, though mostly bu others
it just needs fixes or new features depending on what other things we need
the entire knockturn project is like idk how many repositories at this point
we have over 40 plugins
I Just wrote the core system, that takes care of logins, profile storage and database stuff
cross-server synchronization is complicated stuff
and most of us were ammateurs when we started this
I was the most capable one at the time, so I wrote most of the core components we needed
@brittle flume API alone is over 60 classes, https://i.imgur.com/pDAPS5M.png
damn
Like all good projects
they begin at the end of the evening
and go on until 5am
I worked on it whenever I had time
like 3 years very intensely
and then less so
np
That's ProperCase.
which API did you use, spigot?
Spigot and bungee yes
Does anyone here do Grok learning courses? Or is able to help me know what im doing wrong?
sure
Cheers, so what has been happening, is For some reason, Grok isn't displaying the correct output, I have gone over my code 1 - 5 times and it just isn't displaying, everything should be correct but when I answer with "yes"
It just shows nothing
Okay nevermind i just fixed my own issue... I was missing a dot and a capital letter my bad
yes is not Yes
Haha yeah 1st year student jitters thanks :)
just a note, every language has a 'convert to lowercase/uppercase' method, that way you can unify every possible option
that is, if they enter yes, Yes, yEs, YeS or whatever, it will still count as a valid answer
in your question that would be:
if question.lower() == "yes":
but i haven't done much of python in my career
Oh wow 0,0 thanks
We used to build for bukkit directly back in 2014, but its all spigot these days
What CAD software should I start out with?
I just bought a 3D printer and want to attempt to design some of my own stuff
A lot of people swear by Autodesk Fusion 360 (subscription-based purchase, trial available). Haven't tried it myself due to not having the spare time when I got into the hobby, but still interested. SketchUp is also highly praised and can be used for other modelling such as for woodwork (it can even generate parts lists for planning builds/cuts for this), getting all features with ongoing updates needs a recurring annual license now I believe.
Personally I use OpenSCAD, which is a free, programming-based modelling application (their own simple language). Another free option that's highly popular is Blender; despite its original target being for 3D animation and rendering a lot of 3D print hobbyists use it quite successfully.
Dig around a bit and you can find some excellent comparisons, and try a few pieces of software out, see which one best agrees with your modelling style. Everyone I know in 3D printing seems to have settled on something different and all for different reasons 🙂
as you can see in linked answer, casefold() is even better, as it changes weird characters into their universal representation (so ß is changed to ss for example)
I will look into those
Thanks
so how do i fix this its not centered
ping me if you know how to repair it or have an idea
can someone help me fix my hyperv network issues?
can someone help me with some html stuff?
Hi how can I link section of markdon file in the same fipe
For example:
# keys
[Go to 2] (URL " Go to 2")
...
Some text
...
# 2
Some text
These days there's all this focus on teaching kids that "no means no", but then we end up with these programmers that don't realise that No doesn't mean no 😄
no No nO NO
Can someone possibly help me out with this question
[1:06 AM]
Determine which of the following are valid or invalid identifier, integer constant, character constant,
float (real), constant, string constant and separate them. If invalid give reason?
(a) record1 (b) $tax (c) name and address (d) 27,822
(e) 0.576 (f) 1527 (g) 2e-8 (h) 1,232.5 (i) 5.234
( j ) „ a ‟ (k) “Pak”
[1:06 AM]
C language

I already kind of want auto bed leveling for this ender 3 because somehow the bed got unlevel and slammed into the nozzle
@swift yacht idk? that's what I have a compiler for 
online gbd very useful and quick and easy yes?
wat
its just a online compiler that does multiple languages
when i fooled around on the school chromebooks online gbd let me run some basic code
okay my last shot
i am doning a 24 hour finally atm were i have 24 hours do a project. my group is almost done with the coding part but we are having some trouble with a price calculator.
we need to have 3 boxes for 3 differnt prices couse we are making a travel bureau but we can only get one box to work and are having major trouble getting the other box to work can anybody help
here is the code/script
its a website done with HTML
<body>
<div data-ng-app="" data-ng-init="quantity=1;price=500">
<h2>Pris Per Dag</h2>
<h2>Antal voskne</h2>
<input type="number" ng-model="quantity">
<p><b>DKK:</b> {{quantity * price}}</p>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div data-ng-app="" data-ng-init="quantityb=1;priceb=500">
<h2>Pris Per Dag</h2>
<h2>Antal Børn</h2>
<input type="number" ng-model="quantityb">
<p><b>DKK:</b> {{quantityb * priceb}}</p>
</div>
</body>
```
as you can see only one will giv us a output
@cunning flume that looks like angularjs to me
ancient garbage
should be using Angular instead
welp my teacher is a dumb one
this is only thing he has tought us
we spent no joke 2 months with 2 class 1 hour each pr week learning to change colors
@warm sleet
you dont even need angular for this sort of simple stuff
angular is for building single page applications
single page applications do not reload the entire page when you browse to another page
instead, they fetch content from a server, and update the view
I guess just trying to introduce it?
Yeah but you dont teach someone angular if they dont even know basic HTML, CSS & JS
Yeah ofc
I'm having to use angular at work
I used vue in my latest web project
and I've got years of experience with development, angular makes even my head spin
m8 listen would you mind helping us then we are slightly frustrated here and would appreciate some help with it
impatient
Idk angularjs, sorry
yeah we got like less than 6 hours left before we need to present this and still have a fare way to go
Maybe I'll take a look once I'm at home
its an exam
@cunning flume {{quantityb * priceb}} is ment to be evaluated?
Because thats Angular syntax, not AngularJS.
Confusing naming hell
Yeah.
i mean we just tried separating their names so that they wouldn't interfere with each other
@cunning flume {{}} is syntax that can be used with Angular & Angular CLI
but angularJS is just that, javascript
{{ }} is neither valid HTML, nor valid javascript
we aren't that great at coding/scripting :/
Yet you have an examination?
yeah we have been taught about small amounts of scripting in school and now have an exam ending the year of scripting classes
wat
but like we said we spent 2 months learning to change colors in HTML
@cunning flume are you sure you even have to do angularJS?
and our teacher is really bad at teaching he is an old guy who talsk really slow
Because this sort of stuff can just be done with an event handler and a piece of javascript
do you have any websites or anything of that sort so we can figure out how maybe?
document.querySelector('.foo-class').addEventListener('change', (event) => { /*code here */ });
you put class="foo-class" on whatever input
and when the value changes, it runs that event handler
@cunning flume is angularjs a requirement?
no requirements on what code to run
@cunning flume just use plain javascript then
Oh, then just use plain js
just has to have been scripted by us
@cunning flume look at the snippet I posted
we haven't learnt anything about java script
you can add a CSS class foo-class to whatever <input>
and whenever that input fields value changes
Bruh
it runs the event handler (event) => { }
be a skript kiddie ✅
a travelling company
wat
Any like specific requirements?
So, I think the teacher just wants pure html/css
Nothing interactive
how would you change this then?
A 2000s website
Is it a requirement for it to change?
we have that price calculator as a must
no clue xD
Javascript
Let me make a jsfiddle
Give me a min
thanks
@cunning flume well crap. okay
I can't share this fiddle rn
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
HTML:
<html>
<body>
<input type="text" id="foo">
<p>
Output: <span id="output"></span>
</p>
</body>
</html>
JS:
function update(event) {
document.getElementById("output").innerHTML = event.target.value
}
var input = document.querySelector('input')
input.addEventListener('change', update);
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
@midnight wind one thing you can fix in that one
I suck at js, so tell me
how do you get that input field by ID ?
because getElementById().addEventListener() does not exist
@cunning flume ^
click on that link
it should apparently
yours pr monkeys
I just put it in a link that is sharable
@cunning flume basically, you got your piece of JS, which declares a function called update()
then, you add an event listener, that calls update() when the 'change' event happens
this works?
function update(event) {
document.getElementById("output").innerHTML = event.target.value
}
var input = document.querySelector('input').addEventListener('change', update);```
we need it ti get a quantity and then multiple it with a specific number and then give us that value
then you just change the code
we need that times 2 and then add those two nubmer together
@cunning flume so you have an event listener that listens when either one of the two fields changes, and then updates a value elsewhere on the page
you can read values from both, do your calculation
and then write the result onto the page
document.getElementById("foo").value
gets you the value="" property of an <input id="foo">
@warm sleet you need to set the id, you gave it the id of foo
@midnight wind wat
duuuuuh
function update(event) {
document.getElementById("output").innerHTML = event.target.value
}
var input = document.getElementById('foo')
input.addEventListener('change', update);
This is why I hate scripting languages, at least java tells me when I write garbage.
it can just be a one liner js var input = document.getElementById('foo').addEventListener('change', update);
(e) => { }
okay okay okay
@midnight wind do you remember the days that you could put <script language="VBScript"> in a page?
run arbitrary vbscripts, could even have the webpage open the CD tray on the PC xD
here is the problem
we need a price calc with one input and output
sooo lets say
we put in 5 then
5500 couse we have set the price to 500
then the output is 5500 which is 2500
then we need one more input and output
were we put in lets say 3
and the price is 350
so the ouput is 3*350=1050
then we need one more output that adds the output from the first and 2nd output
so 2500+1050 which is 3550
no
omg
geez
Nuclear Contractor got hit by Ransomware
lmao, and they are threatening to give the info to russia
does my explation make sense
that problem was solved a long time ago, its called a calculator 
@cunning flume https://jsfiddle.net/apm2bqsd/14/
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
