#development

1 messages · Page 90 of 1

hollow basalt
#

but why stop there?

livid bison
#

I feel like this is a million dollar SaaS business

hollow basalt
#

Don't just stop at paying people to create regex for you.
there are people called developers, pay them to create the whole system for you

livid bison
#

Ok but what happens when developers are too busy to fiddle with regex (devs like me PepeLa)

#

I work at a F500 and there's only one dev on our team who's genuinely comfortable with regex

nocturne galleon
livid bison
#

I bet GPT-3 could tell you the correct regex given this

nocturne galleon
#

^net\.minecraft.*|^com\.mojang(?!\.authlib.*).*

mighty aspen
#

the problem with that, is that regex is so rarely needed that it ain't worth

#

i've done probably 4-5 regex expressions in the last year, and that's like... a lot

#

still noly took a couple hours on the site linked above

toxic venture
#

Heyy Tech Folk
Hope you you're doing great
I need help to understand the terminal integration in my react app

nocturne galleon
#

so basically im the most developed single braincell in existence and cloned an empty repository into my project and basically deleted everything. any ideas yall?

#

im acting like this is chill but im having a mild to severe stroke rn

past palm
#

A git clone would 't delete anything - only add stuff. So you deleted files manually? 🤔

scenic knoll
#

Before doing anything. If you aren’t sure what you are doing always compress the work that you have’s directory before doing anything.

deft sigil
#

hehe i recently made a Facebook phishing site 🙂 wich might sound evil , but it was to explain what phishing sites are and wat they do and how to avoid being tricked to my class of "elderly" people i teach (volunteer work) , since they were like , *yeah i think i have seen such a site , it asked me for my facebook login to continue but i tried ceveral times but it didnt work as i always got a white page with 404. * yes that means you prolly should change your fb password now... oh no as i said the site didnt work, it always showed the 404 .. ah ... speds the next 20 minutes making a facbook login page that logs the login fields to a txt and redirects to a 404:) my collegue was like , WTF Did you just , ... freak

scenic knoll
#

But yeah git clone wouldn’t destroy anything but rather add a subdir. If you have the terminal commands handy that you are willing to share that may be helpful.

deft sigil
slate frigate
#

I hate regex too. I also hate how regularly I use it

grizzled steeple
#

^Developers (?:lov|hat)e Regex!$

twilit elk
#

thanks, I hate it.

grizzled steeple
#

Honestly tho, while I understand that Regex can be quite difficult to read/understand, it can also be super handy to quickly write some string validation stuff. For example, a (not so thorough) E-Mail Regex would be this: ^.+@.+\.[a-z]{2,}$
Difficult to read? Yes. Short and does the job? Also, yes.

#

I do get why so many people hate Regex tho. Me too buddies, me too...

slate frigate
#

I don't mind simple regexes, but I've had to do some absolutely painful ones for data extraction

#

also, there is an ip address regex paragraph that works for ipv4 and ipv6

#
'/^(?>(?>([a-f0-9]{1,4})(?>:(?1)){7}|(?!(?:.*[a-f0-9](?>:|$)){8,})((?1)(?>:(?1)){0,6})?::(?2)?)|(?>(?>(?1)(?>:(?1)){5}:|(?!(?:.*[a-f0-9]:){6,})(?3)?::(?>((?1)(?>:(?1)){0,4}):)?)?(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?4)){3}))$/iD'
grizzled steeple
#

Honestly, why not just use two Regrets Regex's at that point?

slate frigate
#

Sometimes it's nice just to use a single compiled regex, rather than double the matching operations

grizzled steeple
#

True

slate frigate
#

For big datasets, that doubling of searching can add a lot of time

#

