#development

1 messages ยท Page 74 of 1

warm sleet
#

list can be empty

#

or contain 1

#

or multiple

rare dagger
#

What will cmd do with those when it needs only 1?

warm sleet
#

it doesnt need anything

#

it just gets a list of child processes

#

and dumps them out

rare dagger
#

i wanna keep it as .bat file

warm sleet
#

rip

rare dagger
#

ok.. just . i will give up with it. it took me 3+ hours to get to that point

warm sleet
#

@rare dagger I can just make it return a single one :P

rare dagger
#

Errr idk man now i kinda feel confused

#

Cuz i wanted to keep it as 1 file only

#

so idk if it is worth

warm sleet
#

@rare dagger lol help me here

#

how do you set variables in windows bat?

rare dagger
#

I'm not linux user

#

oh

#

err

warm sleet
#
E:\FindProcess\FindProcess\bin\Debug>SET foo = FindProcess 4

E:\FindProcess\FindProcess\bin\Debug>
#

this works

#

but, idk how to get it out now

rare dagger
#

Explain me what do you want to do?

warm sleet
#

batch is wtf.

rare dagger
#

omg if i missline once then all text goes wrong

rare dagger
warm sleet
rare dagger
#

1sec

#

give me more than 1sec

#

i dunno even

#

hm

#

lemme test

warm sleet
#
cystal@DESKTOP-E49ULUK MINGW64 /e/FindProcess/FindProcess/bin/Debug$ variable=$(./FindProcess.exe 4)

crystal@DESKTOP-E49ULUK MINGW64 /e/FindProcess/FindProcess/bin/Debug$ echo $variable
144

^ bash under windows

rare dagger
#

got it

warm sleet
#

@rare dagger yeah it needs to run. not interpret as string

#

xD

#

idk how you do that on bat

#

bash is just $()

rare dagger
#

er

#

i dont even know bash

#

I told you i dont use linux

warm sleet
#

ok so

#

its SET /P variable=[command]

rare dagger
#

Err

warm sleet
#

still doesnt work

#

piece of garbage

rare dagger
#

yea... kinda weird. i think imma end it here

empty sentinel
#

"FindProcess" is a valid CMD command?

rare dagger
#

yea

#

or

#

idk

#

nope

empty sentinel
#

Not on my 2 Windows 10 machines it isn't

rare dagger
#

Can u help me

empty sentinel
#

set user=%username% works perfectly.

warm sleet
#

@empty sentinel it doesn't

#

@empty sentinelthat was from another example lol

#

I just whipped up a quick C# program that queries the management store directly

#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;

namespace FindProcess {
class Program {
    public static IEnumerable<Process> GetChildProcesses(Process process) {
        var children = new List<Process>();
        var mos = new ManagementObjectSearcher(
            $"Select * From Win32_Process Where ParentProcessID={process.Id}");

        foreach (var mo in mos.Get()) {
            children.Add(Process.GetProcessById(Convert.ToInt32(mo["ProcessID"])));
        }

        return children;
    }

    static void Main(string[] args) {
        var children = GetChildProcesses(Process.GetProcessById(int.Parse(args[0])));
        foreach (var child in children) {
            Console.WriteLine(child.Id);
        }
    }
}
}
fading phoenix
#

Hello, is anyone anygood with databases and SQL?

#

if so what is wrong with this sql

#

SELECT StockName, Count() FROM Stock JOIN SaleStock ON SaleStock.StockID = Stock.StockID GROUP BY StockName ORDER BY count() DESC

#

I was being stupid my bad I'm new to this sorry.

tight charm
#

You're not putting the column name inside the count's parentheses. That's whats causing the syntax error.

gusty ermine
#

what is 250 Mbps unmetered* bandwidth

midnight wind
gusty ermine
#

is it a good thing or bad thing since im looking at OVH Vps for Web Hosting

midnight wind
#

although I heard OVH vps's kinda suck

gusty ermine
#

im not looking for an expensive one tbh

#

my minecraft network is small

#

so do you think it would work fine for me?

warm sleet
#

@gusty ermine make sure you don't get the ones that have vCores

#

if you hog more than 35% of the CPU they will start sending angry emails

placid flare
#

Uhh so in the latest "Dev Ring" insider update this just got updated... Iam vary confused.

mystic coral
#

Design this amazing Login/Sign-up form with CSS and JavaScript animations.
Watch the step by step tutorial on my channel.
https://youtu.be/eQgmsIy7nQ4

Design Login/Signup Form UI using HTML, CSS & JavaScript || Front-end Designs || Front-end web development UI #1

This is the first part of Front-end web development UI where we'll be designing various front-end pages using HTML, CSS, and JavaScript. If you also struggle designing front-end pages, then this series is for you.
In this part, we'l...

โ–ถ Play video
nocturne galleon
#

no spaces

junior abyss
sly vigil
#

can anyone help me fix this? i have never programmed before and im trying to make a bot but keep getting this error

limpid reef
sly vigil
#

that was probably one problem, now it goes and says this

next light
#

@sly vigil i think (not certain) that js wants semi colon when executing tasks

#

Oh god just noticed

#

You started commenting out a bunch of code but you never finished the comment

#

Thats the missing token

#

You need */ at the end of the code

sly vigil
#

Oh thx so much @next light

midnight wind
next light
#

yeah it was a while since i worked with js and now im doing lua and C# one of them not needing semi colon and the other demanding one

warm sleet
#

@next light lua is the funny one

#

it indexes by 1, and has only 1 datatype

next light
#

damit

#

lua is annoying sometime

#

but been working with it for 3 years now through roblox

warm sleet
#

everything is a table

#

once you understand how lua scopes its metatables, its quite easy to use

next light
#

what?

#

oh hella naw

#

i dont wanna deal with metatables

#

they are so damn confusing

warm sleet
#

you can use them to create instances, and do object oriented programming

#

as well as functional programming

next light
#

yeah doesnt mean they are the only way to go and because they are really confusing, i rather stay away from them

warm sleet
#

like I said, lua only knows one actual datatype, and that's the scoping context of the metatables

next light
#

tf?

#

ok i think we are talking about different types of lua here

#

cause ive been working on different games using lua now for 3 years

#

pretty damn good at it

warm sleet
#

yeah even your regular scope is a meta table

#

xD

#

its just hidden

#

variables in the local scope are just records on that table

#

with the variable name as the key

next light
#

yeah i cant really talk that much about metatables, dont know how to use them, how they work, what they do and stuff

next light
warm sleet
#

no its not different version of lua

#

its how the language works.

next light
#

bruh

#

there is a different version of lua

midnight wind
#

apparently you can do js or other languages to compile to lua for roblox

next light
#

it got its own kinda name even

#

using luau now

midnight wind
#

ah

#
warm sleet
#

if you create a variable in lua, you can also access it by doing __index['variablename']

#

that's what i mean, that the entire scope, is just a metatable

next light
#

as said, metatables are really confusing

warm sleet
#

and when you call a function, it pushes that metatable onto the stack

#

and adds the parameters.

#

this isnt "some version" of lua

#

this is how the language functions internally.

next light
#

yeah im not gonna learn how they work here and now, if i ever do learn metatables, it will be during the day when i do some research

warm sleet
#

just saying, if you know how to use metatables yourself, it allows you write some powerful constructs

#

and makes writing more complicated systems easier.

next light
#

im good

#

i got no need of metatables rn, maybe not ever

#

i do C# at school and probably gonna use C# when i start working and pretty sure C# doesnt have metatables

warm sleet
#

;-;

#

yea, because C# has a stack-heap memory model.

#

completely different from the way that lua handles this.

next light
#

nothing that i can speak of as i got no clue what that is

#

anyway, imma head to the store, cya

warm sleet
#

;-;

mystic umbra
#

Lua and C# are completely different things. They aren't even comparable.

#

C# is much much much more powerful.

ivory bear
#

Lua is powerful in other use cases, like embedding in other language, or as user addon in games or third party application since you don't even need a full fledged IDE just to write Lua and it's almost always sandboxed by other system

like you will definitely need IDE to write C#, you will forget all those long syntax and the required formatting

C# be like

