#development

1 messages · Page 80 of 1

spring pond
#

my main uni project is an app with ~7-8k loc (combining client and server repositories)

fickle verge
#

I see

#

Thanks

deft sigil
#

wish i could give you a name but:

#

and the syntac highlightingg is a highly customized version of Molokai (not monokai wich is widely availeble) but i had a scintilla based text editor 15years ago wich had it and ive been replicating it as needed

#

not to pleased with pycharm btw , from the second a project gets large (try a decompiled version of the ableton midiremote scripts ) and im waiting for letters that i typed to appear, and wtf is wrong with the code error analiser (see first screenshot) sometimes its really off mark (a = "test" ) and marking test as unreferenced :S and also the newer versions really pain me im still running 2020.3 (was 2020.1) but its the olderst the toolkit offers for installation

#

why not vscode ? i really like my env to work with me and not against me from where things are located eg, usually this means i want it the way i had it before , good or bad, and i was used to running aptana but verry customized aswell. syntacs is for some to much a colorbook i know but i can set my mind to focus on a specific color when searching for things and these make that easier, aswel as {([ wich i tend to mix up visually in verry different collors

pliant siren
wicked thorn
#

how do i make a discord bot stay on after i close VS code?

midnight wind
#

You need to host it

hollow basalt
#

run it in cmd, then run your computer 24/7

midnight wind
#

A remote server, a local pi, some extra computer, run your computer 24/7

fickle verge
#

Im trying to solve this

#

im stuck at the sorting part

#

ive used pythons built in sort

#

but it wont sort the fractions in ascending order

fickle verge
#

nvm solved it

obtuse night
#

Just been offered my first DevOps job! Super excited although I have a lot to learn

split rose
#

no

#

LOL

#

wtf is the python institute

#

^^ average admissions officer or interviewer reaction

#

Cisco would prob help you to get a job tho, ime

#

would put you ahead of some kids in internship applications

hollow basalt
#

CCNA is 3 years valid. probs better to get it while in UNI, so it's still valid come the time of intern. Though ofc you can get recertificiation

pliant siren
#

You mean my CCNA I did 20 years ago isn't valid? boo 😦

#

'valid' or not, believe me, knowing even the basics of networking puts you ahead of 90% of other devs. I don't understand why, but apparently it's a dark art to most.

midnight wind
red mulch
hollow basalt
#

∴ most people are people

pliant siren
#

therefore, not all people are people.

#

Quick, someone check the validity of this code!
def check(p:Person): return isinstance(p, Person)

hollow basalt
#

Needs : at the end of the first line

pliant siren
#

this is why I hate the idea of doing SDE interviews without an IDE 😄
(also, I don't do Python - I just used Python here because I know it's a specific case where Python's shitness can enable crap like this to happen)

hollow basalt
#

Dunno what sde means in this context

#

Had an interview once with a supposed code editor in thr browser.
But it's just glorified notepad that can be seen by everyone

#

Not even syntax highlighting

pliant siren
#

SDE = Software Development Engineer

hollow basalt
#

Oh i see

pliant siren
#

I have another interview (for a tech lead) in about 90 minutes... I've already kinda lost interest in it heh

hollow basalt
#

tired of python ai?

pliant siren
#

hah

#

nah, I'm not applying for any jobs that want Python to be used. Ruby, Rust and Golang I'm also not really applying for positions on - which is unfortunate because Microsoft/Github are all Ruby.

hollow basalt
#

So pretty much you're accepting java jobs

pliant siren
#

Java is the primary target; I'd be keen on typescript, javascript is kinda a necessary evil these days, happy to go back to doing C if need be (but there's not too much of it around)

hollow basalt
#

I also want to try c/c++ SDE, but there's way too few

pliant siren
#

Kotlin and Scala pair with Java often.

hollow basalt
pliant siren
#

I've never had to use them - but yes. Good/senior devs will pick up a new language in 3-12 weeks, swapping between languages is just what we do.

hollow basalt
#

JRuby

#

tbf, i don't really have experience with Ruby.
use it occasionally cause someone thought Ruby as a DSL is a good idea

whole ember
limpid reef
whole ember
#

This is hilarious

#

How have i never seen this before

limpid reef
# whole ember How have i never seen this before

Sorry, I'm going to need you to compile your comment via TypeScript, send it over to a SCSS parser to transpile it into LESS, then minify it into CSS before passing it through to my Laravel instance that only works with PHP 7.2 on a Lightspeed server, but only if Python2 is installed. 😄

whole ember
#

this is amazing

#

its also scarily accurate

limpid reef
#

To clarify, I'm laughing with people here... not against them. I tried to go down the developer route multiple times over the last 15 years, but have stuck to design-based work, touching lightly on PHP frameworks, most recently Laravel projects. I do not write my own projects though - I prefer to make improvements to existing projects. Massive respect for actual developers, cause the waters they have to navigate these days are far muddier than they were even 10 years ago.

whole ember
#

ah, thats cool

#

being a designer sounds awesome, sadly my sense of design is quite bad

whole ember
limpid reef
# whole ember being a designer sounds awesome, sadly my sense of design is quite bad

Eh, design has its' own quirks... -_- https://www.youtube.com/watch?v=BKorP55Aqvg

Subscribe for more short comedy sketches & films: http://bit.ly/laurisb Funny business meeting illustrating how hard it is for an engineer to fit into the corporate world! Watch the next episodes: http://bit.ly/SquareProjectEp1, http://bit.ly/SquareProjectEp2 & http://bit.ly/SquareProjectEp3

Starring: Orion Lee, James Marlowe, Abdiel LeRoy, Ewa...

▶ Play video
limpid reef
#

It's design project management hell, regardless of whether it's design, development, or any form of consulting. 😄 "Can you draw one of the lines in the form of a cat?" -- get's me everytime.

hollow basalt
limpid reef
#

I wrote that poorly - scratch was the wrong choice of word. Corrected it. What I meant was I'm a poor self-starter. 😦 Thrive far better when helping someone else improve upon an existing "thing".

hollow basalt
#

Massive respect for actual developers, cause the waters they have to navigate these days are far muddier than they were even 10 years ago
Indeed, used to be good in a language and concepts

#

now needs to be good with 10 frameworks with tools double that

limpid reef
#

Eh I try, when I can at least; otherwise I say "nuh-uh, not my area of expertise, sorry." Get all sorts of requests outta left field when people at work are stuck in the middle of a project.

hollow basalt
#

btw, random question. what camera do you have. DSLR or mirrorless or other. we don't have #camera

limpid reef
#

Yeah, something like that. A technical swiss army knife, if you will. Jack of all, master of none.

pliant siren
limpid reef
pliant siren
hollow basalt
#

hooked up to use with BeatSaber Mixed Reality

#

what now

pliant siren
#

The 7D does 1080p video. So I'm using it with a 10-22mm lense as a webcam via USB for mixed reality streaming 😄

upper cliff
#

So my university is offering an online Intro to Python Programming course, it is 4 weeks long and if successfully complete the course and the final assignment, will receive a Python Foundations digital badge. Does anyone know if this badge mean anything? Would it be helpful on resumes and job applications?

full socket
#

my teacher taught us zero javascript in any capacity and now gave us a jquery assignment thats due tonight

#

Lol, god

#

so incompetent

split rose
#

jquery

#

lel

#

wtf kind of class is thqat

hollow basalt
upper cliff
hollow basalt
upper cliff
vestal spire
#

how would i setup nvidia cuda for tensorflow? When I run the nvidia installer, it says that it tries to install an old driver. Is this normal? I'm trying to run deep learning code for my homework

hollow basalt
#

what installer is that

#

the regular gpu drivers?

vestal spire
#

nvidia CUDA

#

for deep learning stuff

neon nimbus
#

@vestal spire make sure the cuda version is compatible with your driver and GPU.

little ibex
#

oops

viral heath
#

hey i need help with C

#

anybody who knows it and can help me?

#

its a beginner problem

#

im getting these errors: error: break statement not within loop or switch
and
error: 'default' label not within a switch statement

#

ima send the code

#

rn

sturdy ingot
hybrid sky
pliant siren
hollow basalt
#

^

nocturne galleon
#

im 1.5 years in my computer science course and

#

kind of happy, still hate C tho

#

love Java right now

#

sometimes, R

#

when our prof stops being a dick

hollow basalt
nocturne galleon
#

does anyone knows how to implement routerlicious - microsoft fluid framework

#

I've been facing issues and there is no much stuff about it available...it's quite new assignment

viral heath
#

fix'd

sturdy ingot
versed python
#

C++ is 👑

sturdy ingot
versed python
versed python
#

If anyone needs help with C++, Qt, Js. Tag me

sturdy ingot
versed python
#

Requestapi can only run once

#

The bug only happens on win7

#

Idk why

#

Works fine on other platforms

sturdy ingot
#

If QNetworkAccessManager::get takes more time on Windows 7: well, there's your problem.

#

That being said: don't guess, debug.

versed python
#

Its not taking more time, I already debugged that

#

Set up is called when you want to paste

#

Request api is called when the pastebin object is created

#

It gets the api key fine

#

Just crashes in the dissasembler

#

On win 7

#

Oh well, I will look at it again when I have time

#

I don't have time for the project at the moment

sturdy ingot
#

Fair enough. Didn't look into the other files, tbh, and wasn't sure about the calling sequence. Still strange that you don't get a proper stack trace. Oh well. 🤷

full socket
#

Do you guys think that here where it says "PC", "PC", and then "Linux", that it most likely meant to say Mac after PC or something? Confused lol

#

Confused in general about this thing we have to fill out but yeah

#

Not sure

grizzled steeple
#

Could be. There's also Safari listed, which, last time I checked, was last released for Windows in version 5. Spoiler: Safari is currently on version 15

#

So yeah, most likely it's meant to say "PC, Mac, Linux" and I think it's best to just straight up skip Safari on anything but macOS. The last Windows version is worse then IE in terms of web compatibility lol

sturdy ingot
nocturne galleon
#

I am trying to relearn kotlin for android and its giving me a headache the syntax is so weird to me especially the ->

sturdy ingot
nocturne galleon
#

val multiply = {val1 : int, val2 : int -> val1 * val2} also for things like when statements

sturdy ingot
#

Ah, for closures?

#

Reminds me of Haskell's variant, although the types are not necessary there:

multiply = \x y -> x * y
``` `when` sounds like Haskell's `case`:
```haskell
case x of
  1 -> Odd
  2 -> Even
  n -> isEven (x - 2) -- don't do this!
#

Or Rust's match.

lapis plume
#

imo

fickle verge
#

What do you think about this blog

sturdy ingot
past rune
#

Hey guys

#

anyone who understands react a bit?

#

I'm trying to use react with typescript but i'm in a bit of a pickle here

#

I got: a component to do the search, but when I do the search I can't seem to find a way to update one component

wind horizon
# past rune I got: a component to do the search, but when I do the search I can't seem to f...

If you have any specific questions feel free to drop me a link to some code and I can give you some help.

For component updating typically in react data flows down and that change to the props or state in a component cause it to rerender, so for example you may have something like this:

function SomePageComponent() {
  const [searchValue, setSeachValue] = useState<string>("")
  
  return (
  <>
    <SearchComponent onChange={setSearchValue} />
    <span>{`The Search value is: ${searchValue}`}</span>
  </>
  )
}

When the state changes it will make SomePageComponent rerender updating what string is rendered on the page. You can also use some state management like context or redux if you need to more easily access state in many different parts of the app, the example I sent here is a very simple one just to show the general process of why the component updated properly.

tardy bane
wind horizon
tardy bane
#

Is their a way to insert the formula in the code

rancid cedar
#

I-
I don't know where to start.
So, I have this discord bot WIP being written in golang, but with a quirk, I'm designing it in such way that it uses an embedded JS interpreter to handle the commands, due to the shoddy design of golang's plugin system being broken, instead, the embedded JS interpreter will be able to load new plugins on the fly, I've gotten it mostly working right now, except for a single detail that breaks everything.

Each JS command module has a function that returns (or is supposed to) JSON to the main golang process to register the slash commands through an interface, however upon json.Marshal'ing what the function returns, it gets messed up, turning

    {name: "Pong", description: "Ping!"},
    {name: "Ping", description: "Pong!"},
    {name: "Plink", description: "Plonk!"},
    {name: "Plonk!", description: "Plink!"}``` 

into

```sh
[34 91 123 92 34 110 97 109 101 92 34 58 92 34 80 111 110 103 92 34 44 92 34 100 101 115 99 114 105 112 116 105 111 110 92 34 58 92 34 80 105 110 103 33 92 34 125 44 123 92 34 110 97 109 101 92 34 58 92 34 80 105 110 103 92 34 44 92 34 100 101 115 99 114 105 112 116 105 111 110 92 34 58 92 34 80 111 110 103 33 92 34 125 44 123 92 34 110 97 109 101 92 34 58 92 34 80 108 105 110 107 92 34 44 92 34 100 101 115 99 114 105 112 116 105 111 110 92 34 58 92 34 80 108 111 110 107 33 92 34 125 44 123 92 34 110 97 109 101 92 34 58 92 34 80 108 111 110 107 33 92 34 44 92 34 100 101 115 99 114 105 112 116 105 111 110 92 34 58 92 34 80 108 105 110 107 33 92 34 125 93 34]```

Despite upon inspecting the JSON variable while debugging in VSC, it contains the original content in a section labeled "String()".
#

I might be wrong, but isn't json.Marshal'ing something and printing it supposed to return text?

wind horizon
rancid cedar
rancid cedar
#

well, not exactly easier, but, just, importing a library just for a simple conversion seems... odd

wind horizon
rancid cedar
#

never heard of the left-pad debacle till today

wind horizon
#

Honestly the fact that people pushed broken apps still blows my mind, how did their CI not come to screeching halt prevent deploys? (excluding side projects that usually don't have proper CI lol)

sturdy ingot
tardy bane
#

It tells the coding and the sensors for temperature are HTU21D and BMP180

wind horizon
#

I guess if you are in serverless though and not using docker images or omitting your binaries using something like yarn 2 it could be an issue. But as long as you build your prod images. lol

wind horizon
#

I just want JS to finally include better date functionality, it's silly in 2021 almost every app imports a date tool. lol

sturdy ingot
#

I'm so glad I don't work with JavaScript. Don't get me wrong it's nice, occasionally. But it's a frigging moving target, since build and tool chains get reinvented all the time.

#

We had an application with the appropriate packages.json and version lock files, and it suddenly wasn't reproducible 6 months later. What build find beforehand suddenly didn't, although we didn't change anything.

wind horizon
#

The key is to not drink the koolaid in JS world, teams that jump on the latest cool framework will always be dealing with bugs and relearning things.

wind horizon
#

Also gives you a way to reproduce something odd being installed in the img, since a dev can download the img and inspect it.

rancid cedar
#

tbh, docker is like a love hate relationship

sturdy ingot
#

Good ideas in general, but not applicable for that problem back then.

#

Either way, I need to get going, can add some details later

wind horizon
# rancid cedar tbh, docker is like a love hate relationship

Yup I know the feeling, Docker is a whole commitment / thing. It's insanely frustration also when something isn't working right in Docker and you rabbit hole down tones of configs. Don't even get me started on dealing w/ k8s configs. 😆

sturdy ingot
nocturne galleon
wind horizon
#

Whoa whoa, someone loves Java. I haven't heard that in a few years. 😆 jk jk

nocturne galleon
#

Anyway, I have been using IntelliJ IDEA for the past 2 months now, been going fine, and our Course Guide tells us to use Java 8 for our java projects, which is working out fine

#

now here's the problem

#

Java 8 + JavaFX won't go together

#

in IntelliJ IDEA

#

but for my other course-mates, who use Eclipse

#

JavaFX and Java 8 works fine

#

so im kind of fucked, can't see a tutorial online on how to make IntelliJ IDEA with JavaFX and Java 8 work together

#

welp, might as well migrate to Eclipse now

#

if thats the case

#

i tried to use it and i was not productive with it the first few weeks, and then i found IntelliJ IDEA ultimate, it was free for my University Account

rancid cedar
nocturne galleon
#

and i loved coding in java with it

wind horizon
rancid cedar
#

even got a fourth domain just for my nextcloud instance whenever I have time to mess with docker to get it running with HTTPS

wind horizon
#

Oh you know I used to run plex in it, but hardware encoding passing through was always annoying. So the next time I replaced my laptop I put plex on my old one. Works out good, the battery in the laptop kinda works like having a built in UPS. lol

rancid cedar
#

true!

#

I am moving to TrueNAS Scale whenever I fix my broken second laptop, using the laptop as a compute node and my current server as the storage node

#

the laptop will be a much needed upgrade over my Core 2 Quad (i7 372QM from Q9550)

wind horizon
#

I just broke down and bought an over priced prosumer NAS for home, but then I use my old laptop as my actual server for things like Plex and the NAS is only my storage backing.

#

My old laptop is a i7 8th gen w/ 1070, Plex loves that 1070 for transcoding. Can transcode a 4k movie on the fly without breaking a sweat. 😆

rancid cedar
#

that's understandable. tbh, I'd be more of buying rack mounted hardware, it's just,,, oddly appealing, but I haven't ever had a job before so ain't have money to make my dreams come true. Altho I am currently in an unpaid internship at a PC repair shop, and when it ends, I'll most likely get hired for reals

wind horizon
#

Nice!

rancid cedar
#

thanks!

wind horizon
#

I have a old half cabinet in my garage with nothing in it, it's left over from many jobs ago they gave it to me. Sadly it gets too hot in my garage and my house is too small that it'd be too noisy inside my house. lol

wind horizon
rancid cedar
#

even then, usually, rackmount hardware have power bills to match their neatness

rancid cedar
#

altho, at least, if I mess with it, I know my media will be intact
unlike that time I accidentally deleted 300gb of my own photographs when I removed a TrueNAS jail

wind horizon
#

hahaha, better be backing up your NAS! lol

sturdy ingot
wind horizon
#

I encrypt my NAS locally and then backup to cloud cold storage, it's something like $20/yr for a I think 4TBs.

All my Plex stuff I don't back-up, since all my rips are 100% legit and I have the discs in a tote in a closet so not worth the $ to backup the 10TB+ of movies and shows to the cloud when I have the discs + NAS raid.

rancid cedar
wind horizon
#

You ever find you work like 10x more on hobbies than real work? Like this week I spent 3 days building 2 discord bots and an open source library. While at work I did like 1 feature. 😆

sturdy ingot
# nocturne galleon after seeing more problems in R, i love C and Java now lmao

C forces you to walk through the mud. It takes some time, but it's honest and you'll get to know the pitfalls. Java leads you along a marvellous bridge network with the occasional toll booth. It seems like a nice stroll over the swamp and fiery depths, but as you walk along, you'll notice that there are gaps and some bridges are in desperate disrepair and you really should have brought a ladder or rope.

sturdy ingot
sturdy ingot
#

I only work 30h/w, wanted to get a relaxing break from the last job, so it's easy to accidentally get extra hours though.

rancid cedar
wind horizon
#

I think I just like the freedom of hobbies, you can code anything you want anyway you want. Not the way product wants it. lol

wind horizon
rancid cedar
sturdy ingot
wind horizon
#

I used to get to goof off and do stupid stuff with the ops ppl when I started in IT, then I moved into dev world. I'd say I feel less stress as a dev, but ops ppl know how to have way more fun. lol

rancid cedar
wind horizon
#

I love Linux, but always live either dual boot life or just Windows desktop for gaming. Idk I just don't see the point in fighting w/ Linux just to play games when you can dual boot. lol

#

Also WSL isn't that bad, whenever I have to dev on Windows it's the first thing I setup.

rancid cedar
#

in my defense, not like I can play much more, at least to my taste, got a GTX 750M equivalent. altho even if I had a better PC, I'd still find myself playing it a lot. there's just an acquired taste to it no other game matches

rancid cedar
#

also about dual booting is pain for me, I'm still on a mechanical hard drive, a 5000 rpm one, you can imagine the pain of having to live with 20 minute boot times on windows

wind horizon
#

Hahaha yeah

#

No spare flash drives you can put it on?

rancid cedar
#

windows on?

#

kinda gave my only 64 gig USB drive to my dad

wind horizon
#

Oh I thought you had Windows and then were talking about dual booting Linux

rancid cedar
#

yeah

#

to dual boot, I need to restart to get onto the other os

wind horizon
#

I didn't know they still made PCs with 5000rpms

rancid cedar
#

if I want to use Linux I have to wait a while for it to load, and vice versa

rancid cedar
wind horizon
#

Wow some bad HDD luck right there

rancid cedar
#

not really luck more than it is a shoddy hard drive manufacturer

#

😆

sturdy ingot
#

(Depending on your IT department, of course)

rancid cedar
wind horizon
#

When I was in IT support I got bored and one month spent all my spare time slowly installing world community grid on every desktop, since they didn't turn off the desktops at the end of the day. So mid day it was set to do very little, but at night they'd run full tilt. It was really cool to see how much compute power we were contributing to the

Although I think these days the compute contributions from CPUs is like nothing in comparison to GPUs.

rancid cedar
#

y e p

#

it makes me think

#

wouldn't it be ethically better if a crypto was created where the mining is computing scientific workloads?

wind horizon
#

It'd be cool if someone could come up with a way, but I don't know if that'd work for block chain since everyone is trying to solve for a new block and validate old blocks. No one is solving for a scientific problem.

However someone could theoretically make a new crypto that releases rewards to people for scientific contributions. I think the chain just wouldn't be powered by those scientific contributions really, it's just be rewarding people for them using a crypto. Prob something built on proof of steak for the actual chain, but you select who gets to create the next node based on scientific contributions maybe instead of just people staking the crypto. 🤔

idk it's an interesting idea and I'm sure with enough time someone could come up with something. lol

rancid cedar
#

true! the biggest hurdle would be making the blockchain somehow compatible, but if pulled off, it would be amazing

sturdy ingot
rancid cedar
#

o h

#

interesting

#

thanks for pointing in that direction! I'll take a look tomorrow after waking up

sturdy ingot
#

Wait a second.

#

How does the structure actually look like in your Go code?

#

Is it already a string? Marshalled objects are supposed to be, well, objects/structures. The output above indicates that it might be already encoded in some form or another. Depending on your sink, the output might also be correct.

wind horizon
#

Yeah I don't know Go well, but I thought the marshaling was primarily based on the struct.

rancid cedar
#

the variable I'm marshaling is of type interface {} (string)

#

here lemme get a screenshot

#

kinda odd tho

#

there's backslashes

#

doesn't look quite like the original

#

it might be the fact it's a string actually yeah

wind horizon
#

Yeah it's escaped string, that looks odd did you maybe accidentally stringify it twice?

#

For example here is some JS showing what happens when you do that:

const test = { key: "value"}

console.log(JSON.stringify(test)) // result: {"key":"value"}
console.log(JSON.stringify(JSON.stringify(test))) // result: "{\"key\":\"value\"}"
rancid cedar
#

I JSON.stringify'd it once in the JS side of the process to see if that would fix it, but didn't really

#

since the interface is sending strings, I thought I might need to stringify the json

#

all I really know is that the golang JS embedding library possibly runs on magic my ADHD brain can't fathom pay enough attention to understand properly.
so I figure part of the problem is me probably not knowing how to handle the interface between the JS vm and the main process properly

wind horizon
#

Hmm yeah I wouldn't be surprised if they already handle stringiying JSON objs, so adding it yourself might be why you ended up with the escaped characters.

But not sure, honestly never even looked into / considered embedding JS in Golang. 😅

I can say discord.js with plain Node is pretty easy. 🤷‍♂️

rancid cedar
#

reasons

#

I don't actually know why tbh

#

wait no

#

now I do

#

compiled language

#

(I ran my first bot directly off of my netgear r7000 router w/advanced tomato)

wind horizon
#

I think you can just call their REST or GQL end point directly, may be a lot easier than trying to embed JS in Golang.

rancid cedar
#

there's already a discord library for golang, I'm only using JS for command handling. you see, golang has a shoddily broken plugin system, basically worthless. and I want to be able to add plugins on the fly, so a scripting language is the best way to do that.
I also want ease of setup, just download the executable, click, and run! my bot is being designed to encourage self hosting with ease of use

past rune
pliant siren
#

Do we have a LTT users group/leaderboard for Advent of Code?

sturdy ingot
lament bridge
#

I would like to create some sort of redirections based on the input, however there is an issue. Let's say the input name is domain and value is example.com. I use modrewrite for displaying data of the domain.

Eg: http://localhost/example.com would display data about example.com.
My issue is that how can I get the value of the domain?

Since when I pass $_GET['domain'] in the form action, it adds ?domain=example.com.

Though I only want example.com there.

hollow basalt
sturdy ingot
wind horizon
# past rune I’m being able to update it somehow without the set stage. Apparently if I do se...

If you can share some code or an example that'd make it a lot easier to help. 👍

If your api call is defined inside the component and not in something like an effect or memo it'll rerun on every render. A way to think of it / remeber how it works is every time a component renders its running the entire component function again, so any code such as a fetch will run again.

A lot of times ppl like to abstract all the api calls away into custom hooks. That way in the component you just importing and call the custom hook instead of having all that code related to fetching data. It also makes your api calls reusable in other parts of your app.

past rune
#

What’s making my work harder is the typescript part of things

#

I’m fairly good at JavaScript but typescript has a lot of things I wasn’t aware of

#

It’s being a good learning opportunity though

wind horizon
# past rune What’s making my work harder is the typescript part of things

If you or your employer are ok spending a little on some courses Front End masters has a great Typescript video course. I think cheapest options is $39 for a single month.

https://frontendmasters.com/courses/typescript-v3/

Ofc there is stuff like YouTube for the free route.

past rune
#

That’s pretty neat thanks for the suggestion!

obsidian mirage
#

So I’m trying to install Big Sur using OSX-KVM but when I try to install MacOS I get a The operation couldn’t be completed. (PKDownloadError error 8) error. Any chance anyone here knows a fix or solution?

tired canyon
#

@obsidian mirage post more info about your hardware setup, and the steps on how you reached that error. That way, people have more idea what you are talking about.

dreamy sandal
#

hello guys

#

i have a question

obsidian mirage
#

Well it’s in a virtual machine.. I’m using Ubuntu 20.04, Intel i5 9400, RX 5600 XT, and 16GB 3200 RAM

tired canyon
#

@obsidian mirage OSX has some "dependencies" on physical hardware. So often people ignore that part. If you think your hardware is 100% compatible. Then I guess it's going be about your KVM config.

obsidian mirage
tired canyon
#

@obsidian mirage offline install?

obsidian mirage
tired canyon
# obsidian mirage No I’m online.. it fails offline

No idea man. It's not like I can look at their installer's source code. Try not to passthrough your GPU to see what happen. Basically, you have a 2x2 matrix of possible try & error attempts: with/without GPU passthrough, and then online/offline install. Try all combos, if things don't work. Ask Steve Job for help. 😉

#

Actually I have some problems I ran into with KVM as well. I am writing some documentation on setting up new workstations, so I thought it would be nice to include a chapter of running Windows in a virtual machine, so it can allow user to use certain Windows bound apps such as Autodesk 360, etc. But I couldn't figure out why when I add amd_iommu and the connected GPU options into my kernel parameters and then regenerate my initramfs, my host (Pop-OS 20.04 LTS) will start to have this bug where I couldn't suspend or hibernate the system. It will automatically log its current user out and then wake up again. Similar to that "Suspend loop" bug on Pop OS / Ubuntu.

rancid cedar
# rancid cedar I- I don't know where to start. So, I have this discord bot WIP being written in...

Update:
Good news
I solved this exact problem a year ago on another part of the bot without me realizing it
Bad news
I solved this exact problem a year ago on another part of the bot without me realizing it

So I don't remember exactly how the hell it works. Could be magic for all I'm concerned.

Pictured here is the function that parses the JSON properly from a file containing the token.
All I need to do really is copy part of the function to the part I'm having trouble with. Will update later.

#

all in all, lesson learnt, always comment your code

sturdy ingot
echo jay
sturdy ingot
echo jay
#

i am guilty as charged

sturdy ingot
#

And rebase exists. One can always clean their history before they push their changes (or rebase before those get merged).

sturdy ingot
rancid cedar
sturdy ingot
# rancid cedar I- good idea, but my brain can't write proper commit messages

Think about it like an email. Write into the subject the most important part or a summary, and then some text to your (anonymous) coworkers or future self:

json: Don't ignore errors in jsonParse

Since any `err' from the called functions indicates that we either
- could not open the file,
- could not read the bytes or
- could not marshal the bytes back into our structure

we really need to return early, instead of potentially calling
any function on `nil' or some other kind of faulty value.
```Note that the message above is kind of superfluous for experienced Go developers, they could work with the summary alone. Whether you want to prefix your summary with a topic is part of your commit style, btw.

This only works if you create **atomic commits** though. If your commit contains several changes at once, then it's hard to summarize and describe them properly.
#

So no git add -a or git commit -a 😛 (unless you really only changed a single, summarizable part of your code).

rancid cedar
#

makes sense!

last token
#

Anyone know where to go after scratch for my son for coding/etc?

spring pond
#

simple websites with html could be a good option or you could start him on python

last token
#

Thanks.

obtuse night
wind horizon
#

Those small game programming sites are so engaging since they are making something they interact with. There are some great tutorials online how to recreate some classic games like ping pong and what not that might be worth a looking at.

Idk their age but another good idea could be to build a discord bot if they are old enough / use discord to chat.

last token
#

Thanks for the input guys. I will be passing info on. I have been looking online for him too. I’ll check out python myself too.

nocturne galleon
deft sigil
#

is it possible in python to separate of a section of a script that has no logic in it but is just quite large.. (it are dictionary constructions / mappings to a configparser) but they have fstrings in them , and i dont want toe logic that fill in the fstrings to be moved over , what would problem is just moving them over assigning them to a var and importing the module.var doest work out of the box because the variables in the fstrings are unknown.

hollow basalt
#

about the fstring part, if it's not that many. consider .format()

deft sigil
#

the variables would still be in the .format(var1,var2) wich will still fail as they are constructed in the original file, and its about 11*14 lines, and every line has a fn fstring in the form of configparser[section][key] where all 3 vary depending on the key its assigned to ]if there was a possibillity of including code like php does but i tried in a--you never know ---way :importing the file after all starting vars are set (where to look for the configfiles by what name eg)

hollow basalt
#
  1. create non py file
  2. read it as string
  3. eval()
deft sigil
#

that i did not think of ,... thanx

azure hound
#

If anyone wants to peek at it go ahead.

#

The text is Hungarian

#

And I will never know why I had to animate in jquery and not in CSS since I never went to the classes, lol

#

But Github Copilot made this a whole lot easier, that's for sure.

sick coral
spring cradle
#

would trying to make a game/engine go here or gaming?

#

i want to make a rhythm based game, but dunno how id start

sick coral
#

@spring cradle
Decide what you want to build it with. Unity, Unreal Engine, or even HTML5/Javascript is a viable option (https://tonejs.github.io awesome web library for music applications).

Google for "how to make rhythm game unity" or something like that. You can probably find a decent writeup, blog post, or youtube video to get you started

spring cradle
#

oh heck i forgot to mention i wanted it to be done with terminal lol

spring cradle
sick coral
spring cradle
#

mainly because i like text uis, plus there seems to be a lack of such games

#

though i dont mind outputting the text to a new window

sick coral
#

Are you a seasoned programmer or earlier in your journey?

spring cradle
#

also partly curious how hard it is to make a retro looking game with characters instead of pixels

#

i have a bachelors in compsci, but a bit rusty

#

just did a hackathon project in golang, coincidentally

#

tired of "web3" and just want to make something that runs locally haha

#

im not the best concurrent programmer though

#

id imagine anything not turn based would like concurrency?

sick coral
#

If you're rusty, then here's what I would say. In order to increase the success rate and quality of your project, you should go with an approach that is more widely-used and supported that you will find lots of resources for. There's no reason you can't make a text-style UI inside of Unity. Less hang-ups will help your sanity.

it also sounds like just as good of a candidate for being an HTML5 game, especially if you're familiar with a frontend framework. (I love Svelte; easiest and most usable framework out there)

Add in that Tone.js library I already linked, which I think has utilities to get accurate timing events which would be crucial for rhythm.

But if you'd really rather stick to command line, idk. PyGame is popular, but I'm not even sure that's applicable for a purely text-based game. I don't know if you'll find anything aimed at solving your particular use case

spring cradle
sick coral
#

I don't think you would need to worry about concurrency if it's a relatively simple game, especially if it's just text rendering

livid fiber
#

I just finished coding a cheat related software. it changes all your HDIW’s and completely spoofs your PC’s. I am very proud as it’s my first project on c++ software and with drivers!

spring cradle
#

This is the library i found btw

livid fiber
#

I am now probably going to try and code a cheat for a game, not for anyone’s use, just for practice. It’s very good to learn about, but my first project to me 3 months alone (self tought)

sick coral
livid fiber
#

Taught*

spring cradle
#

there was also sdl2 recommended but im not sure what that is, it looked like it was for 3d?

livid fiber
#

Also does anyone want to try and crack my key system I used? I need to see if someone can crack it

sick coral
#

I think your main technical challenge will be figuring out how to get precisely timed user-input for the rhythm aspect of the game. Might just take looking into how other rhythm game tutorials address it

livid fiber
#

it had high encryption but I’m not to sure if you can or not

#

type stuff

spring cradle
#

i see that termloop has an event system for the ticks

#

this seems like it is useful

#

i was planning on having the keys basically buffer? like uhh necrodancer?

#

that should make timings less tight

#

i think

sick coral
#

You have to time every key press in necrodancer?

spring cradle
#

wait you do

#

wait

#

wind waker

sick coral
#

lol

spring cradle
#

like wind waker

#

idk ive never played necro lol

#

i just assumed from visauls, sorry

#

like if i just check for keys pressed when the beat happens instead of handling each keypress, that should be less concurrent, right?

sick coral
#

So you need to define what is the acceptable range of timing for the keypress (beatTime plus/minus maxDelta)

How you go about doing that depends on how the Tick system works in that library, and if/how you can get the precise time of a keypress eent

spring cradle
#

like, every beat the instrument is strummed, and whatever spots are held down determine the chord/note?

#

that's more what i was thinking of

sick coral
spring cradle
#

im also bad at rhythm games lol

#

mostly picked that implementation of rhythm because i wanted it to be like

#

chord progression combo attacks

sick coral
#

lol nice. Good luck with the project

spring cradle
#

im excited now lol, thanks!

echo jay
azure hound
# sick coral Since it's a simple single page static webpage, you can easily set this up as a ...

Since this is basically just html, css, js, and jquery it's not that worth to put on resume, especially since there will be a follow-up course next semester.
Regarding github pages, I know of it, and the teacher used GitHub Classroom to have us use, however that repo is set to private nor do I have the privilege to enable Pages.
Partly because didn't want the students to cheat off of each other.

sick coral
#

You could always polish this project up a bit and tack it onto your portfolio along with your project from next semester, come time for the summer when you could seek an internship 😛

wind horizon
#

If you drop a link I'm sure someone can, I could take a peak but my Python skills are pretty low.

inland tulip
#

Same

hollow basalt
#

Same

echo jay
#

Same

livid fiber
thin valve
#

I assume these are all dependencies for software, and if I remove one it'll brick something

thin valve
#

why must it be like this <insert specific reason here>

echo jay
#

because Microsoft

thin valve
#

yep

#

why do i feel lost trying to understand dev stuff?

nocturne galleon
#

I felt the same way when i started

wind horizon
vocal dock
#

mama’s

loud kelp
#

I wish the VS stuff was just built into Windows

#

I got fed up with it after installing windows for the hundredth time and found a script that installs them all for you so I never have to worry about it again

#

I'm sure there's a good reason they're separate but it'd be nice if they prompted you to install them on first boot or something

hollow basalt
#

wdym VS stuff

echo jay
#

i assume Visual Studio

loud kelp
#

Yes

#

The redistributables

true reef
#

Why don't you script this?

fresh nexus
# loud kelp I'm sure there's a good reason they're separate but it'd be nice if they prompte...
  1. Not everyone needs them.
  2. Little to no one reinstalls their windows installation every week, so it's not really an issue to anyone, but a very small percentage of users.
    And if you need them (redist), then it's safe to assume you can script this yourself, so why would they bother?
    If they added this option, then you would say that 'windows is bloated' with utilities that no one ever uses.
#

You can't have both feature rich experience out of the box, and lightweight system at the same time.
If something is used by the very small percentage of users, then why should it come as 'default', for everyone else as well?

true reef
#

You don't want Visual Studio installed by default if you are trying to keep a large enteprise secure

#

Visual Studio is also customisable, when you make something default it seems to create complacency, instead of looking up variables when requesting said libraries the most common path is requested instead, have a look at C:\Users for example, so many static references here Microsoft will be creating headaches if they changed anything

true reef
#

Is there a way to append to an existing form on a website through javascript?

fresh nexus
pliant siren
true reef
#

Thanks

full socket
#

Can someone help me with this if thats alright? I'd really appreciate it

#

Confused because the book didn't go over Javascript at all. It only linked to the w3schools tutorial on Javascript and didn't explain a thing about it

#

Lol

#

Been messing around trying to get this to work and it's confusing

wind horizon
#

Are you adding this div hard coded or is it supposed to be like write JS that inserts this into the page? Guessing if they haven't covered JS this is a hard coded script.

#

So to "get started" / understand the API open up a browser tab and hit F12 / open dev tools.

Now in the console type document.lastModified you should see the output the steps are talking about.

What we will do is add a script to your website / html file runs this to print the date.

#

Do the instructions clarify if this should be append to the DOM to render as part of the website or if it just simply wants you to print it in console or pop it in an alert or something?

#

Cooking so might be slow to reply. 🙂

full socket
wind horizon
#

Since it says "in the footer area below the email" my guess is they want you to append it to the actual DOM to be shown.

#

Oh you know I'm over thinking this, I'm thinking appending to DOM it says to write it to document and run the script tag in the div. haha

#

So you should have a new div already, right?

#

Should be something like this, didn't test it and cooking so if you run into an issue let me know. lol

<div>
  <script>
    document.write(document.lastModified))
  </script>
</div>
full socket
#

Yeah I put down a new div

#

That worked perfectly, thank you so much lol

#

I was overthinking it

wind horizon
#

The script tag simply is telling the browser I'm going to send you a script here, this is an inline static script not something dynamic we are loading from a remote resource. (we wrote our JS right there in the file)

document is the JS API to access the document object. The write method returns / writes out a string.

Here is full API if you need it: https://developer.mozilla.org/en-US/docs/Web/API/Document/write

MDN is usually my preferred place for JS / web docs site, but guess all opinion. 🙂

wind horizon
# full socket I was overthinking it

To be fair I think it was poorly worded and if they didn't go over JS yet seems odd to just chuck that in there. lol

Sounds like you are doing great, keep it up. 👍

full socket
full socket
#

Also yeah its having us do javascript stuff without even explaining any of it

#

So I assume that I'll have to just learn it all on my own lol

#

I only know a bit

hollow basalt
#

Ok

wind horizon
#

Find the body tag in your classes.html file and make the modification they have shown.

#

Although that "task" is misleading in the statement: "The load event occurs when the web page begins to load in the browser"

onload fires after the browser has finished loading resources. Prob not important of a clarification, but figured I'd mention it since I think the way they wrote it makes it sound like it runs before loading the DOM / resources has completed.

#

If it helps for context onload is an event handler, often times you may see / hear of it on the window object. I think the body isn't very popular, I know I wouldn't like seeing JS right in my html like that unless I had too. lol

Not sure if you covered event handlers, but pretty much in a watered down way description the browser has many operations it does and during them it will emit events about things being done. A handler will listen for an event and do something about it.

true reef
#

lol, does anyone ever make a real mess for themselves and go "FFS, ALL I WANT IS CLOSURE"

#

Or while debugging, you come across those cruel and nasty "I thought I got rid of you" thoughts as you see a line that is..... still existing!

full socket
#

I'm confused lol

#

Thank you for your help with it tho

wind horizon
full socket
#

Sure

full socket
# wind horizon Can you send example code?
<html lang="en">
    <head>
        <meta name="viewport" 
        content="width=device-width, 
        initial-scale=1.0">
    <link href="yogacss.css" rel="stylesheet" />
<title>
    Placeholder
</title>
<meta charset="utf-8">
</head>
<body onload="alert('Yin Yoga classes begin next month!');">
        <div id="header">
    <header class="content">
        <h1>
            <a href="index.html">Path of Light Yoga Studio</a>
        </h1>
    </header>
    </div>
    <nav>
        <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="classes.html">Classes</a></li>
        <li><a href="schedule.html">Schedule</a></li> 
        <li><a href="contact.html">Contact</a></li> 
    </ul>
    </nav>
    <div id="wrapper">
    <main>
        <h2>
            Yoga Classes
        </h2>
  <section class="flow">
      <h3>
          Gentle Hatha Yoga
      </h3>
    <p>A 60 minute class of poses and slow movement that focuses on 
        asana (proper alignment and posture), pranayama (breath work), 
        and guided meditation to foster your mind and body connection. 
        This class is intended for beginners and anyone wishing a grounded 
        foundation in the practice of yoga.</p>
      <h3>Vinyasa Yoga</h3>
    <p>A 60 minute class that focuses on breath-synchronized movement — you will inhale and exhale as you flow 
        energetically through yoga poses. While intended for intermediate to 
        advanced students, 
        beginners are welcome to join in this class.</p>
      <h3>Restorative Yoga</h3>
    <p>A 90 minute class that features very slow movement and long 
        poses. Restorative yoga is useful in relieving stress and 
        fostering a sense of well-being. This calming, restorative 
        experience is suitable for 
        students of any level of experience.</p>
    </section>
    <div id="mathero">
    </div>
    </main>
<footer>
    Copyright &copy; 2020<br>
    <a href="mailto:eli@example.com">Send Email</a>
</footer>
</div>
</body>
    </html>```
#

I think I'm just doing something wrong with the body tag. I didn't even have a body tag before this

wind horizon
#

Hmm works for me when I copy pasted it

full socket
#

What the hell lol

#

Maybe its my browser?

#

I'm unsure

wind horizon
#

Oh do you have a blocker plugin?

full socket
#

Oh lol, yeeah I do

#

That explains it

wind horizon
#

Some will block alerts or your browser may have asked you if you want to see it and clicked no

#

Yeah haha try incognito / no plugin

#

Also pro tip in Discord, and most other MD systems, you can get syntax highlighting if you add the language to the block.

plush valley
#

Ok dont shoot me yet but: Port Node.JS to Microcontrollers much like Micropython

#

Ok now you can shoot me

thin valve
#

ok, Invalid syntax on line 1

hollow basalt
cursive nest
#

Anyone here know a thing or two about OpenCV coding in C++? I'm just learning, and am stuck at getting this error when I try to open a video file:

#

Opening photos works fine

#

Been struggling with that for a day now......

plush valley
night flame
cursive nest
#

imshow("image", img)
does that not do the assignment?

midnight wind
#

is that example code that is commented out?

#

and you are trying to read from img before it would even possibly be assigned

cursive nest
#

The same code (assigning img the way I did) works fine for still pictures
I did find the error with the help of someone on another discord server, seems to be that the program is unable to open the video file itself

midnight wind
#

there is prob something for videos

cursive nest
#

it errors out before even hitting the imgshow command

cursive nest
midnight wind
#

huh

#

look for example code I guess

#

for windows it's not advisable to modify files

#

it's not like linux

midnight wind
#

for one that is not an error

#

but it will be if you run it

#

you are using quotation marks

#

use three double quotes

#

instead of single double quote to encapsulate string

#

the whole string

#

so it would be

c1 = """hello quote "quote". """
``` @warped gulch
#

all I did was google

#

learn it

#

it helps a lot

#

idk that was the first result I got for python quotation mark in string

cursive nest
# midnight wind huh

btw I found the issue, I had to put the OpenCV FFMPEG DLL file in the visual studio project folder
And I told you wrong when I said the imshow line was assigning a value to the img variable - it's the cap.read(img) line that does that

slate frigate
#

Just finished the alpha build of my own shell

#

Managed to keep it under a mb, and still have tab completion, history, and some support for special characters

sturdy ingot
slate frigate
#

Lol, more a experiment than something I want to put on my github

#

Golang, which is why the size point is of note to me @sturdy ingot

sturdy ingot
#

Hm, is Golang notorious for creating large or small binaries?

slate frigate
#

Its a staticly compiled language, so they usually end up being pretty large for what they are

sturdy ingot
#

Eh, you mean statically linked, right?

slate frigate
#

^

#

Yeah

sturdy ingot
#

Hm. Can you enable LTO with automatic dead code removal in Go? At least GCC's -Os really slims down results.

#

And -Oz in Rust is just weird magic, but enables fitting programs in µC flash 😄

slate frigate
#

The most consistent way for quickly shrinking ~30% are the ldflags s and w

sturdy ingot
slate frigate
#

Other than that, you can shave down more space by being more verbose about your imports, and only doing submodules, but that can get messy fast.

sturdy ingot
#

Did you run upx on your shell yet? Would be interesting to see whether it can reduce the size even more.

slate frigate
#

Yeah, upx will generally shrink a go binary an additional 30%-60%

sturdy ingot
#

1MB is already impressing, given that Bash takes ~2MB (on Windows)

slate frigate
#

Upx is what took me from 1.2MB to ~800kb

brave roost
minor roost
#
//What do you prefer?
public void addTwo(int variable) {
  variable = variable + 2;
}
public void addTwo(int variable) {
  variable += 2;
}
public void addTwo(int variable) {
  ++variable++;
}
obtuse night
#

2nd one for me

hazy marsh
#

i've never seen the third option, prefer second when possible

nocturne galleon
#

agreed

dim belfry
#

github being down is so inconvienent

slate frigate
#

I prefer coding with the first option. Easier for my brain to parse as I read through everything

midnight wind
#

^

hollow basalt
#
 ++variable++;

what even is this

slate frigate
#

Witchcraft

slate frigate
#

People learning how to code in comp sci, and not practically?

pliant siren
#

'clean code' does not mean reduce the character/line count 😦

sturdy ingot
#

Also uses stdio.h instead of the appropriate cstdio 🤷

sturdy ingot
#

It doesn't:

#include <cstdio>

int main() {
    int z = 2;
    int y = 1;
    printf("This is a test\n");

    if (z == 1) {        
        printf("a\n");
    } else if (z = 2) {  // [sic]. Yeah, that's in the original code...
        printf("b\n");
        if (y == 2) { 
            printf("b1\n");
        } else {
            printf("b2\n");
        }
    } else {
        printf("c\n");
    }
}
#

Overall, really dumb way to write

#include <cstdio>

int main() {
    std::puts("This is a test\nb\nb2");
}
sturdy ingot
#

Also, the compiler does not care. GCC with -O3 generates on the original lambda-ridden "clever" code:

.LC0:
        .string "This is a test"
.LC1:
        .string "b"
.LC2:
        .string "b2"
main:
        sub     rsp, 8
        mov     edi, OFFSET FLAT:.LC0
        call    puts
        mov     edi, OFFSET FLAT:.LC1
        call    puts
        mov     edi, OFFSET FLAT:.LC2
        call    puts
        xor     eax, eax
        add     rsp, 8
        ret
```Which is just `puts("This is a test"); puts("b"); puts("b2")`.
spare turret
#

I hate Java, that is all.

sweet ferry
#

hahaha

sweet ferry
#

or soothe this

spare turret
#

No no, I'm just in eternal pain.

sweet ferry
#

haha

spare turret
#

Stupendous news, I no longer hate Java, I just hate life.

wind horizon
#

Maybe it's Java making you hate life? 🤔

slate frigate
nocturne galleon
#

My only issue with java is its verbosity, i prefer kotlin

#

I'd certainly take java over javascript or python though

spare turret
#

Python is a million times better than Java, your opinion is wrong.

nocturne galleon
#

indentation based syntax
Bad typing
No compilation
Kek no

#

:3

spare turret
#

Indentation is better then semi colons

#

Compilation is for the birds

nocturne galleon
#

But braces are definitely a lot better than just indentation

spare turret
#

Their official name are curly Bois

#

Also

#

The JVM needs to not exist

midnight wind
spare turret
#

Ok fine

midnight wind
#

whitespace that can cause errors is so annoying

spare turret
#

We'll move on from Languages as you're clearly not going to admit you're wrong

#

IDEs

#

VSCode over Sublime

#

Unless on Linux in which case Vim is the only option

midnight wind
#

vscode all the way

#

even on linux

nocturne galleon
#

I use intellij for java and kotlin, and vscodium for everything else, on linux

spare turret
midnight wind
#

you can use vim on windows too

spare turret
midnight wind
#

vscode exists on linux too...

#

I don't get your point

spare turret
#

Not as good

nocturne galleon
#

How so?

#

Works perfectly fine for me

spare turret
#

I don't like the Linux cursor

nocturne galleon
#

What

spare turret
#

Specifically Kali

midnight wind
nocturne galleon
#

I feel like you're memeing at this point but I'll try to answer seriously, don't use kali unless you actually have a reason to

#

And you probably don't

spare turret
midnight wind
#

you can change the cursor you know...

nocturne galleon
#

Fair, but don't use it as a daily driver, use it in a VM

spare turret
#

And I've exclusively been meming this entire convo

nocturne galleon
#

And that, there are many cursor themes

spare turret
nocturne galleon
#

Ah

spare turret
#

As much as I'd like to, I could never switch to any Linux distro RN

midnight wind
#

opensuse is pretty nice

#

using it rn

nocturne galleon
#

I use arch, has been better than anything i tried before it

#

Imo

spare turret
midnight wind
#

arch...

#

as a server guy, no

spare turret
#

Guys use Redhat at home

nocturne galleon
# midnight wind as a server guy, no

Well yeah on a server something else is probably better, but for desktop arch is the best for experienced users imo, and endeavor is the best for new users

midnight wind
#

opensuse is just robust which I like

spare turret
#

I don't use Linux for any non-network pen stuff for which I use Kali as I mentioned

midnight wind
#

I just install the packages I need

spare turret
#

I think if I were to actually switch over I'd start off with Linux Mint maybe

midnight wind
#

no need for kali, when I can just install things

spare turret
#

It's overkill for 99% of the stuff I do but it's useful when VMs break occasionally

#

I use maybe 1/12 of the packages it comes pre installed with which is still like 50 so it's worth it

snow night
#

ok so we are doing a science fair for my school and i need ideas for a programming project, anyone got any?

night flame
dim shard
#

Hey guys

#

Do any of you know if you can access a sccm server using java

#

and if so how would I do that?

dim shard
simple python
#

I'm tryna do this program for uni project on c#, found some code on how to search files from one's pc but I can't find how to fix this error, or the solutions I find don't work, anyone got any ideas?

pliant siren
#

where do you believe InitializeComponent to be defined?

#

I haven't done C# in a long time but a quick google search tells me it's defined private on Form, so of course any child class won't be able to see that scope.

simple python
#

so I gotta manually initialize it?

pliant siren
#

the quick reading I did suggests it should only be called from the form designer. What examples are you seeing that suggest it must be called directly? It appears to be a builtin component initialization method that's called internally.

simple python
#

yeah the examples I found don't make much sense

#

yeah no see they don't initialize it still

eager scarab
#

It should be in the designer of your form, I wonder why its not there by default

simple python
#

I tried copypasting those lines but it wouldn't work

pliant siren
#

Has anyone created an AoC leaderboard yet?

dim shard
#

Hey is this the right way to prune my unify controller using the mongo database?

golden mural
#

What do you call alot of object orientation in code

hollow basalt
#

object

devout copper
#

im just curious is there any part of coding you're going to use binary codes

midnight wind
#

as in machine code binary

#

no, not really

devout copper
#

oh ok

severe viper
#

c++ im a noob why ;-;

#

it only prints 1

spring pond
#

istream::get() returns a character, not an integer

steep epoch
#

hey, is anyone familiar with Jekyll and github pages?

#

sorry for dropping questions like this..

night flame
steep epoch
#

lol. jekyll does not give me any error when I run bundle exec jekyll serve the local version of the project runs fine. and I can upload the files to github. But. github told me githubpages built failed. and I couldn't get any more error message other than it says build failed..

solemn forge
#

Anyone know how to connect to a remote Linux server using jsch and
Switch user and then perform some operations? Using java

#

I was able to connect but not able to do dzdo su -user

steep epoch
#

@night flame

night flame
#

what does it show when you click details

steep epoch
night flame
#

are you using plugins that github pages doesnt support

steep epoch
#

maybe I will rebuild this repo from ground up later..

visual path
#

Personally, I use Docusaurus just because md react is ezpz

severe viper
#

anyone know how to get rid of whitespace when printing a variable that has an fstream object or whatever

#

nvm

#

apparently it doesn't show up anymore

visual gale
#

Hi is there anyone who knows java? I would like help with finishing an assignment of mine.

visual gale
#

ok so I have an arraylist to print out tickets numbers.the first prize is only one line since it's the first line of the csv file. How exactly can I create a for loop for second place and third place to print out the integer array

night flame
#

what does your arraylist look like

visual gale
#
                int  firstPlace = 0;
                    ArrayList<int[]> SECOND_PLACE = new ArrayList<>();
                    ArrayList<int[]> THIRD_PLACE = new ArrayList<>();
night flame
#

im having trouble understanding. what does the data look like and what do you want to happen with it?

visual gale
#

this is for second place

night flame
#

and you want to store those numbers into the second_place arraylist?

visual gale
#

yeah but these numbers are in a csv file

night flame
#

okay what does the csv file look like

visual gale
#

it is pretty long.

#

I feel I am not right

silk eagle
#

hey guys, when handling requests on a webserver, a lot of the time the requests are ratelimited based on the request activity from an IP address, would there be any issue doing it based on the activity from the cookie/session instead...?

#

like say i have an authorization header somewhere and w/o it requests won't be completed, couldnt I just ratelimit that instead of an IP address that someone could just use a proxy to avoid the ratelimit on

#

this is assuming they've already gotten "authorized" though

midnight wind
#

thing is, someone can easily just get around that

silk eagle
#

how would one do that?

midnight wind
silk eagle
#

well what i mean is they can send requests to the server all they want but if the auth they're using is being ratelimited it wont do anything meaningful

midnight wind
#

so like if the api needs auth, and you do it based on auth token, sure

silk eagle
#

ok cool

#

just making sure there wasnt some massive fundamental flaw in my logic

midnight wind
#

I don't see any

#

user needs auth token to access API, you rate limit based on auth token, as long as it's programmed correctly it should be fine

severe viper
#

how could i end a while loop with a user input combo like ctrl + z

#

c++

vital eagle
#

Which OS?

severe viper
#

windows 10

#

and later i wanna do it in linux but focused on windows atm

vital eagle
#

You'll probably need separate code paths then.
For Windows there's SetConsoleCtrlHandler(), which can register a handler for Ctrl+C and so on.
For Linux see man sigaction and man 7 signal overall.

#

Just set a volatile bool flag as your loop condition and set that bool in the handler.

severe viper
#

yeye ty

slate frigate
#

The command I just had to use to compile a gui windows binary on linux
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ HOST=x86_64-w64-mingw32 go build -ldflags "-s -w -H=windowsgui -extldflags=-static" -p 4 -v -o ClearSkies.exe

nocturne galleon
#

Operating System I was working on for a while called IbisOS. It has been a dead project for months now but the whole reason why I started it was to learn more about programming languages such as C. The main reason why it has been dead is because of memory management and I’m wondering if anybody here knows about Operating System Memory Management because I and some other collaborators don’t really know how it can be done. Just a goofy little passion passion project after learning about TempleOS.

#

Also if someone can look at the terrible code I would appreciate it, lol

#

I will link it

#

So I actually can not really program whatsoever and making an operating system is one of the dumbest things to do without much knowledge so I get help mostly from others.

#

As terrible as that may sound I have tried following YouTube series but I find it very very difficult so recently I went back to game design

#

We used to have a little graphics driver but we have since then removed it

nocturne galleon
midnight wind
#

they are in a flight sim server tho

nocturne galleon
#

I used to be in the flight sim server

midnight wind
tawdry arrow
#

wtf, why is rpi now 130EUR? so much for a "low cost developer board" I can get a TX2 for that....sheesh

echo jay
#

chip shortage / scalpers probably

pliant siren
#

RPi still has a very base level model. But yeah, it has certainly scaled well beyond its original project intent.

outer rose
#

any sql experts in here?

lament cave
#

ask your question, don’t ask to ask! if someone here knows the solution to your problem, they’ll respond

outer rose
#

fair enough

midnight wind
outer rose
#

I have done a big data normalization task on a messy database I received, however, I am struggling with the final query. Imagine a table with 5 columns, I have extracted those 5 columns into 5 new tables, and now what to create a 6th table that will have the same information as the original messy table, but instead refers to ids instead of text or numbers. I can't work out what I need to query (or even google to work out what kind of query I need), to do a multi select insert

midnight wind
#

@nocturne galleon it's like 50 bucks for just the pi 4, 4gb

nocturne galleon
#

Hmm so they did up the price a bit

#

Used to be $30

wind horizon
visual path
lament wedge
#

I had an idea for a product, tell me if it would sell. A 75-150 dollar mini server (like rasperry pi) that includes a web-routable tunnel people can setup on their desk and push their projects to. easy built in interface to host static sites with simple storage, run backend services using docker or an abstraction of it and so on and so forth

#

maybe around 50-100 giga storage in the base models before upgrades. It would be really tiny and power efficient, not meant to serve more than 100 people at a time

#

like a cup of coffee size on your desk, any one interested in such a thing?

tawdry arrow
# nocturne galleon Wtf? It is?
#

125EUR

nocturne galleon
#

Oh, pounds. I’m in the US

tawdry arrow
#

euro, not pounds

#

125 euro is like 150 in the usa

midnight wind
nocturne galleon
#

I thought euros were also called pounds? Anyway yeah that’s still pricey

#

For a pi anyway

midnight wind
#

55 bucks for 4gb model

tawdry arrow
versed onyx
#

what's wrong with my script

strange pawn
#

getElementsByClassName returns a list so you would want to put [0] at the end or ideally just use an id instead with getElementById

#

when accessing the value of inputs you have to do .value

#

even though the type of the input is number it still returns a string

#

e.g. var a1 = document.getElementsByClassName("a1")[0];
..
value = parseInt(a1.value) + parseInt(d.value) * i;

strong star
#

Quick PHP question, how can I find the unix timecode for the beginning of the year?

#

@ me if anyone replies pls

pliant siren
#

use strtotime is one way

strong star
#

🙏 indeed it is, thank you

nocturne galleon
#

Anyone here that can make a discord bot

pine steppe
# nocturne galleon Anyone here that can make a discord bot

If you want to make a discord bot, you first have to choose between Discord.js and Python, or some other language that supports discord bots

Then just google a guide and follow that

I would recommend Discord.js, it has the most functions and it is probably the most versatile.
Guide for Discord.js: https://www.howtogeek.com/364225/how-to-make-your-own-discord-bot/
Discord.js Github: https://github.com/discordjs/discord.js

How-To Geek

Discord has an excellent API for writing custom bots, and a very active bot community. Today we’ll take a look at how to get started making your own.

GitHub

A powerful JavaScript library for interacting with the Discord API - GitHub - discordjs/discord.js: A powerful JavaScript library for interacting with the Discord API

pine steppe
#

Oh

#

I'm not sure if thats possible

#

I mean, it probably is

#

just that it will be really hard and painstaking

nocturne galleon
#

I got a bot but the people i paid to make it didn't add a way to use the economy

pine steppe
#

Do you know what language they used?

nocturne galleon
#

No

#

Cause they made it in a website called bot ghost

#

So

#

I cant look at the code

pine steppe
#

huh

#

lemme check out botghost

nocturne galleon
#

They took a cheap way oit

#

Of making it

night flame
#

why would you pay someone to use bot ghost lol

nocturne galleon
#

I asked for a custom coded bot

pine steppe
#

I mean, if you can't access the code, I dont think you can edit it. You may have to contact whoever built it for you

nocturne galleon
#

I cant

#

They blocked me

#

Can u make me a bot

pine steppe
#

I dont think I can do that for you

nocturne galleon
#

Ok

#

Cause idk how to code

#

Anyone here that can make a discord bot

#

Dm me if u want to help

#

@gleaming ridge can u help me

gleaming ridge
#

I can sure

#

What is the function

nocturne galleon
#

Admin economy and levels

gleaming ridge
#

Doesnt ring a bell

#

I can certainly make one that works with role levels

nocturne galleon
#

I need an admin bot that has an economy

gleaming ridge
#

wdym by economy?

nocturne galleon
#

A market

#

With money

gleaming ridge
#

I cant code that big of a thing, i can get you started but thats it

#

Also it would be taking a lot of time, besides my private life

#

Better off taking the request to Fiverr

nocturne galleon
#

Im on mobile so i cant code it

gleaming ridge
nocturne galleon
gleaming ridge
#

I can make it for you, but cant run it

nocturne galleon
#

Ok how can i run it

#

Do i need a computer to run it

nocturne galleon
gleaming ridge
#

Linux or Windows

#

And yes you do need a computer

nocturne galleon
#

Then im doomed

gleaming ridge
#

Like some small SFF, Ive got a couple of bots from me running on a dell optiplex

nocturne galleon
#

I got no computer

#

Any other way i can run it

gleaming ridge
#

not really

midnight wind
#

Gladly

lapis plume
#

4 hours without a message

nocturne galleon
#

no

gusty oak
#

So what font would you guys recommend for a projects page?

hollow basalt
#

Comic sans

silk eagle
#

one of those fonts that are just a bunch of symbols

nocturne galleon
#

Comic Sans (2) fr

strong star
#

i have no idea what i have done

#

this is the first div after the </head> and i have a head tag in my div now?

#

when i inspect it, it says it's legit inside of the div

#

however that is nowhere in my html

#

this is the top of a div with a table inside

#

i even put an empty div over it to see if that works but nope

strong star
#

nevermind i just re wrote the div

#

and it works

#

it was some php nonsense

sterile orbit
#

very bad calculator

slate frigate
#

@sterile orbit its always making stuff like that that makes you realize "simple little programs" arent all that simple!

#

You should push that to your github :)

sterile orbit
#

hmhmhm

sterile orbit
#

well its true

sterile orbit
#

what should I put in at the last empty space

sterile orbit
#

nvm

nocturne galleon
#

damn

#

our profs made us use javafx instead of JFrame

#

i wasted some hours learning about JFrame when I realized it wasnt going to be used

nocturne galleon
#

Working on a game about sausages linusSmirk

#

Never have I ever released a game to the public but I got some hope for this one

jolly hedge
#

Anyone else losing their weekend due to this log4j zero day exploit?

silk eagle
#

depends on your application but if its a minecraft server you'd just put:
java [args] -Dlog4j2.formatMsgNoLookups=true -jar [args]

nocturne galleon
midnight wind
#

it only affects public facing servers

midnight wind
#

well technically not

nocturne galleon
#

for 1.17

#

read again

midnight wind
#

yes

#

for 1.17

nocturne galleon
#

yes, and i said

according to mojang that doesn't work on all affected versions

#

which is true, older versions are also affected

fast helm
#

Anyone here familiar with python and might be able to give me a few pointers for a small program I'm writing? Related to the random library and calling variables

night flame
#

i dont think anyone here has ever used python before

fast helm
#

Ah, I appreciate it but someone already reached out and got me taken care of. Thanks though!

pulsar viper
#

nice

silk eagle
#

those of us who do know a bit of python are too scared of saying anything in this server because all the people who use other programming languages will bully us

slate frigate
#

Not true. Different languages for different purposes. Python is great for quick development, has wide reaching pre-made packages you can build on top of, and is very easy to learn.

#

Heck, I still use it for some of the one-off scripts I need that I want to run on windows and linux

pliant siren
silk eagle
slate frigate
#

Disagree on good

#

Plenty of stable, long term projects are python

#

My primary malware sandbox CAPEv2, is a python framework, and its excellent

silk eagle
#

nobody has ever told me python is good before cri

#

i mean i knew it was obviously good for something but never had a good reason to copy paste for whenever people criticize it about literally anything. now i have a fallback PES_EvilRondo

fickle storm
#

hello i need som help whth xml

fresh nexus
fresh nexus
#

Are you aware of any banking, medical or so software, that relies on it?
I'm not, so if I'm mistaken - please correct me

slate frigate
#

As part of some incident responses I have done, I have seen government and private sector businesses using custom python frameworks to run critical systems, mainly message queueing or some sort of db middleware. Don't think I can be more specific without breaking nda's, but I know they're out there.

fresh nexus
#

Alright, then I'm wrong 😛
I've worked on multiple mission-critical systems, and I've seen even more, and most of them avoided python and similar scripting languages and most used some kind of language which relied on compiling and which were strongly typed.

slate frigate
#

I think the advisibility of whether those systems should be python is definitely up for discussion, but when something is needed, and Dave the precocious sysadmin knows how to get it done in python, thats how it gets done.

#

Would definitely describe a couple of them as "mad scientist creations"

fresh nexus
#

Well, tbh a lot of software could be described as such KEKW

slate frigate
#

Inspecting the customers codebase be like -

midnight wind
#

it's only temporary

slate frigate
#

Nothing more permanent than temporary solutions

#

@fresh nexus actually, one I think i am good to talk about was an infrastructure provisioning service. Used some insane impacket code to handle dhcp/pxe, and ansible playbooks to build baremetal and VM for pre existing requirements

#

I actually took the idea, and refactored it into golang. Its up on my github

full socket
#

Web dev question, how do I get all the images in an automatic slideshow to be the same size? This is frustrating me a lot lol

#

Tried max-width: 100%; height: auto; and it isn't working

charred nymph
#

i have a very simple website with 3 columns in a row but i want the columns to not be in a row when I'm on my phone

hollow basalt
#

then don't

charred nymph
#

apparently i was a fucking dumbass and had some kind of spacing fucked up and all that fucked up my shit

#

sorry for the language but this pissed me off

silk eagle
hollow basalt
silk eagle
#

are you saying

#

that you use spaces

hollow basalt
#

how long have you been using python

silk eagle
#

a few years now

#

whats wrong with tabs

hollow basalt
#

"Spaces are the preferred indentation method."

silk eagle
#

preferred by who

hollow basalt
#

the actual python

silk eagle
#

what authority do they have, they made python its not like they made c#

hollow basalt
#

interesting that for the years you've been developing, you use tabs

silk eagle
#

yes ive found no problem with it and its comfortable

#

is there some fundamental flaw in using tabs instead of spaces

night flame
#

yes

#

a tab isn't a constant size depending on the environment. A space is always exactly the same size

silk eagle
#

o, yea i've noticed that when editing some python files written in windows on ubuntu, i always just replaced tabs with 4 spaces though which now that i think about it makes more sense

nocturne galleon
#

so

#

Im making a login form in VB and have managed to get it working with SQL from a database hosted on my pc, only issue is that if I were to run the application on my laptop, it cannot connect to the database.

How do I somehow remotely allow connections to it from anywhere so anyone with the application can connect?

obtuse night
nocturne galleon
#

Would an API be a lot easier?

#

For accessing worldwide

obtuse night
#

Safer? Yes. Easier? No

nocturne galleon
#

By easier I mean easier to access

obtuse night
#

You almost never have users connecting to databases directly for security reasons.

nocturne galleon
#

So if I were to publish this program now and my friend ran it on their pc and tried to sign into their account, it wouldnt let them connect to the SQL server, would it allow them to connect with an API?

obtuse night
#

No. Both would require either a VPN and/or opening ports on your router

nocturne galleon
#

So what would be the easiest way to go about doing this?

#

Being able to have anyone create an account and then be able to sign in from anywhere in the world

obtuse night
#

The quickest way to do this would be opening/forwarding ports on your router, and allowing incoming connections in your PC firewall.

#

Without an API

nocturne galleon
#

BUT each person that wanted to use the app would need to connect wouldnt they?

obtuse night
#

They would need to know your IP address or domain name

nocturne galleon
#

So how do apps like discord do it?

#

Allowing you to sign in and use from anywhere

obtuse night
#

They use an API hosted in a cloud

#

So the API and databases are in the cloud

nocturne galleon
#

I could do that, right?

obtuse night
#

Yes, but I wouldn't have a clue where to start

nocturne galleon
#

I know it wouldnt be good in a privacy point of view, but could I just create like a microsoft access database in the files of the app (encrypted) and have the program access that and pull the usernames and passwords from it

obtuse night
#

I guess that would work...

spring pond
#

you can get a low tier aws ec2 instance for free i believe

#

host it on there and make a simple api so you dont expose your entire database

nocturne galleon
#

What is going on with this query

lament cave
nocturne galleon
#

Ah yes

#

my poor eyesight

#

thank you friend

midnight wind
#

@nocturne galleon for anything public,you just make an API

#

You don't want users to have database access directly

silk eagle
silk eagle
#

oh

#

something something AWS ec2 instance?

midnight wind
silk eagle
#

something something dell optiplex in a closet

#

i think that's how they host the discord api

nocturne galleon
#

but if I can get it all working with an easy database, jt can be easily adapted for an API

devout jewel
#

@nocturne galleon you could look at an ORM annd just use that

nocturne galleon
midnight wind
#

there is nothing more permanent than a temporary solution

wind horizon
#

There are many different types of APIs, one of the most common over the internet is a REST API. You can setup a small server that handles incoming http requests and interacts with the DB. Then your app would just call these end points to get and send data.

There are also some cloud providers that will look at your DB schema and auto generate APIs like a GraphQL end point for your DB.

There are a lot of options, but it really comes down to what are your goals / needs. If this is primarily a leanr VB and SQL project that you don't plan to share with anyone except your friend a VPN may be the easiest option to keep on learning instead of having to learn about APIs now.

nocturne galleon
devout jewel
#

@nocturne galleon finding a good orm library might be a good middle ground here

wary briar
wind horizon
# nocturne galleon When the project needs finalising it’d need to use an API as it’s being used by ...

If you will have hundreds using it and plan to keep growing I'd deff suggest setting up a proper API server instead of SQL connections. It's not too hard and you can usually fit them on free tiers of cloud providers with server less, so you don't even have to manage the infrastructure and only need to update code. For example App Engine, Cloud Run, Cloud Functions, Lambda, etc.

These options would work best if your DB is also in the cloud, if you are gonna run it all on prem then you'll need to setup your firewall at home to allow traffic and get a static IP or use something like DDNS to keep updating when your IP changes.

nocturne galleon
wind horizon
humble spindle
#

I am looking for an open-source self-hosted system where you can drag and drop files and share a link quickly. Does anyone know of anything i could get working on docker? Basically looking for something the same as https://imgur.com/upload

midnight wind
# humble spindle I am looking for an open-source self-hosted system where you can drag and drop f...

Nextcloud has that I think but nextcloud is like a whole package and not the simplistist thing. There's this too https://github.com/rodber/chevereto-free

GitHub

Self-hosted Image Hosting solution. Start your own Flickr/imgur alternative with your own rules. - GitHub - rodber/chevereto-free: Self-hosted Image Hosting solution. Start your own Flickr/imgur al...