#development

1 messages · Page 49 of 1

deep scarab
#

maybe try passing a copy of that string?

#

String.Copy(TextBox.Text)

nocturne galleon
#

hmmm, doesn't seem to work

#

it's weird because right above it I'm accessing the count of ListBox.Items.Count and assigning it to an int without problems

deep scarab
#

hmm

#

maybe try wrapping the stuff you do in the other thread inside an Invoke()

nocturne galleon
#

Maybe if I define new variables in the global scope and adjust their value just before calling the new thread

obtuse night
#

Anyone know how i can make this generic C# repository function work?

public void Update(T entity)
        {
            _collection.ReplaceOne(new BsonDocument("_id", entity._id), entity, new ReplaceOptions { IsUpsert = true })
        }

entity can be anything, however it will always have a _id property

shy helm
#

Not specifically sure the terms for it in C#, but you probably have to restrict T to be a sub-type that is guaranteed to have a _id property

#

or if property inheritance is weird in C#, just make it have a method called id() that the subtype can overload

obtuse night
#

That seems a little complicated. Im just going to add another parameter and use that instead of the property

#

T could be 4 different classes

shy helm
#

It's really not that complicated with OO

#

you just make those 4 classes inherit/implement one base class/interface

#

For example:

interface BsonEntity {
  public String id();
}

class SomethingElse implements BsonEntity {
  public String id() { //do whatever }
}

public void Update(BsonEntity entity) {
  _collection.ReplaceOne(new BsonDocument("_id", entity.id()), entity, new ReplaceOptions { IsUpsert = true })
}
#

There's a java equivalent

obtuse night
#

ah yes. that makes sense. trying it now.
been thrown into the deep end with my project really. been an apprentice for 6 months and they are expecting me to know about generic classes and microservice architecture

#

thank you, it works 🙂

shy helm
#

ah, fair

#

🙂

#

glad to hear it

nocturne galleon
#

Maybe if I define new variables in the global scope and adjust their value just before calling the new thread
That worked

buoyant oxide
#

Anyone here tried cloud hosting a personal vpn solution?

elder ivy
#

what does that even mean. like installing a VPN on a VPS?

buoyant oxide
#

@buoyant oxide google google outline
@last ingot
trying to weigh all open source solutions like outline , wireguard and a few github repos i found. Outline seems to have a modern UI and multi platform client.

#

@last ingot Thanks for the suggestion

elder ivy
#

what about it?

#

what are the domains you need to block?

#

I mean really there's a reason why pihole doesn't block youtube ads

#

I mean you're missing a t

#

in your regex

#

and then 5hnedn7z doesn't match your vgqs

#

like your sample regex and the domain

#

it doesn't match because it doesn't match...

#

also the dots need to be escaped

#

since . is any char in regex

#

I mean regardless the trick to youtube is that they generate tons of random subdomains for ads and content

#

so that you can't block it efficiently 😄

#

like I said there's not even vgqs in your sample ad domain

#

what's a sample valid domain?

#

and you know which are which?

#

which are ads

#

and which are not

#

I'd go check with /r/pihole and what not

#

from what I understand it's not that feasible to block youtube ads via dns alone

#

they block at the html element level usually

#

or rather in addition to

#

also try ublock origin instead of ABP 😉

arctic basin
#

RIP terry

stoic lantern
#

is there a server with one hundred thousand users about kernels and Windows DLLs?

#

i notice this in not even populated about it

gilded moon
#

anyone here dabble in golang?

sick solstice
#

can anyone help me with python IDLE

#

3.8.3 i think

#

or 3.8.2

#

forgot

golden mural
#

anyone a C programmer lol

stoic lantern
#

Rust programmer, Rust Analyzer, Rustacean

somber river
#

Does anyone want to help me with some garbled code

#

anyone a C programmer lol
@golden mural same haha

#

I have a semi-reverse engineered version of Ryzen Master's Device.DLL

#

Just over 70k lines of C

elder ivy
#

"some C"

#

that's not some C

somber river
#

valid

#

I mean

#

It's fricken Ryzen Master

#

wait

#

Why am I not just compiling this and running it

#

like I only am looking at pulling one function out

#

@golden mural I am not one by trade but I have been working in c a lot recently

nocturne galleon
#

hey so I started writing code in my main branch that was meant for a seperate one, is there a way I can transfer my stuff to said new branch?

shy helm
#

did you commit yet?

#

if not, you can just checkout your new branch

nocturne galleon
#

oh cool

#

also, I'm trying to create the ability for my c# program to be able to check for and install updates for itself but I'm not sure how to do it, like it would have to delete its own file whilst running and I'm pretty sure windows would error saying "the file is open in another program" or something

shy helm
#

Someone else might be able to help you--I'm not particularly familiar with updating apps/deploying desktop apps, almost all of my work is in server-side

nocturne galleon
#

thats ok, but thanks for your help anyway

elder ivy
#

a lot of programs just run a separate installer to update. or separate updater program to do so

#

also learning to use git efficiently will go a long way for source control. maybe read http://think-like-a-git.net/ if you haven't already learned it

nocturne galleon
#

I'll check that out thanks

elder ivy
#

git is kinda awful in a way

#

but if you know how to use it, it's okay

nocturne galleon
#

when I have my program update by downloading the new version and replacing the old one, do i need to update some kind of manifest windows uses to know what to remove when uninstalling?

#

or is that only when adding/removing extra files to the install

nocturne galleon
#

eeh that looks really confusing

elder ivy
#

an updater is really not easy heh

nocturne galleon
#

sometimes microsoft documentation can be less than helpful, like its informative, but for someone like me who learns as i go it isnt as tutoring as a blog or something

#

I'll just make a super basic thing and pray it works

elder ivy
#

I mean realistically you're not going to be distributing your software anyhow since it costs money to sign it

#

I hear electron apps have magic install and updaters

nocturne galleon
#

well no im not putting it somewhere for 10000 people to download

#

but I am distributing it to a few people and dont want them to have to manually download the new version, uninstall the old one and install the new one. not to mention one of the main reasons this program exists is so I can learn how to do this stuff

limpid reef
elder ivy
#

Just give them a zip file lmao

#

And if you want you can have an in app notification saying there's a new version

nocturne galleon
#

if I'm going to the trouble of having a notification i might as well make the entire thing update in-app

#

and sorry but a zip file is irrelevant because as I've stated, this project is so I can learn how it works.

echo pendant
#

Programmable Bluetooth Controller or Raz Pi 4 PCB and a hacked up Joy Con thoughts?
Thinking about making a Pokemon Egg Hatching Bot


Reason for AI involvement is to make it programmable in a way that the AI can read key word data from the given screen dump, determine if the word is egg, do an action.. at the Breeder OR continue some other action. (likely go back to riding your bike in a circle and checking for hatched)

Check for NON EGG names, in the party.. *this could be pokemon name or anything which is not simply EGG)  every so often and if found do a loop to move them too any free box. 

Once in a while do a Loop down the party frame for key words egg and no egg is found go back to the breeder and check for a egg. 

You get the concept from this.

AI could potentially handle the timing through learning using some basic loops to check down the party frame image for key words, and bascially a set of macro like inputs for going between the breeder NPC and running off a little to cycle around and hatch. 