using System;

namespace HelloWorld
{
  class Program
  {
    static void Main(string[] args)
    {
      Console.WriteLine("Hello World!");    
    }
  }
}

Lua be like

print("Hello World")
midnight wind
#

C# is meant for big complicated projects

#

Lua is a scripting language

#

yeah

#

learning C without an IDE is a good experience

#

for starters

#

just plain gcc

nocturne galleon
#

does anyone have experience with the linkedin API? im a bit confused as how the authentication works (apperantly with oAuth. But im a serverside noob)

hollow basalt
#

drop your code here

nocturne galleon
#

have none. Dont know where to start its for a MagicMirror2 Module @hollow basalt

hollow basalt
#

so uhh, start now

nocturne galleon
warm sleet
#

that sounded so familair, couldnt put my fingers on it

last lance
#

`import pygame
import time

#Color Settings
background = (46, 52, 64)
button = (100, 100, 255)

width = 800
height = 1000

fps = 60
win = pygame.display.set_mode((width, height))

win.fill(background)
pygame.display.flip()

def main():
state = 0 #0 = Picture, 1 = Main, 3 = Settings
landscape1 = pygame.image.load('landscape.png').convert()
landscape1.set_alpha(255)
win.blit(landscape1, (0,0))
pygame.display.flip()
inanim = False
clock = pygame.time.Clock()
run = True
while run:
clock.tick(fps)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_w:
if state == 0:
if inanim == False:
inanim = True
landscape1.set_alpha(0)
pygame.display.flip()
print("send help")
time.sleep(1)
inanim = False
state = 1

pygame.quit()

if name == "main":
main()`

My janky code, when clicking w it prints out send help, but the oppacity does not change

#

I have probably offended every single python coder with my bad code

calm thicket
#

Can anyone help me decide on whether to learn common lisp or a scheme language like clojure or racket?

hollow basalt
#

What's your purpose

nocturne galleon
#

i hate that random numbers are printing at the end

#

can't seem to find the problem, just added switch cases to have the function accept different parameters based on the user's input

calm thicket
honest sleet
dim lava
calm thicket
rancid nimbus
#

At the end of the case statements you have a printf could that be why it is printing an additional int?

#

Also that function does not appear to return an int. Maybe I am just missing it.

storm plume
#

why am i unable to install btrfs-tools from the ubuntu ppa?

rancid nimbus
#

Ububtu ppa?

storm plume
#

yeah

#

sorry i meant using apt

#

heres what it says

rancid nimbus
#

Nevermind I remember what they are. Did you run sudo apt upgrade are you on an Ubuntu version supported by the ppa?

storm plume
#

im on 20.04 rn

#

5.8 kernel

#

i googled it but cant find any answers to that

rancid nimbus
#

Some papa's only support an older version of ububtu for some reason.

storm plume
#
sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.```

```bash
sudo apt install btrfs-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package btrfs-tools is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'btrfs-tools' has no installation candidate```
#

oh

#

i tried apt searching but doesnt return any results either

rancid nimbus
#

Would the package name be right?

storm plume
#

yeah i searched google and it seems to be right

#

also gparted telling me to install it

rancid nimbus
#

This suggests btrfs-progs then it should work.

storm plume
#

i was able to successfully install btrfs-progs (enables creation of the btrfs file system) but gparted says i cant use it until i install btrfs-tools

#

unable to read contents of this file system!

#

ok let me try a reboot

#

might fix some issues

rancid nimbus
#

Also, I would not rely on a ppa for a system critical component like file system.

storm plume
#

what do u recommend

#

also rebooted and it seems i still cant install it, but gparted's issue is gone now

rancid nimbus
#

Trying to stick to what the distro provides.

storm plume
#

okay noted!

rancid nimbus
#

If you have a core component like that and you update you might have to reinstall.

storm plume
#

oh i see

rancid nimbus
#

I have done that with graphics and it booted just fine, but the screen wouldn't do anything. The GPU drivers were installed from a ppa of some sort.

storm plume
#

ah

rancid nimbus
#

Did it work?

storm plume
#

yeah currently trying to move some files onto it

pliant siren
#

So I have a problem where I want to sort the result of f(n) where n is a large number - 2^32, maybe as high as 2^40. No problem, I'll just use an AVL tree and store the indexes in the tree. Now I want it to be fast, so I'll want to use C. And if I do it using a struct or objects you nearly quadruple your memory footprint, so I want to do this using an array. Should be no problem, that will have been written a hundred times before, there will be plenty of examples on stackexchange surely. Right?

Evidently, wrong.

warm sleet
#

@pliant siren use a long integer

#

those are 64 bits

pliant siren
#

yes - but that means more space in memory. Remember that 2^32 is already going to be 16GB as an array index; at 8 bytes per index it'd be 32GB

warm sleet
#

@pliant siren okay, and why in memory?

#

I mean, if you're indexing a large dataset like that, you sure native implementations like that are sufficient?

#

@pliant siren you could use a hashed array tree

#

with a pivot in the middle of your dataset

pliant siren
#

A HAT or any kind of HashTable is going to use vastly more memory than you ideally want to use.

#

Also, the intent is to generate a sorted list. A HAT won't give you that. You would still need to sort each column, and then mergesort that, which is exactly why an AVL tree is ideal - you end up with a data structure which is already sorted and ready to traverse.

#

As I said - I want to sort f(n) for n=0...(2^x)-1

#

essentially what I want to do is calculate f(x), then in the avl tree store x. Every time you do a comparison function, you would have to re-compute f(x) for the current value and every node as you traverse the tree. This is because f(x) is a 256 byte value.

rancid nimbus
#

Does anyone know how to get a systemd timer to wake a system from the shutdown state?

hollow basalt
rancid nimbus
#
sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" 
sudo sh -c "echo `date '+%s' -d '+ 10 minutes'` > /sys/class/rtc/rtc0/wakealarm"
sudo shutdown -h now
#

The first command clears the rtc, then the second sets the timeout 10 minutes in the future, then it shutdown. After 10 min from setting the timeout the computer wakes up.

#

I found this: Not officially supported by ACPI, but it usually works when looking at rtcwake manual page.

#

You could just use the sudo rtcwake -m off -s 600 to do the same as the previous shell code.

hollow basalt
#

preference

#

I use a combination of git cli and 3rd party gui client

nocturne galleon
#

hmm fair enough

#

ok, what about, which do you think is better for a beginner

#

like I'm just looking for something that lets me push my commits to my github repo from linux, and maybe swap branches

#

everything else regarding merging and issue tracking and whatnot I'll just do on the site

warm sleet
#

@nocturne galleon git cli is the way to go

#

I use my IDE for actually comitting code

#

but being proficient with the CLI, means you can use git in any situation

#

most noobs that I see use Sourcetree, but sourcetree completely breaks down on larger repositories

#

if you try load the linux kernel git repo with Sourcetree, it explodes

#

source tree also doesnt know how to rebase properly

#

and if there's a mismatch with the repository, it just crashes

hollow basalt
#

sourcetree seems enough

#

but i never used it

hollow basalt
#

CLi is still the best choice

nocturne galleon
#

Learn Git CLI. All the GUIs I've used are limited and the GitHub CLI will tie you to GitHub, so you won't know what to do if there's a project on GitLab or other alternative Git services

ivory bear
#

ouch ... so it wasn't actual bug in the software
https://twitter.com/ocornut/status/1383002610790174721

  • User submits a mysterious clipboard issue
  • @PathogenDavid patiently digs into system locales, encoding conversions, line-endings etc., fails to repro but somehow finds a fix involving line-endings format.
  • Someones shows up with an answer ouch
Retweets

398

Likes

1402

nocturne galleon
#

very well, you guys have sold me

#

thanks for the help

tropic hound
haughty burrow
#

but i hate JS with a passion so im not reading a single line more

tropic hound
#

cool, thanks for the info.

woeful shadow
#

i made a website

#

the html files worked with my custom font

#

but not when i uploaded everything to my host

#

i even put the font on a cdn which usally helps when local files aren't being found

#

but no luck

hollow basalt
#

it would be helpful if you supplied code

woeful shadow
#

yes

#

i agree

#

my laptop has a different discord account since im borrowing it

empty ingot
#
@font-face { font-family: Chunk; src: url('Chunk.TTF'); }```
#

