#development
1 messages · Page 80 of 1
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
anyone happen to have solved this and want to give any hints on DS to use for it? https://binarysearch.com/problems/Package-Matching
Learn algorithms together on binarysearch. Create a room, invite your friends, and race to finish the problem.
how do i make a discord bot stay on after i close VS code?
You need to host it
run it in cmd, then run your computer 24/7
A remote server, a local pi, some extra computer, run your computer 24/7
Learn algorithms together on binarysearch. Create a room, invite your friends, and race to finish the problem.
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
nvm solved it
Just been offered my first DevOps job! Super excited although I have a lot to learn
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
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
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.
agreed
Ik networking more than development, honestly prefer it
most people are idiots, most devs are people
∴ most people are people
therefore, not all people are people.
Quick, someone check the validity of this code!
def check(p:Person): return isinstance(p, Person)
Needs : at the end of the first line
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)
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
SDE = Software Development Engineer
Oh i see
I have another interview (for a tech lead) in about 90 minutes... I've already kinda lost interest in it heh
tired of python ai?
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.
So pretty much you're accepting java jobs
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)
I also want to try c/c++ SDE, but there's way too few
Kotlin and Scala pair with Java often.
so you're okay with JVM languages not just java?
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.
JRuby
tbf, i don't really have experience with Ruby.
use it occasionally cause someone thought Ruby as a DSL is a good idea
as someone learning programming, why do people hate javascript/typescript?
Despite being 5 years old now, this article always gives me a chuckle when people ask about Javascript programming.
https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f
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. 😄
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.
ah, thats cool
being a designer sounds awesome, sadly my sense of design is quite bad
I remember when i first got into react and i thought my HTML/CSS skills were enough 💀
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...
this is gold
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.
create from scratch and arguing what framework and language to use
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".
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
Sounds like you're great at helping
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.
so like a sys admin
btw, random question. what camera do you have. DSLR or mirrorless or other. we don't have #camera
Yeah, something like that. A technical swiss army knife, if you will. Jack of all, master of none.
i'd dig that
I don't think you'll find much hate for typescript. But javascript doesn't have the kind of mature tooling that you have in some other languages; and it being loosely typed enables all kinds of mistakes and uncertainty around the clarity of what you're actually insisting the code does.
I have an aging (but still functional) EOS 500D (Rebel T1i) - looking to replace it with a Sony Alpha series or the next RX100, assuming it has USB-C and their new menu system. Though if we want to talk cameras, probably want to move it to #off-topic or #tech-chat-1 / #tech-chat-2 - feel free to tag me to continue the conversation over there so we don't clutter #development.
I have my aging Canon 7D hooked up to use with BeatSaber Mixed Reality 😄
The 7D does 1080p video. So I'm using it with a 10-22mm lense as a webcam via USB for mixed reality streaming 😄
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?
my teacher taught us zero javascript in any capacity and now gave us a jquery assignment thats due tonight
Lol, god
so incompetent
it means your have completed a python programming course
did they give a sample of the badge
They didn't
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
@vestal spire make sure the cuda version is compatible with your driver and GPU.
oops
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
Looks like wrong curly braces { ... }.
We are going to need the code to help you with that
That sounds like a pretty descriptive and easy to follow error message...
^
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
You still cant c it's use
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
fix'd
Eh, C is a fine small language. There's no need to hate it.
C++ is 👑
Nah. C++ is fine, but it's not perfect. It has a lot of issues on its own.