(In general though, yeah, I agree, split em. OR just don't use ipv6 :D)

grizzled steeple
#

Pah! Who needs IPv6 anyways? There's plenty of IPv4 Addresses out there! /s

nocturne galleon
neon gale
midnight wind
#

Not translation

hollow basalt
silk eagle
#

yes evilrondo

misty thorn
scenic knoll
scenic knoll
grizzled steeple
#

The plural of Regex is Regrets smart

deft sigil
#

always a fun one to have some people who are just starting out break their heads over : (you may verrify its not photoshopped ,...) 🙂 :p

silk eagle
#

everyone just purchase some static IPs they'll be very valuable someday

grizzled steeple
#

Everybody gangsta till Apple has the "courage" to stop support for IPv4 in macOS and iOS

silk eagle
#

honestly thatd be what brings ipv6 into relevancy

sage vector
sly sequoia
#

ugh python updates broke my old code x.x

silk eagle
#

well you better go catch it

deft sigil
# silk eagle everyone just purchase some static IPs they'll be very valuable someday

since ipv6 doesnt actually need a dhcp , since the adress space is so large you should be able to randomly pick one and it should be fine. (as in its prolly a unique one ) so i think ip addresses wont be worth anything soon, that is besides the ones that are the easiest to remember (and prolly the only ones that you can remember) as they will be worth allot

midnight wind
ancient scarab
next cipher
#

probably python 2 😆

ancient scarab
#

So, idk if this is the right forum, but could someone clear up some conceptual confusion I have about Microsoft's Dynamics Ax?

sly sequoia
#

and it worked in 2020

rancid nimbus
#

I got swd debugging working on a raspberry pi pico. As it turns out do not try to get a dedicated hardware swd device and just use a raspberry pi.

#

Does anyone know of a good GDB client that can connect to a TCP GDB server and is graphical?

frigid river
#

I mean

#

VSCode, but it's kinda weird to use

#

There's an extension to make custom debug profiles but I last used it, like, a year and a half ago and it was a remote GDB target

lament bridge
#

Sorry to ask stupid question, but how could I solve this?

D:\IssueTracker\src>npm install --save @react-native-clipboard/clipboard
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: issuetracker-ui@0.0.0
npm ERR! Found: react@18.1.0
npm ERR! node_modules/react
npm ERR!   peer react@">=16.3.1" from react-async@10.0.1
npm ERR!   node_modules/react-async
npm ERR!     react-async@"^10.0.1" from the root project
npm ERR!   peer react@"^18.1.0" from react-dom@18.1.0
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@">=16.8" from react-router-dom@6.3.0
npm ERR!     node_modules/react-router-dom
npm ERR!       react-router-dom@"^6.3.0" from the root project
npm ERR!     react-dom@"^18.0.0" from the root project
npm ERR!   4 more (react-firebase-hooks, react-router, react-router-dom, the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @react-native-clipboard/clipboard@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@18.0.0
npm ERR! node_modules/react
npm ERR!   peer react@"18.0.0" from react-native@0.69.1
npm ERR!   node_modules/react-native
npm ERR!     peer react-native@">=0.57.0" from @react-native-clipboard/clipboard@1.10.0
npm ERR!     node_modules/@react-native-clipboard/clipboard
npm ERR!       @react-native-clipboard/clipboard@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Marcell\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Marcell\AppData\Local\npm-cache\_logs\2022-07-10T15_57_35_990Z-debug-0.log
rancid nimbus
#

Does anyone know of a great resource to learn USB protocol?

timid citrus
midnight wind
#

at a very low level

fickle verge
#

can i embed a .zip file into my winform C# program

fickle verge
#

how do i access this file in vs studio winform c# application?

#

im tryna copy this zip file to somewhere the user selects

livid bison
nocturne galleon
#

That's fun

slate frigate
#

@fickle vergePretty classic way is to append it to the end of the executable with a header so you can locate it

mighty aspen
mighty aspen
# fickle verge how do i access this file in vs studio winform c# application?

quick google search says the same way you'd do it in any other c# app -
follow this guide til you get to the part where you're putting in code in the Form.cs file and trigger it with a button
https://docs.microsoft.com/en-us/visualstudio/ide/create-csharp-winform-visual-studio?view=vs-2022
then follow this example in the c# api reference to use c# to move a file
https://docs.microsoft.com/en-us/dotnet/api/system.io.file.move?view=net-6.0

#

you'd probably need to use relative pathing tho, so from the location the file is being run,
"String path = "..\FolderIcon\Folder.ico"" means into the FolderIcon folder, then select the Folder.ico file.

lament bridge
lament bridge
#

exactly

midnight wind
#

Avoid dependency hell

lament bridge
#

True

deft sigil
#

the number witout the _ is hard to gage how much it actually is) so for a /48 this is:

f'{(2**64)*65536:_}'
'1_208_925_819_614_629_174_706_176'

adresses they are giving to you for use.

#

but your not entirely wrong as the /64 is a single LAN so i think its more like some /64 adresses will become worth quite a while , but since cloudflare who famously own the 1.1.1.1 and 1.0.0.1 ipv4 adresses have the equivalent ipv6 adresses of : 2606:4700:4700::1111 and 2606:4700:4700::1001 wich makes me assume getting a simple prefix for ipv6 (the first 64 bits) int that easy , or id think they would go for a 2001::1111 and 2001::1001 (i know 2001 is for doc/bench but i would assume theyd get a prefix that had allot of 0000 blocks in it to make it easier to remember) ps the total number of ipv6 adresses for those who wonder:

f'{2**128:_}'
'340_282_366_920_938_463_463_374_607_431_768_211_456'

in comparrison the age of the earth in seconds:```py
f'{436117077000000000:_}'
'436_117_077_000_000_000'

midnight wind
#

for us to runout

deft sigil
#

unless we start assigning blocks to instances of ai programs and one of them starts to clone itself :p

lament bridge
#

Is it possible in react to filter in multiple ways? Example

median tundra
#

thoughs on tech bootcamp?

ocean pebble
#

I'm curious about people's thoughts as well, I've been looking at codesmith myself

sour nacelle
#

I have hired many bootcamp grads - find a way to talk to people who have used that bootcamp - 99% of the quality is in the instructors - because if they dont care/understand the industry - your just wasting $$$ - but if you can find a good instructor and a bootcamp teaching relevant skills - great way to learn development in a classroom setting.

additional 2cents would be - if possible - do an in-person bootcamp so you can build a community of people to talk to afterwards that are local to you

worldly musk
#

So what kind of development does people do here? Any others that do hyper-performance stuff, native system level code?

uneven owl
#

Hi there, I'm working with react-native for the first time. And I'm trying to convert an application I built previously to react. In the old application I used Leaflet, but I found this library called react-native-maps. However, I can't find a way to disable the default map provider (like Apple Maps or Google Maps). Is it possible to do so? Because I'd like to use OpenStreetMap instead.

#

Sidenote: I already have OpenStreetMap working but when I zoom out it takes a while to load, so the apple maps layer is shown underneath.

sour nacelle
worldly musk
#

Ah okay, I'm currently working on a C++ game engine from scratch (hobby project). I've got a high focus on performance and it's really interesting stuff.

slate frigate
#

I'll do near-native work with network stuff on occasion, but only when absolutely necessary, cuz screw that.

slender sand
#

Hey! I have a coding problem i am unable to solve and i'd pay 15€ for someone to fix it.
I don't think it's that big of a deal for someone experienced. I implemented TicTacToe with AlphaBeta pruning in python but i can't get it to work.
PN me if interested.

#

MinMax itself seems to be working, it's just the alpha beta part

slender sand
slender sand
#

I figured it out. I used <= instead of <.
Thx anyway

lethal agate
#

Hey! I have a weird question

#

Say I had a Flask (Python library) app which was a single HTML form connected to a route.

Now I wanted to make this into a standalone windows app from a web one, and didn't have time to remake ui, wanting to keep HTML, CSS and JS template I made. Would it be hard to move this code into Electron/React native? I have close to 0 JavaScript knowledge but can spend a full 5 hour work day on it.
All the app needs to do is serve the HTML form, and when submitted save result to a csv file

#

Literally all I need the app to do is:

  1. (Optional) server button that says "Go to registration"
  2. Server my form, get info
  3. On submit run a function that saves to file and then show "Complete" message
worldly musk
mighty aspen
ocean pebble
mighty aspen
ocean pebble
#

Nope, no degree. I was kinda thinking the same things, thanks.

#

Also, nice pfp :)

slate frigate
#

I've been given offers over people with degrees just based on the strength of my github alone

hollow basalt
#

One key factor is still having exposure/work experience

#

The only thing needed is the first paying project/job

slate frigate
#

Demonstration of skill always trumps theoretical skill

worldly musk
#

I've heard that a strong portfolio can weigh up work experience

sour nacelle
ashen marlin
#

stuff like pair programming irl is great when you are still learning, I love using that to help mentor people

ocean pebble
sour nacelle
ashen marlin
#

trying to think of a dev project to do on my week off

ocean pebble
sour nacelle
ocean pebble
#

My rough idea of what I'll probably do is finish freeCodeCamp's responsive web design, cs50, and go through the Odin Projects full stack JavaScript, then decide if I want to do a bootcamp. I'll be doing these full time so I expect to be able to do those in a few months.

proper hornet
#

How do I escape a / in batch scripting?

#

I'm trying to use a Powershell command in a batch file but / never goes through

#

Powershell.exe net user /domain xxxx

ashen marlin
#

iirc it is \

proper hornet
#

It prints out NET USER and just dies pensivesob

proper hornet
#

it didn't work

ashen marlin
#

oh wait

#

try `

proper hornet
#

i tried escaping \ with ^^ and that didn't work either

#

`domain ?

worldly musk
ashen marlin
#

no so `/domain

proper hornet
#

nope

#

it didn't work

#

It's really hard to find info on it

ashen marlin
#

idk then ` is the escape character for powershell ^ is the one for cmd

#

but / shouldn't need escaping for either

proper hornet
ashen marlin
#

oh

#

you don't need to escape, the /domain needs to be after the username

proper hornet
#

there's a space after user

#

so it's net user /domain ordinarily

ashen marlin
#

the according to that it should be net user username /domain

#

where I presume username is the username of the user

proper hornet
#

it's supposed to be user

ashen marlin
#

I mean it should be something like net user administrator /domain

proper hornet
#

for all intents and purposes, user is not supposed to be found (picture is correct)

#

yolo i guess

ashen marlin
#

the name for the user needs to be before the /domain basically but after the net user

proper hornet
#

it's calling from the system. per the instructions cutout i received that includes an example, the example does not include user at all

#

basically, not important

#

it's just the batch script that's troublesome

ashen marlin
#

given you are calling into powershell why not write it as a powershell script instead

proper hornet
#

oh true

ashen marlin
#

less prone to weirdness maybe

proper hornet
#

LOL. i didn't think of that. thank you

ashen marlin
#

windows has always been jank af for me passing stuff between things on the command line, at least compared to anything linux/unix based

proper hornet
#

i gotcha i gotcha

lethal agate
#

Anyone could help with jinja2 & JS?

#

I need dt_options inside show_result function to be the variable. Basically I need either an fstring or an expression inside an expression
{{ form.division_type_name(class="form-control", id="result-3", onkeyup="show_result(reference={{ dt_options }})", onInput="show_result(reference={dt_options})") }}

#

actually nevermind I think I managed to get a braindead solution working

noble saddle
#

So, I am working on discord bot that will read a JSON file from my website and print out what game is being played. I've tried simply reading gamename but, everything I have tried comes out as "undefined"

shrewd oak
#

what comes back at undefined

#

like in the out var?

ashen marlin
#

Looks like you want out.mariokartwii[0].gamename

#

Or something like that

noble saddle
#

Basically, the user enters the command and its simply grabs the JSON file and reads from it, then printing to the channel respectively. However, I was reading the JSON file incorrectly and it'd simply always print out undefined. The way I got somewhat around it was the most spaghetti code ever.

wind horizon
#

Oh wait I see it’s the request package.

noble saddle
#

Yup

wind horizon
#

Your out variable is the parsed json, but then you were console logging the body and the message you were trying to access it off the body.

#

You should parse to a variable and then you access the data in that variable which is now a normal JS object.

#

const data = JSON.parse(body)
console.log(data)

wind horizon
# noble saddle Yup

Looks like request is deprecated, I’d prob switch to undici or if you aren’t worried about perf and just want simplicity I’d go for axios since it has super simple interface and even auto parses the json for you.

midnight wind
#

why are you searching within a string

noble saddle
#

Cuz, ooga booga spagetti way LOL

midnight wind
#

🤦

#

using json within js is super easy

noble saddle
#

It was originally cuz I was being a dummy and couldn't figure out why it kept reading as undefined. So, I simply just converted to a string.

midnight wind
#
gamename = data.mariokartwii[0].gamename
ashen marlin
#

It's 0 not 1 isn't it

noble saddle
#

Well... That would work. But, only for Mario Kart Wii. Let's say if the user hops onto a game like Pokemon Colloseum. The server wouldn't report it back as mariokartwii. It'd simply make another entry (ie: pokemonbattlewii).

midnight wind
ashen marlin
#

The JSON isn't in a great structure tbh

midnight wind
noble saddle
#

Yeah, don't you love old 2014 python 2.7 code!

ashen marlin
#

You could use object.entries then loop over that

wind horizon
#

Looks like your key is the game name, if that’s 100% always the case you can Object.keys() to get an array of games. Deff an ugly / bad json schema.

sudden cosmos
#

You can always transform it into the schema you'd rather have lol

#

But that's why there's stuff like graphql now, just ask for the schema you want from the server

tight valley
#

I apologize if thats stupid question but I havent been able to find it anywhere

grizzled steeple
#

It says it right in the title: Target SDK level

tight valley
#

I see. Thank you.

sour nacelle
slim parrot
#

I have I question for the developer section is there any good Ps3 emulator for iOS

rancid nimbus
# worldly musk I'd say you are mostly right. But some stuff is just straight up hard. Multi-thr...

I had attempted a graphics rendering system. I never knew how hard it was to optimize a triangle drawing routine until I attempted it. I think I should have started with drawing lines first. Oh well I can re try again. https://retro64.altervista.org/blog/line-drawing-routines-programming-different-approach-6502-assembly-implementation/

worldly musk
rancid nimbus
worldly musk
rancid nimbus
#

What are good resources to learn Vulkan?

gleaming acorn
#

can someone help me get my VisualBasic6 running on modern hardware/os? or point me to the last OS it ran on? I think it ran on Win7?

rancid nimbus
#

Does Microsoft have a translation guide?

strange palm
#

anyone willing to help with beta testing of Kamachya 7 a old made off windows 7 but modern and forgets all the bull$h!t of windows

ocean kelp
#

hey anyone have some good recourses on making custom linux iso ? i kinda wanna take ubuntu server but have certin apps and ssh keys pre installed or just remove ssh all together in the iso so i can flash it to things and allso just upload it to my hosting providers

#

just looking for some links on were to start

deft sigil
deft sigil
# ocean kelp hey anyone have some good recourses on making custom linux iso ? i kinda wanna t...

remastersys is a free and open-source program for Debian, Ubuntu-based, Linux Mint or derivative software systems that can:

Create a customized Live CD/Live USB (a remaster) of Debian and its derivatives.
Back up an entire system, including user data, to an installable Live CD/DVD.As of April 28, 2013, the originator's direct development has ce...

ocean kelp
deft sigil
#

another option is to create not a live iso nor an installer but a full image , with some dirs separeded (anything that needs write access) and the rest of the system readonly with the writable dirs mounted from a seperate writable partition or or as tmpfs. and

deft sigil
#

damn has been since Qt4 was the new thing that i did some gui programming (is not tui/ansi or cli or web(php/css/html) wich i did in that time) but its slowly coming back 🙂

sudden cosmos
#

what ide is that?

#

oh is it like a pyqt specific thing?

sturdy ingot
ashen marlin
#

that idea

#

has so many buttons wtf xD

cloud knot
# tight valley Does this affect target SDK or minimum SDK? https://android-developers.googlebl...

Google never forces you to specific minimum SDK, you can pick whatever version can support the feature set you want to have in your app. It's always the target SDK which they force you to update, as it means that if the app runs on that specific SDK version, it will use all the modern/safety features available. And then it will gracefully degrade functionality based on runtime. So if your app can still run on Android 4.4, you won't get separate permission prompts for example, while on Android 12 you will get them.

cloud knot
ashen marlin
#

yeah I use vscode for most stuff xD

#

though I stan golang rather than python anyway these days xD

tight valley
cloud knot
#

so you can have some generic code for most versions, but then have special code for let's say "Android 4, cause it has a different API for something which was not standardized until later"

#

example being biometric login, which was standardized in 5.0 or 5.1, and then old API completely replaced in i think Android 9 or 10

#

but this is a good example - you can still use the new API (BiometricPrompt i think) but on older Androids it gracefully degrades to Fingerprint API

#

just it doesn't support Face and other methods on older versions, obviously

lament bridge
#

Hey.

Could someone help explaining what am I missing? As I read arrow way should do it, but it does not.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'setState') at setJoke

 const setJoke = () => {
      this.setState({
        items: joke
      });
    }
lament bridge
#

Solved 🙂

grizzled steeple
#

Yeah, was just writing an explenation and a possible solution, but you got it on your own ^^

#

Had run into similar issues with Angular and Vue myself before. Really annyoing when your function get's executed in a different context and thus this doesn't refer to your Class/Component...

lament bridge
#

My solution was
const [joke, setJoke] = useState();

sudden cosmos
#

it does if you use class components but yeah it's better to use the function components

lament bridge
#

Neverthless, now I just get an endless loop of Api requests 😦

#

  const [joke, setJoke] = useState();
  const _key = 'joke';
  const getKey = localStorage.getItem(_key);
  const storedJoke = getKey && JSON.parse(getKey);
  const currentDate = new Date().toDateString();
 
  function jokeMe() {

     useEffect(() => {
    if ( storedJoke && currentDate === storedJoke.date) {
      setJoke(joke);
     
    };
    });

    fetch('https://api.api-ninjas.com/v1/jokes?limit=1', {
      method: 'GET',
      headers: {
        'X-Api-Key': "XXXXX"
      }
    })
    .then((res) => res.json())
    .then((res) => {
     setJoke(res[0]['joke']);
      localStorage.setItem(
        _key,
        JSON.stringify({
          date: currentDate,
          value: res[0]['joke']
        }),
      );

    });
  
  }
  jokeMe()```
sudden cosmos
#

yeah you can't invoke jokeMe() there

#

why are you invoking jokeMe() at the end of the file?

lament bridge
#

well, wouldn't be the way to run the function and "get" the joke?

sudden cosmos
#

jokeMe() is a component it gets called by react every loop to get the jokeMe component and show it on the page

#

so every time the react event loop runs it makes another request since fetch is just in there

lament bridge
#

Aaaah

#

so I would need to make it a compontent instead, then import it once somewhere.

sudden cosmos
#

well actually whats your jsx for the page look like?

#

but it should be like <Joke/> and then in the joke function you have a useEffect that calls jokeMe()

#

then when the Joke component is mounted, it runs the useEffect which makes the request

lament bridge
#

Well the whole page is a bit of a mess to paste here

sudden cosmos
#

that's okay you just need another component that actually calls jokeMe in a useEffect

lament bridge
sudden cosmos
#

oh you do have a joke component, yeah just call jokeMe in its useEffect, and remove that call immediately after you defined jokeMe

#

and jokeMe shouldn't have its own useEffect that should be part of the Joke component itself

lament bridge
#

I just moved it to a new compontent now, so it's no longer used with jokeMe(), however its still and endless loop. I am not sure how to remove the call to stop the redirects. Generally, this should do it, but it doesn't.

 useEffect(() => {
    if ( storedJoke && currentDate === storedJoke.date) {
      setJoke(joke);
      return;
    }
  });
sudden cosmos
#

can you pastebin your whole joke component?

#

remember anything in the joke component body gets called every render loop, only things in hooks like useEffect() are called only on certain events

lament bridge
#

I have a feeling it might be different, because other data I am fetching also loaded twice (not loop though)

#

import { useEffect, useState } from 'react';

export default function Joke() {
  const [joke, setJoke] = useState();
  const _key = 'joke';
  const getKey = localStorage.getItem(_key);
  const storedJoke = getKey && JSON.parse(getKey);
  const currentDate = new Date().toDateString();
    if ( storedJoke && currentDate === storedJoke.date) {
      setJoke(joke);
      return;
    }
fetch('https://api.api-ninjas.com/v1/jokes?limit=1', {
  method: 'GET',
  headers: {
    'X-Api-Key': "XXX"
  }
})
.then((res) => res.json())
.then((res) => {
 setJoke(res[0]['joke']);
  localStorage.setItem(
    _key,
    JSON.stringify({
      date: currentDate,
      value: res[0]['joke']
    }),
  );

});
}

return 
sudden cosmos
#

yeah so that fetch needs to be in a useEffect

lament bridge
#

Ah ok

sudden cosmos
#

it's a different way you have to think about it because it's a functional interface not procedural

lament bridge
#

Than you so much

#

I have a similar problem, but I will try to figure out it myself

#

that's requested twice, not as a loop, although the problem is the same, gives more API requests.

sudden cosmos
#

yeah useEffect also gets called when the component updates

#

if you want to run only once on mount you can pass an empty dependencies array [] as the second argument to useEffect()

#

that tells it it doesn't depend on any props or state and only needs to run with the initial values

lament bridge
#

its actually passed with , [refresh])

