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?
#development
1 messages · Page 89 of 1
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
anyone working on any interesting repos using nextjs?
Or have the user provide their own API key. Otherwise you might end up being a free unauthenticated proxy for the other API...
Programming epick
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
Then set up cors to only allow a single domain.
^ generally apache will handle that for you on the godaddys etc, they wont serve php externally
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.
yeah I'll def generate a new one, but I fully don't understand what you're saying,( I'm just starting to learn this stuff) and yeah i'll do thhe gitignore thing only
man tysm fot the help
😳 it's kinda f'ed up, I need to fix a lot of things
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
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?
yes
the huge blocks look so ugly, I should be the author of 'dirty code'
Yeah, i wouldn't be to concerned then
https://gist.github.com/derzorngottes/3b57edc1f996dddcab25 is this fine ?
No. That will still leave your API key in the open for the end-user and only "hide" it on GitHub (you still need to deploy your application somehow after all).
You can't hide your API key if it is used within your client-side application.
But oliverjam already said that in the comment chain, see https://gist.github.com/derzorngottes/3b57edc1f996dddcab25?permalink_comment_id=3209834#gistcomment-3209834.
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
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
some authentication providers have flows for client side apps with various ways around this (as an example read the first few paragraphs of this: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-client-applications )
but it's still impossible to just store an API key in the client securely for obvious reasons
Thanks i realized major part i was worrying about the “right language part” aswell
If you have no language planned in particular, but want to be guided through some kind of game, you might enjoy https://gdquest.github.io/learn-gdscript/staging/, which is an interactive introduction into GDScript, a Python-like language for the Godot game engine (part of the GDQuest's paid course, but the "Learn GDScript app" is free and open source)
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
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
looks great dude
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.
Yeah I actually thought about that thank you so much for the review
Ty
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
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.
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
Prob vscode
Web storm? Never tried tho
there's probably a tool download for vscode to make that easier, but what exactly are you having problems with php with?
you need to use <?php ?> to get the color cues
Seemed to have got it working, something to do with the path in my system settings
Doom Emacs | Neovim
I’ve started using vim emulation with VSCode it’s actually very nice.
Lunarvim is pretty cool
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?
you do just do that command
do you ever just scream "i hate css"
ah, the joys. this picture helps me a lot
i set it to float right and it just decided to not be confined by the laws of its container anymore
if you ever wanna learn how to not have to deal with such... joys... anymore - check out grid-template-areas
makes it reallll easy, espiecally for mobile breakpoints
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas
*edit link cause that link was poor
flex is the best
i ended up using a flex 
yeah I just use flex everywhere
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).
Css is so awful I'm glad I don't touch it at work
same here 
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
c'mon, it's not that bad...
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...
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
RIP but also, I forgot Atom existed
https://techcrunch.com/2022/06/08/github-sunsets-atom-the-software-dev-environment-it-launched-in-2011/
Idk if it goes here, but I'll move it if I'm told go:
BBC News - Ministry of Defence acquires government's first quantum computer
https://www.bbc.co.uk/news/technology-61647134
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
^^ so you're wanting to be able to see which element was the one that got clicked, in order to change it's color?
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; } } } }
Two things. One if the length of the arrays are same. Two it looks like after you finish that you will have a bug where an array like [1,2,3,4] would be marked as equal to [1,2,4,3]
Also, CS:GO does not help your homework or lab work get done. I guess that is pretty obvious.
Atom is great before VsCode was a thing.
But Vs beat them at their own game by being more performant and PlugIns
However this isn't surprising that MS would focus on VsCode instead of atom
they did at least say their atom team would focus on VS code so it's not like they're firing the developers
yea
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
now i have a event for when a tab is changed aswell so i can load diffrent things by name
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
Using the CUDA Toolkit you can accelerate your C or C++ applications by updating the computationally intensive portions of your code to run on GPUs. To accelerate your applications, you can call functions from drop-in libraries as well as develop custom applications using languages including C, C++, Fortran and Python. Below you will find some r...
that's not really CPU multithreading, that's just using GPU instead of CPU, which for some tasks may be better
C11 introduced standardized multithreading
you can use threads.h
oooh sweet
Learn C Language - C11 Threads simple example
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
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
not to be bitchy but hasnt printf become printf_s 😄 (feel free to shoot me)
my bad, turns out that function is just called more often than i thought
I love how one might think that simply printing to screen would be a single, simple function, regardless of the language
is it possible? yes
it's called the Media Session API
wtf is printf_s
read the docs
BSD's wireguard implementation originally did 
In the middle of crypto functions as well
0thats awesome lol
It was a shit show, really messed up pfsense releases for a bit
we dont have no prinfts because they r bad tho
kinda because airplanes dont have stdouts 💀
How to give the FAA a heart attack - Plane flown by CLI command
😎
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)
just ask
no
Depending on CONFIG_AMOUNT and other factors: no UB in there. Please share the file.
Ah, nevermind, just saw that you already found the issue.
<@&750150305383186585>
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?
Python map() applies a function on all the items of an iterator given as input. An iterator, for example, can be a list, a tuple, a set, a dictionary, a string, and it returns an iterable map object.
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)
It attempts to convert the input to an array of intragers. It splits on spaces.
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 😄
what
Guys is there anyway to sign a exe for free without paying for signing certificates
yeah, something like JSON.stringify({a: "bcd"})
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
there is
@wise path Trusted certs cost money
Or going through a vetting process via a storefront
Hmm okthanks
Ok thanks for the input
@wise path this for your spotify dl tool?
ummm
how do you know
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
im guessing you're appreciating me
Yes. I can always appreciate people that take the time to document
but yea i always go by this rule: Never half arse 2 things ,always do something fully
@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?
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
holy shit thats expenive
do you how to do this?
which is why usually open source is not signed, unless someone "sponsors" them
Oh ig i gotta start taking donations then lol
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
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
i think these are only worth if my user base is above few thousands its barely 100-200 ig
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
thanks
yeah, without cert your users might get this for some time
yea ik
and then there is the whole "notarization" crap at macOS
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
me looks at unused mac mini i5 from 2018 😄
how about a free cert
will that make it go away
to be fair, it is unused because i switched to macbook pro, as mac mini was kinda useless when going to customers
there are no free code signing certs. and self-signed is probably on same level as unsigned
It will just make it go from "unknown" to your details
yea i meant self signed, so if i do self sign its still gonna show that popup eh?
Still good for verification it came from you, just not automatically trusted by windows
oh ok thats good
any video you can recommend to self sign?
Sounds like not much juice for the amount of squeeze you're doing
And not really, i just read the docs
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.
Oh
it's just that until enough people run your program, it might not be trusted
Its not like people wont just click "trust" anyways. People just straight running malware since the beginning of time.
so a signing cert is not really required if i have a pretty big userbase?
Haha lol thats true
pretty much yes, but you might just want to explain why smart screen pops up and call it a day
hmm ok thanks ill add that in my app's documentation
How big does that python executable get?
about 14mb
Not too bad.
What do you mean did you expect it to be more lol?
our android apps are in tens of megabytes
Well, yeah. Python executables bring everything with em, resources, runtime, etc. They can get bloated fast
also you need around 100 or so mb (ffmpeg) to convert to mp3 so thats one downside
true
ive tried my best to make all imports as small as possible by doing from modeule import class
I can't say too much, since i primarily write golang code
Can you say 4mb hello world? Lol
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
this changes nothing lol it includes the whole file anyway
it's just a scope thing
14mb for packaged python is not bad
Man the number of copies of FFMPEG we have ;-;
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
Is there a way to make an elf file that just runs another program?
What tools should a software company use?
I mean Visual Studio Code and GitHub are obvious. Anything else?
thats very broad
depends on the specific needs
idk like web development or mobile app dev?
Still very broad lol
yeah idk honestly. are there like any industry standard tools idfk?
For one thing, work tracking tools like asure devops
That's what we use, there's a shit ton tho
ok lets say web development
still very broad...
hmm never heard of that one
it really depends on company as well
any server software
it also depends on the product as well, what specifically it is designed for
is TrueNAS used in enterprise sector?
yeah im just interested
I've never encountered truenas myself in the wild somewhere
Github has an implementation for it but there's numerous version control services and also tools for reviewing diffs
also CI/CD
What's that
Continuous Integration
Oh ye
continuous integration / continuous deployment
testing, a whole other can of worms
whats better Slack or MS Teams
we use teams since it's free...
My company is stuck on Skype lmfao
ouch
and email I would assume?
Do companies use Discord? Like genuinely
Skype and outlook, yepp
What else do you use PresentMonkey?
slack and teams have much better integration
Integration with what?
hmm everyone does like $6/user/mo for teams
we use microsoft 365 which includes teams, so might as well use it
anyone here know python need help with a code error
At least some people here know python, just post the issue, don't wait for someone to agree to dedicate themselves to your issue :-)
don't ask to ask, just ask
the relevant code would help..
relevent means the section that the error is referencing
response_cap_color=int(sys.stdin.readline().strip())
dw worked it out
jdtls doesn't feel like using my project specific config in nvim for some reason 😭
any can help me with strapi-middleware-cache and setting up aws elasticache redis?
any can
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
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
this is typically just a simple loop when you're storing them for the naming convention, using the inbuilt 'fs' module
ex- you store them at user/date/filename/guid in a standard folder structure using fs, then serve them based on that same convention
if you need something that can handle aws etc (not locally stored), look for something like this: https://github.com/pkgcloud/pkgcloud#storage
probably same concept tho, the actual organization and retrieval is pretty trival to handle yourself
hey i have a question rn i have gpu 1660 super and i would like to upgrade which gpu is compatible with my system
- All modern GPUs are compatible with all modern systems (anything from the last 10 years). Case size and PSU wattage are the only concerns.
- #build-a-pc is better place to ask
he's developing his pc
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?
@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
They have a billing exactly for that purpose. To know which service costed you
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
Is VPC a t2.micro
Yes?
No
Is there even an engine for VPC
Have you read what a VPC is
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.
ah
I’ve had only minor visual glitches so far
12ProMax
I'm testing this on a 8
(and a Ipod 4G)
Wow, wouldn’t have guessed it’s even supported on that
It doesn't
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
Anyone know a good Linux cloud hosting service? I have previously tried Aws and azure
not cloud hosting but contabo has great value vps
Doesn't the SE 2 have A13 and more RAM? The 8 makes sense, but it wouldn't make sense for Apple to drop a device that came out only 3 years ago (from when iOS 17 comes out).
"the cloud" is fake anyway. just use any cheap VPS unless you specifically need hyperscale provider features like multi region/multi AZ or virtual private networking (and even then, more and more VPS providers do something equivalent now)
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)
I have experience with Aws doing that lol , charged me €40 over 2 months , even though I thought I was on the free tier.... Never sent invoices or anything
Does anyone know of an extension or addon for vs code or Visual Studio that runs SEI cert compliance checks
If you want a free vps look at oracle cloud (arm only)
If you want cheap, DO, Linode like Andrew said
I don't think you need features of like azure, gcp, aws
the cloud is real bro 😠 if it wasnt real there wouldnt be jobs for it
Actually you can get a free x86 oracle vps too, it's just not nearly as good
Only like 2 threads and 1GB of ram, compared to the 4/24 in arm
interesting
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
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.
sounds useful, why dont you make it?
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.
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
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
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.
Not even. Now they have these certain intentions which can only worsen the product no matter what as it relates to yourself and OS. It's using more resources to collect data. Literally 100% of those resources you want available.
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.
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
It still is, developers now get to put a different UI up front though.
idk if they would be included in a steam based os
I mean, chromebooks exist.
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)
They're all the safari rendering engine under the hood
Market domination isn't monopolization
on ios you cannot use any other webview other than apples
nmo idea about tauri, but look into ionic angular using capacitor for mobile
@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 ...
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
C and C++ are unique in a way that it doesn't have one way to do things
One common setup I've seen is using cmake with clang
Never used xcode so I can't comment on it
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 ...
@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
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
Nah, guaranteed to have at least 223 values
yeah, appreciate it.
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
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
@gloomy terrace you writing your own compression scheme?
Working on something... but still a long way to go
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
I did not know you needed a GUI to test a GUI program. I have seen a few Linux projects that do it on servers flawlessly.
I'm not talking about automated unit/integration testing (in fact, i believe those would waste more time than they save in most programs), I'm talking about changing some code and checking the GUI to see if it has the desired result
For example, seeing if all dynamic elements of a GUI appear in the right place
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...).
<@&750150305383186585> ^
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).
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...
That's fair, both my servers are private so i don't really have to worry about coworkers and copying my config doesn't bother me
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...
For speech inference it's a lot harder though.
Like he did it for writing inference
https://www.youtube.com/watch?v=6raRftH9yxM
I turned my favorite hand into a keyboard!
Tools/software used: TensorFlow Lite, Fusion 360, Prusa i3 Mk3S
Design files, training utility, and pretrained network: https://github.com/ZackFreedman/Somatic
Assembly instructions: https://www.instructables.com/id/Somatic-Data-Glove-for-the-Real-World/
Project page: https://hackaday.io/project/16929...
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?
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...
Makes sense
a good chunk of his reasoning for doing tfμ was to be power efficient, and have it do its job without needing to run the processor at 100% speed.
If you wanted to run tfl on it full fat, could definitely just dump it in. Mozilla deepspeech may also be a contender in this means.
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
$ brew install zig```- https://ziglang.org comes with a c and c++ toolchain. doesn't work 100%, but can definitely help for getting yourself going (or just bruteforcing your way into it).
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.
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
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++}});
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?
how does one fix this?
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.
vscode
vscode
Pycharm is my go to
I used IDLE for a while than switched PyCharm but now I use vscode so I can do development in multiple languages
I can’t use pycharm current in my company
Never heard of someone actually using idle
right when I got into programming and didn't know much I used it
Neovim and intellij, working on switching fully to neovim
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
@nocturne galleon full jetbrains stack is pretty sweet
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
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
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
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
Though i still think neovim has the potential to be better as a complete development tool with enough work to make jvm servers better
Well, if you believe TUI is a pro not a con, like me
(makes it easier to code via ssh and uses less resources)
Does it have a github copilot plugin 😉 ? Thats been an amazing time saver for me lately
It does actually
Thats pretty slick
will you pay for copilot once it goes out of beta?
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
@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
just curious do you use copilot at work?
Yup
thats nice your company lets you use it
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
If i ever do full time programming (which i hope i don't have to) i hope it's for a company like that
Honestly i have no idea how governments usually operate on a technical level so not really :p
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
hey bro I misplaced my launch codes can u give me yours
is that javascript ? then backtick operator
or to be precise - prepare the conditional parts before, then put them in the backtick operator string as ${preparedConditionalString}
Ah dont worry, I fixed it
just wait till you install Sonar, then it will get even more annoying 😄
Oh no
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 🙂
Are you making a paste?
I have good news everyone, after 45 minutes I found the typo that was causing this
and it was, of course, the dumbest shit

Even more good news, github copilot is released for public use! only 10$/month, 100$/year
good ROI on that
And the people doing the technical review program get a free 2 months
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
VS for C#/C++, VSCode for JS/TS/PHP/Rust/Python, IntelliJ for java (but I prefer just not touching java)
You program in rust? 
oh that's neat, I use VSCode for Python
we're so similar in how we both use vs code for Python

Before using a text editor, you must write a text editor
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
Look at what tablet mode
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?
Some ideas at all
free for students or maintainers of popular open source things
Hello
start /WAIT ?
WAIT Start application and wait for it to terminate.
anyone familiar with strapi-middleware-cache ? I need some help. The logs are spitting out "the store is not ready." Using the type redis
checking the code, it seems like it simply didn't connect to redis at all. have you checked the logs, maybe it printed out the redis connection failed message; or because of connection issues, it is still waiting to connect
it just keeps spitting out the store is not ready and nothing else
warn [cache] the store is not ready and that's it
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).
in my config, I have it like this
type: "redis",
redisConfig: {
host: hostName,
port: portNo,
password: password
}
i think it's correct
so I should have the devops check on the server side?
Got my first software engineering job offer through ☺️ I'm super hyped
username ?
but yeah, seems like correct https://github.com/luin/ioredis#connect-to-redis
the redisConfig is 1:1 sent to this library
you can always just test the connectivity with redis-cli https://redis.io/docs/manual/cli/#host-port-password-and-database
Do I need this specifically? I see the documentation omitted username.
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
btw are you sure you want to develop with code based on Strapi 3.x ?
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
understandable, have a good day
yeah, bunch of stuff moves around. just meant Strapi 3.x ends in Q3 2022, which is soon
and for Strapi 4.x, the middleware-cache sends you to https://strapi-community.github.io/strapi-plugin-rest-cache/
Speed-up HTTP requests with LRU cache
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
Icu is a tld? Obviously scam anyhow
<@&750150305383186585>
anything can be a TLD if you have enough money
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.
😳
Well not anything...
Has to be approved, but for the most part yeah
i mean unless it is offensive or typosquatting, it will get approved
that is why we have .google TLD
inb4 dbrand gets the .ltt TLD and redirects store.ltt to dbrand.com or something similar.
does each country pay for their own?
Like, for example, Portugal owns .pt, Spain owns .es, Tuvalu owns .tv , etc...
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
also that wouldn't work because part of the approval process is that you have to show it actually relates to legitimate business ventures... domain squatting is pretty much an immediate rejection
any freelance developers here who are experienced in nextjs/mantine/tailwindcss?
just post the question lul
well I am trying to hire someone who does front end web development to work on a personal project that i need to be built in code 😅
My coworkers be like (sorry if command is wrong)
Svn commit "debugging"
Svn commit "debugging"
Svn commit "debugging"
Svn commit "debugging"
Svn commit "debugging"
no local servers ? 😄
i mean, i feel dirty when i create a git branch & merge request for single commit to fix something Sonar reported 😄
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
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
We are like old ppl here so we use creaky svn
https://subgit.com/ problem solved 😄
TMate SubGit is a tool for teams that migrate from SVN to Git. It converts SVN repositories to Git and allows you to work with both systems simultaneously.
Yeah good luck getting my bosses to do that
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
Lol they still ban the shit word
hell, there is even git svn clone LOL
Yeah, no. Working with git and svn "simultaneaously" is just asking for a lot of trouble.
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.
i meant one time migration, whatever tool to do it
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)
Pro tip
Work at a high turnover rate company for frequent free donuts when ppl leave lmao
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
objects op
eh, dynamic objects are quite iffy imo
i made a pun
oh i see

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"}`}
ah... yeah I'm not sure that will update unless you're using something from your state
I did update it in the variable
where is the object ITcoming from?
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
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
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
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
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
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?
you probably don't have the server set up to handle client side "push state" routing
I was thinking some rewrite rules or crap
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)
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