Using the starting point directly in front of the Breeder program macro using real player inputs and then its fine tune that and program the AI up to read dumped screenshots or screen read so to speak for key words.```
elder ivy
#

@last ingot there isn't a good alternative to git. Ideally source control would work more seamlessly rather than having someone understand graph theory in the worst case

shy helm
#

Git is kinda awful

#

There’s so much that could be done to make the CLI actually, like, user friendly

elder ivy
#

I watch people new to it struggle to learn it when they're trying to just learn how to fix some simple bugs

#

it gets in their way more than not

shy helm
#

Yeah 100%

#

I feel like most experienced git users can’t even do what should be relatively easy, conceptually, from memory, but is convoluted with Git

#

stuff like rebasing a commit to a different branch, fixing branch head sync issues

elder ivy
#

lol

#

yep, I have a plethora of git commands in a text file I keep handy

#

the random repack errors drive me nuts

shy helm
#

haha sounds about right 😆

#

I've worked with teams that use the upstream master/user origin, PR across repos for changes + smash commits, and it causes so much hell syncing shit

elder ivy
#

I think I would be happier with a mono repo at work rather than the multi repo setup we have. but the tooling just isn't there for that to happen

shy helm
#

Recognizing a tool has a lot of friction is not the same as not knowing how to use it 🙂

#

It's quite fallacious to claim that someone must not know something enough just because they dislike it

elder ivy
#

lol

#

I wouldn't say I don't know how to use git. In reality I've been using it for years

#

I'm still allowed to say it's awful. especially to new comers

shy helm
#

👆

vast echo
#

I would argue a steep learning curve is a significant negative to a collaboration tool

elder ivy
#

yeah, I've had to fix up people's branches before

#

it's not a pretty thing when they get stuck

shy helm
#

Well then make a better tool
Again, a fallacious argument

vast echo
#

Most people who use git know the basics, and have a saved google search for fixing screw ups

elder ivy
#

😄 I like this quote

#

but really the rest of the guide is good stuff. if you can understand git is applied graph theory then everything becomes easier. though it also means you need to understand graph theory lol

vast echo
#

so I should just start teaching graph theory to the old people at my work who are now being thrown into git to track changes in documents

#

easy peasy

elder ivy
#

lol

vast echo
#

sure they still sometimes message me about how to sign out of github desktop, but I'm sure they'll get graph theory

elder ivy
#

I don't know where you work but the old people in my office are fine at their jobs and learning new stuff

#

I work at a software company though lol

vast echo
#

I mean, the reason they don't understand git is because they don't need to

elder ivy
#

yeah I agree with that one

vast echo
#

99% of the time they can use it just fine without knowing exactly what it's doing

elder ivy
#

you shouldn't need to know as much about the source control as you need to know to use git

#

that's really my point

vast echo
#

but that 1% of the time I get a meeting request and I can walk them through something in 5 minutes and all is well in the world

elder ivy
#

lol I see people amending commits when they're not supposed to and what not

#

and then of course gerrit vs github for code reviews becomes another problem

#

(I use both)

vast echo
#

It would be really great if github desktop had better instructions and options to fix common mistakes

elder ivy
#

hmm yeah. I usually prefer git extensions but still has the knowledge

#

I do like the pull/rebase dialog in git extensions

#

has a pretty picture of what you're doing

#

merge commits vs rebases

vast echo
#

pretty pictures are great

shy helm
#

mmm love transparent images lol

elder ivy
#

lol the github model of working is a bit bizzare to me sometimes

#

branches vs forks I mean

shy helm
elder ivy
#

I can understand the reason for forking though

vast echo
#

that diagram is great but I feel like it only makes sense because I already knew everything

elder ivy
#

lol

#

YUP

shy helm
#

lmao

vast echo
#

It needs some numbers to indicate order of operations

elder ivy
#

try to actually number the steps and cycles

#

yeah

#

but even then, it depends what you're doing

#

ie you need to fetch and merge master to local every now and again

#

and there's no conflict resolution

#

which is the other hell at times

#

especially when you use the wrong command 😄

shy helm
#

unless you smash commits, in which case you need to rebase master onto yours

#

lol

elder ivy
#

I just tell people to branch prior to doing anything

#

just git branch temp

shy helm
#

you mean git checkout -b temp right? 😛

elder ivy
#

no checkout

#

I just mean create a pointer to LKG

#

and then do everything in your current branch

#

and if you screw up just reset to it

#

lol

shy helm
#

lmao

elder ivy
#

then again I like reordering commits to squash stuff more sensibly sometimes

shy helm
#
Here was the (well-intentioned!) advice from a GitHub maintainer of a project I’m working on (with apologies!):
1. Find the merge base between your branch and master: ‘git merge-base master yourbranch’
2. Assuming you’ve already committed your changes, rebased your commit onto the merge base, then create a new branch:
3. git rebase –onto <basecommit> HEAD~1 HEAD
4. git checkout -b my-new-branch
5. Checkout your ruggedisation branch, and remove the commit you just rebased: ‘git reset –hard HEAD~1’
6. Merge your new branch back into ruggedisation: ‘git merge my-new-branch’
7. Checkout master (‘git checkout master’), merge your new branch in (‘git merge my-new-branch’), and check it works when merged, then remove the merge (‘git reset –hard HEAD~1’).
8. Push your new branch (‘git push origin my-new-branch’) and log a pull request.
elder ivy
#

depends on the repo size since some of them I use ultimately just squash everything in at the end

shy helm
#

This quote always kills me

elder ivy
#

lol

#

I mean that's the immediate drawback of using forks

#

vs branches

#

I mean branches within forks

shy helm
#

Yeah

elder ivy
#

I can understand the forking for public repos though

shy helm
#

Thee's definitely "simple models" of using Git that makes it relatively easy

elder ivy
#

yeah, we kept it simple for our internal repos

shy helm
#

But as soon as you go past simple use, it becomes a pain in the ass

elder ivy
#

not too many people or too much traffic so everyone just branches

#

I kinda hope that one day I can experience mono repo hah

#

like a good mono repo experience vs everything is in the same repo and built together

shy helm
#

I heard talk from some of my Google friends that they've moved to mono internally

#

I'm veryyy interested to see that

elder ivy
#

yeah that's what I was reading about

#

it seems enticing in some ways

vast echo
#

Theres one big project at my work that is basically a mono repo

#

it was very weird to me at first but it works pretty well

elder ivy
#

I mean do you have individual portions of it that are considered libraries?

vast echo
#

not libraries per say but yes

elder ivy
#

like can you develop parts of the whole independently and then only at the time when you need to really consider the integration implications do you pay the cost

#

speed of the small repo but not the trade off of independent libraries is why I'm drawn to it

vast echo
#

every branch is independent with some shared stuff although we don't automatically update that together, someone has to do it manually but it could be automated in the future

#

it's way easier to manage all the different things than 10 different repos

elder ivy
#

yeah taking a single snapshot of everything at once would be nice

obtuse night
#

whats the best way for microservices to request data from each other? messaging seems like a one-way communication. is it best to use rest apis?

ashen sky
#

That really depends on the data.

obtuse night
#

large json data to send to a website

ashen sky
#

Well, the data format is irrelevant. Try to explain your use case in a little more details.

obtuse night
#

Website -> API Gateway -> Services
The website requests data from a gateway. gateway communicates with service (rest or messaging etc). Service reads from database, parses it and the data returns back up the line.
Its a Purchase Order system

#

clients ring us saying they want to buy stuff. Staff enter it into the website and CRUD actions take place in the services to update the data and return new values

ashen sky
#

If you have any kind of API already in place, just use that. In the case of an internal tool, the delay is affordable. (Should be seconds at most, anyway) If not, some sort of post request should do the trick, you COULD make it REST compliant, but unless you are building more than that API function, I wouldn't bother.

obtuse night
#

still in the planning phase right now. first attempt of microservices

ashen sky
#

So none of the services actually exists yet?

obtuse night
#

but messaging is not the way to go in your opinion?

#

So none of the services actually exists yet?
not really, no

ashen sky
#

You could use a message queue service, but that's just one more service in your setup, and not really needed for simple things like this. Especially not when no queue will actually be needed. Last I used a message queue was for an asterisk server to pass data to a website, based on certain events (Eg. User entered data, call was answered by agent) The messages are quick to deliver, and if data is lost, it's no big deal. It's more important to process the calls as fast as possible, and when the message has been delivered to the queue, Asterisk can move and with more important things. 😉

#

The message queue could be the way to go, if you know already, that you might need to scale out, as you can have multiple processes listening to the same queue. In ActiveMQ messages are delivered round-robin, to listeners, other MQ servers might handle it differently. You can then have the messages be ack'ed when processed, and be redelivered to another processor if not ack'ed withing a set time.

obtuse night
#

and mixing communication methods is fine? like theres a service which emails a manager whenever new data is added. If this uses messaging, is it usually ok to include http too? Also, how would you return data usually? would this be a new queue with IDs?

#

wanting to follow most of the best practices for this

ashen sky
#

I usually uses whatever makes sense. 😉 Also if using a message queue, I would run ALL inter-service communications through the queue.

Need to make a manager? Send a message to the email service
New order? Send a message to the order processing service
What data? Send a request to the appropriate service through the queue, get a response back the same way.

#

I'm not entirely sure if all queues are unidirectional. I think I might have seen something that was bidirectional. But you could give each service a queue, and use them for communications.

#

The MQ would of cause be a SPoF, but you can plan for redundancy if needed.

#

No, one main MQ service.

#

With multiple queues/topics. (Different MQ servers and protocols uses different terminology, but it's kinda the same)

obtuse night
#

one last question, ive seen you mention activemq a lot. in your opinion, is this better than kafka and rabbit?

ashen sky
#

ActiveMQ just happens to be what I've used most recently. We have a RabbitMQ server running, but library availability in PHP and Python suggested using ActiveMQ. I have no preference for either. Never used Kafka. RabbitMQ and ActiveMQ are both easy to get up and running, securing ActiveMQ was a little more PITA than RabbitMQ, but it's all documented.

shy helm
#

whats the best way for microservices to request data from each other? messaging seems like a one-way communication. is it best to use rest apis?
@obtuse night if it’s simple request response, use REST

#

If it’s more complex asynchronous tasks, use queues

#

If it’s 1->many broadcasting of data, use queues (Kafka)

ashen sky
#

Why kafka, over RabbitMQ or ActiveMQ? What benefits does kafka have the others don't?

foggy ginkgo
#

A relatively high management overhead in the form of Zookeeper 😄

ashen sky
#

Can that be considered a benefit?

#

Apparently kafka uses it's own protocol for everything, instead of a more standard like AMQP or Stomp?

foggy ginkgo
#

Can that be considered a benefit?
No, not at all. Kafka is actually quite useful if you are in need for a feature-rich and highly customizable queue system and have the capacity to manage it. I would qualify it as "enterprise-grade" and would reserve it for large-scale workloads.

shy helm
#

Why kafka, over RabbitMQ or ActiveMQ? What benefits does kafka have the others don't?
@ashen sky The Kafka consumption model is extremely efficient (persistent append only log file, clients have a ptr to their position in the log)

#

So, especially when you're broadcasting data, this model works quite effectively, with low overhead

#

Also, the fact that the Kafka topic can be persisted allows you to do many things that are impossible with traditional message brokers--there are a lot of data structures you can model with a Kafka topic, you can even do SQL over it

ashen sky
#

Both RabbitMQ and ActiveMQ has persistence. I tried to look around, but can't find anything on my own. Does kafka support traditional protocols like Stomp and AMQP, or do you need to use a kafka only protocol?

shy helm
#

Kafka has it's own protocol as far as I know

#

Both RabbitMQ and ActiveMQ has persistence.
I don't think either are designed to persist GBs of messages though? Correct me if I'm wrong

#

And in terms of performance, IIRC, Kafka >>>> alternatives

#

By like ridiculous amounts too, 1 Kafka node can do like 10x the throughput of a RabbitsMQ node

ashen sky
#

I don't think either are designed to persist GBs of messages though? Correct me if I'm wrong
@shy helm No, they seem to be mainly designed for a few KB of data.

#

By like ridiculous amounts too, 1 Kafka node can do like 10x the throughput of a RabbitsMQ node
@shy helm Which is nice, if you have a lot of messages, but that does not appear to be the case in this care. 😉

#

I haven't looked into the libraries available for kafka, but I suppose they are not much different from Stomp and AMQP libraries. The fact that it uses it's own protocol, however, makes it impossible to do in-place replacement of the message queue backend. While you can more or less switch between RabbitMQ and ActiveMQ with little to no changes to the application.

visual plank
#

How can I run two batch files at startup in vsdev cmd?

#

By default it runs the vsdevcmd.bat file
I want it to run vcvarsall.bat as well. So I did something like

"....\Tools\VsDevCmd.bat & C:\Program Files (x86)....\vcvarsall.bat"

#

It cannot parse the second argument after C:\Program cause of the space

#

How do I solve this?

ashen sky
#

Put the path in quotes.

visual plank
#

The whole thing? Like the way I've shown above? Or individually?

In other words, is it
"path/to/batch_file_1.bat & path/to/batch_file_2.bat"

Or

"path/to/batch_file_1.bat" & "path/to/batch_file_2.bat"

#

The second one doesn't work. I get a filename, dir name or vol label syntax is incorrect

#

Nevermind I got it 😁

cloud knot
woeful shadow
#

can i make a list like

#
Bill
John
Mark
Jim
Name1 
Name2```
#