sudden cosmos
#

yeah that means it will call the effect again whenever refresh changes

lament bridge
#

Hmm, as far as I can see the issue is even on the first load, I get two data

sudden cosmos
#

even with empty array?

#

if it happens with an empty array that would mean your component is getting mounted twice for some reason

lament bridge
#

I will show you the code in a momento

sudden cosmos
#

is this your first time with react or you just aren't used to the new functional interface yet?

lament bridge
#

first time 🙂

sudden cosmos
#

the hooks reference on their docs is good it explains most of it. you might look for an example app that also fetches from an api using function components though

sturdy ingot
sudden cosmos
#

it's probably useful to have the gui specific tools but i would guess PyCharm has it too?

sturdy ingot
#

I wouldn't know; I used QtCreator (or Emacs) for Qt5/C++.

hollow basalt
#

Resist ide, embrace vim

spring cradle
#

go generics in 1.18 :o cool

slate frigate
#

This guy wrapped up all the generics, its super sweet

sudden cosmos
slate frigate
#

Why not just write your own vim? /s

spring cradle
#

:e file

#

or use a fuzzy find plugin

slate frigate
#

@spring cradle What are you working on in go?

spring cradle
#

just a personal game

#

tui so it can be played over ssh

slate frigate
#

Hyyyyype