Eh, about your issue on Notepad--: race condition on apiData if you have two requestApi() calls in-flight.
Requestapi can only run once
The bug only happens on win7
Idk why
Works fine on other platforms
You're sure? It gets called in both the constructor and setUp. If the network response takes more than the round-time to setUp, the it will get called twice.
If QNetworkAccessManager::get takes more time on Windows 7: well, there's your problem.
That being said: don't guess, debug.
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
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. 🤷
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
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
Tell them the test plan itself didn't pass its own usability test and ask for a corrected/updated test plan.
I am trying to relearn kotlin for android and its giving me a headache the syntax is so weird to me especially the ->
Got an example for the syntax with ->?
val multiply = {val1 : int, val2 : int -> val1 * val2} also for things like when statements
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.
Needs a <meta http-equiv="refresh" content="1"> for NoScript users (e.g. me).
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
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.
https://blog.inkdrop.app/how-to-build-an-air-quality-monitor-using-raspberry-pi-zero-w-c6a71b8dbb3b
Is their a way in the code to change the temperature from C to F
I want to build one for my grandfather because he loves to know data like weather and humdity and all
There is a math formula for converting C to F or many languages have libraries published that do it for you.
Is their a way to insert the formula in the code
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?
Yup ideally I'd find it in the BE code repo, but you'll have to know which sensor it is and find that. If you want todo it on FE in JS, which isn't exact with math lol, you can do it right here: https://github.com/craftzdog/anavi-phat-sensors-ui/blob/master/index.html#L97
code can be found at: https://github.com/AngelFluffyOokami/Cinnamon
Wouldn't doing that manually be much easier than having to import a whole library?
well, not exactly easier, but, just, importing a library just for a simple conversion seems... odd
Yup either way is fine, modules hopefully account for JS rounding issues but yea.
true
It is.
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)
Yeah. Modules and packages are great, but use them when appropriate, not because they seem cool.
There's a isEven package, ffs 🤦. It takes more lines to import it than to write it yourself, if you account for the additions to package.json.
It tells the coding and the sensors for temperature are HTU21D and BMP180
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
exactly!
I just want JS to finally include better date functionality, it's silly in 2021 almost every app imports a date tool. lol
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.
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.
If you use docker what I'd suggest is build your pre-prod image and ship it to your pre-prod. The same image should be promoted to prod, never build new images while scaling etc always point to the digest / hash. Since the built docker image will not change.
Also gives you a way to reproduce something odd being installed in the img, since a dev can download the img and inspect it.
tbh, docker is like a love hate relationship
Not applicable in this scenario, though.
Good ideas in general, but not applicable for that problem back then.
Either way, I need to get going, can add some details later
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. 😆
(TL,DR: not a server application or classic deployment at all, no scaling, prod, or other environments.)
after seeing more problems in R, i love C and Java now lmao
Whoa whoa, someone loves Java. I haven't heard that in a few years. 😆 jk jk
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
I love how easy it is to deploy an application where otherwise it would take hours getting going, but I also encountered a TON of random issues, like once I got one where I had to reflash OMV to my NAS to get docker working again due to it crashing every few minutes
and i loved coding in java with it
I haven't yet run docker on my NAS, I tend to just run it on my local with something like compose and then in deploys. My hobby projects are mostly running on GCP or AWS free tiers. I do have a scraper that notifies me of LTT stuff that maybe I should move it to my NAS, I could run it more often than I can on the cloud free tier. 🤔
makes sense! all I run on docker compose is emby, and soon nextcloud
even got a fourth domain just for my nextcloud instance whenever I have time to mess with docker to get it running with HTTPS
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
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)
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. 😆
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
Nice!
not like there's much choice actually, if I remember correctly, plex only supports nvenc, doesn't it?
thanks!
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
They support the Intel QuickSync as well, you can "hack" AMD support into it but it's not official / supported. lol
even then, usually, rackmount hardware have power bills to match their neatness
oh? didn't know that. though, due to past experiences, I'd rather not mess with the docker image
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
hahaha, better be backing up your NAS! lol
Ouch.
At least the irreplaceable files, yeah.
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.
ZFS would've had my back had I not deleted all the snapshots hours before I realized what I did 
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. 😆
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.
Just started a new job ~3 weeks ago, so at the moment I find myself working more at the job. Tbh, it's so much fun, I accidentally did some extra hours and need to cut back next week 🤣
Oh that's fun / awesome!
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.
overall, yeah kinda, altho my workplace is slow paced, I mostly pass the time on discord while there due to there not being much in the pending PCs queue to fix, if I'm sleepy tho, I just spend the time crimping ethernet cables to wake up
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
Omg I haven't crimped an Ethernet in years, I always hated doing that. Idk why I struggled so much with those stupid little wires. lol
it's oddly fun for me, just a hyperfixation thing I guess, however after a while my fingers start hurting
If you're on Linux, then work on your system's configuration. There's always something to do and to "improve your productivity".
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
I used to use Arch (btw), had to reinstall it enuff times to know how to install it mostly painlessly now, but I ditched Linux entirely due to Nvidia Optimus, and one of the games I play the most not being compatible with Linux ahem, roblox
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.
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
yep, the project I'm working on rn is compiled thru Linux, I'd rather not mess with windows PATH, Linux/WSL is just much easier
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
Oh I thought you had Windows and then were talking about dual booting Linux
I didn't know they still made PCs with 5000rpms
if I want to use Linux I have to wait a while for it to load, and vice versa
don't think they do, the HDD that came with my laptop died (4 different HDDs from same manufacturer Seagate), so money was tight and I had to settle for a cheapo HGST 500 gig drive
Wow some bad HDD luck right there
Meant your work machine 😄. If that was a Linux one, you could use the additional idle time for some configuration.
(Depending on your IT department, of course)
oh! don't really have a work machine, I'm just supposed to fix PCs people bring in to fix, altho there's two PCs me and my three other coworkers share, tho I don't really use it, and one of the PCs is mostly used by a tech to watch vtubers (yeah) while there's nothing to do
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.
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?
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
true! the biggest hurdle would be making the blockchain somehow compatible, but if pulled off, it would be amazing
(tiny bump)
That seems like a double escaped JSON array of objects.
o h
interesting
thanks for pointing in that direction! I'll take a look tomorrow after waking up
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.
Yeah I don't know Go well, but I thought the marshaling was primarily based on the struct.
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
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\"}"
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
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. 🤷♂️
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)
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.
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
I’m being able to update it somehow without the set stage. Apparently if I do set state the code keeps making api calls
Edit: with useeffect, probably that’s the issue set state actually works yeah
Do we have a LTT users group/leaderboard for Advent of Code?
Not that I'm aware of
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.