and then i java read each line as 1 thing

#

and then i can use it to check if Bill or Mark is on the list

woeful shadow
#

nvm

elder ivy
#

o.O

woeful shadow
#

alright so i had to fix some other things

#

why wont list.contains("bill") work?

#

nvm

quiet tartan
#

@cloud knot where tf do u find shit like that lol

cloud knot
quiet tartan
#

blessing

obtuse night
#

Many API calls (code looks neater) vs a single API call (messier code)?
I have a microservice which is accessed by a API Gateway. This service needs to return 4 different shops' data. Is it best to bundle all these shops' data into a single response or call it multiple times from the API gateway? (no api limits and all local services).
I should add this is for a showcase project- not for production use

#

the question could be seen as readability or efficiency?

little knoll
#

Well, from what I've done in the past, I'd say a single call would be better. Just break your code into multiple reusable functions, it will help your project a lot as you'll be able to extend your API endpoint with stuff like query filter and alike

somber glacier
#

Hi, I'm trying to create a reminder system in python with SQLite. The table has a start and end date as well as a frequency (in seconds), finally it has a next_reminder_time column. I'm trying to make it so that the next_reminder_time is updated by the frequency seconds

conn = sqlite3.connect(DB)
cur = conn.cursor()
cur.execute(query, ('+ ' + str(reminder["frequency_time"]) + " seconds", reminder['id'],))```
This results in next_reminder_time being set to null
I also tried 
```query = "UPDATE reminders SET next_reminder_time = DATETIME('now', '+? seconds') WHERE id=?;"
conn = sqlite3.connect(DB)
cur = conn.cursor()
cur.execute(query, (reminder["frequency_time"], reminder['id'],))```
But I'm assuming in this case that the single quotes are overriding the ? placeholder.
The variable reminder is fetched from the database earlier in the code and has the existing frequency_time entry. I've checked and it has the correct value. Can anyone suggest a solution? Thanks.
shy helm
#

Many API calls (code looks neater) vs a single API call (messier code)?
I have a microservice which is accessed by a API Gateway. This service needs to return 4 different shops' data. Is it best to bundle all these shops' data into a single response or call it multiple times from the API gateway? (no api limits and all local services).
I should add this is for a showcase project- not for production use
@obtuse night depends on the structure of the API itself

#

Generally I would go the multiple call route

#

Unless the device making the calls is an android device, they have shit pipelining

nocturne galleon
#

so I didnt realise that I use [] instead of () when trying to append a byte to an array

#

but instead of giving a clear error message like "use of [] not expected" or something

ripe bison
#

looks clear to me, you're trying to apply indexing with [] to a method :)

nocturne galleon
woeful shadow
#

initialize class org.codehaus.groovy.reflection.ReflectionCache anyone know a fix?
a saw a github post that doesn't look good

#

Could not initialize class org.codehaus.groovy.reflection.ReflectionCache oops full error

#

nvm

clear flax
#

@nocturne galleon I think you have two errors saying

  1. I can’t do that, I am the wrong variable type
  2. You put a thing here so I am a sentence fragment or misplaced value

So you are sort of right but instead of confusing the computer with your grammar, you are confusing it with illegal clauses.

#

‘Method groups’ are weird.

plain trellis
clear flax
#

How commonplace is .NET

clear flax
#

I just started making a calculator app and accidentally put two / buttons and no EXE button. 🤦‍♂️

novel dune
red nest
#

any script to reverse youtube translation on titles/descriptions? It's really annoying and the script from github is really buggy, sometimes it leaves old titles on referenced videos and during livestreams it copies the description multiple times https://github.com/pcouy/YoutubeAutotranslateCanceler

elder ivy
#

I haven't ever seen auto translated titles o.o

final crane
elder ivy
#

No.

lone hornet
obtuse night
#

Anyone who knows about SignalR, what does the Negotiation do? Everything works without it, and running an API on docker using SignalR doesnt allow negotiation so im wondering what i'm missing out on by not having it

calm thicket
#

does anyone know if the intel C++ compiler optimizes for ryzen?

shy helm
#

I doubt it

#

it's probably similar to MKL where it only optimizes for intel processors

sick fossil
#

Hey yall i got a question
im new to programming so bear with me plz
How do i turn my code into something that i can run on actual hardware?

novel quiver
#

Compile it

#

Well it depends on what language

sick fossil
#

like im trying to make myself a hex calculator. the coding part im fine with but how can i actually make a physical calculator

#

c++

novel quiver
#

wait, physical calculator?

#

Like irl?

sick fossil
#

yea i imagine i need some components and some other stuff

#

like any pocket calc

#

just hex

novel quiver
#

You probably will need to learn assembly

#

you will be using a microprocessor

#

the other components are the easy part

sick fossil
#

ok compiler turns the code into assembly itself right? can i just grab that?

novel quiver
#

yes, but if you are going to do that I would write in C

#

do you know much about microprocessors?

sick fossil
#

not that much i dont think so

#

C and C++ are basically the same right?

novel quiver
#

Somewhat

sick fossil
#

i can just change some syntax

novel quiver
#

yes

sick fossil
#

aight i'll get back to yall later i gotta learn some c first then

novel quiver
#

learning C aftrer c++ will be a breeze

sick fossil
#

yea i thought so

novel quiver
#

I went the other way lol

#

I learnt C then C++

sick fossil
#

how much of a difference is there

#

like in general

novel quiver
#

syntax is basically the same

sick fossil
#

what about use case

#

idk if the question seems dumb im new to everything

novel quiver
#

the whole reason C++ was invented was to introduce Object Oriented Programming

#

C++ is just OOP C

#

with some extra libs

sick fossil
#

i know a little bit of oop that i studied myself for the full blown thing ima wait till next semester my class starts

novel quiver
#

also, research ARM processors

sick fossil
#

gotcha

novel quiver
#

dw its easy, I'm 16

#

I learnt it a while ago

sick fossil
#

i mean idk

#

i just dont want to learn it wrong i guess

novel quiver
#

It shouldn't matter, cause you will be writing in regular C anyway

#

which isn't OOP

#

also

sick fossil
#

aight ima go do some more research on microprocessors first then

novel quiver
#

Atmel is a good brand

#

they are pretty standard

sick fossil
#

got it

novel quiver
#

they make ARM

#

there is also motorolla, but they aren'

#

as user friendly

sick fossil
#

thanks man

#

appreciate it

#

i'll be back

novel quiver
#

one more thing

#

I recommend the ATmega32

#

despite it's name, its only 8 bit

sick fossil
#

uh

novel quiver
#

It's what is used in the arduino

sick fossil
#

now im looking there's a whole lotta options lol

novel quiver
#

yes

sick fossil
#

yea ima be doing some research on this whole thing

novel quiver
#

there are an absurd number

#

good luck! It's a huge field

#

but super facinating

sick fossil
#

yea

#

yea sounds fun tbh

novel quiver
#

exactly

elder ivy
#

all programming languages are similar with just some structural or syntactic changes 😄

novel quiver
#

Not really

#

I see where you are coming from

#

but I disagree

somber dome
#

Are there people accustomed to kubernetes?

obtuse night
#

what part? i know how to make docker images that can be used in k8s if thats what you are wanting help with. im not familiar with deploying it though

somber dome
#

Deploying

I've tinkered with microk8s, kubeflow and docker images to achieve what I want and Wednesday I'm deploying a cluster on aws

#

Also when I'm launching jobs if ressources are not available they are waiting in a queue for pods to complete and free ressources

But the order of the queue if apparently random...

#

Like I have one gpu available, launch job1, job2, job3

Job1 will get the required ressources, meanwhile pods for job2 and 3 are pending. When job1 end, another job starts but it is random :/

cloud knot
#

@lone hornet want pain ?

  return value ? true : false;
}```
😄
#

