#development

1 messages · Page 2 of 1

hexed mountain
#

change your find command into "echo find ...." and see what it shows

#

Also, your command is not complete (there needs to be a path) so please post the full command

deft sigil
#

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

bleak dew
hexed mountain
#

$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

bleak dew
#

calling "which find" from the script give this output /usr/bin/find

hexed mountain
#

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 ?

bleak dew
#

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

hexed mountain
#

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

bleak dew
#

found the problem

hexed mountain
#

$./xx.sh
find: unknown predicate `-mtime 7'

#

lol looks like you are right, I can reproduce by adding ""

bleak dew
#

thats weird. looks like the quotes add some weird BOM or invisible characters or some weird logic. dunno

hexed mountain
#

agreed, that is weird, not sure what causes that

sly marten
#

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

deft sigil
#

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 😄

grizzled steeple
#

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...

deft sigil
#

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 🙂

deft sigil
# grizzled steeple For Simple graphics and logos, you should be using SVGs. Dunno why there are sti...

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

grizzled steeple
#

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

deft sigil
#

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)

rancid nimbus
#

What font is that?

nocturne galleon
#

sick rider wide

#

at least thats what the filename is

sly marten
deft sigil
rancid nimbus
#

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.

deft sigil
#

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)

peak acorn
#

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?

arctic tusk
spark temple
spark temple
near sail
#

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

nocturne galleon
#

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...

livid bison
# near sail Hi there! I'm curious if there are topics that are preventing any new coders her...

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.

peak acorn
#

Thinking of projects is still a huge issue for me 😢

hollow basalt
silk eagle
#

this is how that's going

sage vector
#

Know the feeling and then after a year, the answer just get randomly accepted

silk eagle
#

I like not saying a post is a duplicate and then rewording the answer to the question that its a duplicate of

sly marten
peak acorn
#

Yeah never wanna do that

#

Very hard to just "go code some large sw project"

sly marten
nocturne galleon
#

yeah those are good because they can be super incremental

#

you just keep adding shit and you get that quick feedback

peak acorn
#

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

sly marten
#

yeah, good place to start if you want to learn some programming

nocturne galleon
#

I am-
what

peak acorn
#

Ugly code

#

That instantiation pattern is so yucky to read

nocturne galleon
#

well.... it works, I guess?

hot sky
#

I am new to coding but want to learn it, anyone got an idea on where I should start?

nocturne galleon
#

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

silk eagle
#

Python is good for learning the logic and if you learn C++ its good for learning the inner workings of the universe

nocturne galleon
#

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

silk eagle
#

exactly, c++ is the deep end though compared to python imo though

floral adder
#

hi

nocturne galleon
#

i started with python and it was really weird

floral adder
#

im in 5th grade and im doing pythoon 😂

nocturne galleon
#

it was really hard to learn wtf a pointer/ref was because all i'd ever had to think about was python shit

floral adder
#

*python

nocturne galleon
#

tos

silk eagle
#

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

nocturne galleon
#

oh yeah c# is a pretty solid start as well

silk eagle
#

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

nocturne galleon
#

lol

#

i flashed a generic uefi bios on mine so i can just straight up install linux

#

the mrchromebox coreboot

silk eagle
#

I was definitely not advanced enough for that back then lol

nocturne galleon
#

i didnt have to do any hardmodding

#

was all software

#

but some chromebooks are different though

rancid nimbus
#

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.

peak acorn
#

Don't bother learning modern assembly

rose pulsar
#

1 bot that does 10000 things

nocturne galleon
#

oh god the amount of unsafe{} segments that must be required to do that

nocturne galleon
#

actually so true though C is so good but I wouldnt do it self taught

#

you are likely to develop some really terrible habits

rose pulsar
#

c is a bit strange

lament bridge
#

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?

cloud knot
sly marten
lament bridge
#

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.

next cipher
#

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

cosmic turtle
next cipher
#

how does that have anything to do with how array.map works

rancid nimbus
#

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.

deft sigil
#

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?...

▶ Play video
spring cradle
#

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

peak acorn
#

Just traditional multi-player networking but over local network I guess

spring cradle
#

its turn based, might just use http for transport

nocturne galleon
#

hello nixnest user

#

honestly http seemed fine

wind horizon
#

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.

midnight wind
#

Sockets?

nocturne galleon
#

I made code a year ago that's half html and half node.js can I get it separated

hollow basalt
#

import express
function (){
return <html>
}

nocturne galleon
hollow basalt
#

Code

nocturne galleon
#

Ok

#

Can you separate my strange code combo

nocturne galleon
#

Its node.js and html

hollow basalt
#

Congrats

nocturne galleon
#

Here

midnight wind
#

separate your html, css, and client js

nocturne galleon
#

Idk how lol

hollow basalt
#

Whaf is that monstrosity

midnight wind
#

template engines

nocturne galleon
#

I made a website

hollow basalt
#

No thats horrible engine

midnight wind
nocturne galleon
#

That should be just html

nocturne galleon
hollow basalt
#

Its not about whaf it does

#

Its about what the hell is that code

nocturne galleon
#

I needed to use html but my host only used node.js

midnight wind
#

you can use cloudflare workers + pages to host for free

nocturne galleon
#

Can I get a link

#

Also can you fix something with the separated html

midnight wind
nocturne galleon
#

@midnight wind can you help me find were a picture is

#

In my code

midnight wind
#

sorry no

#

I can't do everything for you

nocturne galleon
#

I'm editing this on mobile lol

hollow basalt
livid bison
#

Got through first round of AWS coding challenge chad

sly marten
#

why do people love React so hard? it's a complete mess from what I've experienced pepeSad

wind horizon
#

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.

sly marten
#

but at the same time it also doesn't help with the 349283042342 combinations of sub-libraries & frameworks within React 😮

sly marten
#

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)

lament bridge
#

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?

sly marten
#

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

lament bridge
#

😦

lament bridge
eternal scarab
sly marten
#

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

eternal scarab
sly marten
restive ore
#

I can hear my uni teachers screaming in panic searching for what to use to host student projects

regal heath
#

what do you recommend for cross-platfrom development? I want to port my UWP app to other platfroms

wind horizon
shadow hawk
nocturne galleon
#

hmmm, in a gradle plugin how could i get the current NativePlatform?

next cipher
#

there are legitimate complaints about react but lack of documentation/clear errors is not one I've ever heard from any professional

sly marten
sly marten
#

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 eek 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 😅

next cipher
#

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

sly marten
#

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 😂

wind horizon
# sly marten anyway! anyone have any tips or recommendations for me when diving into React? ...

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.

sly marten
#

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? thinkThink if so, what reason(s)?

rich storm
#

Go vue wacha mean react or angular?

peak acorn
#

My favorite framework is
''.join([random.choice(string.ascii_letters) for x in range(randint(1,10))]) + '.js'

#

(Js is bad)

rich storm
peak acorn
#

I don't do web at all 😈

rich storm
#

Then don't say js is bad lmao

peak acorn
#

It is

#

Python bad too which is what that stuff above is

rich storm
#

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 >.<

leaden zodiac
#

i’m a professional React dev, let me know if you need help with anything

leaden zodiac
leaden zodiac
#

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

full socket
#

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

hollow basalt
#

How it is

rancid nimbus
#

Is that what is next?

errant nimbus
#

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

rancid nimbus
#

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

wind horizon
# sly marten would you say there is any reason for me to go with React over Angular? <:thinkT...

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.

errant nimbus
#

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

rancid nimbus
#

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

full socket
hollow basalt
lament bridge
sly marten
# wind horizon If you like Angular keep up with it, personally I prefer React syntax a lot and ...

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

lament bridge
#

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} />
sly marten
# sly marten Yeah, in this case my project is to build a new ticket management system for my ...

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 🤔

sly marten
# lament bridge Hi. I am trying to make a filter, but I can't get around it. I simply want to g...

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

lament bridge
#

I am personally don't think the code itself would work this way, it seems the issue is with the data itself

sly marten
nocturne galleon
#

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

lament bridge
#

@sly marten Don't bother, thank you, I managed to solve it

nocturne galleon
#

i got it to work using isRowExpandable and a HEAD request, it's kinda wasteful but proobably fine

lament bridge
#

I can't figure out how to set a default state :S

wind horizon
# lament bridge I am personally don't think the code itself would work this way, it seems the is...

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.

wind horizon
lament bridge
#

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.

wind horizon
# nocturne galleon hello! i'm currently doing something with react-admin, basically my current stru...

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) }

wind horizon
#

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

wind horizon
lament bridge
#

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;
wind horizon
#

I have to run out, but I'll be back in 15-20mins and take a look / help you out. 👍

lament bridge
#

Thank you so much.

wind horizon
#

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. 👍

lament bridge
#

Sure

wind horizon
lament bridge
#

what is useMemo?

wind horizon
#

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.

lament bridge
#

Ocuh, I really need to rewrite things then

wind horizon
#

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.

lament bridge
#

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.

wind horizon
#

You can think of the hooks kind of like this:

  • useState: Data that when changed should trigger renders and needs to be updated over time
  • useReducer: 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 optimization
  • useEffect: 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 a ref you 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.

wind horizon
# lament bridge How does it know when its needs a new fetch tho? I assume, normally, I would cac...

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.

lament bridge
#

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?

wind horizon
#

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.

lament bridge
#

It's basically a little app we use to track customer issues, feedbacks and see if they are under any risk.

wind horizon
#

If you want some styled tables and such without all the work you can use a component library. Like antd, material, blueprintjs, etc.

lament bridge
#

The API is NodeJS based and fetching data from SQL.

#

Oh, don't worry, the style is already done 😄

wind horizon
#

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.

lament bridge
#

Yeah, I was thinking on limitation as well, probably 15-25 per page

wind horizon
#

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.

wind horizon
#

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. 🤔

lament bridge
#

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.

wind horizon
#

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.

nocturne galleon
#

Does anybody know of something similar to flatpak-spawn or host-spawn, but written in Rust?

nocturne galleon
#

not really flatpak-specific

#

because I'm writing a container manager

#

and at least take a minute to spell it correctly

nocturne galleon
#

is there a specific reason for wanting it in a specific language? isn't it just a CLI program?

nocturne galleon
#

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

#

single 700 line file btw >w<

#

i still need to add file retries

deft sigil
#

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

nocturne galleon
#

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";

nocturne galleon
#

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?

deft sigil
#

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

wraith sierra
#

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)

deft sigil
#

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 🙂

lament bridge
#

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)
}
wind horizon
lament bridge
#

@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()?

wind horizon
# lament bridge 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.

lament bridge
#

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>
...


wind horizon
#

Oof hard to read inline let me grab the laptop and copy into an ide. 😅

lament bridge
#

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

wind horizon
#

So the i is the { sources: ["Design","{roduct"] } right?

lament bridge
#

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

wind horizon
#

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?

lament bridge
#

apply is not a good idea with TailwindCSS 😄

wind horizon
#

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.

lament bridge
#

In this case its report the source being null, which can be right, because in that case I would generally return "General"

peak acorn
#

Annoying LTT messing up their timestamps 3 years ago

wind horizon
# lament bridge In this case its report the source being null, which can be right, because in th...

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.

lament bridge
#

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.

wind horizon
#

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} />)
wind horizon
#

Just sec I'll send example in browser console.

lament bridge
#

Yeah, I tried that, sorry for being stupid, its 1 AM here xd

wind horizon
#
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"]
}));
wind horizon
#

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.

lament bridge
#

I will go sleep and try it later 😄

#

Thank yo so much 🙂

wind horizon
#

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

peak acorn
#

First attempt at mapping what % of wan show episodes are merch/sponsor/other based on description timestamps. it's definitely not catching some timestamps

livid bison
peak acorn
#

I'll try to make sure it gets all the timestamps correctly and then get some more graphs

peak acorn
#

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

peak acorn
#

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

sly marten
#

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? facepalm

peak acorn
#

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

lament bridge
#

Thank you very much!

lament bridge
#

No, like actual html ement

#

element* such as <span>${source}</span>

rancid nimbus
#

Is there a git for the code that generated that graph?

peak acorn
#

My thing?

rancid nimbus
#

Yes

peak acorn
#

I can post it in a bit
The graph itself is just from libreoffice but it outputs csv

rancid nimbus
#

Ok. What I wanted to see was those three metrics with the left being minutes not percent of total time.

wind horizon
lament bridge
#

I got literally <span>Text</span>

wind horizon
#

I can help you out if you share a code sample. Sorry slow replies during work hours, but just about to log off work. 😁

nocturne galleon
#

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"))
}
rich trail
#

Or send me in the right direction to figure it out haha

spark temple
hollow basalt
#

Imagine being able to read smh

swift stream
#

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

lament bridge
ivory plinth
#

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

midnight wind
#

Since style is an attribute iirc

ivory plinth
#

It made everything else pink

midnight wind
#

Show

ivory plinth
midnight wind
#

It's still not fixed

ivory plinth
#

I know.

midnight wind
#

You arent putting style= in the correct place

ivory plinth
#

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

nocturne galleon
wind horizon
# lament bridge ```jsx <div className="flex-col px-4 md:flex"> <span id="UserID" className='hidd...

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.