<@&750150305383186585> ^
Will check on Monday, until then I don't want to care xD
very reasonable 😆
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.
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?
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
I want to host my react app in a subdirectory on my shared hosting account. Ie in the directory domain.com/mydirectory/. But when I type domain.com/mydirectory/ in the search bar it opens the index...
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)
Ah, thats superb, thank u
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...
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)
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()
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
ok thx i will try that
If you wanna validate the input, theres another function you can use
fixed it and it works now thx
i had to add the int(variable) to a few other things too
try:
d = int(input("how many times.."))
except ValueError:
print("invalid count, using default..")
d = 5
This would be the robust way of catching bad inputs, though you could expand upon this by making it a recursive function to keep asking for a valid input.
Cuz if you don't give it an int, the script will crash
ok thx i will see what i can do knowing that
i think checking isnumeric would also work but that might have weird edge cases idk
def ask_for_int(message: str) -> int:
try:
return int(input(message))
except ValueError:
print("That is not an integer. Try again!")
return ask_for_int(message)
d = ask_for_int("how many times to do this")
If you wanna get real fancy
Great for the linter & readability, but no purpose beyond that
You can from typing import List and do something like
def some_func() -> List[int]:
Not a frequent python user and i always keep forgetting this
I thought python doesn't use semicolons. 🤔
I think its technically optional
Ok 👍
Use a switch statement (I assume this is Java)
https://www.w3schools.com/java/java_switch.asp
or could prob use an array or some other mapping with a loop
C#
Well i tried to use switch and it didn't accept the variables.
C# - Switch Statement, A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is chec
Pair your paths into (pos, waypoint) then for each pair, check ypos vs pos, if match set waypoint and break
Ah must be some static enforcement or something in C#, im not familiar
Yeah dont think u can do that
Maybe i can use temporary variables or smth like that.
Like float path1pos = ganeman.Path1pos
But that is nothing. I made a worse thing in the past (which is around 1-2 years ago)