doesn't work

#

works locally opening the file in browser

#

but not on the web

hollow basalt
#

are you need not

empty ingot
#

yes

#
<h2 style="font-size: 37px; font-family: Chunk;">```
#

aww

#

ok

#

just using my brothers laptop lol since im not home and im fixing his website

#

he used to post sometimes here

#

ill leave

#

staff

#

plz no ban

woeful shadow
#

ight

#

alts gone

#

not sure why it doesn't work on my host

hollow basalt
#

what's your host

woeful shadow
#

sparkedhost

#

cheapest

#

$2/m

#

ive used them before

#

dk why the host would be the issue here

#

it's running cpanel btw

#

i just uploaded everything to public_html

#

๐Ÿ˜ฉ

#

the file was named .ttf

#

not .TTF

#

i guess it's not case sensitive locally

#

sigh

#

everytime this kinda stupid thing happens

#

@hollow basalt dont keep searching incase you didn't see

cyan raft
#

I'd say that the git cli is better since it has better integration with ides and vim(via fugitive)

dim lava
#

I somehow wrote this without being tired or drunk

#

i think i'm just bad

#

(^ is the XOR operator here, and A XOR A some number A will always equal zero lol)

pliant siren
#

hah

woeful shadow
#

html buttons dont work

#

why

midnight wind
#

what do you want them to do

woeful shadow
#

@midnight wind when i click i dont get redirected

#

nothing happens

#

the click animation does go tho

woeful shadow
#

nvm i got it

cyan raft
#

I did foobar level 1

#

๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰

#

IK the first one was pretty easy but still

#

kinda proud

stone willow
#

hiya. im not sure if this is really the best place for it but looks similar...? i have a school coding project due tomorrow and im terrible at coding...all i need help with is a username and password system for 2 users to start a dice rolling game so itll probably be very simple for most of you. if anyone has 5/10 minutes to try and help me please dm me so i can send you screenshots of it thanks

warm sleet
#

did you not pay attention during class? :P

zealous dove
#

Hi All, long time listener, first time caller ๐Ÿ™‚ Decided to join in the see what the fuss is all about. My topic of discussion today is Raspberry Pi Development and e-ink screens and bank savings tracker (I'm from the UK - so ยฃ's and bank accounts and not checking accounts LOL).

I have been working on many things over the years. But my most recent is a python3 app that will look at your savings goal for a specific UK bank and display the progress on an attached eInk screen.

hollow basalt
warm sleet
#

@hollow basalt idk what else to day

#

but sounding the alarm 1 day before assignment is due..

hollow basalt
#

it's not like I'm disagreeing

warm sleet
#

sounds like poor planning

stone willow
warm sleet
#

yeah but that is besides the point

#

if your assignment is due tomorrow, and you dont have a thing to show for... that's poor planning on your part

#

dropping the problem in a public channel, hoping for someone else to do it is... not really honorable

stone willow
#

also this was meant to be due at the end of may but last week when i wasnt in school due to illness my teacher told everyone it was due sooner and its only because one of my friends asked how i was finding it that i found out about the deadline

dim lava
stone willow
#

well 24/31 of the students parents in my class have complained about her, weve only had 2 months of teaching from her in entire school year and have had no lessons about coding at all in school, so maybe its just bad circumstances but i didnt know how to do the task well. i had it operartional and it did 8/9 objectives well, however i didnt know how to complete the final stage, and even when i did find it online i wasnt sure how to integrate it into my program. all i did was ask for some guidance but sorry?

stone willow
dim lava
#

no it absolutely is. you're trying to get someone to dedicate their time in DMs in which they are obligated to help, by asking a very generic question that can involve any one of hudnreds of techniques or technologies or languages or structures, and then saying you need it done urgently or else you'll fail this assignment

stone willow
#

you were suggesting that i was being dumb and relying on others to do the work for me, when in reality ive tried and havent been able to so i was just proving that shes not the most helpful

#

ive done it now but ty

dim lava
stone willow
#

well it took 4 hours to learn a tiny bit rather than 10 minutes of someone telling me what i needed to learn but yeah i guess. cheers

stone willow
dim lava
#

The issue with asking for generic DM help is that I personally consider myself a great programmer in a lot of areas, and I help people all the time and invite people to DM me with questions. However, if i do the same to you without knowing wth you're actually doing, you could be working in some popular language or framework that I don't personally know well, like Java, React, TypeScript, etc. Then since I already offered you help, I am basically just led to googling the same exact things you have to google, which basically just leads to me telling you what to put in the search bar

dim lava
#

Anyway, it seems like you've solved the issue, so good job. In the future, be as specific as possible when searching for help so that people can actually help you without having to poke your brain for all the details ๐Ÿ™‚

stone willow
#

well yeah i guess but i didnt have all the info thatd have been helpful and this is my first time coding anything more than like 5 lines so hadnt fully considered that

stone willow
#

yeah i understood about 3 words of that sorry...

dim lava
#

This language looks suspiciously like Java but isn't lol KEKW

#

I rarely work on customer or end-user facing code

#

I mostly do embedded and hardware stuff

midnight wind
#

I hate doing frontend

#

I'm just a student though

dim lava
#

lately been working on various encryption stuff on FPGAs

#

I've even come to hate server code too

#

Basically any code that has to interact with user input, i'm out

#

All the fun is taken out of programming when you have to think of the 30 million ways a user can fuck up a text form

#

Notice her last name is True

#

๐Ÿ˜‚

midnight wind
#

Iol

#

reminds me of a person who changed their name to NULL

#

and all of a sudden they had hundreds of tickets

#

and fines

dim lava
#

lol i love that story

#

@last ingot anyways, i find embedded and hardware development far more interesting because I think the problems are hard and engaging and you don't have to deal with nearly as much fuss

midnight wind
#

embedded programming is cool

dim lava
#

I could probably find similar enjoyment in large-scale deployment stuff like distributed databases and region caching schemes and whatnot, however that just wasn't the path i took naturally so i'm a bit far removed from the skills needed for that

midnight wind
#

Things like kubernetes

dim lava
#

yeah basically

midnight wind
#

distributed storage

#

I"m playing with kubes rn

dim lava
#

embedded is fun because of the restricted nature of it @last ingot , you really have to think outside the box sometimes to be able to get something done

midnight wind
#

trick is, everything should be as stateless as possible

#

and all database and/or storage is done somewhere else

#

not in kubernetes

dim lava
#

Like, I was responsible at some point for improving the code that would record a bunch of stuff in the event of a total system crash

#

However it was way too big compared to the size of the flash space available, we have like 15MB reserved for this purpose and the total size to record was like 70MB

#

i ended up implementing memory compression to take it down to 3MB and sped up the process from a few minutes to 15 seconds

#

what was interesting was because it's a crash scenario, you can't use any sort of dynamic memory/heap, remote function calls, kernel calls, etc. So i had to basically do everything on the stack. I had to modify the compression algorithm to support some preallocated memory and inline as much as possible

dim lava
#

LZ4

#

there was already an implementation of it on the device so it was a clear answer there lol

#

and another useful property was that it can be used as a stream of data, without having to analyze the entire thing first

rotund plover
#

Someone knows C lang?

spring pond
#

yes

hollow basalt
#

maybee

native helm
#

Anyone with a working wsl2+vscode+electron+react setup that can help me get it up and running?

nocturne galleon
#

Why wsl tho?

#

I mean you could just use vanilla linux right?

spring pond
#

its possible they only have a windows machine and dont have real vm permissions or dont want to set one up

tired juniper
#

ok so I got a class restaurant and I got a class foods. everytime you add a food in the constructor for foods an instance of the class restaurant gets created so the food that you created under class foods can also be added to the list of foods which is in class restaurant. My question is how do I do if possible: I write a food with certain parameters in class foods and these parameters get recorded for this food in class restaurant but I call the food pizza(because I am adding pizza). Is there a way to get that name and record the food in the restaurant class but with the same name without putting the value into another variable first and then putting that variable into the restaurant. Can I directly use the food name I created for class foods in main?

#

example
I mean I know I can do it with input by the user console read stuff but can I do it like this directly in code by referencing?
like I write a bunch of foods and when I start the program they all automatically get recorded in the restaurant without me having to put them in manually
and r.Foods is a list
https://paste.mod.gg/ewexeyotan.cs

#

c#

native helm
# nocturne galleon Why wsl tho?

Since I'd rather not use my laptop since my desktop is way more comfortable to do stuff on. Also, I'll be using this at my internship later on, and the work laptop I've got doesn't handle VMs good.

nocturne galleon
native helm
nocturne galleon
#

Ah alr

#

Yea sorry, don't know much about JS

#

Was just curious

native helm
#

No worries. Not so familiar with react or electron but was asked to test some stuff

#

pretty decent with js thou xD

warm sleet
#

@native helm try npm run build

native helm
#

hmm.. Running into an issue. I'm fetching from an AWS S3 ListBucket, looping through until I've fetched all items (10.000+) but it fetches some of them multiple times. Doing something like this:

async function getAllItems() {
  var marker = "";
  var done = false;
  var items = {};
  do {
    var chunk = await fetchItems(marker);
    // looping through the items fetching the values I want
    if (undefined !== chunk["ListBucketResult"]["NextMarker"]) {
      marker = chunk["ListBucketResult"]["NextMarker"];
    }else{
      marker = ""; done = true;
    }
  } while (done === false);
}

fetchItems is an async function that uses node-fetch to get the XML, and fast-xml-parser to convert it to json.

trim adder
#

.

royal lichen
tired juniper
#

can I put image as a background on a whole table column(which includes three rows) and the background is one image it starts on the first row and ends on the third but is only on the second column?
I tried putting every cell of the second column in a class and then do the background for that class but then the image starts again on each cell and I want it to start once and end once not have it start again for each cell
code https://paste.mod.gg/ozerabuxux.xml

latent summit
dense marten
#

Hello, I'm having some issues making a HTTP 1.1 server and I was hoping someone would be able to help me. I am trying to serve a video file to the client (firefox) so I respond with a 200 OK and start reading and sending the file, if I don't do anything this works fine and get me through the entire video. If I try to seek/scrub at all through the video firefox then closes the connection, and sends a new request with a range header, the thing is this range is always the last 29 KB or so of data from the video file. I respond with this data and then firefox never requests any more data so once the original buffer of video runs out the video freezes and won't play even if I try and scrub back to content it's already played. Any ideas?

dense marten
#

so I played around with my code a bit and made it so it sends 2 MiB chunks at a time now and made it multithreaded where each connection gets its own thread. I think making it multithreaded fixed it since I had to restructure the code and I suspect it was having issues keeping the connection alive and was getting blocked by a waiting accept() function where now each thread doesn't have to wait for that it waits on read() instead

abstract lichen
#

hi, im making a website and the css isnt working even though the items has the same class name
html

          <ul class="App-nav">
            <li class="Nav">Home</li>
            <li class="Nav">All Products</li>
            <li class="Nav">About me</li>
            <li class="Nav">Shopping Cart</li>
          </ul>

css

.App-nav {
  margin: 0;
  padding: 0;
  list-style-type: none;
}
.Nav {
  display: inline-block;
}```
calm venture
#