seen that in actual code

elder ivy
#

wtf?

obtuse night
#

Would it be a bad idea to use a single API Gateway for multiple unrelated projects?

#

i'm thinking it would be good for management as you could make a portal to edit the URLs in, and provide monitoring all in one place but not sure about the security of it. Would be deployed with many replicas which will help the reliability

shy helm
#

As long as they're segregated on the gateway I don't see why not--no different then sharing other servers

#

C++ is just OOP C
@novel quiver FTIW this isn't true anymore

#

C++ and C are not compatible, the C++ syntax has been expanded far beyond what's available in C

round dome
#

C is mostly compatible with C++ as long as you respect the C++'s type system

novel spear
#

the "mostly" is what gets you

#

particularly when dealing with not super super recent attempts to fix that

#

like if your compiler is a bit older

#

like most of the time you can paste C code into a C++ compiler and it will work

#

but not always

round dome
#

converting some POD style of coding in C to C++ is kinda trivial though, for small projects

#

shouldn't be that hard

novel spear
#

yea what comes to mind is like, the way structs work

#

and you used to not be able to use the dot notation to init individual struct members in C++, might be able to now

#

and idk what happens when you just slurp a struct into memory in C++

#

as an example

round dome
#

structs as long as they're not in unions themselves are just public classes in c++

#

so they get to have their constructors, operators etc

#

not that different to plain old data structs in C

novel spear
#

in a mixed C and C++ codebase my recommendation is just compile it all with the C++ compiler and code it as C++

#

that allows you to write safer/easier to understand code, use references, take advantage of raii

round dome
#

yeah the biggest advantage of C++ over C is type safety

novel spear
#

and then any slight differences wont get you

#

like the general assumption with new C++ programmers coming from having learned C is that instead of malloc you use new

#

and instead of free you use delete

#

but the actual answer is to use references and smart pointers

round dome
#

or delete[] GWseremePeepoHappy

novel spear
#

this is all to say, C++ having objects is really only one aspect of why it might be used over C, raii and references are a big deal

round dome
#

C++ is just a better language overall I think, it's constantly evolving

#

sure move semantics are important but there's much more to that

#

thinking of the new C++20 features for example

shy helm
#

C is mostly compatible with C++ as long as you respect the C++'s type system
@round dome not really though, there's a lot of things in C that are not valid in C++, beyond typing related things

#

variable length arrays? non-existent

#

flexible member arrays? non-existent

#

and you used to not be able to use the dot notation to init individual struct members in C++, might be able to now
@novel spear I think that's coming, not here yet, iirc

novel spear
#

variable length arrays are available as an extension in many compilers tho

round dome
#

you shouldn't really use VLA in C either way

shy helm
#

It really depends what you're doing

#

there are definitely use cases that benefit from them

#

and there are significant performance benefits vs. heap arrays for computationally intensive code

round dome
#

Of course there are performance benefits from using the stack instead of the heap but that doesn't mean that people should use VLA. There's always a way to avoid using them in any case.

#

Sure you might think that VLA are justified for your use case, if you are 100% sure the variable you're going to use is initiated and a low number, but in most cases it just ends up bloating your .text and being worse than using an invariant

#

Just eliminate any risk factors about having to take care of the variable used to initiate the array and don't use VLAs at all.

nocturne galleon
#

does anyone here know x86 assembly and wanna explain something that i'm seeing in IDA?

knotty mortar
#

Need a good free PaaS other than Heroku.

#

Heroku is cool but the dyno hours.

obtuse night
#

I've made a .net core 3.1 app and built it in release mode however there is not a System.Runtime dll being outputted when there should be. Is there a way to force this to be generated?

nocturne galleon
#

Help building 1500$ Development PC 2d game and 3d pls

nocturne galleon
#

@obtuse night - why would you want that generated? it would be assumed to be there because you need the runtime there to run your application

obtuse night
#

sorry, forgot to update the question. I tried installing it using a new windows service framework and targeted the dll of the project rather than the exe

rough bridge
#

does anyone know if python has any GUI libraries. Am thinking of porting over a program i made in java a while back but since java has terrible GUI libraries. I'm looking for something that i could use

#

that actually looks good* java has swing and such but none actually look good

dusty ermine
#

Hey guys any idea how I can convert my python application to a windows application?

bright hound
#

@rough bridge wxwidgets is a common goto but there's bindings for qt and gtk and frieds if you want

rough bridge
#

awesome, thanks. will look into those @bright hound

strange falcon
#

Anybody know a good place to host a discord bot for free?

deep wharf
#

@rough bridge Tkinter maybe?

#

@nocturne galleon I do, not an expert but I learned something, what is it that you need?

rough bridge
#

tkinter might able to be used. Last time i used it, it was for a class project where I just made a visual. I dont think it will able to have any buttons or any interactivity which i kinda need

obtuse night
#
app.get('/messages', (req, res) => {
  return res.send(Object.values(messages));
});

Is there a way to replace the ".get" with a variable? eg. if i am wanting it to say whatever is stored in a variable rather than .get, how would i go about this?

calm lark
#

I am programming a soundboard app for android, and I would like to use sound bytes from LTT videos. Who would I talk to for permissions and(or) licensing?

obtuse night
#

regarding my question, i think i have found an answer. I believe the eval() function will be best for this

elder ivy
#

eval ... what

#

@obtuse night what does app.get return?

tepid relic
obtuse night
#

@obtuse night what does app.get return?
@elder ivy This was an example using express for a web api. basically, i was wanting to change the .get to different http requests based on a database entry so the eval function will change a variable string into javascript code

obtuse night
#

following on from this, does anyone know of an equivalent function in c#?

knotty mortar
#

Ugh. Anyone know how to send HTML with the express.js but this time the HTML is purely a string?

cloud knot
#

@obtuse night for express, use app.all ?

#

but in general, you can do this:

let variable = 'get';
app[variable]('/messages', (req, res) => {
  return res.send(Object.values(messages));
});
obtuse night
#

sorry, i should have said its going to be an API gateway which supports all types of requests which contains the routes from a sql database. these requests might be a post, get etc so i needed a way to turn a string into js code allowing for different functions to be called

#

i was using the above code as an example of the sort of thing i wanted to do

cloud knot
#

and if you want to be sure if handler method exists, you can add an if:

if(typeof app[variable] === "function") { .... }
#

but yeah, app[variable] with variable set to get is equal to app.get

elder ivy
#

eval is pure evil

#

ohh no wonder. I misread the question. but yes what Parandroid said is correct api["get"] works

cloud knot
patent cloud
#

any iOS devs here? I'm curious if anyone knows of a Swift TicTacToe project with a resizable board (5x5, 8x8, etc.)

#

I've only been able to implement this using brute force check on every move.. wondering if there is a better way.

elder ivy
#

Are you talking about verifying a win or writing the CPU player?

nocturne galleon
#