trail remnant
#

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...

grizzled steeple
#

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...

peak acorn
#

Rocketchat fuckin sucks

grizzled steeple
#

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

trail remnant
#

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:

peak acorn
#

We use Skype and are transitioning into rocket chat. Very behind the times

ornate summit
#

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?

wind horizon
trail remnant
#

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.

neat zodiac
#

Sounds like showing someone a function signature with variadic arguments would be annoying.

trim warren
#

anyone know why it's not being detected?

midnight wind
trim warren
midnight wind
#

show output of dir

trim warren
midnight wind
#

and show what it says

trim warren
midnight wind
#

no wonder it doesn't work

trim warren
#

I have it

midnight wind
#

no you don't

trim warren
#

it is placed as JAVA file

midnight wind
#

you are in C:\codes

midnight wind
midnight wind
# trim warren

SHIFT + Right click on empty space , open in powershell

trim warren
midnight wind
#

I reccomend the first

trim warren
#

ahh i saw it, an empty folder in C: \codes

#

i guess i'll try there

midnight wind
wind horizon
midnight wind
#

regular right click

#

shift + right click

#

just selects the first one

trim warren
ornate summit
#

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

next cipher
#

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 😡

hollow basalt
#

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

ornate summit
#

That isn't too bad. It's just access control and parent types.