game dev friend tells me GMS2 can compile her game to ubuntu if she had a distro installed; i've been planning to install an archlinux-based distro myself, so i'm wondering if i could get her a native linux version of her game

#

would i be able to compile it with my own copy and licence of GMS2 through manjaro, despite it ostensibly being for ubuntu?

warm sleet
#

@calm venture never seen restrictions for software on a specific distro

#

usually, you compile your software against your kernel headers

#

and then it will run just fine

#

ubuntu-specific just means hat you get a debian package you can install.

nocturne galleon
#

if I download a full clone of my old repository, is there a way to view the actual commits and issues if I reupload? or was that only a github thing

#

maybe I can view commit messages but just not issues?

midnight wind
#

So yes of course

#

Issues on the other hand are a specific thing github made iirc

abstract lichen
nocturne galleon
#

aaah ok

native helm
latent summit
native helm
#

No, it's periodically updated, so every few days it gets a batch with all updates since last time. In general it doesn't need to get updated more than maybe once a month or so.

wide cradle
#

is this channel for software only or is hardware stuff ok too

wide cradle
#

ok poggers - back in like 2 weeks

cyan raft
#

That dank momment when you abandon your project to play minecraft with da bois

midnight wind
#

that's the commit history

haughty mist
#

oooh

#

Yeah i have one of those xD

#

But I mostly use git

#

so I dont see the site too often

midnight wind
#

with just a little on top

haughty mist
#

Yeah I set up a website's source and some game projects there, but I havent poked at the gui too much

ionic valve
#

Maybe you forgot the ./ in your link @abstract lichen

vale pine
#

Team GitLab here tho lol

nocturne galleon
#

alpha beta pruning isn't helping at all. All the time is spent creating the tree. The evaluation of the tree doesn't take much time at all so the alpha beta pruning isn't making it faster at all

tired juniper
#

can you tell me a simple function or way to sort an array alphabetically?
I don't want advanced complicated algorithms just a simple method or something

#

c#

limpid reef
# tired juniper can you tell me a simple function or way to sort an array alphabetically? I don'...

I don't really do much programming these days, but stackoverflow has answers to most simple questions. Whether the answers are "correct" is a whole other story. Also, do keep in mind that most teachers know people turn to sites like this for help, so don't just copy paste the code unless you can also explain how it works if asked.
https://stackoverflow.com/questions/16636554/sorting-an-array-alphabetically-in-c-sharp

tired juniper
#

yeah thanks I did it by the Linq method

pliant siren
#

I'm currently working on similar problems... but the array is of size 2^32 and the data that needs sorting is 256 bytes long ๐Ÿ˜„

#

Fortunately, the data is deterministic so there's some speedups you can use.

umbral saffron
#

The pi boots for just a second then switches to that

nocturne galleon
#

the color screan

umbral saffron
#

The green led turns off too

nocturne galleon
#

what os are you using

umbral saffron
#

Raspbian

nocturne galleon
#

is it stuck on that screen?

umbral saffron
#

Yeah itโ€™s still there

nocturne galleon
#

try re flashing your os, you might have corrupted your sd card

umbral saffron
#

Alright ty

umbral saffron
#

Now I need to fix this

#

Itโ€™s not formatted right

spring pond
#

thats probably a hdmi overscan issue

cyan raft
#

Recursively printing