#

What tui framework? I usually use tview

spring cradle
#

gruid

#

atm at least

#

hoping to be able to embed into js or sdl later

slate frigate
#

I'll have to take a look a gruid. And you might be able to embed as wasm, if you're trying to play in a browser

spring cradle
#

gruid has a term.js driver available

spring cradle
#

with vt100 screen size, that's like, 80x48 pixels for art

slate frigate
#

Oh, I can actually help you there

spring cradle
#

ooh

slate frigate
spring cradle
#

maybe i could try tcell

slate frigate
spring cradle
#

but i like the potential portability of gruid drivers

#

ooh

slate frigate
#

I'd stick with gruid, especially if you're already working with it. tcell/tview is a pita, and very verbose to set up

nocturne tree
#

Ever heard of buffers?

spring cradle
#

also what's up with the number 6? is it bc it's punnable with pixel?

#

totally was gonna make a dice oriented mechanic, so i was just gonna call it six lmao

slate frigate
#

I'm looking at gruid right now, and looks like it does a lot of the heavy lifting in terms of setting stuff up. Sixels are actually a bitmap graphic format that is supported in terminals. originates way back in the dot matrix days

spring cradle
#

ah

#

terminals or shells? my friends mostly a user of tty

slate frigate
#

both, should work with everything modern, although I never did any extensive testing