This is GML 1⬆️
But the loading system is better. 
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. 
good good
yes good
Why format the equal sign
better q why not line up the equal signs
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...
lol
I would name mine cortana or something
I'll probably end up calling it Jarvis, just to troll people when talking about it
Ah yes, what a great name 
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
I suggest that any time you're doing comparisons within an object (gameMan) for a recurring event (spawning) you use classes and object-oriented design... functional design works fine, but oo will keep it way nicer in the long term.
This would be along the lines of gameMan.getSpawn(), or gameMan.getSpawnWaypoint() and obviously ends up being nice and legible
Thanks
Demon text
I need help finishing out a vbscript that passes a filepath to a command processor.
you got the code up on github or in a pastebin or some such? or just venting? venting is good too.
Must be venting cause he didn't put the effort to show the code
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.
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)
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 ...
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)
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.
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
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?
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).
I don't know is the community had built anything together. I see more people asking questions and others answering those questions. I know some have built applications or worked on open source projects.
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.
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?
ik how to do it bash, let me check how to do it powershell
I'm sure I could figure it out! If this isn't urgent I could poke around later today. If someone else doesn't get too it first
you want to save the data that is outputted in cli into txt?
yea!
give me a sec
I am overclocking my cpu and am doing around 45 benchmarks on various programs and CB takes the most time.
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!
Ive tried both actually, both outpuit a blank file
oh yes I see. mb
Start-Process -FilePath "cinebench.exe" -ArgumentList " g_CinebenchCpuxTest=true" *> C:\Users\Omniplex\Desktop\CPUBench.txt
try this?
not too familiar with powershell
nice
Also blank
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
C:\Users\Omniplex\Desktop>cinebench.exe g_CinebenchCpuxTest=true 1>"C:\Users\Omniplex\Desktop\CPUBench.txt" worked. ill try that too
instead of averaging, is there a way to output each measure-object?
Out-String?
Err I just removed a bit of stuff so its # Average of 3
1..3 | Foreach-Object { Get-CinebenchScore }
1..3 | Foreach-Object { Get-CinebenchScore } | Write-Output```
?
No just removed the | and everything after.
oh yeah that would get similar result, since I think the default action is to print anyway
#s are comments yea?
yeah
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
if vars ar just classes in disguise then why did they ever bother with actual classes i think.. there might be a difference ,... ow yes yes ,.. a dict has no inheritance, a dict is just data , its maide for storing key-value pairs , like, Health : 45 , or "url" :
"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') ?
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
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
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
I think you're confusing OOP with c# specific oop
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
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
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)
yes there is, because C# OOP from what youve described it as seems significantly less straightforward than what im used to in python or ruby (with my limited ruby experience)
i kinda started with that intend aswell , but the when it makes sense , actually only occured once or twice, (it makes sens for markup stuff) (because you want the whole thing to still look like one piece, so sending each few letter of to a function to be treathed doesnt really make much sense form a text cohesion point o fview
Its been incredibly useful working with raw networking and header parsing
and I have no idea what any of this message means
like theyre words that make sense together but mean nothing to me and im having a hard time understanding it
Herr likes to ramble sometimes lol
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)
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
Got it handled. Needed it for a major OH SHIT healthcare IT problem
C:\Users\HOSPITAL\Documents\heart_transplants.csv
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
i always saw everything in a language as an object cuz what else would it be bro
Wall of text incoming...

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
@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
How about (math.random()-0.5)*4?
Either or. Personally I prefer the verbosity of mine
is there a way that i can just force the number to be non-zero
like some way using math.abs()
velocityX = math.random(-2,2)
if velocityX < 0.5 then
velocityX = velocityX * 2
else
velocityX = velocityX * -2
end
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
@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
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
very coincidental music playing in bg
-2 and 2 are the range
When you put values in the function, it no longer generates a float
i don't know that terminology, all i know is, it makes it pick between anything ranging from -2 to 2
i wouldn't know how to change math.random() to do anything else
An int is a whole number, a float is a decimal number
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
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
so math.random() always generates a float between 0 and 1 by default?
Yep
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
🤘
`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
`
don't know if this info helps but something seems askew
it is clearly not balanced
you have to generate new random floats inside the 50/50 split, you cant reuse the values
what is all of this?
A painful reminder you can never get away from math
golden ratio in arts
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;
}```
right click > inspect element, see if the classname is showing up and check if its being overridden (strikethru on the css var in the inspect tab)
it turned out it was lower case L in the button html
ig quirks mode isn't case sensitive?
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);
}
}
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 🙂
It means that there is no such field in $_POST.
Just to let you know the web page shift on your website was about 6 seconds after the content appeared. This website ranks web pages. I think I scored 100 in all categories before. https://web.dev/measure/?url=https%3A%2F%2Fjunaidcoder.blogspot.com%2F
Test your pages in a lab environment powered by PageSpeed Insights. Then get tips and recommendations to improve your user experience. For field performance, see the PageSpeed Insights tool.
@dapper pond You could use some syntax hilighting on your website. https://highlightjs.org/
I wouldn't give that site too much thought, because that's not "how does website actually work" [sic]: https://junaidcoder.blogspot.com/2022/06/blog-post.html (and yes, that is a sarcastic quote)
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"
}
so what i can do??
Oh wow that page is wildly incorrect
Aye.
lmao what the hell is that site
Can y'all stop pinging me and instead the original author? Thanks. 😄
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.
if you're going to advertise and tell everyone how great your blog is for developers, at least start with getting basic facts right
Pivot to making it a blog about your learning experience rather than an educational tool
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
also great exercise is to build the blog yourself, not use a premade template
Especially if it is web related!
Do you dare to enact the dark magics of CSS and JS?
CSS = Magic
I may be able to do some CSS magic, but I can't do CSS Magic...
haha stockholm syndrome
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
what is CSS, I just use UI libraries
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
Your list function
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.
remove the key={joke.id}
@mighty aspen I thought of that but didn't help.
sorry i said that wrong, you need to ADD key={}
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
http://jsfiddle.net/asbvw7qo/4/ pulled trhat from here - if you remove the key call on line 14 you get the error you're having
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
yeah ended up looping over the result to get it right
god I hate php
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
it's the safest to use indexes as keys
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>
})}
you can wrap the code using backticks
oh neat, ty
use triple backticks like this
then the language name to get syntax highlighting
thats flippin neato - never knew discord could do that now
@mighty aspen Thanks, I might also have to save this to the Cookies, because otherwise I will reach the API requests soon...
there is no point in saving that to cookies
50,000 / m will be reached soon trust me :/
learn about cache and caching api requests
oh, ok, will look into it
easiest way for a quick fix is to save the resp to localstorage if you're looking for a hacky cache solution
yeah but we don't want hacky
there's proper-er ways to handle it tho -- i always have to bust caches so have little knowledge on saving them lmao
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
@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
depends on your BE framework
there are plenty of resources online I think
I sadly don't have a specific one to recommend
We don't really have access or want to touch BE now
but I found a way here
again, this is a hacky solution that is easily defeated
you can manually wipe local storage
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.
just because your team won't do it, doesn'T mean it's a good idea
rate limit your api then
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.
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
Cause you are trying to make a point to something you didn't ask how it will be used.
then fine, use the local storage solution. Doesn't change the fact it's a dogshit solution
Happens
Are you hitting a 3rd party api directly from client?
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
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...
it actually kinda is 😄 , https://codepen.io/team/keyframers/pen/YzKjoev note the empty js frame on the right 🙂
and grid sure as hell beats floating divs , wich sure as hell beat <table> for structuring html pages 😄
That’s got nothing on the Excel roller coaster
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."
Then when you know better, do better in a couple weeks once other people also notice that you can do better.
unless its banking
Yeah, maybe not in a couple of weeks, that's what code review is for after all
And if you dont know how to do better immediately, add some sleep functions so you can "optimize and increase performance" later 
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,
}),
);
});
}
Does anyone have any suggestions for trying to debug a raspberry pi pico?
Please be more specific
well without knowing exactly what ur having issues with, I think just use some compressed air, q tips and cotton swabs with some isopropyl
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.
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:
- Make a linux driver that exposes a device file, then interact somehow with the gpu driver from there by mounting it in the guest
- Same as 1 but talking with libGL.so rather than directly with the driver
- 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
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.
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
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.
The issue is:
There is a "<" but it is unexpected
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
¯\_(ツ)_/¯
Can’t really help without seeing your code, but the error does tell you the character, line, and column.
Does it run fine when you run the webpack dev server / start command?
it runs fine with npm start
Also, the .js file that it shows that the error is in is like a generated build file with the mapping thingy
#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?
What is this?
trying to mount a usb drive in linux c program
bottom is the return value errno and strerror
You could convert errno to a string and maybe that will give you a hint.
Does the mount location exist?
yea
Is the mount type needed?
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
In the man it gives "fuse" not "fuseblk" is that why?
fuseblk is in /proc/filesystems
also, 10 second slowmode is obnoxious
im not sure if nodev is important or not
Oh OK the answer is basically u have to fork and use a mount command because mounting with fuseblk isnt good enuf
As in fork and create another process?
yea, fork and exec /bin/mount
Was that in the manual page you were reading?
Yup, you can open the file and see what it looks like. Maybe it’ll give you some hint to what is going on.
Possibly something funny with a loader or something with the code that’s being loaded? 🤔
it's in his code. build does much more than what start does since it is production ready
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.
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
But if they used CRA unless they ejected it should be a good config. Unless maybe CRA rewired or something is in use.
line 1 in the file is just a comment For license information please see main.xxxxx.js.LICENSE.txt
I'm thinking it's the config as well. Is there a guide on how to set it up?
Is this a new project?
nope
also I think I fixed the problem. There was an issue with homepage in package.json file
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.
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
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.
<@&750150305383186585> fake nitro scam
oops i guess you already saw it sorry for the ping
Like, i know they do scams in other channels but this one? Literally the worst one to try in.
People have come here who have fallen for the "I'm Linus you won a GPU message me on telegram" trick so I wouldn't be surprised
I meant specifically the development channel
No worries. I've been in the tech support channels, I know what goes on here, lol
facts
<@&750150305383186585> this sounds suspicious
i got it alr
nice job bro
Thank you
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))?$
@nocturne galleon Try this?
(^net\.minecraft|^com\.mojang)\.(?!authlib)
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
I would legit pay for a service that tells me the right regex given a plain-english description
there are already free
I know there are auto-generators but I haven't found any that capture all the nuances I'd like them to
like wat
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
so you want the opposite of it. you want paragraph -> regex instead of the regex -> paragraph
By "paragraph" I don't mean the input text, I mean a lengthy description of exactly what I want to regex to do
i know