pstree
``` to the terminal from python
rancid nimbus
#

You might have been able to extract the kernel files and copy them over to your PI sd card to get the PI to boot up.

#

Most Linux distributions keep a few older kernel so that it can boot to an older kernel if the newer one wasn't installed correctly. I have 32 kernel images on one machine.

clear thistle
#

geez

#

idk whether this is better suited for #crypto-currency or here, but

has anyone built a cryptocurrency before?
i mean, fully functioning with p2p netowoking and all

(literally all the tutorials on youtube just build a blockchain and call then call it a day. usually dont even save things as files or anything either)

umbral saffron
#

Does anyone know how to make the magic mirror custom?

torpid current
#

Is there a tool to safely run TFTP flashing for routers and not be like ages old ? (I know about tftp2.exe, etc. but they are not that friendly for less technical people)
I think a more user-friendlier tool would actually get more people to be customizing their home router.
I'd be willing to write one myself if there would be no good alternatives already and I wasn't able to find one yet.

Any suggestions ?

safe igloo
#

Hey guys, I'm searching how to make a discord bot that can start a program on my computer. Is it possible ?

safe igloo
#

I learned python yesterday so it's new for me, but cool ! Thanks for the info !

#

it's pretty simple tough

tired juniper
#

hey just a quick question can you use => as string splitter? For some reason in my task it says that the input has to be done like this

#

c#

umbral saffron
#

What would be a good free c# ide

rancid nimbus
#

Vim?

#

Emacs?

#

Nano?

#

Never mind I do not use IDE's as much as I should.

#

Maybe Visual Studios or Visual Studio Code.

cyan raft
clear thistle
violet cipher
#

If it ran on a server somewhere, it would be dangerous to try and execute something on your PC

warm sleet
#

@umbral saffron Visual studio community edition

#

Visual Studio code is just a lightweight text editor

#

but if you are going to develop and debug .NET apps, you need regular VS

umbral saffron
#

Ohhhh ok

#

Thanks

warm sleet
#

VSC is for things like typescript

#

and web development

#

python, etc

rancid nimbus
#

Vim and emacs could likely be modified to function like a IDE.

rotund harness
#

You can 100% develop and debug .NET Core apps in Visual Studio code. It was at one point just a light weight text editor, it is a full blown IDE at this point. It doesn't have all the features of "Visual Studio" but it has what "most" people need.

minor roost
#

@warm sleet if you add the right extensions for what you need, vsc has as much, if not more functionality then vs. there are just many more extensions, and less stock functions.

violet cipher
#

I find vim enough for simple projects, but once I work on more in depth stuff where I may not, for example, remember function names and such...

minor roost
rotund harness
#

Yeah VSC has evolved SO MUCH over the last few years. I am a software architect / engineer at a .NET shop. I uninstalled visual studio proper a long time ago and never looked back.

#

Extensions in VSC are so powerful.

minor roost
#

only problem i had with it is that debugging embedded systems can be a bit buggy or just randomly fail on start, and i think that is just a problem with my debugger's server.

rotund harness
#

Yeah - every once in a while I will run into a bug with an extension, - you tell them about the bug - and its usually fixed pretty quickly

#

If you find a bug wtih Visual Studio though - good luck getting that fixed ๐Ÿ˜‰

gleaming hatch
#

I've seen this one
It's a classic

minor roost
#

they even have an extension for the ksp code mod.

rotund harness
#

Isn't azure data studio just a vsc extension?

#

I know it is its own download, but I thought I remember that being started as an extension and then they decided to just offer it as a standa lone - but it uses the same core code

minor roost
#

i don't know, i mainly use google's services.

rotund harness
#

Ah, its not anything related to azure - its just a light weight replacement for Sql management studio

#

The naming is dumb ๐Ÿ˜›

minor roost
rotund harness
#

It "was" an extension but they broke it out into its own full fledged app, that is basically VSC for databases, with its own extensions lol

#

so its built on the same platform - I wish they had more db engine support - but its pretty nice and super light weight (and cross platform)

minor roost
rotund harness
#

Nice, I tried using AWS code in the browser thing

#

it was horrible

#

lol

#

Do not recommend.

minor roost
#

still waiting on that github codespace beta thing.........

midnight wind
minor roost
#

github 2077 ? anyone wanna subscribe?

#

been waiting for a response since.... last year probably

midnight wind
minor roost
#

no, but they say it's a closed beta. maybe your institution got access?

midnight wind
minor roost
#

look at this lol

gleaming hatch
#

i said "i sure do love the word out of stock"

cyan raft
crystal hawk
loud kelp
#

I like how I understand just enough computer science to get this

crystal hawk
#

I had the good fortune of being interviewed on caches the day of, ie 30 minutes after my final on computer architecture ๐Ÿ˜›

loud kite
#

Epic

clear thistle
mystic coral
#

Wanna develop games?
Start today. Develop browser games easily.
This is the very first video of my Game development series using JavaScript.
Hope you like it ๐Ÿ˜€
Develop JavaScript games.
This is very first Tutorial of game development series..
https://youtu.be/2sMcvCLd5PI

Build a Memory Game using JavaScript, HTML5 & CSS || JavaScript Game development Series || Part-I

In this video, we will be developing the amazing Memory Game using HTML, CSS and JavaScript. We will see how we can add various levels to the game and maintain the users score as well.
This is the very first part of the JavaScript Game development...

โ–ถ Play video
warm zenith
#

who here hates me

#

(this is a fully functioning reaction roles bot I made)

rotund harness
#

One liner + taking a screen shot by using their phone...

rotund harness
#

Is something really open source, if no one wants the source?

nocturne galleon
#

Technically . . .. . . . . .
yes

cyan raft
warm zenith
#

but I guess that just makes it funnier in a massochistic kind of way

bright grotto
bright grotto
#

Did you come from C# or something

warm zenith
#

no

#

I came from hypercube

bright grotto
#

Can't say I've heard a lot about that

warm zenith
#

it's incredibly obscure

bright grotto
#

Just be wary people will likely slate you for naming your classes that way in Java from what I've experienced

warm zenith
#

really?

bright grotto
#

yup

warm zenith
#

why? it literally doesn't affect anything

bright grotto
#

Something something readability something

warm zenith
#

as long as it doesn't start with a special character or number, right?

bright grotto
#

Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).

warm zenith
# bright grotto Can't say I've heard a lot about that

but it's a part of a minecraft server where they luse minecraft blocks to represent events, actions, if statements, etc. it's actually quite powerful for what it is. So don't be confused if you can't look it up online lol

bright grotto
#

Lmfao fair enough, I make Minecraft mods in my spare time

warm zenith
#

nice

bright grotto
warm zenith
#

I'd actually recommend checking out the server, it is very very intuitive and easy to learn as well as not dumbed down for experts

#

also lots of doctor who stuff

bright grotto
#

yup

#

big fan

warm zenith
#

I used to be, but they took it off netflix before I ever had the chance to finish it

#

I was on the 12th doctor, too

bright grotto
#

outside the us? i recommend getting britbox or use bbc american if so

#

anyways, i worry we're taking this channel off topic

warm zenith
#

yeah

bright grotto
warm zenith
#

I've always wanted to make minecraft plugins and mods

#

but hc is a great substitute while I learn actual java

#

plus it also has a player base so you can get people to play your game like, immediately

#

which is cool

bright grotto
#

cool

#

forge and fabric modding for mc isnt too hard

#

once you know the basics of java tho

warm zenith
#

yeah I've created very very simple mods

#

oh do you by any chance know how to do guild specific stuff on discord bots?

bright grotto
#

depends on the api

#

im assuming jda?

warm zenith
#

yeah

#

I was planning on looking it up later today lol but you seem to know what you're doing so I thought I might ask

#

I learn better from a person than a wall of text

bright grotto
#

well, i never looked into sharding discord bots (creating a instance per guild)
but for a basic approach if you dont expect your bot to be used in a load of servers is to just check the server id of the message

warm zenith
#

well I ask because I'm currently working on a bot, but I wanna make it so all the reaction roles and such aren't hard coded

#

and afaik there's no way to save a variable after a restart

#

or name a variable the ID of a guild (which by the way would be SO useful)

bright grotto
warm zenith
#

oh my god you can do that?

bright grotto
#

well yeah

#

just read and write a json to the programs run directory

warm zenith
#

oh this opens so many possibilities lol

#

oh, to be a novice java developer in an oversaturated discord bot market

bright grotto
#
  public static String lttDiscordID = "375436620578684930";
    
    @Override
    public void onMessageReceived(@NotNull MessageReceivedEvent event) {
        Message message = event.getMessage();
        if(!message.isFromGuild()) return; //Guild messages only
        if(message.getGuild().getId().equals(lttDiscordID)){ //Is Ltt Discord?
            // Do something 
        }
    }```
#

How to only do something in one specific guild

warm zenith
#

well no duh

#

I do that

#

but I meant not hard-coded, like how reaction roles work

bright grotto
#

I would not know that as I don't have your code in front of me and you asked how to do guild specific things o.O

warm zenith
#

but save to disk does what i want it to so

bright grotto
#

glad to have been of help then lmao

shrewd canopy
#

I think you just want to save both the message ID and role ID for the reaction message to disk

warm zenith
#

thanks lol

shrewd canopy
#

Then when someone reacts to that message read from db

bright grotto
#

^^

shrewd canopy
#

However im not sure how the Java lib works, but the nodejs one doesn't receive the events after it has been restarted

#

Just something to keep in mind

warm zenith
#

finna learn how to make a database today B)))

bright grotto
#

sql aint too hard to learn

umbral saffron
#

I need pcb controller mounding ideas

#

Itโ€™s for a drone I made