spring cradle
#

oh wow that's a really high definition image

slate frigate
#

the sixels?

spring cradle
#

relative to using characters, yea

slate frigate
#

Oh yeah. If I had started why after seeing that library, i'd 100% would have used sixels

slate frigate
#

Yup, lol. A stupid project that I put WAAAAAAY too much time into

spring cradle
#

i think i wanna use gruid still just for those retro graphics

#

ill definitely have to think of a project for sixels though

sturdy ingot
slate frigate
#

lol, hey I have realtime playback at 120p, put some respec' on it, 🤣

sturdy ingot
#

F

sudden cosmos
#

Think it uses characters not sixels but still an interesting upgrade over lynx

slate frigate
#

Yeah, it does, just checked. Apparently sixel support is prett patchy

spring cradle
#

ye that's where i got the idea to split the characters into pixels

slate frigate
#

all hail the unicode half-block character

spring cradle
#

o7

swift owl
#

did you know a good no-code website maker?

sudden cosmos
#

Idk Squarespace is the popular one now

livid bison
#

I loved Wix way back in the day, idk if they're still relevant

sudden cosmos
#

Or did you mean a WSIWYG html/css editor? Do those still exist?

#

Yeah Wix is good

midnight wind
rancid nimbus
merry comet
#

oh, and keep a copy of every post you make on your own computer and 3-2-1 backed up

