#development
1 messages · Page 2 of 1
Also, your command is not complete (there needs to be a path) so please post the full command
dots per inch is just the resulution of a printer , for straight forward imanges like jpeg or bmp files you can do a linear conversion between resolution in pixels and resoluution in dpi, more dpi is just a bigger image in absolute values in this case (you can still scale it) for other image formats that are able to store more information then would be visible on a monitor (PSD files eg) higher dpi does not relate to a bigger image in this case , as the size of the image is set with dimentions either in pixels in cm or mm or ... an image of the size of an A4 with a higher dpi , wil result in a more detailed print if the immage allows for it and the printer is capable of it, the confusing part is perhaps when using dpi for a screen , displaying a 100x100px image will half in size on the display if you double the displays dpi, making an image hiDpi means you make it extra large so its not microscopic on a hiDpi display
that command above is the full command $1 contains "/home/alx/test/" $t contains "*.log" and older than contains "-mtime +7"
$cat xx.sh
#!/bin/bash
echo $1
find -L "$1" -name ".log" -mtime +7
echo find -L "$1" -name ".log" -mtime +7
which find
$./xx.sh /etc/vga
/etc/vga
find -L /etc/vga -name *.log -mtime +7
/usr/bin/find
$
try this
calling "which find" from the script give this output /usr/bin/find
looks like I did not copy the $t and my copy paste mangled the command a little, dropped the star, but you get my point, just output some debug statements
and echo "rest of your command here"
what does that say ?
im here -mtime +7
log.*
/usr/bin/find
find: unknown predicate `-mtime +7'
oh and $1 = /home/alx/test/
lmao removing the double quotes from "olderthan" fixes the problem but opens the script to globbing and word splitting
Try to create a minimum script to reproduce your problem and post the full script, such as:
$cat xx.sh
#!/bin/bash
searchpath=/etc/vga
t="log.*"
olderthan='-mtime 7'
find -L $searchpath -name "$t" $olderthan
$./xx.sh
found the problem
$./xx.sh
find: unknown predicate `-mtime 7'
lol looks like you are right, I can reproduce by adding ""
thats weird. looks like the quotes add some weird BOM or invisible characters or some weird logic. dunno
agreed, that is weird, not sure what causes that
yeah, I figured it out xD 1000px is 1000px regardless of how many DPI the image is... so even if the image is 5000DPI, it wouldn't really matter, it would still display as 1000px on screen
yeah using ppi for displays and images would have beel less confusing , it exists but the industry chose the go with dpi , and then came svg 😄
For Simple graphics and logos, you should be using SVGs. Dunno why there are still companies using PNGs or JPEGs for their company logo on their websites
In-fact at the company I work at rn, I've probably made the most impact on replacing simple pixel based graphics with SVGs, from reports to websites...
i agree but with 1 big caveat : the svg's must be : real svg's , no embedded pixmaps ofc... and svg's must be really vector based images, so basicly lines (straight ,beziers, anything with a mathematical function behind it. and polyhedra and colored with rgba gradients , and yes i include fourier transformations in mathematical formullas so you really can draw anything as long as its not a drawing but a math based image 🙂
simple, legacy from when svg support was still verry poor iin browsers, they use probably suites that they bought a licence for just because company and svg is harder to copyright so the companies making those suites choose png and jpeg, and lastly you can design around the size of the images , so it enables cheap and poor (but looking ok and quickly made) coding . and there are no really good tools to convert existing icons to decent svg's , the tools that are there all convert to linesegments and traced silhouets , a cicle becomes 100's of short lines and not a circle with a radius and a thickness
Heh... The company I work at already had Vector versions of the main logos (parent company and slogan included). They somewhat rebranded in 2018. Just not as SVG. They were in EPS format for easy printing, so I had to convert those to SVG myself first xD
if it were up to me svg would be the fanciest thing allowed on a site, but everything else would be pure css and html , no js ,no images , no nothing else...
i tried doing that for a motocross club , to but decided against it halfway trough 🙂 they only had theire logo as a Jpeg so, and since it were only letters no images (the logo) i just made a font to match 😛 still have it 😄 looks verry much like another famous font but it just isnt (cause of copyright and licencing)
What font is that?
makes sense if your logo is a little more complex - but then again you probably don't have a good logo design in the first place 😅
one i made in 2008 or so for SickRiderSociety 😄 (not suure abouut the year actually just looked it up madeit in 2010 or 2011 )
I was hoping it was more of an open source free to use font. It looks nice for a one off font you don't use for main text.
svg's make sence in any way (as long as my prev points ar met about it) 1 they look good at any resolution or dpi setting, they cover that whole range with one single file and the file is not really data but actually just code so in theory you could send it in text mode to the browser, as part of the html and css stream, and it takes up less memory
to actually make the font oftheire logo instead of pasting the png on every flyer and event poster made allot of sense and defenetly one upped the posters they made as they could apply effects and scale or distort that logo / text as they pleased , even made a web font of it at the time so i could also use it as a font for the header on their site wich made the site load allot faster then the photoshop sliced site it was before i made it , as the site would end up heavy and slow enough due to the many video and photo albums , was one of the first sites i think to completely use html5+css3 at the time to as it wasnt really released or common at all at that time 🙂
cant find many others as i dont have facebook anymore but here is one poster i can find (and ofc its just one with to logo really small in the top right corner 😦 but anyway :D)
When making uml sequence diagrams, am I typically meant to include failure conditions into the diagram? Is it up to me to choose? Of course it's ultimately up to me, but typically what to do... for instance, if you need an acknowledgement within 300ms, you can diagram that in with some symbols, but should I include what to do in case of failures in the diagram?
ShellCheck is a really handy tool to help you write bash scripts better
ShellCheck finds bugs in your shell scripts
Depends on the audience or the use case of UML. Or is it important that people know where the failure case goes so they can go to get certain decentralized logs?
Has saved my bacon.
Hi there! I'm curious if there are topics that are preventing any new coders here from getting started with coding.. what is holding folks back from starting a new project or contributing to an existing project?
I'm thinking about starting some work on a YouTube channel that would try to tackle these topics, somewhat inspired by the positive response I've gotten from some WWHF workshops in the past. Would love any recommendations on topics folks would like to see introductions to, or things that would help you take your next step.
Some ideas I have gotten so far: how to use Git/GitHub, how to contribute to an open source project, how to publish a project to a package repository (like PyPI or DockerHub), how to set up a development environment on Windows
hm, I'd say a major one that I experienced was lack of ideas
I started a Rust rewrite of a bash script to learn about how Rust works, such as how it handles CLI arguments and spawning commands on the host, and it gave me a decent idea about how it works
although that's just one, and now I'm basically on an artblock/codeblock
Now I'm trying to update some GNOME extensions that use JS for use with GNOME 43 :D and currently failing...
Early on in my career (and talking to young wannabe devs) I’ve found a huge one is thinking of a starter project that is both approachable at their skill level, but also challenging & educational. They either can’t think of anything because they don’t know what they don’t know, or have lofty goals of a massive groundbreaking app when they don’t know an array from a dict.
I think learning not only the hard skills, but also strategies for picking & breaking down the right projects into approachable tasks, would get a lot more people into the programming rabbit hole.
Thinking of projects is still a huge issue for me 😢
what if the real projects are us developers all along
yeah my project is answering stackoverflow questions in my free time
this is how that's going
Know the feeling and then after a year, the answer just get randomly accepted
I like not saying a post is a duplicate and then rewording the answer to the question that its a duplicate of