nocturne galleon
#

honestly i'm not a big fan of sealed classes

hollow basalt
#

honestly i'm not big

lament bridge
#

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.

hollow basalt
wind horizon
ornate summit
#

Sealed types are great.

next cipher
#

a series of newline separated json objects is actually not technically valid json (if parsed as a whole)

peak acorn
#

Never heard of sealed types

next cipher
#

the difference between

{"a": 1, "b": 2}
{"a": 3, "b": 4}

vs

[
  {"a": 1, "b": 2},
  {"a": 3, "b": 4}
]
slate frigate
next cipher
#

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

ivory plinth
#

Does anyone got good examples for A sibling selector (div ~ p) and
A direct sibling selector (div + p)?

midnight wind
#

mdn web docs are the best

ivory plinth
#

thanks

ornate summit
# peak acorn Never heard of sealed types
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 {}
peak acorn
#

Is non-sealed the actual keyword

#

So only certain type names can inherit from a sealed class unless you deliberately unseal it I guess

wind horizon
slate frigate
#

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

wind horizon
#

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

slate frigate
#

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

wind horizon
#

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

slate frigate
#

Ugh, for real. Which is fine-ish when I'm writing python, but such a pita when I'm using go

wind horizon
#

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

slate frigate
#

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

trail remnant
wind horizon
#

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?