rancid nimbus
#

Use lots of hot glue.

umbral saffron
#

I mean like what do I do with it

#

A custom remote housing, on my arm

minor roost
#

is that an IR transmitter? how do you intend to have it on your arm and still keep it pointed at the drone? @umbral saffron

umbral saffron
#

If I mount it on my arm with the LEDs sticking out then I just turn my arm and itโ€™s pointing at the drone

lament cave
zenith depot
#

Anyone here know how to use unity and mind helping me fast?

nocturne galleon
#

PSA: Any of you who use github, check out the chinese website CSDN for your code. Even if your code is free, someone else is able to make money from it by posting it on this website. I know it may seem unimportant, but I don't read chinese and I also can't use WeChat to report the offending listing.

hallow pilot
#

Are you talking about persisting a little bit of program state between restarts?

#

sqlite is amazing but may also be overkill. I'd start with serializing an object to a text file ๐Ÿ˜‰

violet cipher
#

It all depends. Sqlite is fine if one can also afford to loose the information stored inside due to unrecoverable corruption (SQLite isn't, unlike a full fat RDBMS, very corruption resistant).
Serialized objects are also fine, just depends on how much one needs to perform operations with the data before loading it. Stuff like filtering

inner wraith
#

Honestly SQLite is much more corruption tolerant than you give it credit for.

#

Sudden poweroff's not that big of a deal, multiple applications accessing it simultaneously is safe as of version 3 with any vaguely modern operating operating system.

#

It's certainly more tolerant than serialised objects with no extra precautions, which handles neither of these safely.

#

Faster, too, as you don't have to load, edit and rewrite the lot for every change.

#

If you want corruption tolerance you should back your data up regularly. A "full fat RDBMS" will not save you from data loss if the disks it lives on die.

warm sleet
#

if you need more flexibility, try YAML

#

if you have a large dataset, consider a middleware database

#

@inner wraith its not multithreaded.

#

That's SQLites biggest problem

#

it doesn't scale.

#

it only really finds its use as configuration storage on embedded devices like in mobile apps

#

pretty sure that sqlite also doesnt enforce constraints, and doesn't have any transactions because of it being singlethreaded

#

so yes, data corruption can certainly still happen from application faults, if transactions are not properly committed. They can also not be corrected because there is no transaction log which can be used to rebuild the database in case of a fault.

inner wraith
#

Oh I'm perfectly aware that it doesn't scale for writes.

#

It actually does scale for reads btw (up to disk performance).

#

But the requirement was small, and simple.

#

It is vastly better than JSON, XML or YAML for the stated purpose because you don't have to deserialise and reserialise the lot on every update.

#

You mentioning threading is bizarre. Threads are not the issue, you can have multiple threads with SQlite... It just has to lock the file on disk for writes, putting a cap on write performance.

#

@warm sleet

loud kelp
#

Do any of you know anything about making oscilloscope software?

pliant siren
pliant siren
gusty girder
#

Hey guys. I got an SQL/EF Core 5 question for y'all:
I have a table Users, a table Games and a table Images.
Can I set EF Core 5 is such a way that both, user and games have a 1to1 relationship with images?
I dont want to have separate GameImages and UserImages tables.

edit: nvm figured it out.

pliant siren
#

You know how 8k cameras have crazy high data rates to store data? Well, oscilloscopes are like that.

loud kelp
#

Aw, and here I was hoping to make a cool effect to use with my live stream setup.

pliant siren
#

If you just want to sample it and plot an image it can be fine. But consider how many data points you need to sample and record if you're trying to represent say, a digital signal running at even 40MHz.

loud kelp
#

I take it the average video editing rig isn't going to be sufficient, then

pliant siren
#

It's not so problematic if it's just a continuous repetitive signal you're trying ot represent, but if you're trying to actually look for and measure changes in that wave? That's when you get in to crazy territory.

#

If all you want to do is ignore abberations and outliers, it's fine. But if you're talking the kind of oscilloscipe and equipment you might use for diagnostics? There's a reason they're expensive.

loud kelp
#

Well as I said I just want to make a cool visual to use on my Twitch stream
Nothing diagnostic about it, heh

#

But if that's the kind of quality it takes to make a nice visual, then I suppose I'll have to explore other ideas for the visual

inner wraith
shy helm
#

File locks render the DB effectively sequential access only

#

Also, reads are not fast, because SQLite requires file loading per connection, which is not at all like how normal databases work (where the DB reads to memory, amortized read across all apps)

hollow basalt
#

I kinda considered SQLite as a dev db

#

though I know it is much more than that

inner wraith
#

(Do people here think I'm suggesting Google switch their search engine databases over to SQLite or something?)

hollow basalt
shy helm
#

Nope, just pointing out why talking about concurrency isnโ€™t odd?

inner wraith
#

This was in regards to someone wanting to store a bit of state per guild for a Discord bot. And concurrency != multithreading, which they claimed was impossible.

shy helm
#

SQLite is also not very corruption safeโ€”Iโ€™ve had DBs randomly corrupt without recovery over a weekend for no reason, it also has poor handling of malformed data, which can brick tables and are annoying to recover from (since SQLite doesnโ€™t enforce column types)

inner wraith
#

The proposed alternative was serializing JSON.

shy helm
#

SQLite is just CSVs, so not much different

inner wraith
#

Uh... no.

shy helm
#

Iโ€™m being emphatic ๐Ÿ˜œ

#

Iโ€™m very familiar with SQLite, as someone who inherited a fairly critical app which uses it at work

#

Note: donโ€™t let non engineers build stuff

inner wraith
#

I've seen some really stupid stuff when people with idea of how to plan a system out just bolt things on ad-hoc until every query takes a few minutes.

#

Current workplace has this issue bad.

#

Just inherited 3 systems with this problem about 2 months ago and I'm slowly cleaning up one of them because their solution was using BigQuery as a timeseries database (oh but we'll change historical events sometimes and break it).

shy helm
#

Oh god

inner wraith
#

Please do not use BigQuery as a general-purpose database!

shy helm
#

Ugh, Iโ€™ve had teams do something kinda similarโ€”they used SyBase IQ for everything

#

โ˜ ๏ธ

inner wraith
#

It currently has ~50 small clients and costs $3k a month or so in query costs.

#

You pay per gigabyte scanned when you run a query.

#

Table's now partitioned on timestamp, so per-client report costs scale with the global data ingest size rather than with all data ever, so hooray.

#

You have 100 same-size clients rather than 50? All queries now cost double.

#

TLDR: When making software that scales to infinity in the cloud, make sure you actually think about what would happen if it did.

pliant siren
fervent orbitBOT
lament cave
#

what???

nocturne galleon
#

All that hardwork must have really paid off, right?

#

Right?

celest imp
#

Pretty easy question i suppose but i dont know anyone who could answer it:
Is PHP dead? i have an option between HTML/CSS course vs a PHP one.
They say at the school that PHP one is pretty easy but i don't want to learn something i wont have full value of if its going down the drain.

spring pond
#

from what i know php is more similar in use case to something like python or node js

#

id personally recommend node or python over php, but you should take that html/css course regardless

#

@celest imp

celest imp
#

Thanks for input @spring pond. similar answer from what i've gotten on other places, so guess il go CSS then php if time allows it.

shy helm
#

To be clear, HTML/CSS are not programming languages

midnight wind
#

Yeah, and all major websites don't write pure html/css

#

Its always a framework

celest imp
#

I mean i've already finished C# and starting python in 3 weeks. have to expand due to points to get in to another school. rather learn something IT wise instead of History of bangladesh or something.

hallow pilot
#

If you're looking at maximizing utility, I'd probably do the html/css thing if you're not yet very familiar with them. It's something that just about all major web tech stacks have in common. Take any frontend framework, any backend framework, and they're probably producing HTML and CSS. Even if they have you build the UI out of some other primitives, it's good to understand what is happening in the browser.

celest imp
#

Yeah makes sense. I've marked myself for HTML/CSS now and having PHP as backup/future one unless something else pops up.
due to Distance EDU right now here its a bit finicky to get into to some courses so i take what i can ๐Ÿ™‚

hollow basalt
#

you can self-study

#

or that isn't possible?

celest imp
#

with kids a job house and wife, Not much time left sadly

#

need the course points as well to have it as a valid excuse to cut down worktime for moneeys

exotic glacier
#

anyone up for a c++ problem?

#

i may or may not be an idiot

#

cout << "Digite o " << numDeInput << " numero : \n";
cin >> ntemp;
if (numDeInput == 1)
{
break;
}
else
{
input[numDeInput] = ntemp;// guarda o valor digitado no local x do array
numDeInput++;

    }//os numeros 1 ,2,3,4 estao no array input
}

