#development

1 messages · Page 12 of 1

nocturne galleon
#

yw buddy

inner wraith
#

ASP.net is serverside programming and not applicable for your use case in the browser.
If it lags, you should try disabling components and using Chrome's profiler to look at your Javascript's performance - most likely you're just doing something really inefficiently without noticing.

#

You can't really do much better than Javascript - you could look at WebAssembly if you were making complex games and stuff but for a homepage with a couple of animations it's ludicrous overkill and shouldn't be necessary.

cyan niche
#

better javascript and css

viscid glade
cyan niche
# viscid glade Alright then. Guess there's no other options. Thanks for the suggestion!

Well, there's loads of options. But I often think it's better to establish that what you're doing is inefficient over the idea that your tools are inefficient. Sometimes the tools are inefficient, but as much flak as javascript/css gets for being scripty slow garbage, they're really not, and can easily run in the same order of magnitude of native code.

#

It's probably not the case that something like Javascript is to blame.

viscid glade
#

I can instead chop the gif into several sections and make it be animated with the keyframe function, but in really quick snaps. I think this will work, buf I have to try it out first

#

Does this method actually work tho?

next igloo
#

I don't have any Windows 7/8/8.1 machines to test if my program runs or not. I do have a 64bit Windows Vista machine, which said something like "This program does not run on your version of windows" when I attempted to run the program (Although I am not sure if its caused by the GPU not supporting OpenCL 1.2).

When I tried to run my program in Windows Vista compatibility mode on Windows 10, where it ran just fine. How come the error does not display when I run the program in compatibility mode?

fleet lodge
#

Hey I can talk about batch programing here right?

cyan niche
#

sure why not

cyan niche
cyan niche
#

or do you mean like in general because I have a lot experience in batch processing

fleet lodge
#

I meant like can I ask questions and then put some of my coat up so that people can criticize it for help

cyan niche
#

sure

#

it is the programming channel, see also the ltt forums which may get you more comprehensive help

tender hedge
#

can anyone tell me why this code snippett doesn't work? I know that it doesn't, and I know how to make it work, but I don't understand why

System.out.printf(""+ "Calories: " + "(%.2fcalories)" + " calories");

#

running in java

cyan niche
#
System.out.printf("Calories: %.2f calories", calories);
tender hedge
#

unfortunately my professor isn't available on weekends

cyan niche
#

Java does not support string interpolation, so the arguments must be passed separately

tender hedge
#

sorry if I'm confusing and sound like I have no clue what I'm doing, I don't know what I'm doing, lol

cyan niche
#

What's in the quotes is a string. The %f part is what is replaced by your float (literally specifying, the first argument that follows is a float and will replace it). The %.2f means display the float with 2 decimal places

tender hedge
#

ahhhh, okay

cyan niche
#

System.out.printf("Calories: %.2f calories", 3.1415); prints as Calories: 3.14 calories

tender hedge
#

so it is just a placeholder for whatever argument follows next

cyan niche
#

yes

tender hedge
#

awesome, thank you

cyan niche
#

for multiple arguments you do: System.out.printf("1st: %s, 2nd: %s", "first_string", "second_string")

#

happy to help PaiNod

tender hedge
cyan niche
#

yes but you would want to use actual float datatypes

tender hedge
#

yeah

#

I just didn't feel like punching in numbers, lol

cyan niche
#

them number keys too far for fingies

tender hedge
#

my pinky hurts from pressing + all day already, lol

cyan niche
#

if you think that's bad python broke on me

#

it refused to give me float values until I did a type conversion by adding 0.0, but this isn't how python is supposed to work

#

oh I see, they were using python2 BBdisgust

tender hedge
#

I know nothing abt python, but definitely don't think that's how it's supposed to work, lol

frozen flame
#

also that is a cursed way to convert to a float lol

red mulch
#

Good news ! Going to release my reflink code from work as open source

old nimbus
#

question
for UX designers
for my portfolio site
should i build it myself
or use a template through adobe portfolio?

silk eagle
#

well if you make it yourself you can have the portfolio site be a part of the portfolio

cyan niche
#

congrats

red mulch
#

it is supremely boring to almost everyone 😄

red mulch
#

when using a modern advanced filesystem, you can use reflink, which links blocks from the same files - basically filesystem level copy on write.

#

What that means of course, is that calculating usage can be extremely difficult - and it really only works at the filesystem layer, or if your files are simple, you can get an approximation. This does the ACTUAL calculation to get on disk usage of a subset of files

#

So you end up with accurate numbers, rather than a vague guess because you don't actually understand the problem 😄

#

The complex bit is the extent mapper - you add an extent which has a start and an end, and it checks with other extents for collisions

peak acorn
#

im so confused how my work buddy actually uses AI chat bots for code

#

It's literally garbage, makes shit up constantly and doesn't know what it's talking about, it's slow often misinterprets my questions lmao

red mulch
#

yep. If you are writing shit code, it's a good way to do it faster.

viscid glade
inner wraith
#

The other 30% it's comical but oh well

#

It's not really a "write me a function that does X" kind of thing though, it just suggests what one might write next based on your open documents.

cyan niche
#

No you don't understand a bunch of professionals managed to prompt engineer the creation of a connect 4 game.

inner wraith
#

Prompt engineering is boring, I write programs, not individual functions or trivial toy examples

#

I can also actually write code and do not need to write a text explanation of what I want only for it to comically mess up and have to weld a bunch of responses together

cyan niche
#

What you mean text prediction AI that doesn't contain logical faculties isn't able to code? crazy

inner wraith
#

Text prediction is great for your boilerplate code, definitions, common progressions

cyan niche
#

I don't want to write boilerplate anyway

inner wraith
#

Well no

#

Nobody does

viscid glade
nocturne galleon
#

60GB of unity tutorials + 12GB of WPF

#

imma go brrrrrrrrrrrr

#

but the Visual Studio updates ain't lletting me go brrrrr

nocturne galleon
# viscid glade I can't fix this. Can someone help me with this?

i think there is a missing dialogueIndex between the if function

if (currentIndex < dialogue.length - 1) {
        dialogueElement.textContent = dialogue[currentIndex + 1];
        sprite1Element.src = sprites[currentIndex + 1];
        dialogueIndex++;
    } else {
        document.querySelector("button").style.display = "none";
    }
cyan niche
tender hedge
#

why doesn't this range work? everything outside of it does, but anything within the range throws up exceptions

#

written in java

tender hedge
#

it works if you change "printf" to "println" but I still don't know why it doesn't work with printf

midnight wind
tender hedge
#

I don't know, lol

#

I want the % to be included in the output

midnight wind
#

it needs to be %% to escape the %

tender hedge
#

interesting, I don't remember anything in the lessons saying that, so that's probably why it didn't work, but would've been nice of them to tell me that, lol

midnight wind
#

generally if you use something like %n, or \n you need to escape the % or \ character so the computer knows what to do

tender hedge
midnight wind
#

there should be a backtrace with a much more detailed description

tender hedge
#

it's the zybook web compiler, cause it's for school

midnight wind
#

ah yeah that's why

#

which is dumb it doesn't give you the full backtrace

tender hedge
#

agreed, but unfortunately, I don't have the influence to make my uni use a proper code compiler 😭

cyan niche
#

just use System.out.print

viscid glade
#

I'm just missing some stuffs, I forgot of where to put it

#

I'm able to develop it to be functional. I forgot to put the image query

nocturne galleon
viscid glade
#

I saw a bit of it in the forums, but I'm still confused

#

It's not that neccessary, but I'd want to be able to learn this just in case

nocturne galleon
#

well indian youtubers really help you with that xD

viscid glade
nocturne galleon
#

they explain better than my professor

viscid glade
nocturne galleon
# viscid glade agreed

i got this off stack overflow these examples might help you
HTML:

<p class="typewriter">Hello, world!</p>

CSS:

.typewriter {
  animation: typewriter 1s steps(14) infinite;
  white-space: nowrap;
  overflow: hidden;
  border-right: 0.08em solid;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
#

idk if it helps you yk i'm into desktop app and game engineering

viscid glade
cyan niche
#

They said that python is stupid, but I definitely can see why people use it:

#

entropy calculation on a dataset in like 5 lines of code

red mulch
cyan niche
red mulch
silent gust
cyan niche
#

I don't trust languages with a "contact sales" button in their header

frozen flame
#

Mojo is a meme language atm

#

Interest may return when they actually deliver on their promises

crystal monolith
#

Hello, I'm not really great with coding and I don't know exactly where to ask this, but I'm assuming in this channel is best. Does anyone know how to code your own bot on here?

nocturne galleon
#

in what language? i know JDA for java

burnt spear
#

Has anyone done a game jam?

burnt spear
spring cradle
#

how much fun can you have with an rp2040 with only i2c and 4 adc pins broken out?

nocturne galleon
nocturne galleon
spring cradle
whole vigil
burnt spear
whole vigil
#

oh ok

red mulch
simple canopy
cyan niche
simple canopy
#

That is true. You should just use libraries for EVERYTHING essentially to make python not be incredibly slow

cyan niche
#

I've never had to wait on python programs

#

Programs often need to wait on me though

#

I'm the bottleneck blobwowomgflushshy

simple canopy
#

Hahaha yeah that is true though. But you can measure the difference in speed

crystal monolith
#

im sorry idrk what that means, can you explain pls?

nocturne galleon
crystal monolith
nocturne galleon
nocturne galleon
spring skiff
#

feeling very tempted to host my own gitea instance for the "swag" of a selfhosted git on my own domain, but at the same time, it'd be pretty shitty if my server died and i lost all my repos blobfried

cyan niche
#

I'm going to need you to pay for every git download thanks.

#

My name is Unity and you're watching the death of a platform channel.

grim wind
#
function decodeString(str) {
    const arr = [];
    let tally = "";

    for (let i = 0; i < str.length; i++) {
        const char = str[i];
        const charCode = char.charCodeAt(0);

        if (charCode > 47 && charCode < 58) {
            tally += char;
        } else if (charCode > 96 && charCode < 107) {
            tally += charCode - 97;
            arr.push(parseInt(tally));
            tally = "";
        }
    }

    return arr;
}

Is it possible to make this one go faster?

cyan niche
#

It's already O(n)

#

If you want it to go faster write it in Rust or C

#

Oh

#

Wait, you're doing string concatenation

#

Don't do that. Use a string builder object or use a character array and join them for your tally variable instead.

#

Every time you're doing tally += you're creating a new string which is slow

nocturne galleon
#

finally both C# and unity
i passed it

#

now it's the time for C++ exams

grim wind
cyan niche
#

Apparently concat is the way to do it on javascript

grim wind
#

Oh okay, I'll check it

cyan niche
#

concat is the same as +=

#

which means I don't think your code can get any faster

grim wind
#
const integerArray = [864, 3710, 3698, 523];
const packed = integerArray.map(num => Math.floor(num / 10) + String.fromCharCode(97 + (num % 10))).join('');
console.log(packed);
// 86e371a369i52d

Basically this is what I'm doing. I take integers and I pack em into a string

#

For less size

#

So decodeString just turns packed into integerArray again

cyan niche
#

you could pool web workers or try to compile wasm

outer vale
#

anyone know how to make voice commands using unity?

spring cradle
#

what can you do with arduinos? ive been using them for keyboards but idk what i wanna do with it outside of that, i want to try something ig

fading osprey
#

you can do a load of things with them, I know someone who uses one to monitor the hydration of their indoor mini-farm, and water the plants automatically when they are away from home, I know of other people who use them to trigger smart home automations depending on what room they are in using motion sensors. Arduinos are incredibly flexible

midnight wind
spring cradle
#

i mean its not an arduino arduino, its a processor supported by arduino library, i just dunno what would be fun with em

midnight wind
#

I really like platform.io IDE for microcontroller development

midnight wind
spring cradle
#

eh im pretty happy with what i can do on like, x86

#

dunno whats exactly useful abilities of a mcu

midnight wind
#

depends on the exact model, but for example the uno r4 has CAN Bus, wifi, bluetooth, UART, I2C, SPI support as well has just plain ole digital ON/OFF pins

spring cradle
#

rp2040?

#

ig i could go hunting for cool i2c expansions

midnight wind
outer vale
#

hmmm i got a good idea, why don't somone try to make laser tag, that is compatible with agumented reality so you can see the real laser shots

inner wraith
inner wraith
outer vale
#

hmmm

#

but im making it for my back yard

viscid glade
#

any other recommendation other than godot 4?

nocturne galleon
viscid glade
#

nah

icy raft
#

Maybe not the right place to put this parody of the unity statement, but it will affect devs so....

#

Basically. If anyone hasn't kept up with the unity drama, this will tell you most of it

midnight wind
#

If you look behind the lines, the whole thing to get devs to use their own ad platform since if you use it then you get a 100% install fee waiver

cyan niche
#

Unity's concepts set an incredibly dangerous precedent of charging users per install, rather than for a license (which can have unlimited installs). Imagine a world where every time you install Microsoft Word you have to pay some amount.

#

It may not even be a large amount, it could be like $0.01. But the concept is certainly there about adding what are essentially microtransactions to everyday software.

#

They've created a business model that is even more devious than the subscription model.

#

So yeah, if Unity's business plan fails spectacularly no one will do it. Which I think is a good thing for the health of software as a whole.

silk eagle
#

I'm going to need you to pay for every time the car that you sold 6 months ago drives on the road.

warped kindle
#

Not to distract from the unity conversation, just a quick question. I’m going to start learning to code tonight, idc if it’s. Just 10 min. Would anyone recommend something other than python? If yes, I’d appreciate suggestions. I’m in the process of career shifting and figured understanding the basics will help me decide which path to travel Down further

midnight wind
#

Called leasing

cyan niche
#

It's better than others in its same class because:

  1. It has excellent documentation
  2. It's packaged into Visual Studio and setting it up and running it is easy
  3. Visual Studio's integration makes it easy to learn about things like debugging, offers helpful hints and suggestions, and comes out of the box this way
  4. It's a useful and prevalent language with large real-world use
cyan niche
# midnight wind Called leasing

Not quite the same, since miles represent actual depletion of the car's actual lifespan. The more miles driven the fewer miles the vehicle can be driven. This means it's a devaluation so paying per mile is not an unfair bargain necessarily. Installing software does not degrade the software or any license to use it, its value remains independent of number of installs.

midnight wind
cyan niche
#

It's a bit more nefarious than that but yeah

warped kindle
nocturne galleon
#

i used to create my 2D games using that but yk after awhile your brain just gets tired using this goddamn boring framework

#

i just moved to unity

#

and yk it's good, i like it

#

it's like i'm using unity about a month i really got good at using it

#

user-friendly interface

viscid glade
#

two sides of the same coin....

#

accurate dev choices

covert kettle
#

yall I need some advice
I’m looking to buy an M2 Mac mini for software development, because rn there is an insane deal for students (100 dollars off plus an 100 dollar gift card, so 400 dollars total), although I’m trying to get a second opinion. Any advice?

I already have a Magic Keyboard and mouse for my iPad so I save money there

#

Has anyone here used Xcode on a Mac mini m2? How does it perform?

cyan niche
#

I mean you're limited to macos is really the only downside. Technically you can use asahi linux but it's still in alpha releases.

#

m2 processors are very quick, xcode and whatever else you want to run shouldn't have any issues.

covert kettle
#

I already have a nice windows pc

#

this would be my schoolwork/ios development machine

cyan niche
#

Then sure, you'll be hardpressed to find an equivalent machine for that price. Of course the baseline configuration tends to skimp on memory and ram.

neon oriole
viscid glade
#

It feels like the same I ain't gonna lie, it's fun too

neon oriole
#

yeah my mainreason for posting my reply is thqt its counter intuitive; most expect the welcome to be printed first followed by the question

#
print(f'Welcome, {input("Hello, ... is your name? ")}')
``` maybe its more clearin a one liner what im pointing out
#

stringmanipulaion , python is indeed really king there

#

like unicode by default , try dong that messin c without pullingyour hair out :p

viscid glade
cyan niche
inner wraith
spark temple
inner wraith
spring skiff
#

Any regex wizards in here? I'm parsing through html files, and need a regex to match something like
<input [should not have type="..."] >

cyan niche
spring skiff
#

trust me i've tried

cyan niche
#

you could also just use jquery

spring skiff
#

I'm parsing them as text files, with nodejs, not a frontend thing

#

so no jquery either

cyan niche
#
$.get('file_to_read.txt', function(data) {
   do_something_with(data)
}, 'text');```
#

you can use jquery in the backend it's just a JS library

spring skiff
#

sure but it wont be able to parse as html, it's an Angular file

#

with custom decorators and stuff, otherwise i would've used node-html-parser

cyan niche
#

oh gotcha

spring skiff
#

so yeah in this use case the probable best alternative is a regex that can say "has this in both ends, anything at all in between, but also not specifically type= anywhere in between"

cyan niche
#

give me a minute

#

<input.*type="[^(text)].*>
or for multiple types:
<input.*type="[^(text)(number)(password)].*>

spring cradle
#

i dont think thats how [] works

cyan niche
#

ahh no bars it's been a minute

spring cradle
#

what flavor is that

cyan niche
#

regular regex

#

says it's running javascript engine

spring cradle
#

[] matches only single characters.

#

putting () inside [] just matches ( or )

#

you probably want negative lookarounds

spring skiff
#

but arent lookarounds just ahead and behind, not inbetween?

spring cradle
#

you can do it if youre tricky, i dont have the example off the top of my head

cyan niche
#

ohhh yeah we can just use a lookahead

spring skiff
#

I think it's gonna end up being easier to match the input field with a regex (i already have that) and for each match, just do a !string.includes("type=") i guess

cyan niche
#

try this

spring cradle
#

its more readable

cyan niche
#

<input.*type="(?!text).*>

spring skiff
#

the check is for should not have type at all, rather than just text type

cyan niche
#

ohhh gotcha

spring skiff
#

if node html parser libraries could learn to just... quietly ignore all the angular syntax, unknown custom elements and directives, i could just do something like $("input:not([type])") and i'd be done in 15 seconds

spring cradle
#

^(?!<input.*type=).*>$
?

cyan niche
#

<input((?!type=").)*>

#

Another solution like you were saying is to render the angular into html. I don't use angular but you can do something similar with like razor templates.

rustic dust
#

Hi guys anyone here?

inner wraith
#

No

#

Never

#

All messages in this channel are actually sent by bots, including this one

cyan niche
#

bot reporting YesMam

fading osprey
#

404, bot not found

amber obsidian
#

most of the time its not an issue and there are ways to circumvent those problems but yeah

empty pier
#

Are there any iOS developers who want to collaborate on making a new (actually decent) professional manual camera app?

There are genuinely no good ones. I’ve quite literally tried every single one. So I’ve designed the UI and just need a developer to actually make it

(It would be going through my companies developer organisation)

frozen flame
#

i dont think ios exposes much in manual settings

empty pier
livid eagle
#

Any parser and lexer code using C++ specialists on here? I'm an online college student, and my professor hasn't responded to my question in over 3 days (project is coming due in a few days and I'd rather not wait till the last minute). I'm not asking for someone to do the project for me, just trying to get unstuck.

frozen flame
#

Just ask your actual question and if someone can help you they will

floral isle
#

is anyone good at java and can tell me what im doing wrong in trying to round the money amount to 2 decimals(im a newbie so if this is a dumb question sorry)

cyan niche
floral isle
#

Oh I see, so it was a super simple solution, thanks.

spring cradle
#

ive got an extra adc/pwm pin, i want to do something fun with it, but unsure what'd be interesting, so far ive got ideas like "LED" and "potentiometer" and "speaker"

floral isle
#

How do you get a month from using integer values 1-12 to display a person birth month in java? I can only find tutorials on //java.util.Date giving time and day but I only need month using 1-12, is there an easier way to do this instead of declaring each number a month with 12 lines of declarations?

spring cradle
#

you could make an array to hold the months in order then use the number as index

floral isle
#

whats an array? (im in an intro to java class) so not familiar with alot of terms yet, my teacher is also shitty so have to self teach alot of stuff through w3 and other sites

cyan niche
floral isle
#

thank you, so to recieve input do I just import java.util.Scanner and then do month.nextInt() or how does that work since month isnt an int or double etc , i.e "Please enter a value 1-12" , user enters 10, print month october etc

cyan niche
fading osprey
#

I've finally found one

a wild Fleet user

#

its either Fleet or IDEA, these days I cant decide, the UIs are so similar

cyan niche
#

well you need a prompt I guess idk

#

I'm a poetry convert

#

it downgraded the package to the one I wanted blobwowomgflushshy

frozen flame
#

Ugh poetry

#

Pip also does this if you specify the version fyi

inner wraith
#

If it works for them so be it

#

I use pip but it's certainly not perfect

frozen flame
#

Poetry is one of those tools that usually does what it says on the tin, but it makes everyone else's life miserable and when it doesnt do what it says on the tin, god fucking help you

inner wraith
#

NPM

#

APT :P

cyan niche
#

I was a pip boi for while but poetry has been really clean. I like how it handles everything

burnt spear
knotty vortex
#

Anyone here good with html? I've made a digital calculator collection webpage, https://irish.repair/, but can't figure out how to scale the grid to fit the image

cyan niche
# knotty vortex Anyone here good with html? I've made a digital calculator collection webpage, h...

Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.

knotty vortex
#

but i'll take a look at flex boxes, thank you!

cyan niche
#

Yeah, let each box decide how big it should be.

knotty vortex
drowsy elbow
#

Anyone knows how to remove the bottom menu? I only want the left menu option. Editing FlyoutDisplayOptions doesn't seem to change anything.
Thanks!

inner wraith
#

I have been informed that
W I D E T A B L E time is here
https://blog.cloudflare.com/d1-open-beta-is-here/

The Cloudflare Blog

D1 is now in open beta, and the theme is “scale”: with higher per-database storage limits and the ability to create more databases, we’re unlocking the ability for developers to build production-scale applications on D1

#

Normalisation? Hardly new her.

cyan niche
#

serverless

#

sigh, another technology that's the cutting edge that I need to catch up with

inner wraith
#

It's just managed sqlite

cyan niche
#

Oh

#

I thought they were running postgres or something

inner wraith
#

Ok, it has a few bits that make it easier to use for a distributed service (like backups)

#

But it is for most purposes just sqlite on the other side of an API

noble moat
#

I got this rock paper scissors project and I can't figure out how to count how many times someone has won a round so I could then print who won the game. The game only has to have 3 rounds. Heres the code for the game so far

for (int i = 0; i < 3; i++ ) {
        int roundWinner = doRound(p1Name, p2Name);
        if (roundWinner == 1) {
            winnerName = p1Name;
        }
        else if (roundWinner == 2) {
            winnerName = p2Name;
        }
        else if (roundWinner == 0) {
            winnerName = "";
        }
        announceRoundWinner(winnerName);
        
    }

I just gotta figure out a way to know how many times winnerName has been assigned to p1Name and p2Name and whichever is greater would be the gameWinner.

#
/**
 * Requires: p1Name and p2Name are the names of the respective players,
 *           gameType can be 1 for regular rock-paper-scissors
 *           or 2 for rock-paper-scissors-lizard-spock
 * Modifies: cout
 *
 * Base Project:
 * Effects:  If gameType is 2, prints "Under Construction" to indicate that the
 *           s'more has not been implemented. Returns empty string.
 *           Otherwise, plays exactly three rounds of rock-paper-scissors while
 *           keeping track of the number of round wins for each player.
 *           When a round results in a draw, neither player is the winner,
 *           so neither player is awarded a point.
 *           After each round is played, the round winner (or draw) is
 *           announced.
 *           Returns the name of the game winner, or "" in event of a draw.
 * Prompt:   Under Construction
 *
 * S'more Version:
 * Effects:  Has same functionality as base project, but also handles a
 *           gameType of 2. When game_type is 2, plays exactly three rounds of
 *           rock-paper-scissors-lizard-spock. Keeps track of round wins for
 *           each player and announces round winners in the same fashion as
 *           described above.
 */
string doGame(string p1Name, string p2Name, int gameType);
#

thats the rme for the doGame function. Im trying to figure out the keeping track of number of round wins part

silk eagle
#

well theres 2 routes that seem straightforward to me:

  1. have an int for each player's number of round wins and compare them after the game ends
  2. have 1 int that would start at 0 and go - or + based on who wins rounds, then if its negative you say player 1 won or if its positive you say player 2 won.
#

either way, make sure you define it outside of the for loop because youd want the value to persist through each iteration of the loop.

noble moat
#

right but how do I get that int value in the first place, since the for loop doesn't return anything when it runs.

#

doRound returns an int value but idk how I would implement that

#

how do I count the number of times roundWinner is equal to 1 or 2?

noble moat
# silk eagle either way, make sure you define it outside of the `for` loop because youd want ...

so umm you were right, thanks

string doGame(string p1Name, string p2Name, int gameType) {
    // TODO: implement
    string winnerName;
    int roundWinner = 3;
    int p1Wins = 0;
    int p2Wins = 0;
    if (gameType == 2) {
        cout << "Under Construction";
        return "";
    }
    for (int i = 0; i < 3; i++ ) {
        roundWinner = doRound(p1Name, p2Name);
        if (roundWinner == 1) {
            winnerName = p1Name;
        }
        else if (roundWinner == 2) {
            winnerName = p2Name;
        }
        else if (roundWinner == 0) {
            winnerName = "";
        }
        announceRoundWinner(winnerName);
        
    }
    if (roundWinner == 1) {
        p1Wins++;
    }
    if (roundWinner == 2) {
        p2Wins++;
    }
    string gameWinner;
    if (p1Wins > p2Wins) {
        gameWinner = p1Name;
    }
    else if (p2Wins > p1Wins) {
        gameWinner = p2Name;
    }
    // NOTE: return "" to avoid compile error
    //       remove it after implementing
    return gameWinner;
}

it works now, I don't exactly understand how because I thought the for loop would just run 3 times before the compiler would look at any code before it, but I guess adding the code outside the loop works for some reason. Thanks again

fading osprey
#

ugh, Stackoverflow is offline, now where am I supposed to copy/paste learn how to fix my issue.

silk eagle
#

oh no, if stackoverflow goes down and the stackoverflow devs need help figuring out how to fix it where do they go

fading osprey
#

stack underflow

cyan niche
silk eagle
#

would it use all the same data though or just test data

fading osprey
#

All data is test data if you suck at testing...

cyan niche
#

a lot of places just scrub prod data for test use

fading osprey
#

its back online now anyway

grim wind
#

Anyone know any good one function implementations of SHA3 in JS? I can only find simple one function implementations of SHA2 etc

elder dragon
elder dragon
hollow basalt
cyan niche
#

My code wasn't working so I went to bed

#

I ran it this morning without any changes, and now it works

#

fuck

last tusk
#

Sounds like DNS

cyan niche
#

it was not

#

ML StareSipTea

fading osprey
#

ML is a wild beast

#

sometimes it works when it shouldnt, and others it should when it doesnt

sick patrol
#

Hey can i get some input on this powershell script i found? I changed a few parts but for the mostpart its unchanged. All it looks like it does is start EXO module, grab distro groups via upn, then export as a csv. I'm still super new to powershell but it looks like it would work to me. Any thoughts?

sick patrol
#

Nevermind, I ran it in my sandbox and it worked. gg

cyan niche
#

"Programming doesn't have math"
Me:
bugcat_cry

fading osprey
#

Programming is just mixing math with words to make sand think

#

If you think about it we're all just spellcasters

humble hollow
#

Hey guys, is this the right place to talk about a problem of my attempt of a discord bot? I have some strugglest I cant get past with

cyan niche
#

Sure but I don't know anything about discord bots

drowsy elbow
fading osprey
drowsy elbow
#

Don't forget to mention you live in an old abandoned church on a big mountain where there's always dark clouds

fading osprey
#

oh that wasnt a given? My bad, must come with the poor social skills haha

drowsy elbow
#

Not all programmers have poor social skills tho

#

At my first job there was a senior developer who was kinda acting like my mentor for learning programming haha. He had great social skills (he was a bit awkward sometimes, but he was a good comminucator in general). Learned a lot of that guy and I don't think I would've gotten very far without him.

fading osprey
#

oh yeah, I was just pointing out that is also isnt uncommon for us to suck at communicating haha

drowsy elbow
#

True, but if you want to be a valueble developer it's something you should learn to be better at. I am also pretty shit at it, it really depends on the team.
At my old job I was okay in it, on my new job I suck at it cuz I don't have a connection with these people

#

No common interests, big age gap etc

fading osprey
#

thats one of the reasons I both do and dont want to write code as a job instead of a hobby.

I love talking to people, and I can be a great communicator, when I am comfortable with the people I work alongside.

I struggle bridging the age gap that often exists in these places in the UK, because I am 21, and a member of the alphabet mafia, whose only real interests are software, computers, aircraft, and motorcycles. Compared to the interests that the older generations tend to have where code is their job, and something they wont discuss outside of work, or on break, and their primary interests are football and Brenda from accounting.

There isnt a whole lot of common groundon which to build a relationship and get to know one another, when there's nothing in common you can use as a diving board

#

also imposter syndrome, thats a big kicker

drowsy elbow
#

I'm in the same boat as you. I am now 24 years old, and I got 7 years of experience as a c# dev. My old job also had an age gap I was 17-22, and they were like 30-50. However most of them had the same hobbies as I did. Some liked gaming, and also programmed in their hobbies making tools etc. an older collegue got me into homelabbing and another even older collegue hooked me up with a decent desktop pc so I could get started.
Where I work now they are all 40-67 years old, and they don't have any common interests. 2 of them fly a race drone which is kinda cool, but that's bout it.

#

Still working on my bachelors atm, but I am almost finished. When I am done I'll be looking elsewhere

fading osprey
#

I dropped out of college because I didnt enjoy having to tutor my class, given that the lecturer wasnt willing to put in the basic effort of administering the coursework in a way which could be understood by the other students, I luckily had enough knowledge of python that I could just about scrape by without the class, so I was the one people ended up going to, dropped out mid way through my second year because I didnt fancy going through another year of hell in that course

#

now I'm in the boat of "I can do XYZ but I dont have the paper that says I can do it", which is leaving me without even being an option that gets considered for almost any position I apply to

drowsy elbow
#

I was also tutoring my class (previous course) haha

#

Yeah not having papers sucks

#

I do have some papers, but nothing very impressive really, but enough to get jobs, but a bachelors is really required if you want a higher paying job

#

I will be done over like 4 months, so almost there 😄

fading osprey
#

I'm looking into going back and starting off from fresh at Uni next year, need to figure out how funding works for it because its different here in England than it was when I was in Scotland, looking at doing a bsc hons course at UOL

drowsy elbow
#

What is bsc?

fading osprey
#

Bachelor of Science
usually denoted B.Sc

drowsy elbow
#

Ahhh

#

It's what I am getting, but I didnt know what it meant lol

fading osprey
#

yeah, the course im looking at is a 4 year B.Sc course with honours

#

but really all that honours part means is that you only get it if you finish really high in the course

#

otherwise you just get a B.Sc without the honours

drowsy elbow
#

Probably doesn't mean shit to an employer

#

An employer in NL looks at if you have a bachelors, and how much experience you have

fading osprey
#

depends on the scores, most people will just see a B.Sc Hons. and someone else with a B.Sc and go for the honours hire, because there's a higher chance they actually have some idea

drowsy elbow
#

Good scores only really matter if you have no work experience tbh

#

Maybe if you wanna work at google it matters, but for most jobs, probably not so much

fading osprey
#

around here they check these things a lot apparently

drowsy elbow
#

Ahh

fading osprey
#

idk anymore tbh, things seem to change weekly ¯_(ツ)_/¯

drowsy elbow
#

Maybe then it's worth it 😄
I'm just doing a part time bachelors course. It was supposed to take only 3 years, cuz I skipped the first year, but I started my 4th year now cuz I had some delays due to covid

#

We don't even get to do a minor lol

fading osprey
#

the course im looking at is a 4 year course, but can be done part time over 6 years, which is nice, I may have to take the 6 year option since I likely wont get full funding to support myself and will need a job still to ensure I can pay for my accommodation

drowsy elbow
#

Yeah thats what I did too

#

But 6 years, that's a long time

#

I was already burned out before I started lmao. Could never imagine doing 6 yrs

fading osprey
#

yes, yes it is. if I start next year, I would be graduating when I turn 28...

#

I would literally be reaching midlife crisis territory around graduation haha

drowsy elbow
#

Luckely my tutuition (or however that's spelled) isn't too much for me

#

I paid like 8k so far, and I don't expect to pay anymore

#

first year was like 900 euros, second year 900 euros, thirs year 1900, this year 1900.
So that's what, like 6k only

fading osprey
#

I dont even know how much it would be for me here

but I know it isnt close to that cheap

drowsy elbow
#

first year is 50% off, and second year was 50% off due to covid

#

Americans pay that each month lmao

#

But it's so cheap because most of it is paid by the government. If I wanna do a second bachelor I'll pay the "real" price

fading osprey
#

yeah

drowsy elbow
#

I still think it's expensive for the amount of work done by the university itself, literally everyuthing is via teams, and I haven'd been inside the school building in over 2 years

fading osprey
#

my current biggest issue is that I only have a desktop, so even if I wanted to go to uni, I would have to get a laptop of some sort, which is the most expensive thing for me even with funding, since even with a student discount I would be looking in the higher end range of laptops to do coursework during classes.

drowsy elbow
#

Bro, get a refurbished enterprise-grade laptop

#

Put in a bunch of ram, and hope it';s a decent screen

#

You don't need a wicked-fast processor, just good ssd and enough ram

#

Make sure the outside is metal so it doesn't get destroyed when you look at it

#

Just a decent i5 with 4 or more cores will do

fading osprey
#

yeah, im looking at a mac simply because ive found apple's laptops to be the easiest for me to use, which is annoying tbh

drowsy elbow
#

I don't think a mac is a good choice for a CS course

#

You'll probably be using software which doesn't run on mac

fading osprey
#

would you mind listing some examples? everything I currently use runs on all three major platforms, so I'm a little out of touch haha

also keeping in mind this course is based on python since it has a focus on AI/ML

drowsy elbow
#

Ahhh, AI/ML does require some beefier hardware

#

Not sure how a mac would compare then.

fading osprey
#

M1/2 mac should handle AI/ML decently, since it has accelerators built in for that

drowsy elbow
#

My course is mainly learning programming and did a small AI/ML assignment which I've trained on my desktop pc

#

And my laptop had a quadro gpu so that one also could do the job

#

My first course (wasn't bachelors) was app development and many tools were windows only

fading osprey
#

even buying refurbished I'm still looking at £1,000 for an M1 mac with 16gb of memory, which would barely sturggle along with most workloads

drowsy elbow
#

nah you need 32 for ML/AI and big-data

#

However, maybe a potato is good enough, and you can train it in the cloud

#

I just don't know if that's viable for you and if it's possible for your assignments

fading osprey
#

depends on your dataset, I was doing processing with whisperx on a GTX 1660 and system memory never went above 12GB (including GPU overflow and Windows overhead)

drowsy elbow
#

Lol wtf, my pc is already using 9gb after a cold boot

#

I have discord open, whatsapp and 7 browser tabs lol

fading osprey
#

if I can justify the cost, I could probably use my server thats in the garage to do ML training on, would just need to find a way to stuff a GPU in there since it hasnt got PCIe power connectors anywhere on the board

drowsy elbow
#

And this, but everyone memes on this lmao

drowsy elbow
#

Or maybe buy a upgrade kit second hand for 200 pounds with a decent ryzen processor and put a gpu on it

fading osprey
drowsy elbow
#

why is bruno highlighted lol

fading osprey
#

though, granted, thats Debian im running on, so memory usage would be lower

fading osprey
drowsy elbow
#

This is my usage on debian lol

#

But tbf half of it is ZFS, so it doesn't really count

fading osprey
drowsy elbow
#

No I meant, just buy a cheap pc with a decent ryzen processor and slap a gpu in it

#

And a cheap laptop

#

And then it's just as expensive as a decent laptop lmao

fading osprey
#

ah, fair enough lol, I could do yeah, if no particular reason I couldnt just run an SSH session from cheap laptop to cheap server box through a VPN

drowsy elbow
#

Run tailscale on them, if your ip changes it doesn't really matter

#

I run a dynamic dns client on my server in a docker container which updates dns records at cloudflare, which works for me. But tailscale is easier

fading osprey
#

ironically, I'm doing the same since some of the services that power TWDB are running on my garage server instead of the cloud VPS ive got for the really important ones

drowsy elbow
#

I just saw your site, looks sick

#

Maybe look into cloudflare caching to reduce hosting costs

fading osprey
#

hosted using R2, cf pages, cf workers, Stream, Images, KV, D1, and Queues 😉

the costs are about as low as I can get them for the content that is being served currently, only thing left for cost cutting is getting rid of the cloud VPS, but that cant happen since my home upload isnt good enough (thanks Virgin)

the prototype of the redesign looks a lot better, even if it doesnt function properly yet

drowsy elbow
#

Oh that sounds a lot more complex than I thought at first haha

#

I thought you just indexed the thumbnails, youtube chapters and put it in a db, and then just embedded the yt link with the timestamps

fading osprey
#

the easy bit was the UI, the difficult bit is the automation

I dont wanna be awake for WAN show every week, I want and crave sleep. But I also want the archive to be as complete as possible

fading osprey
drowsy elbow
#

also scaling doesnt work very well yet

drowsy elbow
#

It's really impressive for a hobby project

fading osprey
#

the thumbnails wont load btw because I purged the CDN ahead of an update I am coming out with soon™️

drowsy elbow
#

Looks sick bro

fading osprey
#

scaling still isnt great, but its getting there, the search box will be crushed into a burger menu on small screens and mobile

drowsy elbow
#

My front-ends look like a kid took a crap and called it a day haha

#

The options menu needs a bit of white paint btw

#

Anyways, I should really get back to work now

#

Was fun chatting with you 🙂

fading osprey
drowsy elbow
#

Thanks 🙂

cyan niche
#

I completed all of my AI courses on a framework running an intel processor.

#

GRANTED, the final project was a chore because it took like 20 minutes to train the model, but it was a google codespace so it didn't actually use my hardware.

fading osprey
cloud knot
#

Rant: Every time i have to develop for iOS i hate the platform more nad more and more

fading osprey
#

simple fix: dont

cloud knot
#

sure, tell that to my boss 😄

fading osprey
#

feel free to send me his email, I'll write you a letter saying that forcing you to do iOS is an abuse of human rights under the "cruel and unusual punishment" conventions 😉

viscid glade
#

or this?

#

is push_back only applicable to those that aren't void?

restive abyss
#

are memes allowed here

steady wren
#

Is there a need to protect routes like password-reset or other sensitve actions like that?

inner wraith
#

Well I'd use a bit of common sense there. If you're emailling reset links you don't really want a flood of those, or allow people to identify valid accounts they don't own by attempting to reset a lot of accounts at once/bruteforce passwords. You probably also don't want unauthenticated routes hammering your server either for performance reasons.

steady herald
#

is there anyone here that can help me with a little python code please?

#

i got this error and i cant figure out why

young plover
#

You’re not passing data

silk eagle
# steady herald

Dictionary.get(key) can return None (as opposed to Dict[key] which would just return a KeyError), my first instinct is that results.get("columns") is returning None.

steady herald
#

thats what im thinking
but idk why

#

would ot help if i shared my whole pyhton file?

silk eagle
#

well step 1 is to confirm the theory, get a print or some kind of visual feedback that can confirm that results.get("columns") is actually giving you None, then step 2 is to figure out where or why the columns key isn't being set to an expected value

cloud knot
#

but seems like how you do is fine

#

and instead the columns parameter you pass is empty and not an array

#

could be as simple as your query not returning columns (metadata) when there is no result

gloomy blaze
#

Can I ask coding related questions here?

fading osprey
#

I dont know, can you?

twilit beacon
#

it is infact a possibility

hollow basalt
#

i do agree

silent gust
cyan niche
#

rip question

#

he forgor

hollow basalt
#

thats the question

gentle cipher
silent gust
#

He will prob redo the line lol

cyan niche
#

Rust is too powerful of a programming language.

willow olive
mellow solstice
#

im learning python at the moment

#

and tips to get better at it. i got an coding exam in january for python

fading osprey
#

best way to learn is by doing a lot of the time, so find some programs you would like to make for yourself and just make them

drowsy elbow
#

I paid 10 euros for copilot to suggest this....

drowsy elbow
mellow solstice
#

okay

solar tree
hollow basalt
inner wraith
#

Made a Discord bot to hit Jagex's APIs for player data and scraped GE data off another page when I couldn't pull it from an API

#

Work's time tracking sucked so I scraped that, parsed it and compared with my own time tracking for discrepancies

#

Find stuff you want and get it with Python, basically

mellow solstice
#

okay

#

thanks for the tips guys

neon oriole
# cyan niche

python just gives you a : SyntaxError: invalid character ';' (U+037E) wich also is enough imho , zig does something similar : An error occurred: playground/playground278011722/play.zig:4:94: error: expected ';' after statement playground/playground278011722/play.zig:4:94: note: invalid byte: '\xcd'

#

rust be like

in the year 200BC the greek society boasted a new symbol in their alphabet , the writer and historicus plato discribed it as a welcome and highly needed .... .... futher more when the printingpress was invented in the year ..... .... we also project that by the year 2610 this symbol and unicode for that matter .....

#

want to really confuse a javascript programmer , write jscript and execute it natively on windows :p

#

i want to state that my favorite javascript extention is nojs ... 🙂

dusk surge
neon oriole
#

funny thing is that 80% of python programmers dont even know you can use the semi-colon as a separator between statements ```py
print('');print()

onyx gazelle
#

im learming to program a discord bot and im trying to make a kick command but i have an error

code:
@client.tree.command(name="kick", description = "Kicks a user (No admin abuse!)")
@commands.has_permissions(kick_members=True)
async def kick(ctx, member:discord.Member, reason: str =None):
if reason is None:
reason="Reason Not Provided"
await ctx.guild.kick(member)
await ctx.response.send_message(f"User {member.mention} has been kicked for {reason}✅")
@kick.error
async def kici_error(ctx, error):
if isinstance(error, MissingPermissions):
text = "You dont have permisson to run this command❌".format(ctx.message.author)
await client.send_message(ctx.message.channel, text)
response:
The application did not respond

frozen flame
#

also you're eating all errors that arent MissingPermissions in your error handler, so you wont get any other error messages

onyx gazelle
#

the MissingPermissions not working

#

because thats counts as else

#

how do i fix it?

neon oriole
#

dont know anything about discord bots but ... isinstance checks if an object is of type

frozen flame
#

MissingPermissions refers to the user missing permissions based on your decorator

#

(also id strongly recommend you join the discord.py server for help instead of asking here)

odd musk
#

trynna get git/github working for the first time rn for a school group project, with pycharm specifically, but every time I try to clone it makes me reinstall git and then after i press clone it just says "clone cancled" and i cant open or edit the file, only delete it, anyone know what im doin wrong?

stiff kiln
#

Does anyone know what CoBRRa is?

silk eagle
nocturne galleon
#

good and enlightened people of this chat: How do I move images to be on certain parts of webpages in markdown? I am a complete noob who decided to get a HUGO website running and idk how to do it. Adding the image in via HTML and going that route as searches on goolge recommended did not work at all (the image didnt even show)

nocturne galleon
midnight wind
#

wdym by move, show screenshot

nocturne galleon
#

As in the image is centered on the webpage, I want the image to be on the right side

midnight wind
#

so that's styling, idk how hugo works but from what I read markdown has little to no styling options

#

so either you modify the template or embed html that has styling

nocturne galleon
#

Ok that would make sense

#

Thank you!

edgy roost
#

Would anyone be able to help me figure out why a java program is not reading form a config file?

deep bluff
#

Im looking into Rocketry, pretty new to this and want to get started in developing flight control software etc. etc. What will be a good CFD to do this with?

midnight wind
#

so generally rocketry you don't have any custom flight software

#

you use off the shelf components

#

for simulation most people use openrocket

#

this is based of several equations that model generally the flight

#

CFD is not needed

deep bluff
#

Wasn’t sure if openrockrt supported that

midnight wind
#

That will simulate your flight

#

Go to the r/rocketry discord for more info

jagged vault
jagged vault
odd musk
#
    if currentScreen == 1:
        screen1()
    if currentScreen == 2:
        screen2()
    if currentScreen == 3:
        screen3()
    if currentScreen == 4:
        screen4()
    if currentScreen == 5:
        screen5() ```
silk eagle
#

my first instinct is have a:
screen() function instead of screen1 screen2 screen3 etc

odd musk
#

thats the code, it does work, just it runs on every frame and 5 if statements seems unnessecary here, but idk a better solution. inputs are always 1-5

odd musk
silk eagle
#

also, mostly unrelated, you should use elif after the 1st if statement. if currentScreen is 1, itll do the first bit but then itll unnecessarily check if its 2 3 4 or 5 etc whenever it was already decided that its 1. elif will make it so that if a statement is true, itll skip over the rest in the group of elif's

odd musk
#

thats actually a good point ill switch that ty

#

well shouldnt make a difference since it returns tho and ends the function right?

#

cant hurt ig

frozen flame
odd musk
#

idk what that means, could you explain more?

frozen flame
#

From there it's just a matter of

lookup[currentScreen]()
silk eagle
frozen flame
odd musk
silk eagle
#

yes, but if you did ```py
def main():
xyz()
print("x")

it would
odd musk
frozen flame
#

Yes

odd musk
frozen flame
#

You're grabbing the function from the lookup table, and then you call it with ()

odd musk
#

yeah u right

silk eagle
#

so there lookup[currentScreen] would bring you to the value of the key currentScreen in the dictionary called lookup, which in that case would return a function which u can then call by adding () after it

#

so itd be lookup[currentScreen]() to call the function associated with the value of currentScreen (i.e 1: screen1 or 2: screen2)

#

not to be confused with the return value of a function which would be like 1: xyz() with the (), which would call the function. here you wouldn't put the () because you just want to reference the function to call it somewhere else

odd musk
#

yeah you right, thats mb, i thought the xyz() was replaces with a return function, forgot i changed it

#

i have this

def printScreen1to5(currentScreen):
    lookup[currentScreen]```
and it just fails and says: TypeError: 'set' object is not subscriptable
frozen flame
#

Namely, you're missing the numbers, and you're also calling the functions, which you don't want to do.

silk eagle
#

so a dictionary (which is { and } encasing things) requires key: value, youd use the key to get the value. key here would be whatever u want currentScreen to be in order to refer to a function, value would be a reference to that function, (the function name without the () )

odd musk
#

ah ok ty, idk what a dictionary is before now sorry

#

did this and it didnt work

lookup = {1: screen1, 2: screen2, 3: screen3, 4: screen4, 5: screen5}

silk eagle
#

and then you would take that reference in your printScreen1to5 function and then put the () after it.

#

so after running lookup[currentScreen] youd have a reference to the function you wanna use

#

that you now want to call with a () after it

odd musk
#

wait sorry where do i use the parenthesis?

silk eagle
#

so if currentScreen is 1 and you run lookup[currentScreen], you basically now have the line screen1

#

so slap the parenthesis after lookup[currentScreen] to make it lookup[currentScreen]()

odd musk
#

ohhhhh that did work

#

idk why but it did

silk eagle
#

to make it a little bit less daunting, its like saying:

func = lookup[currentScreen]
func()
#

youre just skipping the func = part

odd musk
#

yeah ig that makes sense, just overthinking it

#

wouldnt that define func as a variable tho?

silk eagle
#

yeah. it'd be useful if you needed the func variable elsewhere in your code but you dont so just doing lookup[currentScreen]() has the same effect.

odd musk
#

ah that makes sense ig. also one more question why isnt it just screen1() in the set directly? also could i replace those with like strings if i needed something similar for something else?

jagged vault
#

Hey developer friends.. Are any of you familar with the luhn algorithm?

inner wraith
#

Yes. 🎉
...Were you ever planning to ask a relevant question or is this just a survey?

jagged vault
#

oh sorry I had to run

#

lets say you were a professor, and you made an asssignment based on coding a simple python program to verify if numbers should or should not be valid based on CC issuer, and report errors. If you did it efficiently, 23 lines of code

#

2nd half of assignment was a write-up explaining the logic behind everything'

#

the prof turned the 1st half into turnitin. the entire class got flagged.

#

since half the code is literally set ranges...

#

tldr: he reported all the guys and 0 of the girls. my appeal went to some lady over zoom who doesnt know what python is

#

I have it all documented and all 4 women in my discord group will back me up should i escalate further, but having a little black * on my transcript bugs me

#

(the writeup was us guessing the error in the black-box checking validity)

inner wraith
#

I'm not fond of Turnitin, especially for programming tasks.

north peak
#

I am trying to deply a vite app on gh-pages getting this
GET https://xxxxxxxx.github.io/src/main.jsx net::ERR_ABORTED 404 (Not Found)

inner wraith
acoustic pine
#

hey uhh i'm very new at java.
first semester CS
i just wanna know what you think about my simple java code
it's probably bad for someone who's experienced's standard but pls no bully lol

#

just a simple 2 value calculator

vague falcon
#

You only ever set val1 and val2 twice, so you can do it as
final double val1 = verifyDouble();

#

Assuming you've covered final ofc

acoustic pine
vague falcon
#

Simlarly, this will work:

do { final int foo = 1; } while (true)

#

Every time through the loop you create an int, use it then it's released and gone. You create a new int as you come through again.

acoustic pine
#

ah
i get it now

vague falcon
#

You can also make the parameters on the methods final unless you need to modify them to avoid issues where you are editing stuff that you don't intend to

acoustic pine
#

so i have this now, but default and case "y" basically does the same thing which is redoing the mathOperator
now i can just make any key means yes it but that's no fun
how do i make if it's neither y/n it makes the user input again

vague falcon
#

Default will exit and the loop will continue, no?

acoustic pine
#

it repeats mathOperator

#

i want it to make the user input again

vague falcon
#

So why isn't the call to mathOperator in 'y'?

acoustic pine
#

y also calls mathOperator again

vague falcon
#

You only need to call mathOperator from inside the 'y' case, right?

#

You can even then move the "Do you want to do anther..." to inside the 'y' case after mathOperator returns

acoustic pine
#

moved mathOperator in the y case
and another mathOperator before the loop

#

this finally got the desired outcome

#

thanks for the help

#

this is definitely more readable than the nested loop

red mulch
#

This is why people get stabbed.

red mulch
#

none of that is necessary of course, and I'm taking it from a learn basic stuff exercise into better coding patterns.

acoustic pine
red mulch
acoustic pine
red mulch
#

<saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/> This is also why people get stabbed

#

XML is the worst thing ever

fading osprey
#

I agree

vague falcon
red mulch
proud raven
#

I'm new to microcontrollers, and would like to write a very time-sensitive program for the PIO on the Raspberry Pi Pico. I know what I want it to do, in a big picture sense, but have no experience with PIO and programming with microsecond precision.

red mulch
#

1 us precision is pretty damn precise - unless you mean 1ms

#

What exactly are you doing and trying to achieve

#

PIO you mean platformIO I assume

#

suuuuuper easy to write stuff in vscode using it for the pico

proud raven
#

Programmable input/output on the raspberry pi pico. I'm very new to the whole deal. I know what I'd like to do is possible because it's been done before. But, I don't understand the code at hand, as it is not documented. So, since I have a pretty decent idea of what I want it to do on a very simple level, it might help to get some experience with time-sensitive functions.

red mulch
#

oh ok yep

proud raven
#

Broadly speaking, I'm trying to simulate Nintendo 64 controllers from the Raspberry Pi Pico in order to interface with the console.

red mulch
#

ahhhh ok

#

That's not us precision I would expect 🙂

proud raven
#

I've been talking with people on the N64 homebrew server, which is very helpful and full of knowledgeable people, but I've got a lot of gaps in my knowledge so I'm coming to the LTT server to get some necessary understanding.

red mulch
#

100us would be fine

#

even 1ms

proud raven
#

I'm not sure about that. The Joybus protocol is kinda picky about how the controllers respond to polls from the console.

red mulch
proud raven
#

Their wiki has a lot of information about the joybus protocol, but I don't understand a lot of it because I've never done anything like this. I've got some programming experience, but nothing of this sort.

#

Code exists to simulate an N64 controller, which is supposedly able to extend to simulating four controllers with minimal changes. I may already understand the extent of those changes. However, the existing code takes controller input from a bluetooth source, and since it's not documented, I have next to no idea how I would go about getting that data from a network source, let alone translating one controller's data into another. Network programming is something I've never even attempted, though I do have friends with lots of experience who I've been working with in order to make sense of the task at hand.

red mulch
#

I mean... I'd just ... take what you've got as above (or whatever - it's been done, don't do it again).

#

then add network bits to it

#

I mean is the protocol already existing blah blah?

#

Would it not be easier to write a PC network to USB controller software and just use the off the shelf software?

proud raven
#

That sounds like it makes a lot of sense, but the issue is that since the code isn't documented, I don't understand which parts come from the protocol and which parts come from the networking.

red mulch
#

what does this hardware actually do?

#

I mean... at some point you're going to need to learn

#

bear in mind your first version of this will SUCK

#

like... a lot. Trust me 🙂

proud raven
#

Essentially, a Raspberry Pi Pico is wired to four N64 controller cables, with the data wires connected to GPIO pins, ground wires connected to ground pins, and power wires left not connected. The Pico gets controller data from a network source and relays that information to the console when polled, pretending to be 1-4 controllers as needed.

red mulch
#

why a network source though

#

like I get your design, but what function are you actually performing

proud raven
#

I would like to play retro games with friends in other places.

red mulch
#

what problem is being solved that can't be done right now

#

and you don't want to use an emulator?

#

which would be easier in EVERY way

proud raven
#

Surely it would, though I am fond of the console itself. I've got an EverDrive and have already got the hardware I'll need to simulate the controllers.

red mulch
#

ok yes, but the hardware is the least of the problems

#

is there already a protocol for the network?

proud raven
#

Could you explain what that means? This is my first venture into networking.

#

While this project is my idea, I'm not the only person working on it, so the gaps in my understanding are not shared by everyone involved. However, I am illiterate of many of the details I'll need to work with in order to bring it to fruition.

red mulch
#

like... what is on the other end

#

what will the messages for the controllers be

#

what happens if they disconnect, blah blah blah

proud raven
#

Ah, gotcha. It has not been written yet, but we have a couple of architectures in mind for how we might have it take shape.

red mulch
#

like this is a fairly significant project

proud raven
#

In one paradigm, the decoding of controller data would be done server-side, and the Pico will need to account for everything that might be transmitted by anything it hopes to be compatible with.

red mulch
#

don't get me wrong it sounds fun, but it is more of a "because yuou can" not because it makes sense

#

nonono, the remote users - how does their controller input get to the pico

#

I think it would actually make more sense in your use case to use the off the shelf pico software and have a pi running the whole thing

#

because advanced networking on a pico is a pain in the butt, and will screw up your timing

proud raven
#

Oh, heard. This has not yet been written, but the others know a good bit about this. How much is not for me to say, since I don't even know what all there is to know.

#

You're definitely right about the "because we can" nature of the project. It's honestly my motive for doing most of the things I do, at least from a recreational point of view.

red mulch
#

I mean, probably not if you wanted to use it over the internets, but hey 😄

#

given it's extremely simple

#

but given what you're saying, I think what you really want is a pikvm for a gamecube.

proud raven
#

What is a pikvm?

red mulch
#

so you do capture and control from a pi. Maybe using a pico as a bridge, but meh

#

look it up

proud raven
#

Ohhh, I was kerning that as pik virtual machine and confused about what the hell was a pik

#

So, this looks great, but is a lot more expensive than I'm able to do anything with at the moment. Currently I've got the Pico and associated tech for ~$30, and this is closer to $300-400.

#

Wait, I think I get what you're saying. I thought you were saying "The device you need is PiKVM". Do you mean "You're trying to do something similar to what PiKVM does, but for a Nintendo console instead of a PC"?

slim laurel
#

Hi! I have a problem with running a VBA Macro(I have no experience with it, I just copied a code from a YTber, but it was repeating), I used chatGPT to help me with it to resolve the repeating process but now, it doesn't work anymore. I endep up here: Sub ShuffleJump()
Dim FirstSlide As Integer
Dim LastSlide As Integer

FirstSlide = 2
LastSlide = 4

Dim SlideList() As Integer
Dim i As Integer
Dim temp As Integer
Dim SlideIndex As Integer

' Create an array with slide numbers
ReDim SlideList(FirstSlide To LastSlide)
For i = FirstSlide To LastSlide
    SlideList(i) = i
Next i

' Shuffle the array
For i = LastSlide To FirstSlide + 1 Step -1
    SlideIndex = Int((i - FirstSlide + 1) * Rnd) + FirstSlide
    ' Swap slides
    temp = SlideList(i)
    SlideList(i) = SlideList(SlideIndex)
    SlideList(SlideIndex) = temp
Next i

' Start the slide show
SlideShowBegin

' Visit the shuffled slides
For i = FirstSlide To LastSlide
    SlideShowGoToSlide SlideList(i)
    ' Pause for a moment (adjust as needed)
    Application.Wait Now + TimeValue("00:00:01")
Next i

' End the slide show
SlideShowEnd

End Sub

Sub SlideShowBegin()
If SlideShowWindows.Count = 0 Then
SlideShowWindows.Add Range:=ppViewSlideShow, _
Left:=0, Top:=0, Width:=1, Height:=1
End If
End Sub

Sub SlideShowGoToSlide(slideIndex As Integer)
SlideShowWindows(1).View.GotoSlide slideIndex
End Sub

Sub SlideShowEnd()
SlideShowWindows(1).View.Exit
End Sub

nocturne galleon
#

What the hell are these errors

#

It would be great help if you can tell me

young plover
#

First mistake, C#

#

Second it’s warnings, they’ll be grand

acoustic pine
#

@vague falcon i improved the code further and implemented more of your suggestion.
i moved the math logic to its own function and also the one that asks for an operator to its own function.
i also added ability to use previous values now using a storedValue object.
take a look and see if i can improve anything

#

hmm maybe i can combine mathOperator and mathOperatorPrevious into one function

fervent aspen
vague falcon
nocturne galleon
nocturne galleon
noble jetty
#

ah macros

glossy quail
#

Hey guys, how hard can it be for someone to decompile a python 3.9 exe code? Keeping in mind there isn't a decompiler of course? Does that mean it's secure?

frozen flame
#

Python is not meant to be compiled, so any exes are actually just a python interpreter plus the source files

young plover
inner wraith
#

Make money forever on subscription, never give your customers the code - great for everyone bar the consumer

glossy quail
#

Thanks for these amazing responses, what can I do to make my app as secure as possible from getting it's source code obtained?

midnight wind
#

You can compile code like C, but it can still be decompiled which won't give raw code but can still get logic

frozen flame
#

it does give raw code when you decompile it

midnight wind
frozen flame
#

ah right

desert iron
frozen flame
#

cython can suck my toes

#

Come back when it can deal with asyncio properly

young plover
young plover
#

If you’re worried about plain text junk left behind because you’ve hard coded passwords and all that jazz you can run strings against it and comb through that output for low hanging fruit

glass rose
#

Anyone here into game development?
If yes, where should i start if i want to learn from fresh?

midnight wind
#

Depends how it's packaged, look above

young plover
#

I mean, Java packages would be straight back
Everything else you’ve stripped comments, if memory serves me correct

midnight wind
#

C/C++ you have nothing from code basically

#

Python depends but you have the whole code since it's just a package of code + interpreter

stable bough
#

Question: i want to develop a bunch of simple database manipulation programs that run locally on someones ocmputer. ON my macbook i can install perl or python and mysql and run the scripts but i need a way to package it so that i can give this to someone and they can run the same stuff on their end on a windows or a mac with no effort including the need to install stuff. How would i best do this?
Everyone needs to do the same database manipulations and i want to get everyone off using 40GB .xlsb files

frozen flame
#

Maybe don't use mysql for something local

#

python can be bundled into an executable, so just use pyinstaller to make an executable out of your script

#

You may want to use sqlite for something local though

#

For the "same database" problem, you'd need to have one central database in the office or whatever. IE not locally on a computer. If your office has a server rack (most do), you might be able to get IT to put it on one of the servers.

#

(I missed the same database part until that last comment, hence the sqlite suggestion.)

inner wraith
# stable bough Question: i want to develop a bunch of simple database manipulation programs tha...

Pretty much you need to make an installer for each platform and bake in a copy of the desired dependencies and call them instead of relying on system versions being present or correct. If it's for internal at your company licensing isn't really a problem when doing that.

Centralising the dataset's also a pretty good idea if you have the time and can get a server for it but without context I can't provide much advice. Otherwise, I'd agree with maybe giving mysql a pass if everyone's getting a database each, sqlite's probably a better fit unless you need mysql-specific features.

stable bough
#

Sidebar I think my company is using advanced machine learning to do stuff which has now resulted in the hilarious "stuff is happening, is not happening like it should and literally no one in the entire company knows why or how"

inner wraith
#

1000s of ppl running data stuff on one server? Lots of power needed Yes and no, you get the benefits of performing certain common operations once or even ahead of time

#

If you have to keep distributing new datasets as-is and you're only pulling small amounts of calculated data out as insights it also massively cuts down on transmitted information

#

But the "our organisation can't do centralised servers competently" problem is one I've seen many times and I have sympathy for you

frozen flame
#

Maybe not mysql, but something like Postgres runs insanely well on limited hardware

#

(Also recommend not using mysql btw)

inner wraith
#

MySQL's performance is excellent

#

The reason to not use it is to not be running a database server on every endpoint at all times or manage its service with starting multiple tools

frozen flame
#

MySQL slogs once you get past fairly basic queries ime

#

There's really no reason to use MySQL in todays world other than for legacy reasons

inner wraith
#

MySQL is fine. Massive companies use it just fine. - Don't get me wrong, if picking an RDBMS I use Postgres and prefer it myself for my use cases...

#

Some companies (Uber comes to mind) even have use cases which make it superior to Postgres

frozen flame
#

Using it just fine and it being fine are two different things though

#

You can use it just fine once you're used to it's quirks and the bs it sometimes spits out (or takes in as the case may be)

inner wraith
#

Anyways the problem is getting data and operating on it in Not Excel, not database holy wars

frozen flame
#

Not Excel you say... clearly the solution lies in MongoDB then x0r6ztGiggle

inner wraith
#

MongoDB with a 40GB document, perfect

inner wraith
# stable bough Actually I rather think decentralised data is better. 1000s of ppl running data ...

You'd probably want to install your dependencies to a subdirectory of your project and test+confirm that it does not rely on anything outside that directory, such as on registry entries. (If it does you'll need to add a script to set them appropriately/mitigate that)
Then use a packaging tool relevant to each platform to generate a install package (For windows MSIX is the trendy new thing, else just build an MSI)

I'd seriously consider using sqlite so you can just send the .db files around as needed without additional ETL tasks on the end users computer (not to mention not needing double the disk space at import time to store both the source datafile and the generated database).
Else you will need to either create a service for MySQL/manage its installer from yours and ensure it never starts twice from two tools.

I don't think you understand how wickedly optimized modern databases are seriously consider a centralised database server if its even remotely a possibility, because they are indeed highly optimised and efficient. Rules out people having stale copies of data too.

#

Sending large files around is definitely not a solution which scales much more than its present size

midnight wind
#

1000 clients on a server should handle just fine

#

Depends on the queries ofc, but in the grand scheme of things 1000 isn't that much for a db

neon oriole
#

note that you have to keep track of how many queries you actuallty make , as some orm/frameworks and other js attrocities hide the amount you actually are making , i dont do js but theprimeagen had a video sometime ago where he had a small portion on the topic

inner wraith
#

note that you have to keep track of how many queries you actuallty make Not really, that's what server performance monitoring is for

neon oriole
#

my question, in linux program arguments are keptr in the programs data segement in memory right? , argv[n] holds pointers to them , so if i copy a pointer to a struct , and later use that pointer in that struct to loop over all chars behind that pointer (untill \0) thereby changing some , that should not be possible imho , but i figured that that is exactly what im doing in some code i wrote , so the code works but it shouldnt.

neon oriole
# inner wraith `note that you have to keep track of how many queries you actuallty make` Not re...

i mean while writing your code , i cant find the exact piece where it was discussed but the gist of it was , there are orms/frameworks out there that , worik in a way that to read a value MSG from a table you could do CHAT.USERS.USERNAME.MSGID ... wich would in turn create queries for all db's to choos the one named chat all tables in chat to select the users table, all records ... you get the point, all really short fast querries butt allot of them,.. where you could write one single SQL query that would get that message with one single querry

stable bough
frozen flame
#

cause you're all accessing 40gb excel files?

#

or is this aside from that

stable bough
#

No this was an application developed by central IT

#

The reason ppl use 40gb Excel files is cuz centralised applications are too slow to develop and changes that are needed aren't done cuz a centralised application ca apparently only cater to the needs of the majority

#

There's too many small little things ever person requires different from every other person. There's actually no need to manage anyone's files or data once installed since all the files and data have to come in the form of a CSV dumped from centralised big data repos that are bogged down by poorly optimized web programming

frozen flame
#

so you dont need a centralized server?

#

does the data need to be synced across users in real time?

stable bough
#

Not beyond there data pool that is the source of data anyway

frozen flame
#

sounds like using sqlite would be a fine option then

stable bough
#

Not at all, ppl just download the date they need from the IT managed pool and mess with it

#

I ended up going with MySQL+ Perl... Why no MySQL? What are y'all opinion on oracle dB?

frozen flame
#

well mysql is a server app for one

#

installing it invisibly is quite annoying in comparison to bundling an sqlite binary

#

sqlite is file-based, and doesnt need a server process running in the background

#

which is more ideal for running on an end users computer

stable bough
frozen flame
#

just make sure you dont leave the server running all the time on the users computers

#

most people use unix timestamps for datetime in sqlite since it doesnt support it as a type

stable bough
frozen flame
#

havent used it, but i do have a hatred for oracle so theres that

stable bough
#

Just to highlighte the level of competence we are working with here...our software that we use for creating quotes and ordering stuff...doesnt do BEDMAS/PEMDAS properly. It has to churn through billions of lines on a daily basis, frequently gets stuck and any attempt to improve it by extending it(many that have been very successful very quickly) have been met with "nuh uh, my application, how dare you"

#

An sqlite or heck even access file on each individual computer would be better in every way

frozen flame
#

sounds like IT

stable bough
#

Lol

#

So... Just normal IT things? Damn I thought it was just me or the company I work for

#

The issue is requirements. Most ppl who do data stuff in the company only do like 20k or 30k lines of data. The team I have... 200k is a slow day. So most applications are designed for 20k or 30k. Rounding errors don't matter if Your max is even $2k. But if you're price before discount has 11 digits all of a sudden 0.001% is a massive number and 1000 people are a lot.

stable bough
inner wraith
#

200,000 rows a day per user shouldn't really be a problem

inner wraith
inner wraith
fading osprey
inner wraith
#

Oh @stable bough Did you delete your thing? Oracle: If it's enterprise licensed I understand it's by core and horrifically expensive

#

So that could be part of why it's slow

stable bough
inner wraith
#

Yep

#

Cores*users if this is correct

#

Which is... insane...

stable bough
#

Ooh yes that can get real expensive real fast

stable bough
inner wraith
#

SQlite for single user databases has excellent performance. It is a database. Power Query is for transforming data into spreadsheets or PowerBI. It's a visual ETL tool

stable bough
#

Unless power query is just as good there's a few ppl already using it

inner wraith
#

Different purposes

stable bough
inner wraith
#

No

#

It works with them and other data sources

stable bough
#

Ooh, ok yea sqlite it is then. I'm comfortable with perl or C++ either one can handle date math if I need it to. So should work I think. Ty

inner wraith
#

For what you were asking earlier, Power Query is an alternative to using scripts to transform the data

#

...By using more different scripts and visual flows depending on target product

#

If you're a programmer anyways I'd just do your desired transforms in a language you're familiar with and can get running where needed

stable bough
#

I just don't like .net programming

stable bough
inner wraith
#

Not really my area of expertise, but If the sqlite database is derived from the Excel+CSV files and you're doing your transforms in Power Query there would be little difference.

languid storm
#

Does anyone have experience on selenium? Been stuck on a issue for a couple hours now 😭

silk eagle
#

whats the problem

#

and what lang/driver are u using

desert iron
nocturne galleon
#

hello

#

I'm a freshman CS major and I'm looking to purchase a laptop, I know that I have to look for 12 gen i5 or i7, but should I get the H version of the cpu or the U version? cuz if it doesn't matter I don't wanna over spend on a gaming laptop, also I'm majoring either software engineering or cybersecurity

peak acorn
#

IIRC h = faster u = better battery

humble hollow
#

Hey guys, was wondering if there is a free option for the discord bot to keep running and active. I tried repl.it with Uptimerobot and the keep_alive Code but the bot keeps turning off/on whenever he wants to. Would appreciate all help coming ;)

hollow basalt
#

As long as you live with your parents and they pay for the electricity, you get a. Free running discord bot

humble hollow
#

:(

vast depot
#

Is there any good youtubers for understanding functional programming? Newbie here trying to learn on my own time but not sure where to start

frozen flame
#

Not without significant caveats such as those of replit (which btw is shutting down their hosting at the end of this year)

hallow sky
#

does anyone know what this software is? its not grafana and its used to view CSV data but I cannot for the life of me figure out what its called. Please ping if you know!

midnight wind
#

it is technically grafana, but customized

hallow sky
#

awesome thank you!

pine frigate
#

A powerful ChatGPT app for all Wear OS devices

GitHub

A powerful ChatGPT app for all WearOS devices. Contribute to DevEmperor/WristAssist development by creating an account on GitHub.

peak acorn
#

We are building a kinda crappy chat system. Right now each client will just poll the back end to see if there are any updates every 5 seconds. But we want real-time updates, so we are adding a websocket connection. The question is:

Should the websocket itself provide the data for the chat (ie "theres a new chat, heres the msg: <>" and "message of ID <> was edited, it's now <>" and "msg of id <> was deleted") OR should we just make the websocket say "there was some sort of update, you can query the server to figure out what the actual update was"

#

Im thinking the former is the way to go? Seems a lot nicer logically. But since we already have polled working, it would be so easy to make the websocket just re-poll basically

silk eagle
peak acorn
#

right-o

fading osprey
# silk eagle looking at devtools it looks like Discord does the former, whenever people start...

can confirm that this is accurate, Discord uses a system called "gateways" to deliver new messages to the user in realtime.

The api provides historical messages, but they are transmitted in real time (along with cool stuff like typing notifications and presence updates) via the "gateway network" as they call it, which is a fancy term for a series of highly inter-connected websocket nodes which people and bots connect to for realtime data

frozen flame
peak acorn
#

i suppose so

neon oriole
fading osprey
#

Effectively yeah

frozen flame
fading osprey
#

thats because it isnt federated lol

peak acorn
#

dafuq, lol

#

id: number plus 1 (literal) = "11", ok

neon oriole
# peak acorn

i can see the logic behind this, '+' checks if the first term of the operation has add implemented ifso , (a string so yes in this case) then it checks the type of the second term and if that implementation opf add implements how to deal with that type, in this case because it tries to add to a string , the most logical path is to convert the second term to a string aswell.
(ps: i said i can see the logic not that i approve of it. i)

peak acorn
spring skiff
astral garnet
#

@neat laurel no self promotion:|

hollow basalt
#

name checks out

fallen horizon
#

I'm still surprised whenever I see a job for a programmer on discord
For me it feels so odd

hollow basalt
#

but ofc, randomly posting your skills to discord server is still odd

fallen horizon
#

Yeah

hollow basalt
frozen flame
#

Clearly development channel means "post my CV here"

trail bough
#

Hey lads, I'm trying to do Speaker Identification with Supervised learning in python.
What are the best set of features to extract from the audio files? (the audio files are for now from audio books, so it's a single person talking with clean and not noisy audio for about 10 to 30 mins per file and I have 10+ files per speaker)

also what would be the best algorithm to use??? I'm using SVC now, but I think deep learning might be better.
the features I'm extracting now are: MFCCs ,Chroma, Spectral Contrast and Tonnetz

Using all 4 features got me 70% acuracy, but only using MFCC got me to 80%.

I know a little about the theory about what could be an issue.
maybe my moddel is too simple for complex data? or I don't have enough data?
maybe I'm causing overfitting to happen
Can someone help me choose and use a deep learning algothim to see if it's better than SCV, I have never done that before and I don't have enough xp to choose which features/models or libraries to use

opal elk
#

hi

#

how can i get all the taskbar items vb.net by it hovering over each item

wispy stone
#

Does anyone have the manual for a leader 8101 oscilloscope

inner wraith
# wispy stone Does anyone have the manual for a leader 8101 oscilloscope

I don't think an analog scope is really a #development But for the heck of it I had a look... it looks pretty basic from a look at the front if you're familiar with oscilloscopes generically - most of the terms you can just google and understand. If it's damaged your best best is probably careful disassembly and analysis. Not easy to find a manual for it.

#

If you do disassemble it, please be careful of the CRT, they can deliver a dangerous shock when charged and can maintain that charge for an extended period of time.

wispy stone
#

Thanks

indigo dragon
#

Ive been bug hunting in QEMU since I submitted some patches back in February and want to contribute to open source some more. My strategy was to throw AFL (the fuzzer) at it by loading generated BIOS images. I kept it running until it generated a failure that resulted in some memory corruption (either in AddressSanitizer or Valgrind) and it found one after about 48 hours

#

It hit many other issues but all of those involve TCG breaking and I feel like the likelihood of a patch being accepted is higher if the problem is a segfault because the solution is more obvious

peak acorn
#

What is generally preferred? :

      loadedMessages
        .filter(filterAllowOnlyMessagesISentFunction)
        .reduce(reduceGetMessageWithHighestIDFunction).id

versus

      selectMessageWithHighestID(filterMessagesISent(loadedMessages)).id

Basically the bottom just moves the filter and reduce into its own function

urban mulch
#

Ok guys, I need tips

#

My problem is:
I have an API and my frontend needs to upload an excel file and import the data to the database
The code for uploading, reading the file and adding the data is all working fine
The thing is that there's a lot of data, so it takes some time to do all the importing, and the request times out

#

What do I do in this case?

inner wraith
#

If the time's all being taken up by a big insert rather than something in your code communicating progress may be a pain

peak acorn
#

Is this a terrible idea? (diagram incoming..:)

#

this sort of double recursive deal

#

or should I be structuring the data differently to not have things like this

fading osprey
#

if you can avoid recursion, absolutely try to, but sometimes it is significantly harder to avoid than to accept and work with

peak acorn
#

Realistically you should ever only have one layer of recursion, but unless I change the data type i cant really enforce that

#

Could just change the datatype to not have the batch and simply provide a list in the first place maybe

grim wind
#
/^[0-9a-j]+$/.test(str)

Is it possible to do this check faster? I'm basically checking if a string is either something like 423did9j32b4hac0j52418ge261 or a normal English text

#

Strings are a lot longer than my example, that's why performance is critical

astral garnet
#

/^(?>[0-j]+)$/.test(str)

grim wind
#

The second one gives me a "? The preceding token is not quantifiable"

drowsy elbow
#

Thanks... I guess

drowsy elbow
# grim wind ```js /^[0-9a-j]+$/.test(str) ``` Is it possible to do this check faster? I'm ba...

Pretty hard to do I think. Best bet would be to use a dictionary, but then you cannot accept words which aren't in the dictionary, or even words with a typo in them without calculating a hamming distance.
Maybe a dictionary is good enough and only accept if more than 50% of the words are in the dictionary. I think performance can be pretty fast if you do the following:
0. Load your entire dictionary in a hashset (You only need to do this once)

  1. split input string on space (returns an array)
  2. initialize a counter set it to 0.
  3. foreach through the array
    a. Check if the word is present in your hashset (hashset is (near) o(1) performance)
    b. if true: up counter, if false: do nothing
    c. check if the counter >= array.length / 2
    d. If true, return true. if false, keep iterating
  4. If you get here, less than 50% is english, so return false.
#

You can maybe do some more optimalizations, like calculate if the unprocessed batch can even reach to 50% if it's all in the hashset

#

Or just use a.i. 🤷‍♂️

#

Also check what it does if someone puts multiple spaces in their input. Maybe you need to strip those out

#

Is it actually an issue if your input isn't English or just garbage? Maybe it's just a non-issue.

grim wind
#

Yeah it is an issue cause I need to tell the engine how to handle the data

#

So I have that .test attatched to an if sentence

ornate summit
#

My stupid little game engine is coming along nicely.

reef crystal
#

Why is web assembly code 15x slower than when I run it natively, both with -O3 optimization?

nocturne galleon
#

Hello everyone

spring skiff
#

Help, I am losing my mind and sanity, I can't for the life of me parse this number in Lua (for Conky)

#

Value coming in is just 0.4, but tonumber spits out nil

nocturne galleon
inner wraith
#

Depending on the browser it may be implemented differently, which means different amounts of performance impact.

#

It'll also depend on what kind of code you're writing.

#

It's a (usually) faster, low-level alternative to JavaScript for heavier compute tasks you can target from LLVM. Because it's a VM your code will run on any CPU that runs a browser supporting WebAssembly, assuming you're OK with its other caveats around memory and IO.

reef crystal
#

I see, does a 15x time slow indicate something wrong with my code, or is that expected

inner wraith
#

Hard to say without a ton more context but native code being multiple times faster is expected.

#

If you need more performance, target the platform natively. If you need it to run in a browser faster, aim to optimise the program's code. If you need neither... don't worry about it?

reef crystal
#

Ok, thanks!

neon oriole
# astral garnet /^[0-j]+$/.test(str)

could just check for [k-z], would catch a great deal of normal english text strings, then see what regular enlish text still fall strough the sieve and build on that (like possibly checking for single letters surrounded by digits, or lack of vowels eg

neon oriole
# inner wraith If you do disassemble it, please be careful of the CRT, they can deliver a dange...

i think hes looking for an operation manual not a maintenance manual , but anyway, i own a Philips PM3365a (many manuals online for that scope, oa https://bama.edebris.com/download/philips/pm3365/Philips PM3365A-67A-75-77 100MHz Digital Storage Oscilloscope Reference Manual.pdf) alswel as on the internet archive, but for the leader its harder to find so it seems, however there is a 50minute video on youtube about that scope https://www.youtube.com/watch?v=4gYcaCzsorc browsing trought the transcript its basicly a guide on how to use it . (and perhaps you can contact the creator of that vid and ask him if he has a digit al copy of the manual)

This scope not only provides 100Mhz Dual Trace Capability, but it also provides On Screen Digital text information on your settings as well as voltage, period and frequency, dual time bases with delayed sweep, additive and subtactive waveforms and more. The video introduces the scope and its many features, then runs Horizontal accracy tests, ban...

▶ Play video
inner wraith
#

The remainder was talking about maintenance because no context was provided as to why they wanted the manual.

nocturne galleon
#

Anyway, here's a very basic .BAT script that:

  • Downloads videos from D:\OneDrive\Apps\yt-dlp\list.txt using yt-dlp. In the process it removes various sponsored segments, adds chapters, image preview for the video, and all subtitles available from the original.
  • Downscales the videos to 2560×1600 if necessary (my OneXPlayer has a 2560×1600 screen).
  • Transcodes videos rather aggressively into AV1, with 96k OPUS sound.
  • Moves the resulting file into an SD card mounted on H:\ drive.
  • Uses binary comparison to ensure there are no errors in the process of copying the file.
  • Cleans up the temporary files.

I barely attempted to fix anything and haven't tested a lot of stuff (SD card free space check for example), it's really raw.

spark torrent
#

m starting to learn c# any tips?

inner wraith
#

Visit an optometrist

fading osprey
#

oooh, I've got one:

DONT

#

(/s)

spark torrent
spark torrent
#

or basic

inner wraith
# spark torrent m starting to learn c# any tips?

Uh learn how to build your project outside of Visual Studio (helpful for testing later), learn to program generally, lean on your IDE's completion features, get familiar with C#'s types if you're not already

spark torrent
#

c# types?

fading osprey
# spark torrent c# types?

the core types, python has dictionaries, javascript has maps, rust has whatever you decide to code into it, that sort of stuff

spark torrent
#

learning tasks?

fading osprey
#

took me about 30 minutes, but I was learning it to write basic scripts for a game, so entirely irrelevant

fading osprey
#
Space Engineers Wiki

Programmable Blocks are an in-game way that lets players execute custom scripts that can interact with any other block in the game. You write scripts using the C# language and the SE API...

inner wraith
#

I find video tutorials to be unwatchable and unhelpful myself but I'm sure you can find more than you could ever watch with a YouTube search on the matter.

#

Always felt like this to me when I was new at it

spark torrent
inner wraith
#

30 minutes on the fucking circles and 2 minutes on the owl

spark torrent
#

but is there any other way?

inner wraith
#

I select my own projects and work towards their completion at my own pace with the developer documentation, but I get that this suggestion is unhelpful at first.
Perhaps you'd prefer course-style materials?

spark torrent
#

i dont even know what i can do

inner wraith
#

I'd start by figuring out what you want to do.

spark torrent