trail remnant
# nocturne galleon honestly i'm not a big fan of sealed classes

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.

trail remnant
trail remnant
slate frigate
#

Not really? It's pretty much the same for any compiled language, dealing with non-compliant formatted arbitrary/unknown data

trail remnant
#

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.

trail remnant
slate frigate
#

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.

slate frigate
trail remnant
#

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.

slate frigate
#

Its a god send whenever swagger documentation just EXISTS.

trail remnant
#

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.

slate frigate
trail remnant
slate frigate
#

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 😅

spring cradle
#

zap seems to get a lot of use

#

though im not sure how useful of a metric that is

trail remnant
#

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)

spring cradle
#

seems like how a lot of go devs operate, ive seen so many implementations of the same thing

trail remnant
#

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.

slate frigate
#

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

trail remnant
#

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)

slate frigate
#

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

trail remnant
#

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.

slate frigate
#

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 🤣

trail remnant
#

wellllll

#

Doesn't everything depend on someone else doing their job properly?

slate frigate
ornate summit
errant willow
#

Hello, I'm a Mainframe Dev. feel free to roast me lol

obsidian prairie
#

How's COBOL treatin ya?

errant willow
#

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.

peak acorn
#

Sounds super fun

errant willow
#

The salary is fun 🙂

peak acorn
#