I guess you're using PHP? Then $_SERVER['REQUEST_URI'].
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.
Yeah I’ve seen examples of that but I’m just programming a simple weather app so basically I can run the api call every time the thing renders
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
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.
That’s pretty neat thanks for the suggestion!
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?
@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.
Well it’s in a virtual machine.. I’m using Ubuntu 20.04, Intel i5 9400, RX 5600 XT, and 16GB 3200 RAM
@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.
I’m sure my hardware is suppprted.. at least my board and cpu. I’d assume my 5600 XT would need passed to it either way. I ran the commands exactly as listed in the GitHub
@obsidian mirage offline install?
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.
Here is a link to my setup documentation. It shows all the detail steps I take until I run into the "suspend loop" bug. https://gitlab.com/sudofluff/os-config
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
And/or write proper commit messages.
fixed it
done the thing
test
.
thing
works
NOW it works
i think works
I said proper ones, not brain-dead one liners. :P
And rebase exists. One can always clean their history before they push their changes (or rebase before those get merged).
Don't you want to return err early if it's not nil? Going to be hard to continue on a non-opened file or wrong byteValues.
t r u e
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).
makes sense!
Anyone know where to go after scratch for my son for coding/etc?
simple websites with html could be a good option or you could start him on python
Thanks.
+1 python. It may not seem as exciting - going from graphical outputs (in scratch) to text outputs, but eventually he can work up to graphical stuff. Maybe start off with something like a quiz to get used to the syntax/language and conditions, then maybe calculators for learning the operations?
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.
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.
id go suggest some of the sites my universty and myself uses: Hackerrank / Codecademy
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.
just creator another .py
about the fstring part, if it's not that many. consider .format()
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)
- create non py file
- read it as string
- eval()
that i did not think of ,... thanx
I'm done with the abomination of a single-page website assignment I had to make for uni.
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.
Since it's a simple single page static webpage, you can easily set this up as a Github Pages website. Which means you can put your project in a Git repository, then have a link to a live hosted version of the website (eg. https://Tudi20.github.io/beadando-site)
Just fyi if you'd want this to be more accessible and shareable, particularly as part of your resume
would trying to make a game/engine go here or gaming?
i want to make a rhythm based game, but dunno how id start
@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
oh heck i forgot to mention i wanted it to be done with terminal lol
was mostly thinking a pixel art type display via cli output, and the only library i found for even making games like that was something written in golang?
Is there a particular reason you want to do it in a terminal?
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
Are you a seasoned programmer or earlier in your journey?
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?
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
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
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!
This is the library i found btw
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)
that library looks perfect for what you'd like to do
Taught*
there was also sdl2 recommended but im not sure what that is, it looked like it was for 3d?
Also does anyone want to try and crack my key system I used? I need to see if someone can crack it
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
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
You have to time every key press in necrodancer?
lol
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?
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
isnt this for more ddr style games?
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
ahhh that would be simpler to implement
im also bad at rhythm games lol
mostly picked that implementation of rhythm because i wanted it to be like
chord progression combo attacks
lol nice. Good luck with the project
im excited now lol, thanks!
thats very cool, but does it interfere with Windows in any way? esp with TPM2.0 required in Win11, are you sure this wont break that?
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.
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 😛
If you drop a link I'm sure someone can, I could take a peak but my Python skills are pretty low.
Same
Same
Same
I’m pretty sure it does tbh
I assume these are all dependencies for software, and if I remove one it'll brick something
probably LOL
why must it be like this <insert specific reason here>
because Microsoft
I felt the same way when i started
If you enjoy it just keep going, there is a moment where things start clicking and it's like oh that makes sense.
mama’s
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
wdym VS stuff
i assume Visual Studio
Why don't you script this?
- Not everyone needs them.
- 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?
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
it's not needed
Is there a way to append to an existing form on a website through javascript?
Not sure, but document.createElement might work
- Create the relevant dom object; 2. Append it to another existing dom object.
Thanks
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
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. 🙂
This is the whole thing for what I'm supposed to do, it doesn't clarify any further than this so I'm unsure. I think it just wants me to print it in console
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>
Yeah I put down a new div
That worked perfectly, thank you so much lol
I was overthinking it
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. 🙂
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. 👍
Thank you, I really appreciate your help with this :D
Sorry to bother you again, but I'm confused with this even more than the last one. This is like the last thing I have left on this now lol. Not exactly sure what it wants me to do
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
Ok
So this one you can pretty much just follow their example word for word, guessing they are having you do this and then will explain what you are doing later? lol
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.
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!
It doesn't do anything
I'm confused lol
Thank you for your help with it tho
Can you send example code?
Sure
<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 © 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
Oh do you have a blocker plugin?
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.
Ok dont shoot me yet but: Port Node.JS to Microcontrollers much like Micropython
Ok now you can shoot me
ok, Invalid syntax on line 1
Do you want bloat in your controllers
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......
Y E S
You initialize the img variable but never assign it to anything. Line 23
imshow("image", img)
does that not do the assignment?
I assume no
is that example code that is commented out?
and you are trying to read from img before it would even possibly be assigned
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
maybe cuz you are using the function imshow which clearly means image show
there is prob something for videos
it errors out before even hitting the imgshow command
yeah it's supposed to show one frame of the vid at a time
huh
look for example code I guess
for windows it's not advisable to modify files
it's not like linux
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
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
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
Source code? Programming language? Use case? Github link? Give us some details 😄
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
Hm, is Golang notorious for creating large or small binaries?
Its a staticly compiled language, so they usually end up being pretty large for what they are
Eh, you mean statically linked, right?
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 😄
The most consistent way for quickly shrinking ~30% are the ldflags s and w
Hm. Just realized that LTO might not make sense for Go, depending on their compilation model.
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.
Did you run upx on your shell yet? Would be interesting to see whether it can reduce the size even more.
Yeah, upx will generally shrink a go binary an additional 30%-60%
1MB is already impressing, given that Bash takes ~2MB (on Windows)
Upx is what took me from 1.2MB to ~800kb
58% off 360 hz monitor, and if you use honey, you get 75 cache back. https://www.dell.com/en-us/shop/alienware-25-gaming-monitor-aw2521h/apd/210-aycb/monitors-monitor-accessories
//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++;
}
2nd one for me
i've never seen the third option, prefer second when possible
agreed
github being down is so inconvienent
I prefer coding with the first option. Easier for my brain to parse as I read through everything
^
Witchcraft
People learning how to code in comp sci, and not practically?
'clean code' does not mean reduce the character/line count 😦
Also uses stdio.h instead of the appropriate cstdio 🤷
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");
}
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")`.
I hate Java, that is all.
hahaha
so is there anything I can do to help you lol
or soothe this
No no, I'm just in eternal pain.
haha
Stupendous news, I no longer hate Java, I just hate life.
Maybe it's Java making you hate life? 🤔
It generally does, does it not?
My only issue with java is its verbosity, i prefer kotlin
I'd certainly take java over javascript or python though
Take that back
Python is a million times better than Java, your opinion is wrong.
I don't care about semicolons, use kotlin if you don't like them
But braces are definitely a lot better than just indentation
no
whitespace that can cause errors is so annoying
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
I use intellij for java and kotlin, and vscodium for everything else, on linux
Hmmm
you can use vim on windows too
Yeah but why would you when VScode exists
Not as good
I don't like the Linux cursor
What
Specifically Kali

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
I do, I do Hackthebox and THM rooms on
you can change the cursor you know...
Fair, but don't use it as a daily driver, use it in a VM
And I've exclusively been meming this entire convo
And that, there are many cursor themes
Well yeah I still use Windows as daily
Ah
As much as I'd like to, I could never switch to any Linux distro RN
Guys use Redhat at home
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
opensuse is just robust which I like
I don't use Linux for any non-network pen stuff for which I use Kali as I mentioned
I just install the packages I need
I think if I were to actually switch over I'd start off with Linux Mint maybe
no need for kali, when I can just install things
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
ok so we are doing a science fair for my school and i need ideas for a programming project, anyone got any?
GPT-3 just became public you could do something with that
Hey guys
Do any of you know if you can access a sccm server using java
and if so how would I do that?
You could do an airline reservation system
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?
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.
so I gotta manually initialize it?
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.
yeah the examples I found don't make much sense
Learn about the InitializeComponent method in Windows Forms.
yeah no see they don't initialize it still
It should be in the designer of your form, I wonder why its not there by default
I tried copypasting those lines but it wouldn't work
Has anyone created an AoC leaderboard yet?
Hey is this the right way to prune my unify controller using the mongo database?
What do you call alot of object orientation in code
object
im just curious is there any part of coding you're going to use binary codes
binary codes?
as in machine code binary
no, not really
oh ok
istream::get() returns a character, not an integer
hey, is anyone familiar with Jekyll and github pages?
sorry for dropping questions like this..
why didnt you just ask your question instead of asking if you can ask your question
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..
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
what does it show when you click details
are you using plugins that github pages doesnt support
I am using this theme: https://pmarsceill.github.io/just-the-docs/ also I have previously built and pushed my project successfully on my github pages, heres the link: https://zhouxiang19910319.github.io/buddhistBlog/ and its just that the latest commit that gives me the issue
maybe I will rebuild this repo from ground up later..
Personally, I use Docusaurus just because md react is ezpz
https://www.youtube.com/watch?v=_Mo6U7_B7gs&list=UU6Om9kAkl32dWlDSNlDS9Iw&ab_channel=DEFCONConference
lamo dns go brr
GOV Doppelgänger Your Häx Dollars at Work

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
Hi is there anyone who knows java? I would like help with finishing an assignment of mine.
just ask your question
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
what does your arraylist look like
int firstPlace = 0;
ArrayList<int[]> SECOND_PLACE = new ArrayList<>();
ArrayList<int[]> THIRD_PLACE = new ArrayList<>();
im having trouble understanding. what does the data look like and what do you want to happen with it?
this is for second place
and you want to store those numbers into the second_place arraylist?
yeah but these numbers are in a csv file
okay what does the csv file look like
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
sure, that's what a lot of services do
thing is, someone can easily just get around that
how would one do that?
just sending another request using curl or similar
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
if they need auth, then yeah you can do it based on auth token
so like if the api needs auth, and you do it based on auth token, sure
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
Which OS?
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.
yeye ty
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
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
But I’m coming back to OSDEV once more to work on a custom operating system for a custom 65xx computer I will be making, I have started learning a little bit of Assembly Language, assembly still feels like gibberish to me but it’s more understandable than C or any other language I have tried thus far.
idk os dev myself but ik someone who does
they are in a flight sim server tho
I used to be in the flight sim server
sent a dm
wtf, why is rpi now 130EUR? so much for a "low cost developer board" I can get a TX2 for that....sheesh
chip shortage / scalpers probably
RPi still has a very base level model. But yeah, it has certainly scaled well beyond its original project intent.
Wtf? It is?
any sql experts in here?
ask your question, don’t ask to ask! if someone here knows the solution to your problem, they’ll respond
fair enough
it's not
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
@nocturne galleon it's like 50 bucks for just the pi 4, 4gb
union select?
Can you share an example? Like show what the tables are with some fake data or a diagram / schema or something?
the base model is still cheaper
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?
Ziel von Raspberry Pi ist es, den Kunden viele qualitativ hochwertige Produkte anzubieten und die Bedürfnisse aller Kunden zu befriedigen. Um dies zu erreichen, wird Raspberry Pi mehr Zeit für die Nutzung und das Design der Produkte aufwenden. In unserem Geschäft finden Sie immer mehr klassische,...
125EUR
Oh, pounds. I’m in the US
amazon is known to be more expensive
I thought euros were also called pounds? Anyway yeah that’s still pricey
For a pi anyway
55 bucks for 4gb model
euro is the currency for teh EU, pound is the currency for the UK, VERY different bud.
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;
Quick PHP question, how can I find the unix timecode for the beginning of the year?
@ me if anyone replies pls
use strtotime is one way
what you probably want is https://www.php.net/manual/en/function.mktime.php
🙏 indeed it is, thank you
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
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.
Problem im on mobile
Oh
I'm not sure if thats possible
I mean, it probably is
just that it will be really hard and painstaking
I got a bot but the people i paid to make it didn't add a way to use the economy
Do you know what language they used?
No
Cause they made it in a website called bot ghost
So
I cant look at the code
why would you pay someone to use bot ghost lol
I asked for a custom coded bot
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
I dont think I can do that for you
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
Admin economy and levels
I need an admin bot that has an economy
wdym by economy?
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
Im on mobile so i cant code it
What can u do
I can make it for you, but cant run it
Thx but how do i run it
Then im doomed
Like some small SFF, Ive got a couple of bots from me running on a dell optiplex
not really
4 hours without a message
no
Comic sans
one of those fonts that are just a bunch of symbols
Comic Sans (2) fr
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
very bad calculator
@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 :)
hmhmhm
well its true
what should I put in at the last empty space
nvm
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
Working on a game about sausages 
Never have I ever released a game to the public but I got some hope for this one
Anyone else losing their weekend due to this log4j zero day exploit?
depends on your application but if its a minecraft server you'd just put:
java [args] -Dlog4j2.formatMsgNoLookups=true -jar [args]
according to mojang that doesn't work on all affected versions
source?
it only affects public facing servers
well technically not
it literally says to do that
yes, and i said
according to mojang that doesn't work on all affected versions
which is true, older versions are also affected
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
No
i dont think anyone here has ever used python before
I can probably help
Ah, I appreciate it but someone already reached out and got me taken care of. Thanks though!
nice
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
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
Yo, I'm a Java dev who uses Eclipse, how do you think I feel? 😄
thats why we get bullied
because its great for quick development, not "good" development
Disagree on good
Plenty of stable, long term projects are python
My primary malware sandbox CAPEv2, is a python framework, and its excellent