finding a project for the sake of finding a project is particularly difficult, at least to me
I find Discord bots to be one of the more fun things to suggest to people tbh
yeah those are good because they can be super incremental
you just keep adding shit and you get that quick feedback
Yeah eh, but still gotta decide what they do
But yeah discord bots are a good medium to interact with a program, good for for-fun projects
yeah, good place to start if you want to learn some programming
well.... it works, I guess?
I am new to coding but want to learn it, anyone got an idea on where I should start?
first pick a language you want to learn
some languages beginners start with, from what I've seen, is stuff like Python and JavaScript, although Rust is pretty easy to get into if you know one of the former two
Python is good for learning the logic and if you learn C++ its good for learning the inner workings of the universe
i dont see the whloe c++ is low level thing
honestly learning cpp as your first language is really good because you get introduced to most good paradigms without being forced into one of them
you get functional stuff, oop stuff, etc and you can mix and match all you want
exactly, c++ is the deep end though compared to python imo though
hi
i started with python and it was really weird
im in 5th grade and im doing pythoon 😂
it was really hard to learn wtf a pointer/ref was because all i'd ever had to think about was python shit
*python
tos
fair enough
I started with C# making crappy wfa programs and only moved to python because my old laptop brokey and i was stuck with a chromebook for a bit
oh yeah c# is a pretty solid start as well
so I installed linux on the chromebook using crouton or something and could only figure out how to use python 2.7 but it was something
lol
i flashed a generic uefi bios on mine so i can just straight up install linux
the mrchromebox coreboot
I was definitely not advanced enough for that back then lol
i didnt have to do any hardmodding
was all software
but some chromebooks are different though
Start at the beginning and program your own bootloader. Start with c since then you will be a better programmer than most. You will then understand the relationship between data and logic. After all object oriented is just a fancy set of structure creations tools with functions where the first variable is a structure.
Assembly can be fun, but it is pretty hard. The concept of limiting yourself to a very small amount of operations can mean you get really creative.
Don't bother learning modern assembly
a lot of bots have the feature creep thing though because of this
1 bot that does 10000 things
write it in Rust
oh god the amount of unsafe{} segments that must be required to do that
yeah thats kind of the point
actually so true though C is so good but I wouldnt do it self taught
you are likely to develop some really terrible habits
c is a bit strange
I know array.map(x => ... ) prefers arrays, but I have an Object, that I can't really change, as it's a webhook.
The output looks like this.
"0":"40888","1":"XXXXX@gmail.com","2":"1,872.00","3":"2","7":"7"}
Now, in map, currently I can't use things such as x[0] as they are not really keys. Could someone help me here?
would guess that's a json response, which you can map to an object or list of objects
Yeah, its a JSON, but I am not entirely sure how. As the way I did before was
{data.map(i =>
<div key={i.uuid}
...
<span>#{i.issue_id}</span>
and as my json rather has numbers instead of actual names in it, I cannot use things like i.uuid or i[0] as that not an option here.
are you sure that isn't an array? because that's how dev tools display arrays sometimes
are they displayed in [] or {}
in any case i think you may be fundamentally misunderstanding what array.map does, because you shouldn't be referencing subscripts anyway unless you're doing something very unusual
As Parandroid linked, Object.entries() is good for this case. Also, you can access those like x['0'], you can access object keys using the [] brackets with a string of the key inside; that's how you access keys that are integers, so if for some reason you had to you could do that.
Its React
how does that have anything to do with how array.map works
Was thinking about trying that, but I am sitting at a higher level where I might not need to use unsafe as often. I need to have access to a few libraries, so I ended up going with c. Also because it just works for what I need. I might try to re-write in rust.
Now that I think about it, re-writing my Bible app in rust might improve performance. Most importantly it would be a fun coding exercise.
MPSADBW : Multiple Packed Sums of Absolute Difference => word
A new series on x64 Assembly language. In this vid, we'll look at few general aspects of ASM, before diving in and coding a few simple examples.
I wanted to redo my early ASM vids for a while, and I hope this series is as fun as the original one was, plus I hope I'm able to explain a little better the second time round.
Support What's a Creel?...
what is a good way to handle multiple clients for a multiplayer game?
i was considering just using files to sync data, but surely theres a better way?
multiplayer local
Just traditional multi-player networking but over local network I guess
its turn based, might just use http for transport
If it’s web based you can consider RTCDataChannel for P2P traffic, it often requires your server to help connect the 2 peers but then traffic flows between them directly saving you on bandwidth.
If that’s too much of a pain or you find too many clients with it blocked you can use web sockets, which will let you have a bidirectional channel. So you can push the data / events to the other browser when the other player takes their turn instead of having todo polling.
I made code a year ago that's half html and half node.js can I get it separated
import express
function (){
return <html>
}
What's that
Code
Congrats
Here
Idk how lol
Whaf is that monstrosity
template engines
I made a website
No thats horrible engine
A website my discord bot could host
I needed to use html but my host only used node.js
you can use cloudflare workers + pages to host for free
I'm editing this on mobile lol
.
Got through first round of AWS coding challenge 
why do people love React so hard? it's a complete mess from what I've experienced 
The team makes the code clean, not the framework. If your working with teams that write messy code it’ll be messy in any lang / framework.
That said react for sure has its drawbacks, but also works really well for complex apps. I’m not sure if it should be used for small / simple apps always, since it has a largish foot print for the front-end. Although there is preact you can checkout that’s smaller.
React provides a small amount of opinion and a lot of things aren’t in box, making it flexible for many uses. The downside is that makes it even easier for an unorganized team to turn the code into a mess.
Code standards agreed on by the team can do a lot to help any codebase, even if they aren’t patterns you always agree on consistency makes it easier to navigate and feel like less of a mess.
I started a project from scratch, so it definitely doesn't help with my lack of React experience 😂
but at the same time it also doesn't help with the 349283042342 combinations of sub-libraries & frameworks within React 😮
I do prefer Angular over React by far, but then again I have more experience with Angular too (though not a lot of experience with Angular either)
I have a React app, which works fine on npm run dev, howevr, whenever it's built, it doesn't work properly in preview.
It seems something going on with the redirection part, because in case, I change the home page to an another page such as /login or /issues /bablabla it works fine.
There is only one thing in the developer console and that's this.
https://reactjs.org/docs/error-decoder.html/?args[]=object&args[]=&invariant=130
Though, there is no source where the issue is actually 😒
I also tried to use console.log("Error..") and insert it in some functions, but I am a bit lost. Can someone advise here?
this sounds like the type of crap that made me want to ditch React and never look back 
I've found that there are so many things that should be fairly trivial that just aren't, and even after a reasonable amount of Googling, still not being able to solve it
😦
Can possibly someone maybe check this maybe, this will help?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Geez you sound like you need 2 more years of experience
that probably is true lol, but Angular still was much simpler to dive into imo
besides, I'm a backend developer who can do fullstack if necessary, though just never had the chance to really work with React and such, because the jobs I had was always just working with old tech that predates these frameworks
yeah this is always the case now days, but there is no point of hating a framework/library/language
I worked/working on both React and Angular. Im a BE/Fullstack dev too. Just use whats required or you're familiar with.
If you must work on something you're not comfortable with, just keep an open and calm mind
not necessarily hating on it though tbf, I'm just expressing my frustration... it's like almost guaranteed it's mostly a result of lack of experience 😛
I can hear my uni teachers screaming in panic searching for what to use to host student projects
what do you recommend for cross-platfrom development? I want to port my UWP app to other platfroms
Pretty hard to understand what your error is, could you maybe share some screen shots or some examples?
Sounds like you are using a module / script that runs a mini web server on local to preview the prod builds. 🤔
Tiny Crate is now Open Source!
https://t.co/kN5mlCRds9
All the assets and code in this Godot 3.5 project are free to use. Get modding! (:
#GodotEngine #IndieDev #GameDev #OpenSource
hmmm, in a gradle plugin how could i get the current NativePlatform?
no offense but i think this is less react and more related to not knowing anything about JavaScript or programming as evidenced by previous messages in this channel
there are legitimate complaints about react but lack of documentation/clear errors is not one I've ever heard from any professional
@next cipher I agree - I don't feel offended tbh, it's a fair assessment 🙂
well, it's more that there are too many options, and I lack the experience on that front to know which options to pick from, and what goes where and when (if that's an explanation that makes sense) 😅
my main reason for complaining was to vent a little, but also hoping I could get some more insight or assistance in being steered in the right direction 😛
if React was as bad as I made it sound to be (projecting my inability on to React 🙈), it wouldn't be an industry standard like it is haha - so it was more of an in the moment frustration
that said, in my defense, it was quite a bit easier to dive into Angular than it has been with React, which is one of the reasons I was so frustrated
then again, I'm used to writing Java, Kotlin, C#, or PHP for the most part... which are all fairly different than JavaScript (though less so now than some years ago)
anyway!
anyone have any tips or recommendations for me when diving into React? I tried to look into React with NextJS, because to me that sounded like a good route from the stuff I read
but maybe there are better routes to take? maybe a better combination of libraries/frameworks to use with React?
never done any Assembly, never needed it, and I hope I never will 😅
hmm my advice would be to start with no other frameworks - just make a totally vanilla react client side app and try to write some basic components with current react idioms
that's stuff like hooks, function components, trying to keep everything declarative
yeah, someone else suggested just starting out with a plain CRA, so will probably do that 🙂
if I still end up preferring Angular over React, I can just go back to that 😂
Yeah things like NextJs honestly are probably too much if you haven’t learned the basics of React.
React is easier with a solid understanding of JS and html, then move to CRA for mostly out of the box client side SPA for learning. Just grab a starter tutorial video series and you’ll blast through it quick if you know JS.
Remember in React it’s typically top to bottom for data flow, so comp A -> Comp B. You can pass down things like callbacks that can update state at Comp A if needed, but Comp B should not be trying to return data that Comp A then uses directly. Common mistake when new to React is to try mutating state of parent or passing back in a CB some data that you want to render on Comp A without updating Comp A state.
There are state mgmt libs like redux, but for learning React I’d start without that and just use plain state, then work your way up to understanding context, and then you can look into more advanced state mgmt as needed.
Plain react isn’t too hard, but the ecosystem is full of tooling that can get complex and hard to grasp all at once. So focus on JS & HTML > Basic react > Then start looking into the popular libs/ecosystems as needed for your project / ideas.
thanks for the feedback! 😄 I'm fairly comfortable with HTML, reasonably with JS too, but that's where it stops 😅
I've done some Angular stuff though, and the principal is the same between the two, but they are still pretty different
would you say there is any reason for me to go with React over Angular?
if so, what reason(s)?
Go vue wacha mean react or angular?
My favorite framework is
''.join([random.choice(string.ascii_letters) for x in range(randint(1,10))]) + '.js'
(Js is bad)
wacha use php? o.O
I don't do web at all 😈
Then don't say js is bad lmao
Idk man, business wise, cheaper and quicker to find someone who knows js. For product wise, it's quick and easy to make something especially for prototyping.
Sure in production backend u might want C#. Since a few years back node.js would of been the option here.
It supports web sockets out of the box also, which PHP I believe still does not >.<
i’m a professional React dev, let me know if you need help with anything
make sure you’re serializing anything you put into JSX
anything you put into redux or any state management system needs to be serializable as well. this can cause the issue you’re seeing but may not necessarily be the only possible cause
I have a really shitty computer programming professor who refuses to explain anything and im trying to make sense of this assignment. I'm not sure if my C++ code here is done correctly and wanted to ask if someone could give advice or let me know how it is
#include <string>
int main() {
std::string name = "Eli";
std::string major = "Computer Science";
int luckyNumber = 17;
double textbookCost = 0.00;
std::cout << "My name is " << name << ".\t";
std::cout << "\nMy major is " << major << ".\t";
std::cout << "\nMy lucky number is " << luckyNumber << ".\t";
std::cout << "\nThe cost I paid for my textbook was $" << textbookCost << ".\n";
return 0;
}```
Haven't done much C++ previously
Basically in the position rn where I have to teach it to myself lol
How it is
Object oriented?
Is that what is next?
While we're at this, lemme ask if anyone knows why the hell does curl not take in spaces for file names while passing as variables in a bash script?
And if someone has an answer for it lol
You need to put the URL in quotes likely.
For example curl 'https://google.com/search?q=help with tech'
Or curl "${URL}"
For scripting
If you like Angular keep up with it, personally I prefer React syntax a lot and the eco system / community around react is massive now. Pretty easy to find React devs these days.
But yeah if you love Angular stick with it, no reason to switch to React if your job doesn’t make you and you preferAngular.
My advice is just keep JS skills sharp if you plan to work on FE, since frameworks change, jobs change, etc. The core JS skills are what are most valuable and will help you pickup new frameworks fast.
Tried this lol
curl: (3) URL using bad/illegal format or missing URL
Tbh, my url is "https://google.com/path/to/put/$dir/$fileName"
Already in quotes lol. And I tried doing URL="https://google.com/path/to/put/$dir/$fileName" and then "${URL}" and didn't work lol
The URL would be a variable that represents the data. You might need to URL encode the data. https://linux.die.net/man/1/urlencode
urlencode converts each character in all the strings given on the command line. If multiple strings are given, they are concatenated with separating spaces before conversion.
Its not about curl
? I'm not sure what you mean by that
Next
It seems one of the component messed it up
Yeah, in this case my project is to build a new ticket management system for my employer, on my own initiative.
I’m free to use whatever frameworks and what not I desire. Though I will want to pick something that’s future proof and will be manageable for them if I ever went elsewhere.
I much prefer Kotlin as programming language, and would love to write backend in Kotlin with JVM. Company being a .NET company, I will definitely use C# .NET for backend. I kinda have to anyway, otherwise my employer wouldn’t go for it.
Also before anyone go there! I know there are a lot of ticket management systems out there, or CRMs in general! I recently started, and our current system works, and is already developed in house, but I’m missing some functionality in it, and it could use a more optimal code base 😛 also they made it because they couldn’t find any solutions that worked the way they wanted
Hi.
I am trying to make a filter, but I can't get around it. I simply want to get some buttons to toggle the filtering according the risks.
RiskFilter.jsx Component
import { useEffect } from "react";
function RiskFilter({setActiveRisk, activeRisk, setFiltered, data}) {
useEffect(() => {
if(activeRisk === "5") {
setFiltered(data);
return;
}
const filtered = data.filter((i) => i[3].includes(activeRisk));
setActiveRisk(filtered);
}, [activeRisk])
return (
<div
id="RiskFilter"
className="flex flex-row w-full p-5 space-x-2 lg:px-8 justify-evenly lg:justify-start"
>
<button onClick={() => setActiveRisk("5")} className="inline-flex items-center justify-center w-16 h-10 text-white border border-white rounded-lg bg-nblack-500 hover:border hover:border-gray-300">
All
</button>
<button onClick={() => setActiveRisk("3")} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-nred-500">
High Risk
</button>
<button onClick={() => setActiveRisk("1")} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-nyellow-500">
Low Risk
</button>
....
</div>
);
}
export default RiskFilter;
Example Data
{
"0": "13505",
"1": "test@example.com",
"2": "2,270.00",
"3": "1",
"7": ""
},
"3" can be:
4=no info
3=high
2=medium
1=low
0=no risk
RiskCenter.jsx View
const [data, setData] = useState([]);
const [filtered, setFiltered] = useState([]);
const [activeRisk, setActiveRisk] = useState("5")
<RiskFilter data={data} setFiltered={setFiltered} activeRisk={activeRisk} setActiveRisk={setActiveRisk} />
But I guess if I use Angular or React, doesn’t matter too much on that account. If I went with Angular, and they hired a React developer, they’d quickly pick up Angular anyway, otherwise they can pretty easily and quickly rip out the HTML and CSS and build the React solution on top of the API quite quickly
Most important is probably how well I develop the backend API, and how well I document it for future reference
I was also entertaining the thought of using Blazor
Could probably do a SSR implementation with ASP.NET MVC or something too, just to keep that as an option as well - not a whole lot of extra effort really 🤔
With my very very limited react experience, but reasonable experience as a developer I just quickly Googled the error
also on my phone atm! so bit hard to read the code itself
https://stackoverflow.com/questions/48497358/reactjs-maximum-update-depth-exceeded-error
This makes it sound like you have structured the code so it gets in a re-render loop
just trying to understand the issue myself, while thinking out loud - hoping you get some new thoughts on it
I am personally don't think the code itself would work this way, it seems the issue is with the data itself
I’ll give it another look in a little bit when I get on my pc
hello! i'm currently doing something with react-admin, basically my current structure is a ReferenceManyField, containing a Datagrid, with some columns but most importantly for this an expand attribute with an ImageField, is there a way to make the expand attribute only apply if the response from the ImageField URL is actually an image? (it may not always be), currently what happens is it just shows a broken image when that's the case, example attached
https://cdn.discordapp.com/attachments/244238416248569857/1013098306156638319/unknown.png
@sly marten Don't bother, thank you, I managed to solve it
i got it to work using isRowExpandable and a HEAD request, it's kinda wasteful but proobably fine
I can't figure out how to set a default state :S
Yes the issue is you are filtering in the component data from the parent then setting data back to the parent which will trigger the child effect to run again. The logic for your filtering should not be in the child if it needs to be set back to state for the parent.
If your filtering just to render it’s fine to be in the child, if you need to have some complex state but don’t want it all written out in the parent you can also make a custom hook to handle it and then call that custom hook in the parent and have it just return filtered data state.
Functional with hooks or class with state obj?
The way above works now somehow, I might did some typo or used wrong constants.
The only issue now, is that I havo to set an activeRisk with a click, otherwise nothing appears.
Hmm it's been a long time since I used react-admin, but I see a prop for specific rows: https://marmelab.com/react-admin/Datagrid.html#isrowexpandable
So looks like you'd have to use a callback that can check is there an img in the data row, if so then it is expandable.
For example say the data is imageFIeld.url I think your prop would look something like this: isRowSelectable={ row => Boolean(row.imageField.url) }
yep, i got it
I wasn't a big fan of react-admin and moved an app off of it at an old job, it works great for simple admin site but as soon as you want to customize stuff it feels like it's kind of a pain. Like it's so opinionated your API has to kind of conform and when you do custom stuff, like that expand only some rows, it feels like they force you into some performant patterns like checking every single rendered row against a CB. lol
Hmm without seeing code it's hard to guess, but this sounds like when you are doing something outside of the normal flow of data for react and not causing a render event. For example like having a global object outside of state, which when mutated then doesn't change until you force a new render, since react doesn't know it should render after mutating that obj.
yeah possibly
FIGURED OUT
actually no xD
This is the functional one.
import { useEffect } from "react";
function RiskFilter({setActiveRisk, activeRisk, setFiltered, data}) {
useEffect(() => {
if (activeRisk === '5') {
setFiltered(data)
return;
}
const filtered = data.filter((i) =>
i[3].includes(activeRisk)
)
setFiltered(filtered)
}, [activeRisk])
return (
<div
id="RiskFilter"
className="flex flex-row w-full p-5 space-x-2 lg:px-8 justify-evenly lg:justify-start"
>
<button onClick={() => setActiveRisk('5')} className="inline-flex items-center justify-center w-16 h-10 text-white border border-white rounded-lg bg-nblack-500 hover:border hover:border-gray-300">
All
</button>
<button onClick={() => setActiveRisk('4')} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-ngray-200">
No Info
</button>
<button onClick={() => setActiveRisk('3')} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-nred-500">
High
</button>
<button onClick={() => setActiveRisk('2')} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-orange-500">
Medium
</button>
<button onClick={() => setActiveRisk('1')} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-nyellow-300">
Low
</button>
<button onClick={() => setActiveRisk('0')} className="inline-flex items-center justify-center w-24 h-10 text-gray-600 rounded-lg cursor-pointer hover:text-gray-200 hover:border hover:border-ngreen-500">
No Risk
</button>
</div>
);
}
export default RiskFilter;
I have to run out, but I'll be back in 15-20mins and take a look / help you out. 👍
Thank you so much.
So it looks like we have state kind of like this (apologies for me crude drawings lol)
Ideally we want to lift the data filtering logic into the parent or into something like a custom hook, so it's at the parent level. Also looking at the above code it looks like the risk levels is constant, so we can either hard code them or use an enum in the app or if they need to be dynamic we could compute the list of them at the parent and pass down.
Anyway we would end up with data only flowing 1 direct, set risk level / filter level would only need to flow back up to the parent. The actual filter code would not run in the child.
If you can share some example items I can use for filtering I could write up some example code for you on something like codesandbox and share it. 👍
Sure
@wind horizon https://pastebin.com/WBzNtbXD
the risk is basically the "3": "number",
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Here is an example doing filtering in the parent directly: https://codesandbox.io/s/tender-water-zwo77v?file=/src/App.jsx
what is useMemo?
It only reruns the function when something in the deps array changes, similar to useEffect. The difference being useMemo returns data.
So like
const data = useMemo(() => "hi", [someVariable])
The function to return "hi" would only run when someVariable changes. So it won't run on every render.
We wrap filtering in this in case the component ever rerenders for something unrelated to the filter, for example say some other state is on the component like column ordering, we don't need to refilter the data when that changes.
Ocuh, I really need to rewrite things then
@wind horizon You see, this is how I did, which is why its likely the trouble
https://pastebin.com/VF15aYGc
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
useEffect is fine for fetching data on mount, like from an API, since you normally only run that once. I usually abstract those away though. Personally one of my fave setups for fetching data form plain REST (not GQL) in React is Axios + react-query. Gives you a great API with built in cache, refetching, etc.
Although it's prob good to keep doing what you are doing learning todo it by hand, so you understand how things work. Once you have a good grasp than moving onto libs like react-query will be a lot easier to understand why you have issues in those libs when they come up.
How does it know when its needs a new fetch tho? I assume, normally, I would cache it, then use a refresh button for example to refetch.
You can think of the hooks kind of like this:
useState: Data that when changed should trigger renders and needs to be updated over timeuseReducer: Custom state mgmt, you likely won't need this for a bit if you are new to react.useMemo: Something you don't want to recompute unless the underlying data changes, often used for perf optimizationuseEffect: You need to perform an action on mount and when data changes, this replaces lifecycle hooks in React classes. Should not normally be used for managing/setting state.useLayoutEffect: You need todo something AFTER the first render, for example measure an item in the DOM which can't be done before render. You should always reach for useEffect before using this.useContext: Used to get data from context (you won't need this if you aren't using context in your app)useCallback: Similar to useMemo, but for functions. So it lets you prevent function from being redeclared between renders, you won't need this usually unless you are doing perf optimizations.useRef: Used to create arefyou can pass into a component and access the DOM for manipulation. Sometimes it can also be used as a hacky way to track changes between states since it is mutable and does not trigger renders.
There are a few more, but that's the core ones.
https://reactjs.org/docs/hooks-reference.html
Dont' forget you can make your own too! So you can make like useGetSomeData and in that hook you fetch and return the data. This is how things like react-query are built and expose custom hooks.
This is hard to answer since each app can have different needs, but for example say react-query has a default setting of marking items as stale right away. So when the user focuses out of page, like changes tabs changes active app, then comes back to the page it'll fetch in the background and replace the data once fetched.
You have to be careful with things like the above though, since say you have a table of data the user filtered. They don't expect to see it change suddenly when they come back to the app. If your building some kind of like log researching tool I'd prob make the user click to refresh the data or if you want you can also build a live feed similar to what you see in firewalls where the data keeps streaming in as it's available. This can be achieved with something like sockets or polling on an interval.
So I guess the answer is, it depends. 😅 Just need to find out how your users would want your app work.
In my case things are worse to work with, as I use divs and map() instead of actually table :S
But this app will be only used by 3-4 people roughly, literally for our team. I really don't need live data to refresh itself on changes, rather when I press F5 or something.
Is it possible that the data from the API only fetched too late? So that the filter can't find the data thats needed?
Is this data required for that app to even be used / work? If so I’d prob just render a loading spinner there while the data is being fetched. Once it’s fetched then render your table / list or whatever it is.
It's basically a little app we use to track customer issues, feedbacks and see if they are under any risk.
If you want some styled tables and such without all the work you can use a component library. Like antd, material, blueprintjs, etc.
The API is NodeJS based and fetching data from SQL.
Oh, don't worry, the style is already done 😄
Ah yeah so in that case normally I’d send my filters and any search in the api and to SQL query, then it returns the data needed.
For example /data-endpoint?riskLevel=1 if there is TONES of data in SQL likely a limit as well w/ pagination.
usually the best way to implement pagination is using something like a cursor, which should keep the pages accurate even if data changes in DB between page changes. But if your data doesn't change fast then simple skip in SQL is ok, just be aware it's possible to end up with new insert data that + a sort at the same time that results in a jump in items when changing pages.
react-query has some nice built in functionality for handling pagination and even pre-fetch of next page to make it feel instant, which is pretty cool. Although it's more complexity to the app, so imo especially being new to React I'd focus on getting basic app working as expected then doing iterative updates.
Looking at screen shot you shared personally I'd prob try infinite scrolling as an interactive update later, so the user can just keep scrolling on the page. But then also give them the filter buttons + maybe a search box that search the fields. Since at least the ones you shared with me had an id and email, so they may want to lookup / jump to something specific. 🤔
Yeah, I will do that later
😄
Risk Center is really short, its roughly 30-25 users, so I wouldn't limit that. I also don't really want to search in those.
The only place where that happens are the Issues, Ongoing Issues, maybe Feedbacks.
As you can see there is a filter option on Feedbacks
Though thats going to be harder than the toggles, as they kinda interference with multiply filter options, so its not just one thing to look for.
Yeah usually if you have BE on sql you can just offload all the work to the DB, make every filter part of a query parm which is used to get the data from DB.
If you do it in only FE there are some libs to help or if you go custom you can do something like cache the filter keys so you can skip applying that filter if that filter didn’t change but another did. But it gets complex and I only suggest it if you for some reason can’t / don’t want to have your DB filter them on query.
Does anybody know of something similar to flatpak-spawn or host-spawn, but written in Rust?
might be better in #flat-pack
not really flatpak-specific
because I'm writing a container manager
and at least take a minute to spell it correctly
is there a specific reason for wanting it in a specific language? isn't it just a CLI program?
mainly to keep dependencies minimal
I'm writing my container manager in Rust, and I don't want to rely on anything other than that and podman to function, ideally
oh fun
worst case, I'll just make it basically alias to host-spawn
I want to get the host-exec portion finished first, as that seems to be the easiest at first glance
nice help command, did you use a library for it or do it manually?
iirc there is one arg parsing library that's really popular
it's built into clap, I think
yep, that one
i just do it manually because it's easy enough lol
I like doing as little work as possible where it makes sense
and I could probably make this a bit more efficient by splitting it up into multiple files:
https://github.com/orowith2os/rustbox/blob/master/src/main.rs
single 700 line file btw >w<
i still need to add file retries
still much better then 700 1 line files , or 70, 10 line files , even possibly better then 7, 100 line files , 🙂 make that col80 compat and your up for a 1k slc file
actually the slc is like 600 according to github
fun fact: modpacks.ch uses a user agent to limit API access
that's literally the only thing it does
and said user agent is embedded inside the official API client sooo
just had to do this
let manifestResp = ureq::get(&url)
.set("User-Agent", USER_AGENT) // API returns empty url otherwise
.call()
.map_err(|it| format!("Failed to get modpack version manifest: {:?}", it))?;
const USER_AGENT: &str = "modpacklauncher/202207271710-0f9644f5fc-release Mozilla/5.0 (LINUX) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.138 Safari/537.36 Vivaldi/1.8.770.56";
anyways, back to an implementation of host-exec in Rust
maybe it would be possible to use ssh or something to pass through commands to the host?
fun
devs dont take people with a shotty connection into account , it loops over every file/repo each time , and fails if one fails , 10th attempt or so , each time diifferent files that fail .... ow and yes look at the response times of my ping , gotta love a monopoly on the isp market
Hey guys! A friend of mine needs help with a practice question in C. It's as follows:
Person A and Person B are experimenting about collisions using balls. Each ball has a sign representing its direction (positive meaning right, negative meaning left). Both of them are provided with the list of N balls. A and B pick a ball from their list
Conditions about collision:
a. If both balls have the same sign, print "Balls will move in same direction"
b. If both balls have different signs then print "they will collide".
(outline provided:
Make separate linked lists for A and B
Ask the user to select one element from each list
compare the selected elements
print the output accordingly)
esy install --solve-timeout=60 -v --fetch-concurr did the trick 🙂
.
so the "sign" is actually arbitrary , if both are A same dir if both are B same dir if one A other B collide, makes it easier to store in memory and compare aswell
could even make it a boolean 🙂
How can I itterate within a map?
To explain the issue, you can see the JSON array, but it would be nice to display like
<span>Product</span> <span>Sales</span>
Currently it looks like this
{
i.categories == null
? "General"
: JSON.stringify(i.categories)
}
Why can’t you do data.source.map?
@wind horizon I really don't want to bother you further bro 😄 you helped a ton alreaady
but the point is, it's already in a map, do you mean something like a sub map()?
Hmm sounds like maybe you are confusing some terms or maybe I’m misunderstanding you. 😅
You can have a map, like a hash map, that is data structure. This is what we are used to calling an “object” in JS. I think maybe this is what you are referring too?
What I was mentioning is map the function / method on the Array object which loops over items in an array return a new array.
I think your saying you have an object / hash map, inside it you have a key of source which is an array. You want to render a react element for each item in that array. Right?
Using an array map method we can loop over an array and return a JSX (react) element for each item in an array. React will see that array and render each item to the screen.
This is how it looks for the main content
<div className="flex flex-col px-5 py-6 space-y-2 lg:px-8">
{filtered.sort(function(a,b) { return (b.feedback_id - a.feedback_id) }).map(i =>
<motion.div animate={{y: 20}} key={i.feedback_id} className={i.feedback_nature === "positive" ? 'flex flex-row border-l-8 border-ngreen-500 rounded-lg h-24 bg-nblack-500 items-center justify-between' : '' || i.feedback_nature === 'negative' ? 'flex flex-row border-l-8 border-nred-500 rounded-lg h-24 bg-nblack-500 items-center justify-between' : '' || i.feedback_nature === 'mixed' ? 'flex flex-row border-l-8 border-npurple-500 rounded-lg h-24 bg-nblack-500 items-center justify-between' : ''} >
<div id="data" className="flex flex-row items-center mx-2 ">
{/* Feedback Type */}
<div className='justify-center hidden w-32 px-4 md:flex'>
<span className={i.feedback_nature === "positive" ? "text-ngreen-500 border-2 rounded-md border-ngreen-500 px-4 py-2 select-none" : '' || i.feedback_nature === "negative" ? "text-nred-500 border-2 rounded-md border-nred-500 px-4 py-2 select-none" : '' || i.feedback_nature === "mixed" ? "text-npurple-500 border-2 rounded-md border-npurple-500 px-4 py-2 select-none" : ''}>{i.feedback_nature}</span>
</div>
...
Oof hard to read inline let me grab the laptop and copy into an ide. 😅
and inside this filtered() map I would love to iterate things further, so that it would look something like
This is my plan 😄
I guess now you understand my point
So the i is the { sources: ["Design","{roduct"] } right?
not really
a second
I show you an example
{
"feedback_id": 7,
"user_id": "64892",
"email": "XXX",
"feedback": "He replaced XXXXX because he wasnt happy with the pricing. Now he pays 11 USD per month for Unlimited Users. He mentioned the features he getting are the same as BN.",
"date_created": "2022-06-01T10:02:14.000Z",
"risk_level": 0,
"feedback_nature": "negative",
"categories": {
"source": [
"Product",
"Sales"
]
},
"source": null
}
Oupsie
So what I would need is the categories.source
Also quick tip if you move those classnames into another file or at least define them seperatly you can then make the code a lot easier to read. Looks like a lot of overlap, for example I see a lot of them reuse flex flex-row border-l-8 rounded-lg h-24 bg-nblack-500 items-center justify-between just looks like border changes between them. So you can make 1 that you apply to them all + then adding border for the specific version maybe?
apply is not a good idea with TailwindCSS 😄
Right so if that is i in your code about you can do like i.categories.source.map(source => <span>{source}</span>)
Ah sorry I just meant combine, so you can have 1 constant that has the ones they all will use, then just add to it the specific extra rule.
In this case its report the source being null, which can be right, because in that case I would generally return "General"
Annoying LTT messing up their timestamps 3 years ago
You can use optional chaining often to help with that, i.categories.source?.map would not error, but would return undefined. So you'd then have to default that out to null or whatever you want. You could also check this when you loop over the data to apply the filter or sorts as well. For example in the filtering stage you could replace null sources with empty array or if you want you can leave it null and then in render use ?. with || or ?? to default to something if it returns as undefined.
Normally when it gets this nested I'd consider braking it into another component. That way the logic to handle what to render in the edge case of null is self contained and not getting crazy all in-line in 1 huge function.
Also note on combining css classnames a handy module I used when I worked w/ css modules and tailwind in the past wass classnames. https://www.npmjs.com/package/classnames
Not sure it's still the "cool" css joining util, but it was a few years ago and still has 10M+ weekly downloads so looks like it's widely used still.
Yeah, I do that in some views actually
I am not sure i follow how to use ?? or || in this example, because i.categories.source??.map goes Errrror brrr.
It looks like you have something maybe like this:
- FeedbackPage
Here we are looping and rendering lots of JSX for each feedback item in this list / feedback card it looks. Is that right?
If you want to simplify the code a bit perhaps try:
- FeedbackPage
-- FeedbackItem
(ofc rename as needed making up from what I see)
Then in you FeedbackItem you can have all the logic and JSX for rendering out the card. In feedback page all you are doing is looping on the filtered data and rendering a bunch of cards. Like
filtered.map(feedback => <FeedbackItem key={feedback.feedback_id} feedback={feedback} />)
Oh those would have to come after the map call.
Just sec I'll send example in browser console.
Yeah, I tried that, sorry for being stupid, its 1 AM here xd
const exampleData = [
{ name: "Test1", sources: ["Hello", "World"] },
{ name: "Test2", sources: null }
]
exampleData.map(({ name, sources }) => ({
name,
sources: sources?.map((source, i) => `Source ${i + 1}: ${source}`) || ["No Sources"]
}));
No worries, not being stupid just learning. 🙂
This line here:
sources?.map((source, i) => `Source ${i + 1}: ${source}`)
Will return undefined if .map is not a key on sources object (array obj). So we can use || or ?? to default it to something since we can't render out undefined. In your case you'd be returning some JSX, but I left it as plain strings so it's easy to test out in a browser console.
If you know for sure it's always null or array of source you can do simply truthy checks too, like sources && sources.map( but have to be careful with that if it could be some other shape sometimes. lol
First attempt at mapping what % of wan show episodes are merch/sponsor/other based on description timestamps. it's definitely not catching some timestamps
Would be cool to see this in duration form as well as percentage
I'll try to make sure it gets all the timestamps correctly and then get some more graphs
I'll need to devise a way to override certain results
Like the 2nd newest video doesn't have indented merch messages and is completely full of like 5 seconds inbetween timestamps, messes up my method
Damnit, sponsorblock doesn't consider merch message segments as skipped segments
So I will have to figure out how to parse each and every video uniquely, probably with some manual sifting
how the heck do you test Facebook Commerce? I'm supposed to help customers set it up or figure out what goes wrong, but without being able to use some sort of sandbox or create a dummy shop, how do they expect me to get it done? 
Alright it's damn near impossible to properly parse these videos from the description since different "timestamp guys" have different styles and some of them are really hard to see how much of it is merch messag es
What I ended up with
Got it working. Now I really would just need to know how to insert some spans between those texts
Thank you very much!
Spans between? Like a break?
Is there a git for the code that generated that graph?
My thing?
Yes
I can post it in a bit
The graph itself is just from libreoffice but it outputs csv
Ok. What I wanted to see was those three metrics with the left being minutes not percent of total time.
Hmm what issue did you have with rendering out the span?
I got literally <span>Text</span>
Oh you are prob returning a string of that then not jsx haha.
I can help you out if you share a code sample. Sorry slow replies during work hours, but just about to log off work. 😁
does anyone here use gradle for JNI stuff? how can i customize compiler args based on the platform of the task? trying to use targetPlatform doesn't seem to work since that value hasn't been set yet apparently, and if i try to do it as a doFirst, before other things in the task run, the compiler args have been finalized
tasks.withType(CppCompile::class.java).configureEach {
val home = "${org.gradle.internal.jvm.Jvm.current().javaHome}/include"
val platform = targetPlatform.get() // Fails
val osPath = when {
platform.operatingSystem.isWindows -> "win32"
platform.operatingSystem.isLinux -> "linux"
else -> throw IllegalStateException("Invalid operating system")
}
compilerArgs.addAll(listOf("-Wall", "-I$home", "-I$home/$osPath"))
}
Can anyone help me with going about trying to run this source code locally? https://github.com/supermosh/supermosh.github.io
Or send me in the right direction to figure it out haha
I mean, the source code is pretty easy read. If you look at https://github.com/supermosh/supermosh.github.io/tree/main/core, it says just read that. It’s in the src/index.ts. But all you need to do is install the module into your project and then import the functions you need, to do the things you want.
Imagine being able to read smh
hey sorry bother but can anyone here help with my LVL1 DFD
a better image of that
i m unsure if points and fouls scored going out from my data store is correct or not
and also what else should i add in this
<div className="flex-col px-4 md:flex">
<span id="UserID" className='hidden text-xs text-gray-600'>Department</span>
<div id="UserID" className='flex flex-row space-x-2 text-gray-400'>
{
i.categories ?
i.categories.source?.map((source, i) => ` ${source}` + '')
: "General"
}
</div>
</div>
Ping me if needed, so having an issue with HTML. This is happening on the document, and here is the code
Here is the code snippet
Style tag does inside the >
Since style is an attribute iirc
Ok? So I did have one of those earlier and the problem kept showing up
It made everything else pink
Show
It's still not fixed
I know.
You arent putting style= in the correct place
I'm trying to fix it, but I'm new to html
Now I'm trying to get the other text to be blue, wait I got it!
Now I'm trying to get the image to be below it
<a href="https://scentsy.com" style="color:hotpink">
I think this is what you are trying todo:
<div className="flex-col px-4 md:flex">
<span id="UserID" className="hidden text-xs text-gray-600">
Department
</span>
<div id="UserID" className="flex flex-row space-x-2 text-gray-400">
{i.categories?.source?.map((source) => (
<span key={source}>{source}</span>
)) || "General"}
</div>
</div>;
Personally I'd prob break out the sources map and defaulting to general into a component, so it's not in-line in the JSX like that. I don't like having many conditionals inside my JSX personally. But that's just a personal thing haha.
Me dealing with slack's markdown support:
It looks like they've changed how they handle parsing links since the last time slack created an infinite edit glitch. Now if you try that, the period disappears, and you don't get an infinite link problem.
In the past, there was some "interesting" behavior...
Why can't companies just use GFM (GitHub flavoured Markdown) when they implement Markdown. It's like the most used variant of Markdown
The company I work at used to have Rocket Chat, and it's Markdown implementation was an absolute dumbster fire. It was pure luck if you managed to get it detect the format correctly...
Rocketchat fuckin sucks
Yeah, we've since moved onto M$ Teams. Formatting text is kindof a pain there using Keyboard only, but at least it actually works properly
I used "Flowdock" for a while. It's Atlassian's competitor to Slack. Honestly, I think it's strictly better, once you start to understand the threading model.
As someone who wrote a decent chunk of a proper parser to run a custom DSL, it baffles me that no one is smart enough to just hook their custom code into the official markdown parsing libraries. It's not that hard to create a few custom functions to do things like modify elements or add/change features of markdown to fit your custom chat app. Discord removes embedded links (I assume for safety reasons), but they have otherwise good markdown support. Why doesn't literally any other chat app have okay markdown support?
And for the love of god, please STOP modifying markdown messages. The whole point of using markdown in the first place is to have interop between different text entry fields. Then slack goes and does this garbage when you try to edit a message you posted:
We use Skype and are transitioning into rocket chat. Very behind the times
Does anyone have ideas on how I could clean this up some?
This is the source structure:
struct IDiscordLobbyTransaction {
enum EDiscordResult (*set_type)(struct IDiscordLobbyTransaction* lobby_transaction, enum EDiscordLobbyType type);
enum EDiscordResult (*set_owner)(struct IDiscordLobbyTransaction* lobby_transaction, DiscordUserId owner_id);
enum EDiscordResult (*set_capacity)(struct IDiscordLobbyTransaction* lobby_transaction, uint32_t capacity);
enum EDiscordResult (*set_metadata)(struct IDiscordLobbyTransaction* lobby_transaction, DiscordMetadataKey key, DiscordMetadataValue value);
enum EDiscordResult (*delete_metadata)(struct IDiscordLobbyTransaction* lobby_transaction, DiscordMetadataKey key);
enum EDiscordResult (*set_locked)(struct IDiscordLobbyTransaction* lobby_transaction, bool locked);
};
This is a sparse version of my Java implementation:
public record IDiscordLobbyTransaction(MemorySegment segment) {
private static final MethodHandle SET_TYPE_FUNCTION = bind(S32, ADDRESS, S32);
...
static final MemoryLayout LAYOUT = struct(
ADDRESS.withName("set_type"),
...
);
private static final VarHandle SET_TYPE = member(LAYOUT, "set_type");
...
public int set_type(int type) {
try {
return (int) SET_TYPE_FUNCTION.invokeExact((Addressable) SET_TYPE.get(segment), (Addressable) segment, type);
} catch (Throwable e) {
throw new RuntimeException("Failed to execute IDiscordLobbyTransaction.set_type", e);
}
}
}
S32, ADDRESS, bind, struct and member are defined in a helper class and should be fairly obvious.
Sheesh, Discord still doesn't know what a record is?
Last time I tried slack didn’t have proper code highlighting either, I think slack wants us to use snippets instead of inline markdown. Esp since I don’t think I can even toggle to mark down mode on my mobile app anymore.
I generally like slack more than discord, except in this area. Haha
Yeah, zero support for code highlighting, which makes is quite useless.
But at least the code blocks stop slack from randomly turning things into unicode. I've caught it doing all sorts of crazy character replacement on unexpected things. Like turning three periods into the unicode ellipsis character.
Sounds like showing someone a function signature with variadic arguments would be annoying.
anyone know why it's not being detected?
javac .\TestPerson.java
same result
show output of dir
this?
yes, you have no files in the codes folder
no wonder it doesn't work
I have it
no you don't
you are in C:\codes
this is not C:\codes
SHIFT + Right click on empty space , open in powershell
so i should place it in C: \codes?
you either open the correct folder in the terminal or move it to C:\codes
I reccomend the first
this would be C:\Users\<Username>\Documents\codes
I never knew about the shift shortcut, I hope this works on Win11 so you don’t have todo the registry hack to see all your stuff like 7zip without clicking show more options.
doesn't seem to do anything in win11
regular right click
shift + right click
just selects the first one
finally got it, thanks
I would recommend using Idea Community.
public abstract sealed class DiscordValidateOrExitCallback extends Callback implements DiscordValidateOrExitCallbackI permits DiscordValidateOrExitCallback.Proxy, DiscordValidateOrExitCallback.Native {
I'm getting some crazy class definitions. :V
going a little insane. we have a fairly complicated setup of load balancing & cross-DC stuff at work on top of our on prem VM/container platform
managing it directly is a huge pain and basically requires you to be an expert in the vendor's janky shit
so they have some homegrown scripts/integrations so in theory you can just upload a container or package up your app with a heroku-style buildpack and deploy, then use these integrations to automatically set up load balancing and custom domains as needed
except, completely undocumented, it turns out that the whole load balancing/TLS termination/auto failover thing has globally shared configuration between all environments including the dev/qa/staging deployments
in the end, it turns out if you create an app with the same name & subdomain as your production app, in a different environment, and use these integrations...
it will delete the SSL certificate from the production app and replace it with a cert that's only valid for the staging environment
anyway that was my afternoon 😡
I wonder if the Java spec team has a sprint and they need to spit out features every once in a while
that code looks too bloated, and it is only the definition
That isn't too bad. It's just access control and parent types.
honestly i'm not a big fan of sealed classes
honestly i'm not big
Can anyone recommend a way to concatenate two jsons to one within Javascript? So whenever the ID (index) matches in both, they would be merged together into one.
great
If they are parsed to an object you could use merge from lodash/underscore to merge objects.
But you say index, so it sounds like you want to merge based on index in an array, which you can do that too but a bit more risky since you have to guarantee the order of arrays between JSON will never change.
Sealed types are great.
very important to keep track of whether you're dealing with a series of individual newline separated json objects, or a single valid json array of objects
a series of newline separated json objects is actually not technically valid json (if parsed as a whole)
Never heard of sealed types
the difference between
{"a": 1, "b": 2}
{"a": 3, "b": 4}
vs
[
{"a": 1, "b": 2},
{"a": 3, "b": 4}
]
And yet half the api's I hit think newline seperated is ok 😠
i hate how many people use it or try to accept it
should at least be an opt-in to throw an error on invalid json so it doesn't cause problems later
Does anyone got good examples for A sibling selector (div ~ p) and
A direct sibling selector (div + p)?
mdn web docs are the best
thanks
public sealed interface SealedInterface permits FinalImplementation, Implementation {}
public final class FinalImplementation implements SealedInterface {}
public non-sealed class Implementation implements SealedInterface {}
// The following is invalid
public final class OtherType implement SealedInterface {}
Is non-sealed the actual keyword
So only certain type names can inherit from a sealed class unless you deliberately unseal it I guess
What kind of APIs are you hitting, I have never seen an api respond like that 😂
A lot of Cybersecurity data apis
I can always tell when they use a jank python backend when it happens, and they're just appending data instead of properly formatting it
Interesting, I worked in cybersecurity for a while but the engineer teams owned the backends so I guess we just didn’t have bad engineers. Lol
I interviewed for a dev/researcher position for an aggregator company. One look at their code base during an interview (and the lowball salary) and I noped RIGHT out of there
When I was in cybersecurity I did notice they loved to key all their data and provide names. So like some_long_name: [{}]
You were expected to take out that long key name and use it as the name or map that key to a string fort displaying it lol
Ugh, for real. Which is fine-ish when I'm writing python, but such a pita when I'm using go
Also in cyber security is where I saw the biggest push for python I have ever experienced, it could be something that is 10 times harder to do in python and they would say let’s do it in python
I attribute that to making it so analysts can also write tools. A lot of tools come from analysts solving a problem by becoming a dev, rather than devs who became analysts.
I've had to refactor some stuff from go to python so that other people could help maintain it/write modules for it
Welcome to nearly every job in IT. 
Yeah I assumed it was related to how much Python was used in their analytics and in a lot of their published docs on how to replicate attacks and such. Just so heavily used they prefer to keep using it even when it’s not the best tool.
Now I’m in nearly all JS hell bliss?
It's been a while since I used Java, and I don't remember sealed classes. I just looked it up, and it's probably the stupidest feature I've seen in a while. Inheriting from a class already only allows you to access the public attributes, so why bother with preventing people from doing even that? It doesn't prevent them from wrapping your entire class in some helper class anyways.
Like, what is the intended use case for sealed classes? It doesn't make any sense.
Apparently new in Java 15. So it's only been around for the pandemic.
As someone who has been forced to work with Golang for the last year, I'd argue it's a pretty compelling argument for why Golang is a badly designed language. 
Not really? It's pretty much the same for any compiled language, dealing with non-compliant formatted arbitrary/unknown data
Speaking of, are there any reliable and decent structured logging libraries for golang? My team currently had garbage logs, and management is looking for a solution. Using structured logging in the past has been pretty nice, but I don't know the full state of go libraries.
Maybe I'm not understanding correctly. They have a completely dynamic data structure that doesn't support static identifiers? Or their data structure just wildly violates valid parsing rules? One of those is not a great decision, the other is completely stupid.
Not sure what the data you're logging looks like, or where else you need it. but I usually create a new custom logger, with syslog style syntax.
And I've had to deal with both. Lot of Cybersecurity analysts that are smart, but have zero data science knowledge
We're running a bunch of microservices. Ideally, we'd use some Kubernetes service to just log the requests inbetween the services, but my manager wants more classical logging from within the code. Recreating a logger for every microservice would be a lot of work, so ideally there is some existing library we could just import and use.
Its a god send whenever swagger documentation just EXISTS.
I mean, I recently found this issue for Rancher: https://github.com/rancher/rancher/issues/12925
Hello, I have found https://github.com/rancher/api-spec but there does not seem to be a machine readable OpenAPI/Swagger spec for the Rancher API. I do not see an issue in 2.0 or 2.1 milestones. Ca...
FOUR YEARS RANCHER. It's been four years, and you still don't have a swagger definition for your APIs. Get your stuff together man.
Then might I suggest an in house library? I usually end up copy and pasting my custom one around myself.
Is there really no existing good logging library for golang? No industry standard set of options that other devs would already be familiar with?
Tbh there probably is. I try to stick to standard libs as much as possible, which means i end up recreating stuff thats already out there, but thats a "me" thing
Like when I accidentally wrote my own version of caddy 😅
I think that's a big part of the problem with our current situation. We had two amazing engineers who helped found our team a few years ago, and they were amazing. But they had their own ideas on how things would be run, but they didn't leave any specific path forward for the rest of the team without their skills and experience. Lots of things were custom built, which increases the cost of onboarding new devs. (which we're doing a lot of)
seems like how a lot of go devs operate, ive seen so many implementations of the same thing
I'm looking at new jobs, maybe even moving out of corporate software, so I'd like to put more standards in place before I leave, instead of leaving behind a custom built system where I'm the only one who understands how to use it.
Yeah, that always causes pain when unicorns leave behind custom systems without documentation. I try to write (and document) things so that the complex stuff is behind easy to use api's
They actually did leave behind amazing documentation. They were great engineers. But nothing beats personal experience with a system. Docs can't cover every single use case without hiring a full time technical writer.
(which is why MSND, Kubernetes, and Mozilla have amazing docs)
(And why most of Google's docs kinda suck, and why AWS is a mixed bag of nuts)
Main reason why I end up putting http api's in front of stuff that REALLY should talk directly between each other. Its technically less perfomant, but makes integration, especially in already existing pipelines, much eaiser because every (good) dev should know how to interact with it.
And it makes cross language communication much easier
Yeah, I think the entire industry has standardized on HTTP to communicate. I think it's a generally good idea. While it is technically less performant, nearly every single piece of infrastructure I've seen could handle the extra workload. Most services sit idle half the time anyways.
From the security side, I like it because it makes it really easy to identify bad non-http traffic, and with a good SoC, easy to identify non-normal http traffic. Of course, that relies on the SoC being good 🤣
Yeah, but things get catastrophic fast when your supposed defenders are blind to whats going on
Pretty much. Some of the new STD APIs make use of the stuff too. Limiting the scope allows for better optimizations and you can guarantee more things that limit checks you'd otherwise have to do.
Hello, I'm a Mainframe Dev. feel free to roast me lol
How's COBOL treatin ya?
Horrible! I'm a junior dev so still learning. Been mostly messing with JCL and CA Easytrieve since that's what my teams mostly uses. Most of our function is processing payments and generating reports.
Sounds super fun
The salary is fun 🙂
Yeuhhh
Once you outlive all the veteran legacy code maintainers you go contracting and collect ur $500/hr
Hopefully you're doing some type of contracting, where you can work for like 6 months then have 6 months of fun. I think that would be pretty cool.
At that point, your actual job doesn't matter that much. You're only working like 10% of the hours in your life. You can do whatever you want if you've got a job that allows that.
I feel like it’s common for us to think this, but then when someone dangles another bag of money in our face it’s hard to say no and actually only work part time. 😅
The important part is keeping your life simple. If you get seduced into a huge house with a 30 year mortgage, you're going to have a hard time turning the money down. I think the key is to learn to say no to things outside your job. If you're able to get a cheaper and smaller used car, pay it off, and rent in a cheaper area, you can start to save up some good money for doing other things. But if you decide that you just need that BMW, then your work will always have a lot of power over you.
Buy a car, then live there
Imo buying a house usually works out better, mine doubled in value since I bought it. But yeah deff don’t live outside your means. I live on the same pay I made 4 years ago, I just put all the extra money in savings. I don’t save it all forever, I’ll spend it on fun expensive stuff but usually all those things are in cash so I’m not tied to some huge payments I have to have a really good job for.
Definitely the right play. Saving money away gives you so much flexibility. I'm surprised that so many people end up making more money, then quickly ending up wasting it all on frivolous things. In the world of software, there's not a good reason to do that, since the pay is pretty good.
Woohoo getting a math degree and my future income is gonna be low asf cuz I’m planning to go into education
Yeah, I’m an FTE. Contracting never really appealed to me
As long as you enjoy teaching sounds awesome, hating your job isn’t worth more money imo. I have worked jobs I hated and it was the worst thing ever to not want to go to work every morning and dread the end of the weekend, also if you do work you enjoy you’ll excel at it.
Do work you love not just work that pays well, if you can happen too find both awesome but everyday happiness > money.
Gotta come up with an idea for an upcoming mobile app dev course. How the fuk yall come up with ideas?
what is this color code 0x62ea71
Grean
stealing
or i see a really cool ui and im like damn i wanna make something that has a cool ui and force an idea out thatll work with it
Right
I want to think of something unique even if it's not good but God damn literally everything already exists
yes but what type of code
It's a 24 bit color in hex
0x is the hexadecimal prefix yeag
ok
If it's RGB pure red is 0xFF0000
ok now the embeds for my bots are now red
Then hopefully you work for a place that gives you like 6+ weeks of vacation a year? Money doesn't mean much if you can't take time away from work to enjoy the pay.
Oh yeah PTO is cracked
I'm jealous. In the USA, most of the places I've worked have had pathetic and insulting PTO offers. It's what makes me want to go into contracting, so I can make a TON of money and afford to just pay myself to take vacation, even if I'm not being paid.
I need to get to the step where I make big money 😔
Start the first part of the course with something boring like a calculator, which will teach them the basics of how to build interactive apps, then let the students submit ideas for what their next app will be. You don't need to commit to having the best idea. Bringing the students in on the design phase is a good way to get people excited and interested in the class. You can even let them know day 1 that they'll need to start brainstorming ideas for what kind of app they'll build. Just make sure you vet each idea. Newbies generally have a bad idea of how long things take, so they'll usually suffer from committing to too much work.
Nah nah nah hold up
I'm not a teacher no I'm trying to think of an idea for the semester project I'm gonna be doing
Ah. I misunderstood. I had a long essay typed up about my experience as a tutor, helping a student work through picking their own app.
Looool
indeed
Well I got 2 ideas working in my brain rn
One turns out it already exists called "parachute" or smth. Basically as soon as you open the app it will start recording video from front and back camera, and streams it off to either a cloud or self hosted off-site server using webrtc or smth else. For emergency purposes or anything like that.
2nd is much more silly, an app that maps out (the university) an area and shows "hazards" in the stalls of nearby bathrooms, such as unflushed shit or piss or smth.
It's a real problem i my dorm, jesus,, maybe it'll be able to shame the school into making ppl fuckin flush
Idk what could be a more petty way of trying to convince ppl to fuckin flush like making an app where you can report bathrooms as too stinky for use
So, if you're trying to come up with ideas, brain storming is a fairly well documented process. (with some disagreements on exactly which way is best)
What I do is I start by listing out all the possible ideas I have, then using my gut feeling to dig deeper into the things I feel strongly about.
"Digging deeper" means I look for three things, in increasing order of complexity:
- Am I really interested in doing the work to make this happen, or did it only have the staying power of a tiktok video? This means figuring out how much I actually care about the idea.
- Is this idea a "good" idea? This means doing some simple validations on the idea to make sure I actually know what my plans will be. If I can't come up with a basic blueprint for how the app will work, then the idea gets thrown out.
- Can I realistically finish the idea in a reasonable amount of time? This means looking at specific details, like what libraries I'll use, and probably doing some UI mockups to make sure I have a general goal to start working towards.
In your case, think about if you really have the emotional energy to spend months writing an app about "hazards". Is that something you'll be happy with in a few years?
And can you really sustain a high level of energy with frustration alone?
Lol well it certainly wouldn't be going on a resume but it would definitely be a fun petty projext
1st one is the actual decent idea, unfortunately it exists with more features than I had thought of. Although obviously that doesn't bar me from making the project anyways
I'm not here to tell you how much your pettyness can give you energy, but it's definitely a question that needs answered. For me, I can't sustain development on something petty. My anger subsides after a short time, so I can' rely on anger to fuel my work.
Unfortunately, student projects aren't supposed to be professional products. If it's an idea that's good enough to make a real app out of, then some company probably already has a team of professional developers working on it.
Fact
So, if you like the first idea, then ask yourself question #2. Do you have the skills to write that app in a few months?
Related: What is the list of features you want the app to have?
Yea prob, it's just basically some UI and basic phone system api stuff. And then figuring out webrtc.
I gave specific features some thought at work some days, don't have the list on me but basically automatic recording and streaming of both cameras, optional retrieval from the remote server. GPS location tagging. Not much else to it really
Which also gives it a bad vibe, it's pretty simple on the surface, I don't know if they are looking for extensive feature lists
Although also it should be said that if I made the remote servers self hosted, it would be a superior app to "parachute" Since that is a paid service with limited functionality
Estimating software projects is always difficult. Self-hosted servers to handle video footage while building an app is definitely outside of what you can do in a single semester.
Honestly, I can sit here and try to educate you on how surprisingly difficult it would be to build the basic version of the app you want, but I think it's better to let you have a personal lesson on how hard it is to estimate software projects.
This is your first project, right?
Not first in general, but first mobile project
Take any estimates and triple them.
I looked into what it takes to stream video p2p, doesn't seem too difficult rly, there's libraries for the client end and the "mediator" server or w/e it's called to negotiate bitrates and stuff is pretty available open src as well
If you still think you have tons of time left to finish all your features, sit down and properly stub out all the functions you'll need to make the project trivial (type definitions, pre and post conditions, etc). You'll start realizing that things get more complicated than you first realized.
Well anyways yea just my current best idea, anything else so far seems incredibly boring or anything else
Mobile is a terrible platform
Yup
Rn i do embedded stuff where the screens are less than 30x30 characters, legit more fun than developing all the fancy ass stuff for mobile
Wait, you already do professional work?
Internship
Ah
But they kinda threw me onto a team right away, some meaningful experience there
Being on a team is really good experience
But yea no I do think I could get it functioning in a semester. But it's also definitely true that if I choose something technically easier, I will have way more opportunities to make it as polished and tested as possible
The problem is thinking of a simpler But as engaging idea
I dunno. If you already have enough skills to be hired to start working, then you can expand the scope beyond what I'd recommend a freshman should work on. While I suggest that you scope things to keep them small, pretty much every one of the projects I did for school I went completely above and beyond what most other people were doing. When everyone else was assigned to create a non-interactable slide show, I created a functional game. If you think you can work on something big, then try it out. Worst case is you do badly on that one assignment, or work crazy crunch to get it done.
I have had the opposite experience, sure I worked at one terrible place but I have had great PTO and solid pay here in US. This year I’m at something like 6 weeks already off.
I think it’s just finding a good company, just sucks it’s hard to find that out during interviews sometimes. I usually try to feel out the engineers in technicals for that kind of info instead of recruiting or HR who lie / say anything lol
This. Its always a good sign when the interviews turn into psuedo-development talks, and the whole "hiring" thing gets forgotten for a bit
Anyone here try digital nomad life? I have been thinking about it. Just sell the house and travel for a year or more working wherever I am at the time. 🤔
Wanna try that since kind of a remote job
Can’t travel because job. Why not combine them and do my job while traveling. Just need a decent internet
gotta get one of those vans that you can put a bed in and then some satellite wifi and screens and stuff
Too cumbersome really
You need go travel light, probs a laptop and a nintendo switch.
Then check in to hotels or something
Having a van limits you to land travel
depends on the van
The vans available in my area cant fly
Yeah just need to look ahead for places with good enough cell coverage for hotspot or Wi-Fi I think
You could prob do like a van or small travel trailer for “home” which is mobile, being US that gives me NA. Then when you want to go overseas you just park it at a friends place and hop a plane. 🤔
with starlink now it's not as hard
only a few areas with little/no coverage in NA https://www.starlink.com/map?source=rv
kinda, my css is rusty but i can take a look
"4 hours" is the only correct guess software developers can do. Less or more than that, and you are most likely off
kinda optimistic, arent we
no matter what new agile methodology we create, we still can't estimate porjects
maybe it's the curse of our field, forever not knowing the correct timeframe
Even if you could estimate a project, those that want your estimation often doubt that it takes that long. Surely, it must be faster, it's only software, right?
That reminds me of a project where my optimistic estimate of 14 months was downplayed as "unnecessary". "You just need the to implement the bare minimums". Yeah, and those 14 months contain all the overhead and the necessary synchronisation points between team members, as well as their maximum time they may spent on the project. We were told to do it in 3 months. I told them that's not possible. They told us to cut stuff to make it possible, and I told them that the 14 months are required for the bare minimum (the project had some safety requirements).
When I hear only the bare minimum I get mad because I want every line of code to go further beyond
The main issue is: there's no end to refactoring, all part of code can be improve including the improvement you do
So yeh, if you have infinite budget, I'll make that further beyond code 
I'm the kind of guy to work off the clock for that but I also understand it's not a good habit for business
Yehhh this is mostly why agile has taken off, if the client have the budget, go for it 😛
Oh yeah it doesn't matter what job it is or whether or not I'm on the clock or not I've got bits and bytes in my heart lol
Yeah I take a mixed approach to off the clock work, I feel like so many in the industry fall into the it’s expected or do real tickets off clock to get done in time or you have the other end where it’s no one can work off the clock and they make a huge deal about that.
I think working off the clock should never be expected or budgeted into planning for a company, but for those of us who love to code working off the clock on things we enjoy is fine todo. It just should never be expected of anyone.
I typically work on fun stuff or trying todo something new and interesting, I never do “ticket” kind of work. Haha
What would you do if your internet went out and you're not even 50% done programming a tech demo for a video game that's very ambitious and it's due in like a day or two
if you are already pull everything you needed already, you will still be late with 50% of the job left 
Let's make it interesting let's say in the same situation you're also full stack and debug man
if you include the power of god and anime, you good 
Lmfao anything that has safety or other certifications can't be done in 3 months
That's wack anyone would think u can like quarter an estimate lmao
pull dependencies -> makes a coffee -> comes back to pc -> *5% done * 
so if i ask you to do Red Dead: Redemption 2 in 3 months with 2 dev, you'd be able to? 
*edit: if i missunderstood that: if i ask you to add lorem ipsum into a div, it would always take you more than 3 months? *
Well, money was running out, and the SW was already overdue. But yeah, sure, let's have the SW team that's currently helping the HW guys debugging their faulty boards (which have very well not at all documented FPGAs with arcane interfaces) just lift the anchor, because obviously it can get done faster
"Safety" as in "safety for human life and mission critical equipment" aka "Disaster prevention safety". That needs a lot of documents and specially crafted code, if it's part of the requirement. E.g. MISRA-C, JSF.
If RD:R crashes or glitches, well, that's funny. If an airplane controller crashes or glitches? Well... that's possible a lot of lives lost.
Oh my point was more: your estimate can make sense, it always depend on the work and the technical debt 😛
its estimated time * 4 = minimum
30 mins? seeu in 2 hrs
Anyone down to reinvent the captcha
The ultimate battle human and machine
Above all else it takes more processing power to play a demanding mini game than word networking in my opinion
But damn finding that yin and yang of accessibility is crazy
Recaptcha v3 seems to be the industry standard now
Get ready bots we're coming in hot with deez-nutcha the Google killer
Complex captcha with trust is common today, for example check out the Google captcha. It uses harder to solve images and such, but tries to skip it when it has a high enough trust in the client. So it keeps the burden lower for most of your users. Not perfect but kinda works haha
the best captcha is the one that interacts less with the user
I'm pretty damn sure we're at the point where robots are better at image clarification capt has than humans
Friendly reminder that discord DOES sell ur info (yt recommendation)
Of course they do….
It's in the name
u see dis cord? its for your data
The best part about this is that we can literally check back and see how accurate this estimate is. For someone who hasn't done app development before, I'd be interested in how long it takes him to set up his development environment, learn about all the relevant libraries, bootstrap a project, set up all the functionality of the app, handle permission management, and then deploy and test the app on a phone. You can test your four hour estimate, and I can test the idea that whatever a rookie's estimate is, it's likely very wrong.
Thus why so many engineers often over-inflate their estimates, to counteract the urge management has to try and magically make things faster. If you multiply your estimates by pi, (roughly three) then management shaves 30% off your estimate, then your estimate is probably only going to be half the actual time it takes.
people dont realize how exhausting software can be because its not physical activity (except for when you actually burn calories from typing so much)
putting in 100% brain effort for hours, making sure code is safe, tested, and efficient... then re-calibrating every hour to make sure you actually understand the code you wrote for future reference
and then you have the issue of debugging the code whenever it doesn't work as intended, taking even more brain power depending how far into your day you are
That reminds me: First time to compile at the new job? 2 days. For every new dev. So many arcane settings that only some people knew, so many things that you usually only do once in a Dev machine. I was lucky to tell them that I want to document that sh*t, because I'm cursed and I will break my machine at some point. The documentation managed to cut the time-till-first-compile to 4h (ha!) on average. My personal best is currently 2h (yeah, we had to reset my machine. Told them!)
Lmao on boarding is the fucking worst
Lmao
streaming video at scale is not easy at all
this
There wouldnt rly be any scale to it
Not to evangelize my employer and their products, but using codespaces really helps cut that time down drastically
Over the past months, we’ve left our macOS model behind and moved to Codespaces for the majority of GitHub.com development.
Man at first I thought this was some custom Linux distro
didn’t realize it was just a cloud service. So y’all will still be on macs, just not pulling/compiling locally?
Interesting, but not compatible to our tech stack. Also not available on-premise, I presume?
Someone said to not use system python with tensor flow, what's the correct way to install it?
I avoid Python as much as possible, that means nothing to me.
I just used DDG.
Does Ubuntu not have python now? python isn't working and apt install python didn't find the package.
Oh yeah, they renamed it.
AHHHHHHHHH
Virtual environment. That keeps your system packages alone.
Ubuntu sucks.
user error...
They didn't. python was python2. python3 is not symlinked to python by default, because there are some breaking changes and different semantics. If you want to have python act as python3, then install python-is-python3.
I'm pretty sure python is python 3 by default.
I'll check on my main machine when I get home.
On Arch Linux it is a symlink:
[julemand101@beta ~]$ which python
/usr/bin/python
[julemand101@beta ~]$ ls -ls /usr/bin/python
0 lrwxrwxrwx 1 root root 7 Aug 3 19:39 /usr/bin/python -> python3
# Why are these not done by default...
ln -s python3 "${pkgdir}"/usr/bin/python
ln -s python3-config "${pkgdir}"/usr/bin/python-config
ln -s idle3 "${pkgdir}"/usr/bin/idle
ln -s pydoc3 "${pkgdir}"/usr/bin/pydoc
ln -s python${_pybasever}.1 "${pkgdir}"/usr/share/man/man1/python.1
It is not default. It is a modification Arch Linux have made in the packaging for Arch Linux.
It might be some other distributions are doing the same thing. But it is not coming from upstream
So Python has weird defaults...
Glad that I don't need to change my opinion about the Python project. It was a close call 😛
The toolchain and language are painful.
Hrm, I'm forbidden from downloading a part of CUDA.
This is the link the Nvidia website gave me.
Forgot that discord doesn't support embedded links?
Yeah, the dev work happens in the cloud on linux via Codespaces.
I'm def not the right person to ask, but our docs says rn it is only available for GitHub Teams, GitHub Enterprise Cloud, and private beta for individuals.
I don't use discord enough to know that. I thought it supported markdown? but apparently not 🙃
A subset.
I think embedded links don't work on purpose
phising
Basically only the basic formatting stuff like italic, bold, strikethough, underline and code.
ahhh
and code
Yeah, no chance. That would leak source code from within the company to GitHub (which is why most of my employers use an on-premise GitLab installation).
And ||spoilers!||
GitHub has an on premise solution for a lot of our products! But I won't get into GitHub v GitLab convos rn 💀
public final class Hello {
public static void main(String[] args) {
System.out.println("Hello world!");
Stream.of(args).forEach(System.out::println);
}
}
Though these only occasionally work on mobile.
Whaaaaaaaaaaaaaaaaaat? But I just had sharpened my pitchfork and added new tar to my torch. 😦
So I suppose no one has a solution to the forbidden issue?
This. Nvidia isn't allowing me to download some software.
Well, where did you get the link to the "forbidden" software?
It's called GitHub Enterprise Server 😄
can you wget / curl it from a computer or is this issue on the phone?
It's an issue on a computer.
There are several typos in that URL.
what's that link
I copied it.
(for copy pasta)
Where did you get the URL from? https://developer.nvidia.com/cuda-downloads?
That requires a login.
And then you probably also need authentication during the download, so your wget is missing the session cookie.
Oh hey, TF has Java support. That's dope.
What's the current opinion on the least painful tooling to create a relatively simple Android app? UI layout has consistently been the bane of my existence when dealing with Android, web etc. Apps and my initial experience with new projects in Android Studio has been that it's a headache to find the right UI elements
"Suck it up and figure out Android Studio" is a valid response though I feel like I'm missing a trick
The trick is you have to suck it up and learn
I like Xamarin/MAUI
Xamarin/dotnet MAUI or suck it up, eh?
I guess there's no harm in trying it - I'll have a crack and see how I go with MS tooling
I am running wordpress on my ubuntu VM on Azure and using nginx as a proxy, however when using my wordpress sometimes it says "domain" refused to connect with this error (screenshot) in the console, anyone got any ideas ?
hmmm If you only focus on android, Android studio is good bet. If you plan to make it Iphone and Android usable, React Native is a good one too (you'll need either expo to test on a real phone or a phone sdk which android studio will help you download)
you are probably sending the same header from both web app and nginx
check your nginx configuration, or remove the original header if you want to force the one you have set in nginx
i don't actually particularly like it as a user, but if you just need a quick and dirty android app and don't care about performance, react native is fine and pretty quick to set up
I've never used React before, React Native could be also worth attention. It's been on the todo list but my web app experience was largely trying to unfuck a particularly poorly made vuejs application which unfortunately could not be rewritten in whatever spare time there was in the year or so until I quit, the equally fucked nodejs backend got most of my time. Could also be worth a shot.
I don't love js but it's definitely an option if I can get something together quickly
Portability is always a lure but not strictly necessary at this time - The goal here for me is more "toys for me and if I learn stuff that's neat" than "the next facebook" and the best part of not having users is that I don't need to care what devices they have :)
But that's two things to play with and see if they serve me, though I'm fine enough with Java/Kotlin and it's mostly the UI stuff that annoys me. Gaining low-effort crossplatform at the same times as avoiding Android's stuff would be a plus though... we'll see. Thanks for the input.
It's worth checking out Jetpack Compose, It's Google's answer to Apple's SwiftUI & react: https://developer.android.com/jetpack/compose/tutorial
The dev tools in android studio cut down on UI iteration time, particularly the component preview feature
Thanks a bunch! That was it!
yehhh lets say, if you've never use react, it might be a learning curve for that. If you don't plan on making it iphone compatible or a web version of it, native is overkilled, so staying with what you know is a good idea. If type safety is the main drawback, there's a typescipt version for react and react-native 😛
Anyone working in the game industry? Would like to learn more on how game studio works on new games.
where should i go to learn to code?
at the right time
Esp32 based eink home assistant remote I'm working on. Going to put a resistive touchscreen layer on it when it gets here for input.
Not sure if that really counts as development, but I need help with excel power query. Would anyone here have some experience with it ?
No
I mean I think that counts as development but I don't know what the fuck a power query is lmaoo
imagine querying, now do it with power
There is a reference for all who want to know some about it. It looks like a GUI Microsoft way of doing a SQL command in excel.
Are there any good strategies of matching these images? They are not 100% identical
at least a way to figure out which image is the closest in some fashion maybe
@peak acorn Perceptual image hashing, theres a variety of ways to do it
Is there an easy way I could get firefox to automatically download all images from the network tab on the devtools to a folder?
I dont wanna right click save as all of these
it wasnt that many i ended up doing it anyways
I want to program my Arduino Uno and a servo....I want to have 3 LEDs turn on after each press and off together after the 4th press..also I a servo will rotate 360 after each press. How should I proceed with this in the ide..
I'm pretty new to Arduino and the only thing I've ever programed is a timed servo motor rotation.
Why is python PIL/PILLOW sometimes making getpixel() return a number and not a tuple
i am so confused, google is showing up with nothin
Ok thats weird, I just took the image into paint.net, saved and re-ran my program, and the images that had the issue are gone
PIL must not work with some specific formatting or w/e
php not working on IIS 11 (Server 2022) when i connect via the ip or domain root, but when im connected via localhost it works - getting 500 error
Ok
ok
Hello
I have created a website using wordpress and I have almost created everything.
It is a website to support the stray animals. I want to add a UPI donate option to support them. Can I know how to add a donate button for a static website without using PayPal donate button.
Thats not a static
It's kind of a blog type including the nearest vets available for them
urgh.... processing json in C++ suuuuuuucks
Surely theres a library that can help you
I use nlohmann::json
I love python for this very reason
C++ in arduino, so, needs to be ultra-light-weight, a generic off-github library not designed for embedded platforms, isnt going to work
Makes me think why would use json in arduino
hi, i'm trying to do some web scraping for this"https://ulasim.sivas.bel.tr/akillidurak/sivasyazilim.aspx?ID=546"
i need the <tbody> tag but it comes out empty when i request it with python
document.querySelector("#burayayaz > tr:nth-child(1) > td:nth-child(3)") this is the js path of what i'm trying to get
and i'm really lost here, if i'm not making any sense please tell me so i can fix myself
Aint on my pc so i can only give advise.
Try using the id only then it work down from there
Basically document.querySelector(“#burayayaz”)
If it returns something then add the next part then check again
makes sense, thank you
because im using platformio with the arduino framework to build a firmwaree for esp32 that uses wifi, that i want to be able to post some structured data to, to get the esp32 to do stuff, but the structured data comes from an external web ui
so json makes the most sense
I believe (didnt notice)document.querySelector wants a CSS Selector
how are you requesting it with python and how are you trying to access the element's data?
im using requests and basically for now im getting all the data and just manually checking if the tag is still empty
`with open(f'blah blah', "w") as info:
x = requests.get('https://ulasim.sivas.bel.tr/akillidurak/sivasyazilim.aspx?ID=546', headers = headers)
info.write(x.text)`
this is my code for is
The data in the table is grabbed from another URL on the site https://ulasim.sivas.bel.tr/bilgi/tablomuzekran, managed to grab it using ```py
import requests
import json
Session cookie required to grab the data (not sure how long this lasts or how to get it using only requests)
cookies = {
'ASP.NET_SessionId': 'y1unq4linawmnbelrrjoqnsf',
}
headers = {
"User-Agent": "User agent here"
}
Returns JSON Data
response = requests.post('https://ulasim.sivas.bel.tr/bilgi/tablomuzekran', cookies=cookies, headers=headers)
jsonData = json.loads(response.text)
print(jsonData["plk_"]) # "plk_" / "hk_" / "ha_" / "yazilacak_" / "renk_"```
you did it, wow
how did you find the right session cookie?
Well the request to the url didn't work initially, so I assumed there was something that separated the raw request to the url from the request made by the original page so I made the request with all the headers used by the browser. Removed every header little by little until the request stopped working and was left with the cookie.
The original page makes the session cookie, I assume its somewhere in the javascript but idk. im not able to generate the cookie using a requests.Session'd request to the original url so probably in the javascript.
@silk eagle thank you very much, you really helped me a lot
Taking the top image and running those perceptual hash comparisons against the bottoms, somehow it picks the option on the right as more similar
Could it be like a centering issue or scaling issue or something maybe?
@peak acorn what algorithm are you using for the perceptual hash?
https://pypi.org/project/ImageHash/
whash/wavelet hashing
No idea if its the right choice
just googled around and picked one, maybe i should try some of the other options they have
@peak acorn if you have purely black and white images, ahash might work better for you
Something else I've had success with is dividing the image into a grid of blocks, and doing comparisons between corresponding blocks. Gives you a block by block matching, and then you can figure out how to combine the scores after
Also gives it a psuedo-crop resistance, since you are sub dividing it.
The only downside is an increase in image processing time potentially, especially if you're doing it with python
Auto tools or cmake for a small project that should stay small with 5 or so dependencies.
Not if the blocks are oercentage based, rather than a hard coded pixel counta
Would this be the chat to ask about arduinos?
Yes
Yes
Yes
Just lost a years worth of postgres data, ~500k rows
y i k e s
All on a microSD card from a raspPi, whose root partition is invisible to every OS
Sorry but storing all of your data only on an sd card. . .
128gb card, appears as a 32MB drive with one 20MB partition, doesn’t boot in the Pi anymore 
Yeahhh setting up rolling backups was very next thing on my todo list
I was getting the schema/config right before setting up backups
definitely asked for it
Doing work for only like a month on SD cards, they are so fragile
i know how to do it, but it def is possible
I just googled it and it looks like you can set up special hooks that will cause URL's to be loaded with the repo or something after being pushed to
okay i got distcc working but i have to set my CC/CXX variables to gcc/g++ for it to work, is there a way to add a link to gcc/g++ on the worker side?
a combination of SSH token and webhooks is what you need
Lets say i want to build streaming service that i control.
Like floatplane. How should you build a platform. Hosting, Hardware, code and other stuff.
That would be hard
If you’re asking a discord those types of questions, you are not even close to being able to build a streaming platform
start with something way more simple, and/or start with higher education 😛 (college/university)
also doing a project like that solo probably isn't gonna amount to much - so definitely do look into this based off of what you expect to achieve
not yet anyway 
but for hosting video files I like to use Bunny, it's very decent.
is a good start at least
for hardware, random web hosting provider's hardware.
now if u wanna do everything inhouse and the right way i have no advice
yeah you don't want to worry about hardware
unless everything in house, but then I would think you would have a seperate infastructure team, and then dev team
dev team doesn't think about hardware, they just deploy via containers or whatever
and in that scenario those ppl should know how to do things
it's cheaper to use an existing cloud platform usually
than try to do better yourself
they have the luxury of mega redundancy and sharknado protection
Level-up on the software skills most in-demand at QCon San Francisco Software Development Conference on Oct 24-28, 2022.
Uncover emerging software trends and practices to solve your complex engineering challenges, without the product pitches.
QCon San Francisco brings together the world's most innovative senior software engineers, architects an...
reminds me of this
netflix came up with chaos engineering I think
i watch videos like that and i impostor syndrome real hard im having a mental breakdown gonna go stress eat brb
yeah most of the time that level of complexity is not needed
My coworker has written two successful books and given several convention speeches like that about Android development. He says he STILL has imposter syndrome. You're not alone.
wtf is dat
its this https://www.javatpoint.com/automata-chomsky-hierarchy and as someone without a cs degree its gibberish to me
Oh yeah I never did that grammer and programming language shit
it doesnt matter what education i have. if i have a plan its better to start it early than late. im asking and i know what anwser u agve me
experience/education kinda matters
i dont think university is strictly necessary for any software development, a lot of it wont even really be applicable to what you end up doing, but it provides a really nice structure for learning that can help a lot of people who aren't already experienced in the topic.
yeah, traditional education isn't needed, but you can't go head first into learning development with a complicated project
^ start small, learn the fundamentals, then learn/figure out what you need to learn and then learn that
Im asking to know where to head
im biased toward python so ill say python, its easy to jump into starting off
But basically ur saying u dont know so go to school. Rather than helping a bit.
Python for backend likely
watch some python tutorials for random stuff, maybe just a python course on youtube. then learn the specifics of whatever you wanna work toward (even if it means using a different programming language)
Not "school" specifically, just being educated on the nuances of platform development. That could be youtube tutorials or a computer science degree
Your initial questions were extremely broad
They were not things that could be answered briefly in a discord chat
Does it matter?
Im asking a question. And expecting anwser
😐
Yes, it matters
it can't be answered easily
a streaming platform is a big complicated project
Absolutely massive project
we can give u pieces of the answer which can help u figure out the rest of the answer
Well i still stand by that saying "education" as anwser is bad.
No, you just misunderstood it
Higher education????
they mean educate yourself on what it takes to create a streaming platform then learn what u need to learn
or higher education
Pretty sure it means go to school
Yeah. But i need guiding. Not jokes
Ok
Your guidance is to start smaller, start with something way simpler.
i love not needing to know regex
No. My hyper fixation for that is not ok..... I need big plans
Then pay a software architect to plan it for you
ok, you want a streaming platform. start with "how to make a python webserver" or "ruby on rails tutorial" or whatever idk.
This stubbornness is not gonna bode well for you here
Have you even hosted a website before?
is ruby on rails still the thing people learn
Sometimes lol
No. But im studying IT so.... At some point i will figure it out.
It wasn’t a joke. Building a steaming platform like Floatplane isn’t easy. Besides I’m not sure how many people in this discord even would be the right people to ask for guidance on it…
It probably takes multiple people to answer different parts of it… so in practice to make a successful (or worthwhile) solution, you kinda need a team…
what alternatives to ruby on rails are used
You are years away from starting a project like this
Higher education gives you a good foundation to continue off of. It will teach you a bit about essentially everything you need to know to get started (probably)
Well i need guidance. Not a whole code guide. Basically seeing what needed
Well school teaches only the essentials. Thats the problem. Why waste time in school when u can learn it from someone else
the essentials are essentials
You're pulling a dunning kruger and assuming this is straighforward enough for someone to give you a brief overview of what you need to setup/learn.
learn them first then youll know the next path to take in your project
That sounded like most dum thing i ever said. But i mean essential are easy to learn by ur self
you can learn them from university or from anywhere else, but u need to learn them first
Well python webserver is good start
You need infrastructure. Hosting with the needed bandwidth to sustain the traffic. A service that can serve video in the browser (probably libraries that already helps you with this already), then a fair bit of experience with general web development. Then lastly you’ll probably want to tweak and optimise whatever player you end up using, which I reckon is one of the harder parts. Then hosting and running this, as well as covering all of the expenses it involves (depending on the scale of the project and the amount of traffic) is gonna be one of the real culprits I guess
then, you look into what u need after that, you have to figure it out along the way because each scenario is different
Don't forget about auth
Because it teaches good principals, unlike just winging it on your own… you’ll actually learn how to learn, and in a structured setting. You won’t learn what you think you need, you’ll learn what someone else has already figured out you probably need
Yeah, I pretty much dumbed it down to bare minimum - besides I’m personally not capable of building such a service at the moment either 
the people who dont need university for software development are usually the people who have been doing it for a while
Well im still young
Very easy to overlook or build bad habits without someone to correct you
but u know, me personally, i could probably duct tape together a streaming platform in a couple weeks 😏

Like hella young.
Like not even adult young....
Better start now than when i cant learn as much
Explains the stubbornness
I’ve been doing it on and off on a hobby basis for about 10 years, and professionally for about 4 years (stopped professionally recently). And man can I say it’s a bumpy ride… starting off with uni or something would given me a huge boost in getting started, and I would also have better principals, better habits etc, now I need to learn terms, habits (and unlearn bad habits), etc etc

then learn the essentials bro, pick a language like PYTHON <-- or the other ones, get proficient at it, then advance as you go
Like I said; start with something more simple… like try to build your own forum software or something instead… then in doing that you have the foundation already to build your streaming service off of - or at least (hopefully) valuable experience
Years from now you're gonna look back and facepalm at the memory that you thought you could tackle this type of project
yeah specific terms are my downfall usually, but i have no fear of asking for explanations from people who are better than me
thats the secret
I wouldn’t personally recommend Python for web though, but that’s not to say it’s necessarily a bad pick - however I would probably recommend like NodeJS, .NET, or Java/Kotlin (JVM)
well heres the thing, u can just use a cdn for video cant u bro
Ok. And if i laugh at u in few years remembering how u said i could never do it it will be also nice
Nobody says you can never do it - we tell you that it’s unrealistic to have that as one of your first ever projects 😛
Sure bud
Precisely this
I miss being this naive, life was so simple
They will probably see this as an insult though 🙈 but it isn’t really an insult
I miss not being 18 soon. It was easy to play Minecraft on ps3 and just have fun.
bunny's cdn lets u create & manage storage zones/folders w/ api calls (say, for a specific user's videos), get a link to video content, thumbnail, preview clips, i bet u could just slap an auth up front be like yo ur authorized aight bro u can manage the videos in ur assigned zone