Yeuhhh

#

Once you outlive all the veteran legacy code maintainers you go contracting and collect ur $500/hr

trail remnant
#

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.

wind horizon
trail remnant
#

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.

hollow basalt
#

Buy a car, then live there

wind horizon
# trail remnant The important part is keeping your life simple. If you get seduced into a huge h...

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.

trail remnant
#

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.

twilit iron
#

Woohoo getting a math degree and my future income is gonna be low asf cuz I’m planning to go into education

peak acorn
#

🤡

#

Good morals or whatever, but no moneh 😦

errant willow
wind horizon
peak acorn
#

Gotta come up with an idea for an upcoming mobile app dev course. How the fuk yall come up with ideas?

nocturne galleon
#

what is this color code 0x62ea71

peak acorn
#

Grean

silk eagle
#

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

peak acorn
#

Right

#

I want to think of something unique even if it's not good but God damn literally everything already exists

nocturne galleon
peak acorn
#

It's a 24 bit color in hex

nocturne galleon
#

so i can change it to red

#

so keep the 0x on the front

peak acorn
#

0x is the hexadecimal prefix yeag

nocturne galleon
#

ok

peak acorn
#

If it's RGB pure red is 0xFF0000

nocturne galleon
#

ok now the embeds for my bots are now red

trail remnant
trail remnant
# errant willow 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.

peak acorn
#

I need to get to the step where I make big money 😔

trail remnant
# peak acorn Gotta come up with an idea for an upcoming mobile app dev course. How the fuk ya...

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.

peak acorn
#

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

trail remnant
#

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.

peak acorn
#

Looool

trail remnant
#

indeed

peak acorn
#

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

trail remnant
#

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:

  1. 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.
  2. 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.
  3. 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?

peak acorn
#

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

trail remnant
#

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.

trail remnant
peak acorn
#

Fact

trail remnant
#

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?

peak acorn
#

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

trail remnant
#

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?

peak acorn
#

Not first in general, but first mobile project

trail remnant
#

Take any estimates and triple them.

peak acorn
#

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

trail remnant
#

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.

peak acorn
#

Well anyways yea just my current best idea, anything else so far seems incredibly boring or anything else

#

Mobile is a terrible platform

trail remnant
#

Yup

peak acorn
#

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

trail remnant
#

Wait, you already do professional work?

peak acorn
#

Internship

trail remnant
#

Ah

peak acorn
#

But they kinda threw me onto a team right away, some meaningful experience there

trail remnant
#

Being on a team is really good experience

peak acorn
#

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

trail remnant
#

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.

wind horizon
#

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

slate frigate
wind horizon
#

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. 🤔

hollow basalt
#

Can’t travel because job. Why not combine them and do my job while traveling. Just need a decent internet

silk eagle
#

gotta get one of those vans that you can put a bed in and then some satellite wifi and screens and stuff