rancid nimbus
# merry comet oh, and keep a copy of every post you make on your own computer and 3-2-1 backed...

For using Hugo it is as simple as git with a private repo on GitHub, a local clone and a remote clone on your server. That is kinda what I do. You could even make it so that when you make a git commit you it posts it to the server. Google servers will likely throw your data on a ok SSD, so local SSD and HDD. That makes it two local with two mediums, and one remote location, with a total of three copies (min).

tranquil zinc
#

Long time lurker here, first time posting in a while. HUGE LTT
Been heads down building. Going to do a test event for our open source social WebXR tools https://www.etherealengine.org.

Really want to make a Linus web world!
We are an open code collective and are excited to show off a year of work. https://etherealengine.eventbrite.com

Eventbrite

Come join our immersive Concert, VR + AR tour, social eCommerce shopping and more. Experience the open metaverse on the social spatial web.

vestal spire
#

I get this error when deployed the code:



TS7006: Parameter 'params' implicitly has an 'any' type.

however, in my project, there's no src/components/MaterialUI directory at all

mighty aspen
#

turn off ts/eslint 'no implicit any' rule

#

dunno why its spawning from a non-existing directory but maybe something to do with compiling? is this react?

nocturne galleon
#

:FZF, type in part of filename, win

hollow basalt
#