nobody has ever told me python is good before 
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 
python is good
hello i need som help whth xml
it is, but there are a reasons why there are almost none, mission-critical systems that rely on it 😛
Oh you poor innocent thing
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
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.
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.
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"
Well, tbh a lot of software could be described as such 
Inspecting the customers codebase be like -
it's only temporary
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
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
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
then don't
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
the worst part about python is that people who use spaces to indent exist.

are you saying that you are using tabs
how long have you been using python
"Spaces are the preferred indentation method."
preferred by who
what authority do they have, they made python its not like they made c#
interesting that for the years you've been developing, you use tabs
yes ive found no problem with it and its comfortable
is there some fundamental flaw in using tabs instead of spaces
yes
a tab isn't a constant size depending on the environment. A space is always exactly the same size
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
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?
Usually, you would create an API rather than the laptop connecting directly to the database. If you dont want to do this, then you can just open the required port in your database host's firewall (the port depends on which database you are using), and change the connection string to the database host. This will only work on your local network
Safer? Yes. Easier? No
By easier I mean easier to access
You almost never have users connecting to databases directly for security reasons.
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?
No. Both would require either a VPN and/or opening ports on your router
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
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
BUT each person that wanted to use the app would need to connect wouldnt they?
They would need to know your IP address or domain name
So how do apps like discord do it?
Allowing you to sign in and use from anywhere
I could do that, right?
Yes, but I wouldn't have a clue where to start
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
I guess that would work...
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
you forgot a + between Text and "
@nocturne galleon for anything public,you just make an API
You don't want users to have database access directly
something something kubernetes something something probably
nah
I mean sure, you can host an API anyway you want
something something dell optiplex in a closet
i think that's how they host the discord api
That's pretty insecure
it is
but if I can get it all working with an easy database, jt can be easily adapted for an API
not really
@nocturne galleon you could look at an ORM annd just use that
Yeah, ive already sussed it
there is nothing more permanent than a temporary solution
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.
When the project needs finalising it’d need to use an API as it’s being used by hundreds of people nationwide
@nocturne galleon finding a good orm library might be a good middle ground here
um...
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.
Yeah that’s what I was planning on doing, but others said it would be extremely hard even though i’ve looks into it and it doesn’t seem too bad.
APIs are really easy, if you know the basics of programming and REST already. However if you early in your learning it can be pretty difficult in the sense that there is a lot to learn about.
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
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