hollow basalt
#

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

silk eagle
#

depends on the van

hollow basalt
#

The vans available in my area cant fly

wind horizon
#

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. 🤔

midnight wind
brazen vector
#

does anyone know css?

#

im getting an extra row in my css grid

young elbow
#

kinda, my css is rusty but i can take a look

cloud knot
hollow basalt
hollow basalt
#

maybe it's the curse of our field, forever not knowing the correct timeframe

sturdy ingot
#

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).

misty thorn
young elbow
misty thorn
young elbow
misty thorn
wind horizon
#

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

misty thorn
#

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

young elbow
misty thorn
young elbow
misty thorn
#

LOL

#

5 megabit internet devs be like

peak acorn
#

That's wack anyone would think u can like quarter an estimate lmao

young elbow
young elbow
sturdy ingot
sturdy ingot
#

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.

young elbow
silk eagle
#

30 mins? seeu in 2 hrs

misty thorn
#

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

wind horizon
#

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

hollow basalt
#

the best captcha is the one that interacts less with the user

peak acorn
#

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)

neat zodiac
#

Of course they do….

hollow basalt
#

It's in the name

silk eagle
#

u see dis cord? its for your data

trail remnant
# cloud knot "4 hours" is the only correct guess software developers can do. Less or more tha...

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.

trail remnant
silk eagle
#

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

sturdy ingot
# trail remnant The best part about this is that we can literally check back and see how accurat...

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!)

peak acorn
#

Lmao on boarding is the fucking worst

hollow basalt
#

Lmao

midnight wind
hollow basalt
#

this

peak acorn
fallow coyote
livid bison
sturdy ingot
ornate summit
#

Someone said to not use system python with tensor flow, what's the correct way to install it?

midnight wind
#

venv

#

iirc

ornate summit
#

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

sturdy ingot
ornate summit
#

Ubuntu sucks.

midnight wind
#

user error...

sturdy ingot
# ornate summit Oh yeah, they renamed it.

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.

ornate summit
#

I'm pretty sure python is python 3 by default.

#

I'll check on my main machine when I get home.

sage vector
#

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
ornate summit
#

Which is the default.

#

Ubuntu has weird defaults.

sage vector
#

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

ornate summit
#

So Python has weird defaults...

sage vector
#

Glad that I don't need to change my opinion about the Python project. It was a close call 😛

ornate summit
#

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.

trail remnant
fallow coyote
fallow coyote
fallow coyote
ornate summit
#

A subset.

midnight wind
#

phising

ornate summit
#

Basically only the basic formatting stuff like italic, bold, strikethough, underline and code.

fallow coyote
#

ahhh

midnight wind
#

and code

sturdy ingot
fallow coyote
#

GitHub has an on premise solution for a lot of our products! But I won't get into GitHub v GitLab convos rn 💀

ornate summit
#
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.

sturdy ingot
ornate summit
#

So I suppose no one has a solution to the forbidden issue?

ornate summit
sturdy ingot
ornate summit
#

Nvidia's website.

fallow coyote
fallow coyote
ornate summit
#

It's an issue on a computer.

sturdy ingot
fallow coyote
#

what's that link

ornate summit
#

I copied it.

fallow coyote
#

(for copy pasta)

sturdy ingot
ornate summit
sturdy ingot
#

That requires a login.

#

And then you probably also need authentication during the download, so your wget is missing the session cookie.

ornate summit
#

That's really stupid.

#

Guess I'm doing that when I get home.

ornate summit
#

Oh hey, TF has Java support. That's dope.

inner wraith
#

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

hollow basalt
#

The trick is you have to suck it up and learn

inner wraith
#

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

fervent thicket
#

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 ?

young elbow
cloud knot
#

check your nginx configuration, or remove the original header if you want to force the one you have set in nginx

next cipher
#

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

inner wraith
#

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.

barren steppe
fervent thicket
young elbow
median flame
#

Anyone working in the game industry? Would like to learn more on how game studio works on new games.

cloud hemlock
#

where should i go to learn to code?

hollow basalt
#