time to sleep

spring cradle
#

fuzzy find op

nocturne galleon
#

Anyone know if opencv can offload processing to remote server? I would lile to handle processing on the server side but don't want to have to send the entire thing via the network

grizzled steeple
nocturne galleon
#

Like have the server take inputs from the device, and then serve results as a webpage that can be grabbed

silk eagle
vestal spire
#

(using React)
When the user presses back on the browser, the page still goes back. Is there a way to prevent that? Here is my code

  const handleBack = (e: any) => {
    console.log("handler called");
    // e.stopPropagation();
    // e.stopImmediatePropagation();
    e.preventDefault();
    console.log('event', e);
  };

  useEffect(() => {
    window.onpopstate = handleBack;
  },[]);
rancid nimbus
peak acorn
#

What do you not want to send over the network, whatever does the compute gonna need the data yaknow

limpid reef
# vestal spire (using React) When the user presses back on the browser, the page still goes bac...

Might try checking stackoverflow, though altering the expected behavior of a web browser's core functionality (BACK, FORWARD, RELOAD, etc.) creates a bad usability situation for the end user. Totally understand that many modern web apps do this in their own way; just have to ensure that pressing BACK or FORWARD still cause the app's UI modals / user interface to appear to work as the end user expects.
https://stackoverflow.com/questions/60838781/controlling-browser-back-button-in-react