Hey, so I'm not into coding, but I know people here know their stuff about coding. I want to know exactly how bad the code from Yandere Simulator is, here's some of it a friend shared.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IfElseScript : MonoBehaviour
{
public int ID;

public string Day;

void Start()
{
    SwitchCase();
}

void IfElse()
{
    if (ID == 1)
    {
        Day = "Monday";
    }
    else if (ID == 2)
    {
        Day = "Tuesday";
    }
    else if (ID == 3)
    {
        Day = "Wednesday";
    }
    else if (ID == 4)
    {
        Day = "Thursday";
    }
    else if (ID == 5)
    {
        Day = "Friday";
    }
    else if (ID == 6)
    {
        Day = "Saturday";
    }
    else if (ID == 7)
    {
        Day = "Sunday";
    }
}

void SwitchCase()
{
    switch (ID)
    {
        case 1:
            Day = "Monday";
            break;

        case 2:
            Day = "Tuesday";
            break;

        case 3:
            Day = "Wednesday";
            break;

        case 4:
            Day = "Thursday";
            break;

        case 5:
            Day = "Friday";
            break;

        case 6:
            Day = "Saturday";
            break;

        case 7:
            Day = "Sunday";
            break;
    }
}

}

round dome
#

my eyes...

elder ivy
#

lol wtf

foggy ginkgo
#

Wow. I like this code! So much junk!

Hey, @nocturne galleon, did you know there is a way to nicely render code -except on mobile versions, apparently-? You need to wrap it inside a code block and indicate the language. Here is an example:
```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IfElseScript : MonoBehaviour
{
}
```

would render as:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IfElseScript : MonoBehaviour
{
}
nocturne galleon
#

Ah, I knew that existed, just never knew how to do it. Cheers!

knotty mortar
#

Hey, so I'm not into coding, but I know people here know their stuff about coding. I want to know exactly how bad the code from Yandere Simulator is, here's some of it a friend shared.
@nocturne galleon
We know. Anime sucks.

nocturne galleon
#

))

nocturne galleon
#

lua is easiest language

#

ik its much into maths but for a game its actually easy nl

#

ngl*

#

im deving on roblox

earnest breach
#

Does anyone have good resources to improve coding skills?

foggy ginkgo
#

Out of my head:

  • Practising: Advent of Code, Euler Project, Google HashCode, HackerRank, Google Interview challenges, CodinGame;
  • Learning: Roadmap.sh (go crazy), meetups, blogs;
  • Reading: https://techurls.com/, HackerNews, IncrementMag.
    Resources unrelated to coding can help you code better. In any case, may I suggest contributing to an open source project? There is an infinity of things out there that could benefit the community and teach you cool tricks.
nocturne galleon
#

I guess you could always get programmer socks

wooden fjord
#

@earnest breach A four year course at a recognised trade school?

#

Damn amateurs, thinking they can steal dev jobs from certified folks

zenith nymph
#

?

nocturne galleon
#

Nothing like a bit of toxic elitism ))

elder ivy
#

o.O

#

as a dev, a four year degree won't help you code. but it certainly opens up doors to good jobs that need you to code

#

also google interview trivia questions do not make good code imo

#

contributing to open source would probably be a good option. but don't just code by yourself imo. find some way so that you aren't just doing it in isolation without anyone to bounce ideas/feedback off of. especially when it comes to architecture/design and even coding style really

nocturne galleon
#

is python good for coding games?

round dome
#

no

wooden fjord
#

A four year degree, at a trade college, will give you the fundamentals on how to code efficiently, introduce you to a ton of concepts, and land you an apprenticeship in the real world.

#

I have no idea where your statement of

"A four year degree won't help you code"

I've gone from being very amateur webdeveloper to full stack.

#

@nocturne galleon It depends on what kind of game you are making. Some engines use python, but don't expect to make AAA titles with it.

#

I would much rather recommend you learn C# or C++ if you want to enter game development.

elder ivy
#

@wooden fjord I mean I've been through 4 years of uni. it doesn't teach you to code but rather forces you to teach yourself a few languages. it's one way to learn but I'd argue I learned a lot more on my own and on the job

wooden fjord
#

To be fair I said trade college. Not university.

elder ivy
#

yup I know. I also know where my coworkers went to school. the type of school itself isn't what's teaching them imo

wooden fjord
#

Let me guess, American?

elder ivy
#

no

shy helm
#

as a dev, a four year degree won't help you code. but it certainly opens up doors to good jobs that need you to code
@elder ivy I agree, a four year CS or SE degree won't teach you how to write good code.

It will def teach you concepts that are rather difficult to learn on your own (most things relating to algorithms IMO). But this doesn't mean you write good code--I know plenty IOI kids who can't write production ready code to save their lives, but excel at LeetCode etc problems

elder ivy
#

also brain teasers in coding interviews are awful lol

shy helm
#

I do want to take a moment to recognize the fact that both are actually acceptable though, we def need people in our industry who are amazing at algorithm problems and we def need people who can understand how to productionize and build solutions out.

elder ivy
shy helm
#

also brain teasers in coding interviews are awful lol
@elder ivy Ugh yeah don't get me start on them, sadly though, it is a necessity in our industry to be proficient enough in Leetcode to get jobs

elder ivy
#

haha I know what you mean

shy helm
#

it sucks though, because it's the IOI kids that kill all those interviews because they've already seen all the problems

elder ivy
#

it's honestly hard to sort through who would be good at what you need them to do. understanding of code aside

#

I agree with you about the differences between the type of roles that need to be filled

shy helm
#

I don't agree with the Leetcode-whiteboard-interview stuff, but I do recognize that it's sooo difficult to really assess someones skills and competency in our industry

elder ivy
#

the one time I took part as an interviewer was when the candidate was on the phone. you could literally hear pages flipping when we asked a question

shy helm
#

oof

elder ivy
#

lol

shy helm
#

😬

elder ivy
#

YUP

shy helm
#

TBH though, I wish more interviews would allow for the use of resources

elder ivy
#

oh sure

#

bring your own laptop and show me you can write some code

shy helm
#

Not stack overflow obv, but like, C++ and Java docs etc?

elder ivy
#

that too

#

I don't even care if it's stack overflow

#

it would be up to the interviewer to design a question that isn't just searchable lol

#

probably supplying a base template that needs implementation, and has some bugs

shy helm
#

The number of times I'll have an interview in Java or C++ after coming off a bender of writing the other, and then get confused on function naming of basic things is far too high 😆

elder ivy
#

and just have people walk through how they'd solve/debug/design/implement

shy helm
#

Hmmm, is it Vector.add? Vector.put?

#

Does ArrayList have an emplace... ?

#

😆

#

Shit is it length or size in CPP

elder ivy
#

lol

#

I mean I get thrown at various languages depending on where they need me. so yeah I just look it all up

#

and/or use IDE to help

#

I'm on the web side of things though

shy helm
#

My fav interview question I had was about reflecting a binary tree, i.e. provide a mirror image of it so the left branch becomes the right etc

#

OH, no it was about determining if two binary trees were equivalent

#

Wrote it recursively, it looked great

#

then off hand as the interviewer was asking a new problem, he goes "Oh, what is the space complexity of this algorithm?"

#

I say, well, we have to check every node, so it's O(N)

#

Oh wait, no, it's log n, because we only need to hold the longest path

#

Hmmm... maybe it's O(N)?

#

and the interviewer was like "I ugh... I think it's.... uhhhh... lets just move on"

#

Later, I asked one of my profs and he goes "Oh, well it's obviously O(N)..... wait.... no it's log N.... uhhh"

#

😆

elder ivy
#

lol

wooden fjord
#

Just pointing out.. Never gotten any of those awful coding questions people keep talking about. I've been asked to bring samples of my work, or work on a minor project and show off the solution.

And just going to reiterate my point since it is being possibly deliberately missed. I am not talking computer science or software engineering at a university. I am talking full stack developer educations at trade colleges, which involves mostly actual coding, not theory or selfteaching. It also involves actually working with code at businesses.

shy helm
#

Just pointing out.. Never gotten any of those awful coding questions people keep talking about.
It probably depends on the companies you apply to

#

But all the major US tech companies ask those kind of problems

wooden fjord
#

Everything from webdevelopment to backend solutions and database management.

elder ivy
#

yeah I work at a major tech company. they still do awful questions. but of course YMMV depending on the company

wooden fjord
#

And the general competence of HR and interviewers.

shy helm
#

Eh, most tech companies have engineers do the bulk of the interviewing, from my experience

wooden fjord
#

I have yet to get an interview with someone who wasn't directly working with developers.

#

@shy helm That has been my experience as well.

elder ivy
#

as a company becomes larger, the screening they do tends to try and filter out people with some "easy" solutions

foggy ginkgo
#

then off hand as the interviewer was asking a new problem, he goes "Oh, what is the space complexity of this algorithm?"
I would reply that the space complexity of a binary tree comparison is O(log2(N)) if both trees are balanced, O(N) assuming the worst case scenario.

elder ivy
#

like Amazon with their text analysis of resumes (back when I was applying)

wooden fjord
#

Sounds like a CS student

elder ivy
#

what's wrong with being a CS student?

wooden fjord
#

Shrug Personal experience has left me with the impression that most of them are incompetent in most branches of programming.

#

Lots of theory, no practical experience.

elder ivy
#

o.O

#

your personal experience is probably due to where you experienced it

wooden fjord
#