at the right time

olive ice
#

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.

hushed knot
#

Not sure if that really counts as development, but I need help with excel power query. Would anyone here have some experience with it ?

hollow basalt
#

No

peak acorn
#

I mean I think that counts as development but I don't know what the fuck a power query is lmaoo

hollow basalt
#

imagine querying, now do it with power

rancid nimbus
#

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.

peak acorn
#

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

slate frigate
#

@peak acorn Perceptual image hashing, theres a variety of ways to do it

peak acorn
#

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

violet harbor
#

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.

peak acorn
#

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

iron python
#

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

hollow basalt
#

Ok

spring cradle
#

ok

silk scarab
#

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.

hollow basalt
#

Thats not a static

silk scarab
#

It's kind of a blog type including the nearest vets available for them

vestal crest
#

urgh.... processing json in C++ suuuuuuucks

peak acorn
#

Surely theres a library that can help you

nocturne galleon
#

I use nlohmann::json

silk eagle
#

I love python for this very reason

vestal crest
hollow basalt
#

Makes me think why would use json in arduino

rapid ember
#

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

hollow basalt
vestal crest
#

so json makes the most sense

silk eagle
#

how are you requesting it with python and how are you trying to access the element's data?

rapid ember
#

`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

silk eagle
# rapid ember

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_"```

rapid ember
#

how did you find the right session cookie?

silk eagle
#

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.

rapid ember
#

@silk eagle thank you very much, you really helped me a lot

peak acorn
#

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?

slate frigate
#

@peak acorn what algorithm are you using for the perceptual hash?

peak acorn
#

just googled around and picked one, maybe i should try some of the other options they have

slate frigate
#

@peak acorn if you have purely black and white images, ahash might work better for you

peak acorn
#

I will try them out

#

Im just about finished re-sizing and centering everything

slate frigate
#

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

rancid nimbus
#

Auto tools or cmake for a small project that should stay small with 5 or so dependencies.

slate frigate
#

Not if the blocks are oercentage based, rather than a hard coded pixel counta

delicate lake
#

Would this be the chat to ask about arduinos?

midnight wind
#

Yes

hollow basalt
#

Yes

peak acorn
#

Yes

livid bison
#

Sadge Just lost a years worth of postgres data, ~500k rows

peak acorn
#

y i k e s

livid bison
#

All on a microSD card from a raspPi, whose root partition is invisible to every OS

peak acorn
#

Sorry but storing all of your data only on an sd card. . .

livid bison
#

128gb card, appears as a 32MB drive with one 20MB partition, doesn’t boot in the Pi anymore Sadge

livid bison
peak acorn
#

💀

#

that is fuckin rough

livid bison
#

I was getting the schema/config right before setting up backups

hollow basalt
peak acorn
#

Doing work for only like a month on SD cards, they are so fragile

midnight wind
#

yes

#

idk how exactly to do it, but it def is possible

hollow basalt
#

i know how to do it, but it def is possible

peak acorn
#

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

spring cradle
#

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?

livid bison
#

a combination of SSH token and webhooks is what you need

dry mist
#

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.

midnight wind
#

It's hard

#

Hosting would prob be in cloud

hollow basalt
#

That would be hard

livid bison
#

If you’re asking a discord those types of questions, you are not even close to being able to build a streaming platform

sly marten
#

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

silk eagle
#

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

midnight wind
#

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

silk eagle
#

and in that scenario those ppl should know how to do things

midnight wind
#

it's cheaper to use an existing cloud platform usually

#

than try to do better yourself

silk eagle
#

they have the luxury of mega redundancy and sharknado protection

midnight wind
#

reminds me of this

#

netflix came up with chaos engineering I think

peak acorn
#

I gotta watch that

#

I have no fucking clue what microservice actually is

silk eagle
#

i watch videos like that and i impostor syndrome real hard im having a mental breakdown gonna go stress eat brb

midnight wind
livid bison
silk eagle
#

linusSmirk i'll survive

#

this will always scare me though

peak acorn
#

wtf is dat

silk eagle
peak acorn
#