numD1 = input[0];
numD2 = input[1];
#

in this code on line 3 if i have it ==1 it never stores on the [1] position.

#

if i have it to ==2, aks for the input 3 times and only then saves it to [1]

#

i cant for the life of me figure out why

#

supposed to ask for two inputs and save them to [0] and [1]

languid canopy
#

quick question, where did you learn C++, I have been learning C# making discord bots ect. but am limited to what i can do

#

C++ seems to be better for communicating with games so wondering where you learnt

exotic glacier
#

im in university

#

trying to learn it , really haha

languid canopy
#

ahhh yeah thats fair enough, that'll teach you ๐Ÿ˜‚

#

thanks for the help anyways!

exotic glacier
#

im at a point if i dont know if im being very stupid. or something is borked

languid canopy
#

i know the feeling

midnight wind
#

still learning

languid canopy
#

i spend 4 hours filtering a list earlier.... yes i was being stupid ๐Ÿ˜‚

languid canopy
midnight wind
#

stuff like Arduino

languid canopy
#

ohhhh i see

#

thats pretty cool

#

i would like to get to that stage at some point just gotta change jobs first

#

full stack web dev seems like the best option

exotic glacier
#

am in fact an idiot, thank you !

#

cause it was what i saw on stack overflow

glad glen
#

So I've got a 7* 6 2D array (width* height) in python. Say if I have a particular array index like [5][4], how can I return the positive and negative diagonals as separate lists?

languid canopy
#

Yeah im planning to make a plugin for a game to output information which can be handled with a bot

#

possibly expand it to allow more people to get involved with developing plugins for the game without having to learn C++ by allowing them to access all the data via the C++ plugin

#

thats the plan anyways xD

#

think I will need it tbh ๐Ÿ˜‚

placid zinc
#
@bot.command()
async def wanted(ctx, user:discord.Member = (None)):
 if user==None:
  user = ctx.author
 wanted = Image.open("wanted.jpg")
 asset = user.avatar_url_as(size=128)
 data = BytesIO(await asset.read())
 pfp = Image.open(data)
 pfp = pfp.resize((284,284))
 wanted.paste(pfp, (88,229))
 wanted.save("profile.jpg")
 await ctx.send(file=discord.File("profile.jpg"))
#

Poggas

warm sleet
#

Anyone know how to get Visual Studio code to be aware of Angular concepts?

#

I've created some components, and now wish to have syntax completion when doing string interpolation

#

I added the Angular Extension Pack, though I still do not interpolation with autocomplete.

hallow pilot
#

Like, inside the .html?

nocturne galleon
#

Anyone here know how to port a linux application to macOS (ie. re-compile an app for macOS)?
Do I just have follow the compile instructions?

warm sleet
#

@nocturne galleon any app specifically?

#

@hallow pilot Yeah. But I concluded it was caching. Restarting the editor suddenly made it work.

nocturne galleon
warm sleet
#

@nocturne galleon Its .NET Core

nocturne galleon
#

Yup

warm sleet
#

Yeah so that probably runs fine on macOS

nocturne galleon
#

Alr, Thanks

nocturne galleon
#

Thank you but I already installed it

warm sleet
#

fair

rotund harness
warm sleet
#

@rotund harness well, just lack of autocomplete in my component templates

#

it doesn't immediately recognize functions that I created

#

I'm used to using WebStorm

#

but my employer does not pay for this sadly enough

#