Denmark. University students in general are pompous tits.

#

I should know, I was one briefly.

elder ivy
#

I'm from Canada -shrug-

shy helm
#

Shrug Personal experience has left me with the impression that most of them are incompetent in most branches of programming.
@wooden fjord lol

#

Terrible take

elder ivy
#

pretty much

wooden fjord
#

Terrible take, possibly. Just speaking as I see 'em.

shy helm
#

I would reply that the space complexity of a binary tree comparison is O(log2(N)) if both trees are balanced, O(N) assuming the worst case scenario.
@foggy ginkgo For reference, this is correct. The issue was in the interview there was a bit of ambiguity on the nature of the trees 😆

round dome
#

Why even bother looking for a job? Harvest the energy of dark mystical x86 assembly and feed off that to survive

elder ivy
#

lol

native helm
#

long shot, but is there any ios app/tweak developer here that could help a newbie out? Stuck on custom UITableViewCell layout for almost a week now 😦

calm thicket
#

does clang produce smaller binaries than gcc

wild delta
#

Hey I started learning Python yesterday .___. and uhh is
while Truean infinite loop until it's broken?

wooden fjord
#

Always an infinite loop.

#

There is no pointer to what is false or true, so true in this case means the app is running

#

At least I believe that is a case. Do not do much work with python

wild delta
#

Thanks

#

Also is there a way to change the state of a variable (True or False) if a condition is met in Python

wooden fjord
#

If(variable1 == condition)
..... variable2 = true

wild delta
granite river
#

shouldn't line 15 be "started = False", one equals sign?

wooden fjord
#

Because you never add start = false

#

Wait, dalt is right

#

Yea its a typo with the double equal signs.

tall kernel
#

can someone help me with-
if you type servers ip address then it will automatically forward to the domain?!

#

idk how to do it

#

html, php, htaccess?!

#

nginx config?

#

i want to redirect this automatically to

#

this

shy helm
#

Yeah you can use nginx

#

Set the server name to be your IP

tall kernel
#

😮

#

i dont want to redirect from SOMEDOMAIN to ANOTHERDOMAIN

#

i just want to redirect the the domain if someone enters the servers ip

shy helm
#

Yeah

#
server {
    . . .
    server_name XXX.XXX.XXX.XXX;
    rewrite ^/$ http://www.domain2.com permanent;
    rewrite ^/(.*)$ http://www.domain2.com/$1 permanent;
    . . .
}
#

Create a new site

#

and add this

#

It's under example 1 in the link

#

You don't want to redirect the same site to itself

wild delta
#

I'm trying to make a program that sorts a list so there is no duplicates

#

Nvm

wooden fjord
#

Looks like you're never saving the new value

wild delta
#

Does name become a new variable or something??

vast echo
#

the { } around the name variable

#

specifically because of the "f" before the string in that print statement

#

which allows for putting variables in { }

#

notice how the text hilighting changes to signify it's different from the rest of the string

wild delta
deep scarab
#

@wild delta

person = Person("John")
person.talk()
wild delta
#

ohhhhh thanks

deep scarab
wild delta
#

huh

#

Ohhh I think I got it

deep scarab
#

because talk() doesn't return anything

#

just do person.talk()

#

doesn't make sense to print it

wild delta
#

Oh I see

#

Thanks!!

wooden fjord
#

I think you need some kind of book or course Sirkolor

nocturne galleon
#

lol python go brr

wooden fjord
#

No print(brrr)

#

0/10

nocturne galleon
#

print(‘brrr’) ?

#

I think you need some kind of book or course Sirkolor
@wooden fjord

wooden fjord
#

Yes

clear flax
#

In WPF, is it possible to store an XAML context menu for later use like a user control?

#

On second thought, is it as simple as altering an XAML user control and set it as a context menu?

shy helm
#

@wild delta so, right now, your find max function doesn't take any input

wild delta
#

Right

shy helm
#

so, how does it know what array of numbers to be looking at?

wild delta
#

Uhh

#

Oh wait

shy helm
#

One of the most important ways that information is passed around in code is through function parameters

wild delta
#

That was a stupid answer

shy helm
#

the function that you made doesn't get to "see" that array numbers you have declares in the bottom of the file

#

functions only get to see whats inside of themselves

wild delta
#

Oh wait

#

Ok listen to this solution

shy helm
#

(this is called scope, but that's a discussion for another time)

wild delta
#

What if I make a class called Numbers then I put that as a parameter

shy helm
#

That is one way you could do it!

wild delta
#

Then I can use different arrays for each time I call max_numbers

shy helm
#

But, I would say, I don't think this function meets the criteria for being a class

wild delta
#

Wait one sec I'll be back in like a minute

shy helm
#

Instead, you just want to be able to give this function specific data, and for that, you need function parameters

wild delta
#

Ok I tried something it didn't really work

#

So what are you saying I should do @shy helm

shy helm
#

make numbers a parameter to the function find_max

#

i.e.

def find_max(numbers):
#

also get rid of the numbers = []

#

this way, people calling find_max can give their own array of numbers to search through

wild delta
#

How come it only gives me 1 error even though there are 2 different errors

shy helm
#

You're missing one last thing

#

you gotta return the result

#

🙂

wild delta
#

huh

#

Where?

shy helm
#

line 6

#

inside the function, write return max

#

that's how you get data back out of a function

wild delta
#

HOLY SHIT IT WORKS

#

OMG Thank you

shy helm
#

essentially, function parameters take data in, return gets data back out 🙂

wild delta
#

That was just a "simple" exercise in a tutorial dude jesus

shy helm
#

Once you get familiar with the basic concepts it will become "simple"

wild delta
#

Holy shit WOOOOOOOOOOOO

shy helm
#

Kinda like, riding a bike is only simple once you know how to 😉

wild delta
#

Ok but I still have some questions about the finished function

shy helm
#

shoot

wild delta
#

Ok so there is the parameter "numbers" right

shy helm
#

Ok wait one sec

#

before we dive in

#

the return needs to be unindented

#

right now the return is in the body of your loop

wild delta
#

What's the difference?

shy helm
#

if it's in the body of the loop it runs every time 😉

wild delta
#

Yo xbox games showcase is starting PogChomp

shy helm
#

but in this case, that means you actually just exit the loop immediately and return the first value

#

your code rewritten in pseudocode (essentially, code written in "normal" english) is equivalent to

function find_max(numbers):
    max = 0
    for each number in numbers:
        if number > max:
            max = number
        return number
    end for loop
end function
stiff sun
worn stump
#

So I'm trying to work on parallelizing ffmpeg transcodes, but I'm having a hard time a) nailing down exactly how much CPU & RAM ffmpeg is using, and b) how to actually properly parallelize it.

I was initially thinking of just using parallel (https://git.savannah.gnu.org/git/parallel.git/) to do it as it's already installed (as it was apparently a dep of aurutils), but AFAICT that doesn't necessarily keep each process isolated to one core (or set of cores)

wild delta
#

Omg dude ffs I just closed and opened up PyCharm and the package or folder or whatever you want to call it that I was using is gone

#

And instead the package that I actually did want to get rid of yet still don't know how to, is STILL THERE

#

"PyCharm is beginner friendly" my ass

graceful silo
#

pycharm is plenty beginner friendly

#

it'll re-open the last project you had open when you start it

wild delta
#

That's the first thing you adress -__-

graceful silo
#

what's your current code

#

is it the same as the last screenshot? or has it changed

wild delta
#

?

#

There is no code

#

There isn't even a file

graceful silo
wild delta
#

The there being no code part doesn't matter cuz I erased everything I had in there

#

It's just for me to practice things I've learned / am learning

graceful silo
#

see where it says "> Scratches and Consoles"

#

click the >

wild delta
#

Yeah and

#

In it is a folder called "Scrathes" and in that is a single scratch file

#

The thing I was using is called "Hello World"

graceful silo
#

gotcha

wild delta
#

I still have the actual folder on my computer

graceful silo
#

right click on it and click reload from disk

wild delta
#

Op wait nevermind I just restarted PyCharm and the thing is there

#

I've never seen that page before when I've started PyCharm 😅

#

Huh

#

Weird

#

@graceful silo Anyway thx for all the help today

graceful silo
#

lol

dim shard
#

hey does anyone know how to delete a txt file in java?

clever sparrow
rancid arrow
#

does anyone know how to set up a Collider in Unreal using C++
i m trying to make this actor code
do :
player enter the collider
code run : increase the rust of the texture )
player exit the collider
code : decrease the rust of the texture

#

i already make the texture and nessasary part , just now sure how to implement it

#

do ping me for reply , thanks

dim shard
#

@clever sparrow I meant delete a line in the file sorry

woeful shadow
#

hello so i already have a website running on an apache2 server on my vps

#

now i was wondering how to without disturbing how could i make an image on the vps show with a url like...

#

i need this for a trick im doing

#

and it requires a changing image

#

so i'd need to be able to swap out image on the same url

nocturne galleon
#