Oh yeah I never did that grammer and programming language shit

dry mist
midnight wind
silk eagle
#

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.

midnight wind
#

yeah, traditional education isn't needed, but you can't go head first into learning development with a complicated project

silk eagle
#

^ start small, learn the fundamentals, then learn/figure out what you need to learn and then learn that

dry mist
#

Im asking to know where to head

silk eagle
#

im biased toward python so ill say python, its easy to jump into starting off

dry mist
#

But basically ur saying u dont know so go to school. Rather than helping a bit.

midnight wind
#

for what? backend

#

frontend? infrastructure?

dry mist
#

Python for backend likely

silk eagle
#

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)

livid bison
#

Your initial questions were extremely broad

#

They were not things that could be answered briefly in a discord chat

dry mist
#

Does it matter?
Im asking a question. And expecting anwser

silk eagle
#

😐

livid bison
#

Yes, it matters

midnight wind
#

a streaming platform is a big complicated project

livid bison
#

Absolutely massive project

silk eagle
#

we can give u pieces of the answer which can help u figure out the rest of the answer

dry mist
#

Well i still stand by that saying "education" as anwser is bad.

livid bison
#

No, you just misunderstood it

silk eagle
#

they mean educate yourself on what it takes to create a streaming platform then learn what u need to learn

midnight wind
dry mist
#

Pretty sure it means go to school

livid bison
#

Pretty sure they're half joking, given the emoji

#

You don't know what you don't know

dry mist
#

Yeah. But i need guiding. Not jokes

silk eagle
#

Ok

livid bison
#

Your guidance is to start smaller, start with something way simpler.

silk eagle
#

i love not needing to know regex

dry mist
#

No. My hyper fixation for that is not ok..... I need big plans

livid bison
dry mist
#

NO

#

I want to plan it my self. Gotta save money.... And i dont have money....

silk eagle
livid bison
#

This stubbornness is not gonna bode well for you here

#

Have you even hosted a website before?

silk eagle
#

is ruby on rails still the thing people learn

livid bison
#

Sometimes lol

dry mist
#

No. But im studying IT so.... At some point i will figure it out.

sly marten
# dry mist Yeah. But i need guiding. Not jokes

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…

silk eagle
#

what alternatives to ruby on rails are used

livid bison
sly marten
#

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)

dry mist
#

Well school teaches only the essentials. Thats the problem. Why waste time in school when u can learn it from someone else

silk eagle
#

the essentials are essentials

livid bison
silk eagle
#

learn them first then youll know the next path to take in your project

dry mist
#

That sounded like most dum thing i ever said. But i mean essential are easy to learn by ur self

silk eagle
#

you can learn them from university or from anywhere else, but u need to learn them first

dry mist
#

Well python webserver is good start

sly marten
#

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

silk eagle
#

then, you look into what u need after that, you have to figure it out along the way because each scenario is different

sly marten
sly marten
silk eagle
#

the people who dont need university for software development are usually the people who have been doing it for a while

dry mist
#

Well im still young

livid bison
#

Very easy to overlook or build bad habits without someone to correct you

silk eagle
#

but u know, me personally, i could probably duct tape together a streaming platform in a couple weeks 😏

livid bison
dry mist
#

Like hella young.
Like not even adult young....

#

Better start now than when i cant learn as much

livid bison
#

Explains the stubbornness

sly marten
# silk eagle the people who dont need university for software development are usually the peo...

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

dry mist
silk eagle
#

then learn the essentials bro, pick a language like PYTHON <-- or the other ones, get proficient at it, then advance as you go

sly marten
# dry mist Better start now than when i cant learn as much

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

livid bison
silk eagle
midnight wind
#

yeah video is a pain as well

#

transcoding, etc.

#

large storage

sly marten
#

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)

silk eagle
#

well heres the thing, u can just use a cdn for video cant u bro

dry mist
sly marten
livid bison
#

Sure bud

livid bison
sly marten
dry mist
#

I miss not being 18 soon. It was easy to play Minecraft on ps3 and just have fun.

silk eagle
#

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