really miss my IDE :(

midnight wind
#

what are you having trouble understanding

#

for promisses specifically

#

I reccomend to use async/await for more readable code

#

which is just synatic sugar on top of promisses

#

@unkempt sonnet

umbral saffron
#

Iโ€™m trying to use an old psvr for a project, and Iโ€™m trying to connect it to my Mac

#

The only thing Iโ€™ve found is MacMorpheus

#

Has anyone used it? I need help setting it up

rare dagger
#

''undeclared identifier''

#

help

warm sleet
#

@unkempt sonnet the solution: do not use plain javascript

#

typescript has a whole language construct for async code, and it takes out all the crap that javascript does

#

async functions, which you can await for

#

async functions return promises, which you can either wait for, or callback

#

typescript has this built into the language, so you don't need to declare promises, it automatically wraps them

#

async getSomething(): Promise<string> { }

#

you can then wait for: const something = await getSomething()

#

if you don't use await, it will return immediately and set something to a promise of type string.

midnight wind
#

js has async/await

#

I am learning ts though

#

for the types and everything

#

and checking

warm sleet
#

@midnight wind how is it so far ? :o

#

not bad eh?

midnight wind
#

the hardest part is the beggining since I want to keep it maintainable

#

so like, do I keep each command in it's own object?

#

do I do this

#

do I do that

#

basically it's a bot that takes info from this API

#

caches it in redis

#

and you can do things like this

#

what I have trouble with though is the caching of the actual embeds since they have classes and you can't serlize them. So for now I just turned off caching for the embeds and just did the api requests

#

and on the other hand I need classes for the embed since I need to add the In <time>

#

I just need to redesign how I do it

warm sleet
#

@midnight wind the trick with loose functionality you'd want to put in a class otherwise, is to use constants with functions in them

#

so const myfunction = () => { //body }

#

you can import these from any other location

#

without needing a class instance

midnight wind
#

what I was also thinking is to just cache the data, but then when it's retrived from cache and deserlized it will tag on methods

#

this mess..

sand kayak
#

If someone wants to do a paid commission to make 2 Youtube chat commands (with API's inside of them) send me a message. $30 USD for re-making these 2 commands from Twitch over to Youtube.

I'll send you all the documentation and API related stuff, so yeah let me know

hallow pilot
#

Lol that's some discount software development ๐Ÿ˜‰

Do you already have a bot in the youtube chat thing?

rotund harness
#

Yeah, I feel like asking a dev to do something for 30$ is more insulting then just asking them to do it for free. You probably would be better off with something like "Anyone available / willing to help with some youtube bot? I have it working in twitch but want it working in youtube."

#

That being said, might be students in here - that just want something to do - who knows :/

sand kayak
#

I'm not asking someone to make a bot. It's just two commands in nightbot.

#

You plug in variables to read a YouTube chat api in both examples. You're not programming a new bot, just creating two commands within http://nightbot.tv

hallow pilot
#

Ah, okay, that makes more sense. It's making a new nightbot command, within nightbot, using their syntax. Not general-purpose code in a general-purpose bot.

Their docs describe integrations that pull information from a bunch of third-party sources, including Twitch, PSN, etc.. but I don't see anything about YouTube: https://docs.nightbot.tv/commands/variableslist

sand kayak
midnight wind
#

yea, kinda

#

sure

#

widget?

#

There's embeds

#

but those are just fancy messages

#

not really iirc

spring pond
#

afaik there is no โ€œlive updateโ€ functionality for discord

midnight wind
#

really all you have is updating the message

minor roost
#

do you know how to disable the auto bracket-new-line in vscode c++?

hallow pilot
#

identify the plugin responsible, and see if it has any settings you can change?

#

I haven't used it in a while, but it looks like the plugin respects .clang_format

nocturne galleon
sand kayak
warm sleet
#

@sand kayak are you looking for a program to stream to youtube?

#

its just a bit annoying to configure, because these kind of network thingies are very strict, can't mess up :3

#

and nomenclature is always a bit confusing if you dont work with it

sand kayak
#

@warm sleet im looking for someone to make two commands within nightbot (http://nightbot.tv) that pull data from YouTube api's

warm sleet
#

mh. not really my world

nocturne galleon
hallow pilot
vocal nova
#

Just want to show of a pic of a synth i'm working on โค๏ธ

cyan raft
#

He's prlly reusing the same code

pliant siren
#

Yeah, you want promises. What you're asking for is basically what makes javascript ugly and difficult to use compared with other languages.

hallow pilot
#

async is contagious. afaik there's not a great way to get back to synchronous. so you have to let msg = await getID(); , which means you need to be in an async function, which means that needs to be async, all the way up to your entry point

#

What kind of execution environment? (web browser? node.js?)

lone hornet
#

I'm having trouble understanding this prompt from my textbook "Declare an array of three pointers to functions and invoke the appropriate
function based on an index value passed in as an argument.". can someone clarify what pointers to functions mean?

midnight wind
#

msgID would be a promise value. What you want is let magID = await getID(); but that wouldn't work if it is not in a asyc function. What else you can do is this js let msgID; getID().then((id)=>{msgID = id})

#

They lower would work ona top-level

#

Async/await is just a wrapper around the function().then.then.finally.catch syntax

#

But async await is much more readable than promise chains

elder nebula
#

does anyone know how to use an if statment along with an else if to play sound
with a list of numbers associated

#

this is js btw

elder nebula
#

wdym?

elder nebula
midnight wind
elder nebula
#

I work in code.org because my school makes me

#

I don't think that statment is in code.org

midnight wind
elder nebula
#

besides i dont think our teacher expects us to know what that is

midnight wind
#

switch is the best one

#

js is js

#

coding is constantly looking things up

midnight wind
elder nebula
#

ig well thanks for the help

fickle verge
#

its a clock

midnight wind
#

yes

#

lots of calls to discord api

#

I think there is a limit

loud kelp
#

Proud of my team for getting a new version of our game out today

lone hornet
rancid nimbus
hallow pilot
brisk sparrow
#

Does anyone code here and if so what software do you recommend. I've finished a couple ap computer classes over java and I wanted to code over the summer(doesn't have to specifically be for java). I've used visual studio but I've heard people trash it so I was wondering if there were better alternatives

undone pond
#

I personally use Atom. Atom is more than enough for me lol

#

but for java, you may want to use Jet Brain's IntelliJ IDEA

brisk sparrow
#

ill try it out

#

๐Ÿ‘

undone pond
#

notepad++ is alright, but please don't use normal notepad KEKW

hallow pilot
#

Interested in other languages? Or just more tools to Java with

nocturne galleon
#

monke

brisk sparrow
hallow pilot
# brisk sparrow yeah im kinda looking to dip my toes into a couple languages

Whatever language(s) you choose, I'd recommend https://exercism.io/ for a series of small exercises to work through.

I wish I'd been exposed to functional programming earlier when I was learning. (maybe try F# or Clojure)

brisk sparrow
#

alright thanks, Ill take a look at it

warm sleet
#

@brisk sparrow IDEA Community edition

hollow basalt
#

hard to beat that IDE

warm sleet
#

If you are looking for a java IDE, look no further

#

Its hands down the best one on the market

#

I've been using ultimate for the last 8 years now, and I cannot really go without it anymore

#

@hollow basalt the ultimate version can also be used for web development, python, node, etc

warm sleet
#

plugins are free for the ultimate version

hollow basalt
#

spring

warm sleet
#

ew

hollow basalt
#

ehh, it's what the work needs

warm sleet
#

I know IDEA integrates with spring

hollow basalt
#

sooo

warm sleet
#

but that doesn't fix the shittyness that is spring.

hollow basalt
warm sleet
#

my new workplace uses spring for everything

hollow basalt
#

must be fun

warm sleet
#

and they have a "micro"-service for OAuth2 tokens

hollow basalt
warm sleet
#

and the binary + libraries = 85MB in size

#

80% of that is Spring.

hollow basalt
#

time to migrate to boot

warm sleet
#

no

hollow basalt
#

for even more lel

warm sleet
#

Time to migrate to Spark

#

You really do not need much for a tiny rest service

hollow basalt
#

spark is nice especially kotlin

warm sleet
#

I wrote an MVC framework ontop of spark xD

#

with route handling

hollow basalt
#

i see that sparked your interest

warm sleet
#

dadum

#

tss

hollow basalt
#

haven't used spark yet

#

but seems a lot more lightweight than spring

#

like a ton

warm sleet
#
    private static TemplateViewRoute createCall(final Method method,
                                                final Object provider,
                                                final boolean login) {
        return (request, response) -> {
            try {
                if (login && !session(request).login()) {
                    LoginHelper.login(request, response);
                    return null;
                }
                return (ModelAndView) method.invoke(provider, request, response);
            } catch (IllegalAccessException | InvocationTargetException e) {
                throw new InternalServerErrorException(e);
            }
        };
    }
#

@hollow basalt pretty neat ^

#

this takes a service method, and service object instance

#

and a boolean if the user is logged in or not

#

it generates a function

hollow basalt
#

yikes, that code makes me feel like I'm using js

warm sleet
#

that handles the request

#

@hollow basalt the entire route resolving is done with lambdas

#

it wraps the target method

hollow basalt
#

I do like lambdas

#

but for simple anonymous functions

warm sleet
#

@hollow basalt yeah but the thing is

#

route discovery is done through reflection

#

I scan types by annotation

#

and register them in a list

#

(ModelAndView) method.invoke(provider, request, response);

#

this is a reflective method invocation

#

this.getClass().getMethod("foo").invoke(this, "hello world");

hollow basalt
#

I also use reflection in spring, but tbh. i don't like it that much

warm sleet
#

@hollow basalt its the one thing that makes OO powerful lol

#

reflection.

hollow basalt
#

yikes

warm sleet
#

yeah..

#

xD

#

its one gigantic functional-loop

hollow basalt
#

"lambdas for simple"

warm sleet
#

first part filters classes from service classes

#

the second part

#
                        Arrays.stream(p.getDeclaredMethods())
                                .filter(m -> m.isAnnotationPresent(GET.class))
                                .forEach(m -> {
                                    String mPath = "";
                                    if (m.isAnnotationPresent(Path.class)) {
                                        mPath = m.getAnnotation(Path.class).value();
                                    }
                                    m.setAccessible(true);
                                    route.addRoute(
                                            new Tuple<>(
                                                    RequestMethod.GET, combinePath(path, mPath)
                                            ),
                                            createCall(m, object, m.isAnnotationPresent(RequiresLogin.class))
                                    );
                                });
#

goes over each method of that service class

#

checks if it has a GET annotation

#

then it checks for a path (class and method can define a path)

hollow basalt
#

idk man, do you like the annotation more?

warm sleet
#

:D

#

annotations โค๏ธ

hollow basalt
#

i kinda like explicit registering them

#

like
app.register("/",GET) or some sht

warm sleet
#

@hollow basalt well thats the thing

#

that getRoutes() method

#

returns a list of elements that can be app.register()'ed

hollow basalt
#

i kinda like "explicitly" doing it, than being wowed with the magic of "it just works"

warm sleet
#

@hollow basalt well.

#

idk

#
@Path("status")
public class StatusController {

    @GET
    @Path("service")
    @RequiresLogin
    public ModelAndView getServiceStatus(Request request, Response response) {
        Map<String, Object> models = new HashMap<>();
        ServiceAPIClient client = session(request).getClient();
        models.put("services", client.getStatus().getService());
        models.put("servers", client.getServers().getServer());
        models.put("page", "Status");
        models.put("page_desc", "Services");
        return new ModelAndView(models, "status/service");
    }
}
#

I think this is pretty nicely done ^

#

this is the code it 'reflects' over

#

this registers a GET to /status/service

hollow basalt
#

-> @RequiresLogin , your auth middleware i assume

warm sleet
#

@hollow basalt that's actually a JavaEE annotation

#

but yes, I implement its functionality

hollow basalt
#

and that's why I don't usually program in java

warm sleet
#

createCall(m, object, m.isAnnotationPresent(RequiresLogin.class))

#

^ see

#

@hollow basalt requires login just forces a redirect to the login page

#

and encodes the original URL as a parameter

#

after login

#

it redirects you to the place of origin