hybrid island
#

I have two electives to choose from in the next semester for my CS degree

  1. Design Patterns
  2. Data Warehousing and Mining

Can you please tell some pros and cons of each so that i can choose better.

hollow basalt
#

One can make you design better

#

The other would teach you how to mine

rancid nimbus
#

What does option 1 mean? I think I have an idea.

wild delta
#

Yo what's the difference between firemonkey and wpf

jovial gazelle
#

firemonkey is multi-platform whereas wpf is for windows apps

#

also firemonkey can be used to make mobile apps for iOS and Android but WPF is for Windows desktop apps

sudden cosmos
sudden cosmos
#

In terms of classes it could be more fun though, hmm. You should try to dig up a syllabus for each and see what you might be doing specifically in each class

jovial gazelle
#

np

hybrid island
sudden cosmos
#

I meant "I would" as in "If I were you I would"

hybrid island
#

I did that and searched on different websites.
I came to the conclusion that Data Warehousing would work for me

wind horizon
hybrid island
wind horizon
# hybrid island Yes thank you, I have chosen Data Warehousing

Nice, even if you do it and come out saying “I hated that” it’s still valuable to know the basics of it, since many dev jobs will interact with or at least facilitate in the data collection process.

Also you never know you might come out of it loving it and decide to pursue a career more focused on data. Imo college is the perfect time to try a little of everything. 🙂

hybrid island
#

Thank you for the kind words, let's see what happens

slate frigate
#

Data is love, data is life

#

Most of the crap I do is ETL on some level

deft sigil
# sudden cosmos Design Patterns helps you think about all code you will write in the future. Dat...

the only design patterns they will teach you in school will probably set you back a couple years as opposte to starting as a total novice with some good collegues at your first job... the closest most teachers have come to operatrional code is prolly there excel paychecksheet , other than that they are just propagating all the wrong stuff they had to learn from their teacher who had a book that was popular at the time or so

sudden cosmos
#

My new coworkers are sus, they got defensive about my first PR because I made another source file instead of adding it to the already 1000 line main file lmao

deft sigil
#

that depends , in a verry large code base its sometimes easier to find stuf and follow a thread /procedure in 20 insanely large files , then it is to find your way in 800 files 100 subdirectories , of wich half are prolly files with a single funciton or class with 2 methods of wich one is init so

#

on the other hand large files with code that has no logical coherense , and of wich more than half are commentblocks of wich half are not actually up to date anymore and lines clearly written by someone with a 3x ultrawide widescreen 4k monitor setup that needed to use all width is also 🙂

#

(on the other hand i get often the remark that i should use the vowels on my keyboard sometime to keep the wear evenly spread )

#

(and particulary for python: that the convention for star-arguments and starstar-keywordarguments is : py def function(*args,**kwargs): value=kwargs.get('key') return args,kwargs,value and not:```py
def fn(*a,**k):
v=k['k']
return a,k,v

deft sigil
#

(we had no choice in what courses we had to take , you chose a field (ICT, electronics, socialstuff, architecture, civil engeneer (= the crazy smart people also known as Master of Science in Engineering), civilian engeneer (=the not so smart ones that got to reap the benefits of the name) , or whatever , but courses within that were set ), so i had to take , JAVA, Visual Basic, Web(javascript),Excel,, msql , access they were all of real use later on lol)

sudden cosmos
#

About 50 of those lines actually need to be in main the rest is like UI event dispatching and initialization routines. Only 15 files it's not a huge code base