Just created a custom gaming linux distro. ultralight openbox/debian idles at 90mb ram and can work on literally any processor

prime pine
#

Code?

#

I just create a window manager in rust

#

it works in x because i use the xcb lib

vernal marsh
#

hie

#

if anyone has worked before with electron and google cloud api's

#

I was trying to use node.js client of gcloud auto ml

#

I have always stuck on the part of authentication.. no matter what I do its not really working

#

this is one of the different 100 varients of errors... but this is without any authentication... because it says something about a way to do it... but I am not that of a web developer

#

it would be awesome if someone gives me hint about what is it telling me to do

prime pine
#

Bruh

#

Electron dev in windows

#

XDDD

vernal marsh
#

lol not primarily electron dev... this is just a project... I thought electron would be good

#

🤷‍♂️ but I don't think this is windows problem

hollow basalt
#

Some apps are switching from electron

cloud knot
nimble hemlock
#

Question: Is this any development, or some specific project?

vernal marsh
#

@nimble hemlock nothing that important.... its just for a competition.. for which I don't even have to make a client application but 🤣 I am that kind of person who would learn anything related soooo... yeah

#

@cloud knot yeah I did figure that..... the examples they showed which I just first copy pasted... is for a node.js normal app ... so they used 'open' lib.. which just opens uri on a browser and has callbacks and stuff... offcourse I can't do that inside a browser and it had webpack incompatibilities sooo... I found electron.remote could be the alternative

#

I will catch up on it... its been a long day of debugging codes

#
//pretty sure this line can be replaced.. with electron.remote
open(authorizeUrl, { wait: false }).then(cp => cp.unref());```
vernal marsh
#

frikkk... fs doesn't work in browser too..... node.js and electron is a mess

grizzled steeple
#

Of course not. You don't want random websites snooping around your harddrive. require('fs'); is a NodeJS only thing for a reason. Electron uses Chromes Blink to render normal HTML and CSS, but uses NodeJS's V8 engine to run JS, so that you can actually make a usable PC app and not just a website framed in a slimmed down browser

#

So if you want to develop a website, that can also be used as a seperate app (like Discord for example) and want as much code re-usage, you have to make if statements around things that only work in browser and things that only work in Node/Electron

vernal marsh
#

@grizzled steeple is there a way to use node.js libs and electron? I don't think its possible but I am new

#

so I am unsure about many things 🤷‍♂️

grizzled steeple
#

I haven't worked too much with Electron, so I can't say for certain, but it should be doable. Afaik you can use the fs lib in Electron somehow. Could ofc be that they're using something else with similar abilities

#

But it could also be that it's like Vue vs Nuxt, where some Vue libraries work without a hitch after importing into Nuxt, and others need some rewriting to work

vernal marsh
#

so here is a thing.... when I read using fs.. it shows no errors or anything .. it works.. but when I include electron.ipc or remote... crash

#

any idea what else this would mean?

#

I could skip electron.remote too.. and use react portals but I would like to understand this issue 🤷‍♂️

grizzled steeple
#

You are sure fs is available in that function context?

#

That's like the biggest annoyance of JS

vernal marsh
#

I never checked ... hold a sec

elder ivy
#

o.O

#

how are scoped variables annoying?

#

it's just closure

grizzled steeple
#

The annoyance is that JS doesn't tell you. You never know what this refers too

brave jungle
elder ivy
#

use typescript

grizzled steeple
#

Hey, that's what's part of the fun, Lima xD

elder ivy
#

don't use ==

vernal marsh
#

const ipc = require('electron').ipcRenderer; I just imported ipc

#

and it shows up the error

grizzled steeple
#

Well, you wanna check if a variable is null and/or undefined? blah == undefined

brave jungle
#

i like javascript even tho its a bit messy

#

so if im working on something that isn't a small script i'll just use TS

elder ivy
#

!blah

grizzled steeple
#

*!!blah

#

Oh wait... nvm. I'm stupid xD

elder ivy
#

I mean you can do blah ?? false if you want stuff like "" to pass

grizzled steeple
#

?? I never heared of that...

elder ivy
brave jungle
#

i didn't know that exists in JS

#

i use it a lot in swift tho

elder ivy
#

they've been trying to improve it recently but yeah a lot of proposals currently

#

I don't disagree that there's a lot of weird quirks lol

#

and terrible pitfalls

vernal marsh
#

ohk.. its undefined

elder ivy
vernal marsh
#

well... react portal it is

elder ivy
#

apparently there's a module called electron that isn't electron

vernal marsh
#

whaaaat? really... 🤦‍♂️

#

now... how do I know if I have currect 'electron'

elder ivy
#

the other option is that you're in the wrong context for requiring it...

#

iunno the the debugger and see what's inside? check your package.json?

#

ugh what's with electron and promoting automatic semicolon insertion

vernal marsh
#

welp...

#

oh wait

#

that issue is old

#

@elder ivy

#

I guess they figured it

elder ivy
#

oh I see

#

And thanks to @logicalparadox for allowing us to take over the electron package on npm.

#

lol

vernal marsh
#

I had a heart attack 🤣 lol... if I would be using wrong electron

#

well rewriting the same file for 3rd time

elder ivy
#

iunno last time I used electron I just cloned the quick start as a basis

nimble hemlock
#

@nimble hemlock nothing that important.... its just for a competition.. for which I don't even have to make a client application but 🤣 I am that kind of person who would learn anything related soooo... yeah
@vernal marsh I was talking about this chat channel :D

prime pine
#

javascript is shit

elder ivy
#

jobs that use it pays more than most the other languages 😄 ¯_(ツ)_/¯

prime pine
#

bloated lang

#

Hello world uses 1GB

worldly crow
#

anyone who got some experience with C# and JS?

elder ivy
#

lol "hello world" uses 1GB. what are you talking about

vernal marsh
#

javascript has its own place

#

😇

#

its a tool 🤷‍♂️ which has matured a lot, I assume, over the years... personally I like style of statically typed language but python and javascript cause no problem

prime pine
#

I hate what electron does, all applications have inconsistent themes, better make applications using qt or gtk

#

forgot to say they consume more ram, i'm in a CLI app of discord now

#

6cord

hollow basalt
#

discord have a cli?

#

hahaha

#

how do you see the chats?

#

stdout?

#

no seriously I am curious
@prime pine

elder ivy
#

you know IRC exists right

hollow basalt
#

discord have IRC?

elder ivy
#

no I mean IRC is a thing before Discord

hollow basalt
#

he said " CLI app of discord "

elder ivy
#

all I'm saying is that I would imagine it would look like IRC

prime pine
hollow basalt
#

thanks for that @prime pine

prime pine
#

There's more

hollow basalt
#

Now I could use discord in CLi and look smarter

prime pine
#

but this is the most popular

elder ivy
#

might as well go back to irssi

prime pine
#

IRC is my city

elder ivy
#

I moved off of it. meh

#

privacy be damned but having nice clients across my devices is better

cloud knot
#

@prime pine let me explain what electron does - it allows you to have apps on more platforms at decreased costs and developer time. You do not need extreme performance from a Discord chat client, so if you can do the whole app once for web (in HTML+CSS+JS) and bundle the same code (with minor extra native features) in EXE/DMG/RPM/DEB with Electron and as APK/IPA with Cordova/Phonegap/Capacitor/whatever else, then why wouldn't you.

prime pine
#

Well, you explained something to me that I already knew

round dome
#

oh yuck electron

elder ivy
#

isn't vscode built in electron now

round dome
#

I don't use vscode I wouldn't know GWcmeisterPeepoEZ

elder ivy
#

yet you use discord lol

round dome
#

in the browser

#

(and I don't mean electron's chromium)

grizzled steeple
#

VSCode, Atom, Discord, WhatsApp Desktop (probably, could also be React Native)
Just to name a few apps written in Electron

granite river
#

Microsoft Teams is Electron too

#

and Slack

#

and Skype.... heh, Microsoft actually owned Electron for a while, after the Github acquisition. But it was handed off to the OpenJS Foundation a few months ago

prime pine
#

isn't vscode built in electron now
@elder ivy vim is my city

#

Microsoft Teams is Electron too
@granite river fuck microsoft, all my homies use BSD based

granite river
#

@prime pine I used to say stuff like that in the 1990s when I was running FreeBSD, then I grew out of it once I realized I'd be a lot more employable if I knew all the major platforms.

#

I got on the Windows 2000 Beta program, learned Active Directory (both admin and programming), and made, oh I dunno, $900k over the next ten years just with that skill?

#

So really the only person you're fucking with that attitude is yourself

prime pine
#

idk i am 15

#

NetBSD is my city NetBSD

elder ivy
#

lol

cloud knot
#

@prime pine well that explains it, you have no concept of how real world of SW development economy works. There are use cases for native, but majority of use cases is better served by not wasting money and time doing same UI 5 times for every major platform (iOS, Android, Windows, Mac, GTK/Qt) + web.

prime pine
#

try dart

#

multi plataform lang

#

but it is different when you are a sysadmin

cloud knot
#

I don't need to try stuff, I get my salary for 20 years now from SW development. Your personal ideals are first thing you will put away once you start working in the field. Dart, Go & co you can play around when you have free time or you work at Google. Not in real world.

prime pine
#

Rust is my city

nocturne galleon
#

@cloud knot - depends on where you work - but you are mostly correct - we are using Dart for some internal projects - but nothing customer facing yet - there will always be new languages, but only 5-10% will likely see a new decade - the question is which 5-10%

#

Most big companies are 5+ years behind the curve anyway because they are too risk averse

elder ivy
#

well that and existing code bases make it hard. not too many companies are polygot

nocturne galleon
#

True

sudden cedar
#

LMAO i'm looking at coding classes and learning courses on codecademy to see what they got and you can screw up some of their c# classes just by doing dotnet new console --force

prime pine
#

run rm -rf /* --no-preserve-root in the console

grizzled steeple
#

Leave out the star to save character. It's not needed anyways.

# If you are already SU
rm -rf / --no-preserve-root
# If you are not SU
sudo rm -rf / --no-preserve-root
prime pine
#

doas mv / /dev/null

#

sudo is bloated

#

All my homies use doas

grizzled steeple
#

I'm not that deep into Linux, ok?
I'm more of a Windows/Web dev

cloud knot
#

@prime pine don't even joke about that at all, unless you never want to see certain discord servers ever again

prime pine
#

Are u mod?

round dome
#

he's not mod he's mad

fervent orbitBOT
#

Don't arbitrarily run commands if you don't know what they do, eh? I see nothing wrong here.

vast echo
#

I've never seen the mv / /dev/null before, that's pretty great

#

are there any other creative ways to delete everything?

prime pine
#

dd if=/dev/urandom of=/dev/sda breaks all the HDD

#

are u nixie pixel??

vast echo
#

Not sure what that means

nimble hemlock
#

dd is for converting and copying files. if is input file, of is output file. Thus he's idea was to copy a file that generates pseudorandom numbers over the whole partition sda. Not very pleasant, but it won't break all the HDDs, especially because even if you delete the meta table, you can still reconstruct it, not that big of a deal.

As far as I know, but I know nothing, so I could be wrong.

vast echo
#

No I meant the nixie thing

#

I think shes a youtuber after googling it

elder ivy
#

lmao. I think they're trying to ask if you're someone who uses *nix

vast echo
#

nixie pixel is a linux youtuber

#

I think bc of my user he thought I might be her but I'm not

elder ivy
#

oh I see

tropic quartz
#

Linus Torvalds its a god

limpid plaza
plush tartan
fading notch
#

I just make games i dont think any of my projects belong here tho

wild bolt
#

Is messing with adb stuff safe? Like using apps that needs adb permissions?

#

Or like in other words does the app can possibly see what processes are going on in the phone

#

Basically data?

elder ivy
#

or they can root your phone, install spyware, and then steal everything from you

#

your call... but just watch the permissions and make sure it's really specific to exactly what you think the app can/is doing

cloud knot
#

@limpid plaza i would suspect you are not adding the required JAR files in your classpath (and they are in classpath in the IntelliJ)

#

@wild bolt adb is just a developer tool; there is no such thing as "adb permission" really

elder ivy
#

I think he means using ADB to grant permissions

#

you need to do so for stuff like secure storage write and such

clear flax
#

Hi, can someone answer this?

I am making my own program that converts custom measurements.
It uses breadcrumb sorts of things, each breadcrumb is a Scratch type thing that holds either a unit and a multiplier or just an operator. The multiplier is just when you times a unit like when measuring breath alcohol or using decilitres and things. You can also make the multiplier do its own function instead of timesing the measurement metric value.

I just made the multiplier also do functions of what ever you put in, rather than just the metric value of the measurement. My question is, it seems to do it twice so I have to put one multiplier as the function then the other as just x to divide it down and stop it from doing it. Why does it do it?

For example (unit done by output abbreviation simulation rather than actual user input)
Input = 2
From = 1 units(Pow(x,2))
To = 1 units
Output = 8

Input = 2
From = 1 units(Pow(x,2))
To = x units
Output = 4

My guess is it has something to do with it being broken back down at TO.

elder ivy
#

I don't understand your question

clear flax
#

I made a unit converter which allows you to make up 'such and such per such and such' units (instead of the straight ones like on Google) and recently put the ability put in functions. But the functions fire twice/+1 power for some reason.

#

() means function, not tied with 'units' which is just a unit of measurement in itself which can be replaced by metres or something.

#

I am thinking it has something to do with it being over-divided on what you are converting to, so casting it to x units instead of 1 unit seems to cancel it out

elder ivy
#

read your code? run a debugger? don't know what you're expecting with such an abstract problem

#

either that or you need more of this: https://en.wikipedia.org/wiki/Dimensional_analysis

In engineering and science, dimensional analysis is the analysis of the relationships between different physical quantities by identifying their base quantities (such as length, mass, time, and electric charge) and units of measure (such as miles vs. kilometres, or pounds vs. ...

clear flax
#

(By the way, I like making it throw an argument error below by dividing zero by zero.)

wild bolt
#

your call... but just watch the permissions and make sure it's really specific to exactly what you think the app can/is doing
@elder ivy ah right that was really what I meant, thanks
So I just need to keep track of the activities of the granted app right?

delicate tendon
#

@hollow perch PP

hollow perch
#

indeed pp

wild bolt
#

wow development right above here

weary sparrow
#

i need help in a python program

#
from discord.ext import commands

client = commands.Bot(command_prefix='.')

@client.event
async def on_ready():
    print("Hi MrBloodBoy.")

@client.event
async def on_member_join(member):
    print(f'{member} has joined the server.')



client.run('token')```
#

i am getting error

vital blaze
#

What's the error?

weary sparrow
#

here

#

this is error

#

my code isnt even touching the 100

#

lines

vital blaze
#

You are getting a 401 Unauthorized response on a http request that the package is makeing.

#

I would assume that there is an issue with how you are handling the token.

weary sparrow
#

is my token wrong?

#

i will see

#

thx

prime pine
clear flax
#

I once was going to use Unity for stuff, but I it didn't quite work because of VS versioning but I might use Programming or something instead now.

#

I used to use GameMaker but it is now a trialware.

woeful shadow
#

why can't i put this in an email?

#
<!DOCTYPE html>
<html>
<body>

<embed type="text/html" src="https://neednot.net"  width="500" height="200">

</body>
</html>
brave jungle
#

you gotta use the html email option probably

woeful shadow
#

gmail doesn't render it

cinder kraken
#

Embed is not supported as emails don't fully support html5. Stick with html4.01

elder ivy
#

but really you can't just put arbitrary html in an email. there's a heck of a lot they won't let you use (for good reason)

thorn tangle
#

Hello,
i am developing an app using android studio(java), i intend to make a pop up window (using popupwindow class) on touching a button, but when i press the button two pop ups are created instead of one.can you point out where i went wrong?

code - https://pastebin.com/znPP8U78

testing on oneplus 3t (a3003)
android 9.0

cloud knot
#

@woeful shadow HTML email. if you think browsers are bad, then be prepared for the hell called HTML email. Every client renders it differently. Plus IFRAME/embed/... is a no-no in email. HTML email equals using tables for layout, minimal CSS support, images by default do not load and so on.

#

@thorn tangle set breakpoints in relevant places (for example at first line of onDataChange) and examine the stacktrace to figure out what happens. might be events firing multiple times etc.

thorn tangle
#

@cloud knot thank you for the reply...will do that and get back

cloud knot
#

that is a general developer recommendation tho - debug your code

thorn tangle
#

I found where i went wrong and fixed the issue , thanks @cloud knot .

nocturne galleon
#

hello

#

im having trouble with what my modulename should be

#

so is a module like a class or something
cuz there are classes that have shit like Uworld which has the world and local player info

#

@proper gale

proper gale
#

i haven't the slightest clue

#

what is your problem though?

nocturne galleon
#

im having trouble with what my modulename should be

proper gale
#

its a string, put whatever you want there

#

wait wait wait

#

thats a module loading function

#

i have no idea what you need to put there

#

should be in the documentation

nocturne galleon
#

documentation being

proper gale
#

idfk, whatever SDK you are using

nocturne galleon
#

ok thanks

proper gale
#

they should have docs for it

nocturne galleon
#

so

#

would it be in one of these

proper gale
#

real question, what are you trying to do?

#

?

copper ravine
#

@nocturne galleon why are you using this sdktest library?

nocturne galleon
#

to try and find something

copper ravine
#

A file, a word, find a what?

nocturne galleon
#

a word

proper gale
#

in?

nocturne galleon
#

this library

copper ravine
#

Oh fuck! /I love sharades!!!/

proper gale
#

^

#

what are you trying to do in the first place

nocturne galleon
#

help a mate figure something out

proper gale
#

thats, not helpful here