#development

1 messages · Page 52 of 1

fathom prawn
#

just a heads up i may be posting here for help alot lol im new to programming

glad bone
#

yeah np, prolly a lot of people here who can help with anything

fathom prawn
#

awesome

#

slice(F, 2, 5) F = “ABCDEFG” @glad bone can u help?

glad bone
#

slicing means that you're slicing your original strings at certain positions into smaller pieces.
In this example, the new string should start at index 2, which is 'C' and it should end at index 5, which is 'F'.
This means that slice will return "CDEF" (or "CDE" if index 5 is exclusive, depends on language/implementation)

fathom prawn
#

ok thx

#

concat(substr(X, 2, 4), G) X = “PQRSTUVW” G = “B”

#

@glad bone sorry to bother u again

glad bone
#

So, substr is basically the same as slice.
With index 2 and index 4 that'd be "RS".
Then concatenate "RS" with "B", making "RSB"

#

@fathom prawn

fathom prawn
#

thx

#

@glad bone can i just dm u for help?

#

when i need it lol

#

if not thats ok

glad bone
#

just put it here

fathom prawn
#

ok

#

toLowerCase(concat(substr(X, 2, 4), G)) same X and G as above

#

is this just going to be "RSB"?

glad bone
#

@fathom prawn No, as it converts it to lower case it turns into "rsb"

fathom prawn
#

ahh ok what about concat(toLowerCase(substr(X, 2, 4)), G)

glad bone
#

Well as you are converting the "RS" part to lower case, only that part will be lower case.

#

=> "rsB"

fathom prawn
#

ahhh makes sense thx

jagged kayak
#

reminder that my nanorand is currently the best non-cryptographic RNG crate in the Rust ecosystem, as it has a 4.5 GiB/s wyrand implementation (with 64-bit output)

fathom prawn
#

concat(pop(Coin), slice(F, 3, 4)) Coin = [ “H”, “T” ] F = “ABCDEFG” can anyone help me solve this plz

#

@glad bone

#

so u find pop(coin) which is "T" then slice which is "D" so would it be "T","D" ?

glad bone
#

"T", "D" or "TD", yeah

fathom prawn
#

awesome thx

clear flax
#

Are you cheating?

clear flax
#

Is there a way to put gradients over the top of buttons without affecting their button style using pure CSS?

#

Wait, found a way. Change the background-image rather than the background

fathom prawn
#

@unique flint yes thats is

nocturne galleon
#

Anyone able to explain to me why this isn't working?

#

Not sure why the package file isn't loading into the folder

#

Just learning to script, so feedback is helpful

proper gale
#

have you tried just enter?

nocturne galleon
#

Yeah, nothing

proper gale
#

have you tried linux?

nocturne galleon
#

The OS...?

proper gale
#

yea, probably works on linux

jagged kayak
#

^

warm sleet
#

@nocturne galleon installed all the packages you need?

#

$ npm install in the root of the directory of said project

#

that should download all the libraries it needs

#

$ node app.js to launch your node app

nocturne galleon
#

Ingot it to work

#

I just switched the file

#

Thanks anyways

hollow basalt
#

👌

vernal marsh
#

hi... just a question ... can any pair of 3 lines segments, where adding any of the 2 lines is longer than the last line segment create a triangle?

#

https://www.youtube.com/watch?v=qTRW7ELhhME&t I was watching this video (more like for 10 secs)... 🤷‍♂️ I just remembered property, I couldn't find anyone in comments saying it, so there must be a exception to it and I must be wrong in some way... but I can't think any 😕

hollow basalt
#

🤔

#

now that I think about it

#

x + > z makes sense no matter what

#

I can't think of an example where it doesn't

#

@vernal marsh what's your idea

vernal marsh
#

yeah me too 🤷‍♂️ that's the first solution came into my mind.. because its so freaking simple

#

I thought he would follow this when he said geometrical property

#

I am pretty sure we can proove this mathematically but 🤣 I am pretty lazy

hollow basalt
#

I still can't think of an exception

vernal marsh
#

yeah..... neither me 🤷‍♂️ ... I asked my brother who is major in maths he said that its fundamental property of triangle to have 2 sides addition larger than other side and it applies to all triangles.

#

I guess this goes the other way around too... if any combination of 2 sides is longer than third then it can form a triangle

hollow basalt
#

It should be that way

vernal marsh
#

lol I looked in comments for like pure 10 mins

#

no one wrote it.... I was like.. naah I might be wrong on this, there is no way..

#

anyways ... if anyone else 😅 looks at it pls let us know if we are wrong.. now I am fairly certain I am not... but still

gray gull
#

Anyone here a C++ Fanboy?

#

Lots, if not everyone I talk to is a Java boy

#

Either Java or Python

#

Very popular

warm sleet
#

only times I use C is for embedded

#

everything else, higher language

hollow basalt
#

what if I told you i like assembly

warm sleet
#

@hollow basalt macro assemblers ? xD

hollow basalt
#

I should try to spread the good language "brainfuck"

warm sleet
#

nah

#

LOLCODE

#

is much better

hollow basalt
#

hmm

#

does LOLCODE have webframework currently?

#

don't ask why TF would someone do that, ask why not

warm sleet
hollow basalt
#

oml

warm sleet
#

.lol

hollow basalt
#

oh a http server

warm sleet
#

@hollow basalt or even worse

#

emojicode

hollow basalt
#

was expecting a web framework

#

emojicode is a very productive language

#

other languages usually take time debugging

warm sleet
#

need a whole new keyboard

hollow basalt
#

emojicode uses most of the programmers time finding the emoji itself

#

spend more time coding instead of debugging

#

must be great

warm sleet
#

emojis are annoying

#

cus UTF8 vs Unicode

#

need to reserve double amount of bytes in my database

#

just to support emojis

hollow basalt
#

👀

warm sleet
#

unicode is 16 bit

hollow basalt
#

we should go back to wingding

warm sleet
#

lol

#

made with autohotkey lmao

#

cus windows cannot detect multiple keyboards as seperate keyboards

#

but autohotkey can

hollow basalt
#

eekk

#

guess it's time to convert some of the other mechs into emoji keyboards

cinder kraken
#

and of course it's a tom scott production

warm sleet
#

he's the emojigod

hollow basalt
#

and of course it's a tom scott production
he's the one brave enough to do it

warm sleet
#

first guy to upload a video on how it works

#

and they also made emogli

#

emoji only chat service

#

should be a feature of the warship during april's fools

#

mutes anyone not using emoji

willow lion
#

what?

cinder kraken
#

19" on the ruler, nice [REDACTED] bro
smashing keyboard you're banned

#

if i got it right

#

@hollow basalt

proud lantern
#

does anyone here have a favorite program to make basic vr games in? when I get my headset I wanna screw around with stuff like that

foggy ginkgo
#

I believe you could play around with Unity. Not into game development but I'm guessing that major 3D engines may lead you somewhere.

grand grail
#

Yeah, unity would be a good place to begin. plenty of resources and info on the web.

wanton cliff
#

@paper escarp

paper escarp
#

bruh

proud lantern
#

Okie thanks

tawny badger
#

Godot I think also started having vr support

warm sleet
#

I'm trying to recompile my kernel, but am running into some dependency issues with openssl

#
/tmp/ccZfY8Cs.o: In function `main':
sign-file.c:(.text.startup+0x4f): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x5b): undefined reference to `OPENSSL_init_crypto'
sign-file.c:(.text.startup+0x295): undefined reference to `OPENSSL_init_crypto'
collect2: error: ld returned 1 exit status
scripts/Makefile.host:91: recipe for target 'scripts/sign-file' failed
make[2]: *** [scripts/sign-file] Error 1
Makefile:560: recipe for target 'scripts' failed
make[1]: *** [scripts] Error 2
make[1]: Leaving directory '/home/crystal/kern/linux-source-4.4.0'
debian/ruleset/targets/common.mk:295: recipe for target 'debian/stamp/build/kernel' failed
make: *** [debian/stamp/build/kernel] Error 2
#

openSSL 1.1.1 isnt available through apt for me, so I compiled and installed it locally

#

I can find the references in /usr/local/include, but the compile step for the kernel still errors out...

#

I'm at a bit of a loss.

#
sudo apt list openssl -a                                                         
Listing... Done
openssl/xenial-updates,xenial-security,now 1.0.2g-1ubuntu4.17 amd64 [installed,automatic]
openssl/xenial 1.0.2g-1ubuntu4 amd64
#
$ openssl version -a
OpenSSL 1.1.1  11 Sep 2018
built on: Mon Sep 21 09:42:59 2020 UTC
platform: linux-x86_64
options:  bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr) 
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DNDEBUG
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/lib/engines-1.1"
Seeding source: os-specific
#

I'm not one for premature celebrations, but I think I am making progress

warm sleet
#

@hollow basalt nah,ubuntu 16

#

this is my daily driver

#

and its very outdated, so lot of packages and parts I've been fixing on my own

#

main reason for recompiling..

#

PREEMPT

#

Kernel preemption is a method used mainly in monolithic and hybrid kernels where all or most device drivers are run in kernel space, whereby the scheduler is permitted to forcibly perform a context switch (i.e. preemptively schedule; on behalf of a runnable and higher priority...

#

not on LTS

#

and I wouldn't anyways, because it would literally

#

break

#

everything

#

PREEMPT kernels have 'low latency' desktop

#

GNOME has a tendency to freeze, when there's a lot of IO or kernel cpu usage

#

preemptible kernel, gives priority to user-space

#

so it doesnt freeze the desktop

#

it also gets rid of vsync issues

#

backend dev

#

This fixed my compiler issues ^

#

compile and install from source lol

#

server and desktop are much alike

#

except no DE

#

well

#

kernel 4.7 needs new OpenSSL library to compile

#

and ubuntu 16 has only up to version 1.0.1g

#

but I need at least 1.1

#

you gon call your isp today?

#

ask them the spice?

#

sorry

#

thiskeyboard is shit

#

work keyboard

#

rubber dome

#

I hate it

#

Im not bringing a greasy RGB keyboard into work

#

I have corsair xD

#

K70 RGB

#

dual monitor + laptop on a stand

#

so I use external

#

yeah its a thing you put your laptop on

#

raises it off the table

#

so its same height as your monitors

#

its like a dock

#

but without cables.

#

I could use the dock

#

but I don't have usbc

#

still compiling

#

-1/10

warm sleet
#

@hollow basalt rip

#

no pics 4 me

#

azure KEKW

#

cloud KEKW

#

Install this ^

#

FF?

#

it makes cloud marketing seem a bit more realistic

#

uploading your files to my butt

cinder kraken
#

sounds like something stanley from the office would say

warm sleet
#

I'm using word online, to do spellcheck on all my markdown files

#

this feels so wrong

#

rip tim

#

@hollow basalt at home I have two 1080p60 displays, and laptop on the side

#

laptop is also my HID host

#

so desktop's keyboard & mouse comes from the laptop

#

3 screens, two machines, one keyboard & mouse

#

One of the few pieces of software, I actually paid for

#

I paid for the pro version

#

cus it has TLS encryption

#

:/

#

yawn

#

yes

#

I use my private laptop @ work

#

since

#

I refuse to work on windows

#

if macbook people can get away with it

#

then so can linux users

#

wa

#

no its not

#

xD

#

nm-connection-editor

#

ez

#

I use L2TP

#

mh

#

well

#

I configured L2TP on my mikrotik

#

mostly because it works on android, iOS, windows, linux and OSX

#

PPTP is old

#

and not as secure

#

L2TP/IPsec is the norm nowadays

#

cool

#

compiler is done

#

its now packaging

#

then

#

it has to prepare bunch of headers

#

there's lot of propietary solutions out there too

#

I think l2tp/ipsec, with passphrase is only like 2 passwords

#

what software is it?

#

wat

#

does it make a sound?

#

SUCCESS

#
sudo dpkg -i linux-image-4.4.232_4.4.232.custom_amd64.deb linux-headers-4.4.232_4.4.232.custom_amd64.deb
Selecting previously unselected package linux-image-4.4.232.
(Reading database ... 647016 files and directories currently installed.)
Preparing to unpack linux-image-4.4.232_4.4.232.custom_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.232 /boot/vmlinuz-4.4.232
Done.
Unpacking linux-image-4.4.232 (4.4.232.custom) ...
Selecting previously unselected package linux-headers-4.4.232.
Preparing to unpack linux-headers-4.4.232_4.4.232.custom_amd64.deb ...
Unpacking linux-headers-4.4.232 (4.4.232.custom) ...
Setting up linux-image-4.4.232 (4.4.232.custom) ...
#

:D

#

hopefully this works

#

I grabbed the source of my currently running kernel

#

and generated the config, from the running kernel

#

so it should work

#

k

#

installed

#

nvidia drivers also recompiled successfully :o

#

kk

#

moment of truth

#

Linux watomat 4.4.232 #1 SMP PREEMPT Mon Sep 21 13:15:54 CEST 2020 x86_64 x86_64 x86_64 GNU/Linux

#

you can change that :P

#

/etc/apt/sources.list

#

vmware

#

barf

#

only reason I had to do thiskernel upgrade lol..

#

was because my previous kernel... was about a year old

#

lol

#

hold on

#

lemme see how many kernels I have installed on this

#
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.232
Found initrd image: /boot/initrd.img-4.4.232
Found linux image: /boot/vmlinuz-4.4.185+
Found initrd image: /boot/initrd.img-4.4.185+
Found linux image: /boot/vmlinuz-4.4.179+
Found initrd image: /boot/initrd.img-4.4.179+
Found linux image: /boot/vmlinuz-4.4.167+
Found initrd image: /boot/initrd.img-4.4.167+
Found linux image: /boot/vmlinuz-4.4.162+
Found initrd image: /boot/initrd.img-4.4.162+
Found linux image: /boot/vmlinuz-4.4.155+
Found initrd image: /boot/initrd.img-4.4.155+
Found linux image: /boot/vmlinuz-4.4.144+
Found initrd image: /boot/initrd.img-4.4.144+
Found linux image: /boot/vmlinuz-4.4.140+
Found initrd image: /boot/initrd.img-4.4.140+
Found linux image: /boot/vmlinuz-4.4.0-189-generic
Found initrd image: /boot/initrd.img-4.4.0-189-generic
Found linux image: /boot/vmlinuz-4.4.0-142-generic
Found initrd image: /boot/initrd.img-4.4.0-142-generic
Found linux image: /boot/vmlinuz-4.4.0-45-generic
Found initrd image: /boot/initrd.img-4.4.0-45-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
#

generic kernel is one without any ubuntu patches

#

the ones with a + are self compiled

#

like

#

4 years now?

#

I never removed the old ones

#

lol

#

distro kernel is installed alongside my system, but I dont use it

#

literally, how to recompile kernel:

#

$ apt install linux-source

#

$ cd /tmp

#

$ tar xf /usr/src/linux-image-$(uname -r)

#

and then

#

$ make olddefconfig to generate make configs using your current kernel

#

fakeroot make-kpkg -j2 --initrd --revision=4.4.232.custom kernel_image kernel_headers

#

@hollow basalt yeah yea

#

this is

#

recompiling the distro's kernel

#

linux-source is whichever your distro is

#

easy install

#

xD

#

ubuntu server installation takes like 2-3 mins

#

anylonger and you are doing it wrong

#

@hollow basalt did it download the one you selected ?

#

cus that's completely wrong architecture xD

#

you installing this on a vmware host?

#

why do you need a desktop?

#

ubuntu desktop is 80% programs

#

and 20% OS

#

ye

#

I have a windows desktop

#

and linux laptop

#

and like 5 linux servers

#

I game on my desktop

#

and its also got a nice watermark

#

"Activate Windows"

#

nop

#

I have a legit key

#

just.. windows installation is so broken

#

that it errors out when I enter key

#

some weird error in system32

#

and the effort involved in reinstalling windows

#

vs

#

not giving a fuck & just game

#

cus windows isn't 1. 2. 3. done

#

takes

#

ages to get all the programs

#

back the way they were

#

copy the %APPDATA%, and pray all the settings get carried over

#

that sort of bs

#

what?

#

is it ?

#

on linux this is so normal lol

#

~/.config/

#

just copy that

#

and ezgame

#

should write a program/toolkit

#

for managing .config <--> appdata

#

for various programs

#

even mac is suprior in that regard

#

programs and program databases can be fully backed up on macs

#

it is

#

did you know that linux isnt? xD

#

linux isnt fully posix compliant

#

but mac is

#

linux does things little different

#

details..

#

quircks.

#

always

#

there's

#

1000s of different sound cards

#

but if they are usb

#

they all use usb-snd-core

#

1 driver

#

but the cards's specifics, have to be configured in the driver

#

often called 'quircks' mode

#

when you have issues on linux

#

and people suggest to maybe install drivers.

#

I just..

#

die inside

#

did you know that with many drivers

#

the drivers are in the kernel, often before the hardware is even released

#

lot of intel stuff

#

and amd

#

pretty much all that, works out of the box

#

currently, the only driver that doesn't play ball

#

is nvidia

#

I use DKMS to load it into the kernel

#

its a way to have drivers live outside of kernel code

#

when you install a new kernel, it has to link the nvidia drivers to the new kernel binary

#

and then it installs

#

nouveau

#

there's two areas on linux

#

where I die inside, if i have to debug them

#

Xorg

#

and

#

ALSA

#

display stuff and sound stuff

#

configuring that

#

is hell

#

xD

#

you can make it work

#

just have to know what config to wrangle

#

lol

#

"Please contact system administrator"

#

esp, if the software runs into an error

#

why can it not fix itself

#

why does a human need to press a button to "unfuck" it

#

ugh

#

2 more hours

#

then I get to go home

#

and get back to building in factorio

#

xD

#

nothing much changed for me

#

except, that I use a car to go to work now

#

instead of public transport

#

dont want to be among the proletariat and get sick

#

esp since the average dutch person gives 0 fucks

#

people not wearing masks

#

2nd wave is happening here right now

#

Rotterdam and Amsterdam are declared "red zones"

#

and we barely test

#

@hollow basalt you should have seen.. the day the lockdowns and pandemic started

#

they said, they were going to close the coffeeshops (place to buy weed)

#

and literally

#

that same evening

#

100s of people in line

#

next day, they reverted decision

#

you cant smoke in the cafe itself

#

but you can go in, to buy some

#

yeah, I mean

#

if there's on thing that is good during pandemic

#

people gettin high, at home on the couch

#

instead of going out in public

#

@hollow basalt KVM/QEMU

#

And this is my front-end

#

virt-manager is great

#

:)

#

And this console emulator

#

I dont use vnc

#

I just have X11 forwarding

#

ssh -X root@server

#

huh

#

download, install, and run Xming

#

then in PuTTY

#

set X11 screen to: localhost:0.0

#

and it works

#

I use Xming with putty & forwarding also

#

x11spice also works

#

its an alternative

#

@hollow basalt my VM host doesnt have a DE either

#

but I do run GUI programs on it

#

via forwarding

#

you dont need that

#

only if you want the host to shutdown the guest, without a hard-kill

#

and network autoconfig

#

also uses tools

#

I usevmware too

#

but if I need options

#

I just go with debian

#

yeppers

#

debian is also the distro

#

that if you need help with

#

you will always find someone using it

#

if you want latest and greatest

#

go Fedora

#

Fedora is often the first distro to support new hardware features

#

because its rolling release

#

Friend of mine runs Tumbleweed

#

Rolling release

#

Incredibly stable

#

nah I mean

#

if you want to try out

#

the latest and greatest graphics

#

Fedora is usually the first to deliver an OS with the newest kernel

#

for testing purposes and bleeding edge, you'd do that

#

really?

#

mh

#

ubuntu server doesnt need much

#

can run that stuff with 500MB ram

#

and 1 core

#

ubuntu desktop

#

has a bunch of things that slow your PC

#

like

#

tracker-miner-fs

#

it indexes all your files

#

and sucks up CPU

#

:D

#

transparant terminal

#

xD

upbeat nymph
#

@warm sleet uh....did someone get banned here?

warm sleet
#

?

upbeat nymph
#

Or you just talking to yourself?

warm sleet
#

@hollow basalt keeps deleting their messages

upbeat nymph
#

But...why?

hollow basalt
#

@warm sleet Why would he delete it

warm sleet
#

Maybe for this exact comedic effect

hollow basalt
#

what's the comedy

warm sleet
#

har har

#

funny

hollow basalt
cinder kraken
#

holy shit

#

you just wiped 24h worth of messages

warm sleet
#

@cinder kraken baited xD

hollow basalt
#

me scrolling @warm sleet 's messages

cinder kraken
#

it looks like a monologue from a mental asylum

warm sleet
#

I do have a diagnosis

#

but not for that

hollow basalt
finite void
#

would it be possible to port the code from lets say an old console to a pc and change the code up so that it could use your hardware and act like a console as in using original disks in said pc

nocturne galleon
#

can i get a what what from all my haskell users out there?

tender glen
#

Currently making a hands free bot so that people who want founders additions of 3080s, 3090s or 3070s can get ONE without having to die clicking reload. Heres about 4 hours of work, currently in the optimizing stage so its a bit slow on startup: https://youtu.be/AUAe4vkkCz4

Realy build of something I threw together in about 4 hours. Its meant to allow someone to make a single purchase before all the other mass purchase bots can get through. Currently kinda slow and only works on chrome. If I do some debugging I might work on getting it to run on ...

▶ Play video
hollow basalt
#

Anti scalper bot

#

But you're also botting?

#

Wait until Nvidia shows captcha kshhhh

tender glen
#

I already beat the basic robot identification

#

And yes I'm also botting. The point isn't to stop botting, but let people who actually only want one or two cards but them.

nocturne galleon
#

Question: (heres the line of code)

#

Anyone know what the issue is?

hollow basalt
#

where did you even delcared the message @nocturne galleon

#

I guess it's supposed to be

bot.on('message', message => {

}
nocturne galleon
#

yeah

#

I fixed it

#

Thanks

next igloo
#

which is better to learn (I know very basic JavaScript and i know how to code in scratch well)
Python, Java, C++ or Lua (Lua as in Roblox game development)

orchid bough
#

Depends what you're trying to do?

nocturne crypt
#

if you want to do systems development

#

your answers are Rust, Go, and C++

#

if you want to do web services, you need to learn one of the above and then learn docker/podman

#

most of the core languages have binding to JIT languages such as Lua

unreal robin
#

Any web developers here

round dome
#

hope not

hexed harness
#

trying to teach myself python can't see anything wrong but apparently there is

#

most likely a dumb question but i got to start some where

next igloo
#

If it is a simple question about html or css i can help you

vital blaze
#

@hexed harness What are you trying to do?

hexed harness
#

make it ask me to add something to y then print y then repeat

vital blaze
#

Add to y or set y to equal?

hexed harness
#

add

vital blaze
#

how many times do you want to do that?

#

It would have to be a set number of times, untill y reaches a certain value or you could have a specifiq input stop the program.

hexed harness
#

is there a way to make it loop endlessly?

vital blaze
#

Yes. I use a while loop instead of a for loop then.

#

A for loop is better if you know how many iterations you need, and a while loop is better for iterating until a condition is met.

#
while True:
  do_stuff()

Will loop forever

#

If you are getting an integer from input you'll have to cast it to an int since the input() function will return a string.

hexed harness
#

so while true do

end?

vital blaze
#

There is not a do and end in python the blocks of code are defined on indentation.

hollow basalt
light prism
#

While true will work in most languages

vital blaze
#

```html (newline)
code
```

deft stone
#
    <div id="einstein_bio">
        A Breif Bio of Einstein
    </div><!-- End of einstein_bio Div-->

    <div id="mozart_bio">
        A Breif Bio of Mozart
    </div>
    <!--End of Mozart_bio Div-->

</div>``` I want to select the mozart and einstein bio with a  jquery command to hide.
#

can someone help me, i cant figure out how to use descent and filter with bio at the same time

light prism
#

You want to hide them with JS rather than CSS?

deft stone
#

with jquery

light prism
#

JQuery is JS

#

Its just a framework

deft stone
#

ohh ping

#

but yeah, i know jquery is working in the document, because i was able to hide the whole page

light prism
#

$('#einstein_bio', '#mozart_bio').hide()

deft stone
#

my proffesor is a little picky, i wanted to do that, but he wants us to use the filters

#

i tried this, but its not working

light prism
#

I mean you can just do $('*_bio') that will select anything that ends in _bio

deft stone
#

i just tested that, it doesnt work

light prism
#

One sec im just checking havent used jquery in so long

#

Ah yeah it does use the queryselector syntax so

$('[id$="bio"]')

#

@deft stone

#

They still teaching jQuery in Uni?

deft stone
#

yeah

light prism
deft stone
#

i'll send it over

#

its old technology, but yk how long it takes for them to transition to latest tech

#

eventhough we pay 40k a year in tuition

vital blaze
#

The webdev course at my uni asks the students to use pictures for buttons.

deft stone
#

glad mine isnt that bad

vital blaze
#

It's mostly just that one prof who's terrible. The rest of them range from mediocre to pretty good.

deft stone
#

TBH i am tired of being a college student at this point, because i am tired of learning old technology. None of my college classes teach AWS, which is the next big thing

#

i discussed this with some advisors and proffesors, and they just shrug it off, and tells me 'its a long process to add a course'

nocturne crypt
#

okay, one should not learn AWS

#

one should learn what composes the various micro service architectures

#

AWS is cool but it's like 1% of the ecosystem it represents

#

If you really want to learn actual web development

#

learn Rust, Go, and C++

#

javascript and HTML5 are made up based text languages which you can infer from knowing one of those languages

#

afterwards

#

college is not there to teach you specific things tailored to the private sector. college is there to provide a route to learn new material

#

trade schools provide instruction for specific domains in the private sector

deft stone
#

@nocturne crypt those are some wise words, thats why on the side i am learning aws on my own through udemy

hollow basalt
light prism
#

When I was at uni I did a course specifically in IBM mainframe because it's such a niche subject system z that everyone that knows about it is getting to retirement age lol

hollow basalt
#

When I was at uni, I did study

light prism
#

Chicken science 🐔 the best subject

obtuse stump
#

Starting with Rust, Go and C++ is crazy, imo. What is even "actual web development" and why isn't JavaScript/Typescript + NodeJS better for beginner?

#

Or even, gasp, Java, endgasp.

hollow basalt
#

NodeJS better for beginner
Because I wouldn't teach someone about the event loop while they are printing hello world

#

(my 2 cents)

obtuse stump
#

So Java it is 🤗

hollow basalt
#

@warm sleet he's starting java

grizzled steeple
#

I always start teaching with C#, 'cause it's comparatively easy, yet has all the commonly used programming blocks, that make up most modern day software (like OOP, strong data typing, easy to use console Interface, etc)

warm sleet
#

Java is less... microsofty-yy

grizzled steeple
#

Obviously Java is pretty similar, but I found it more difficult to start out with a Project then C#, since VS has built-in project templates

hollow basalt
#

then that's IDE opinion

#

not language

grizzled steeple
#

In the end, everyone has their own preferences

warm sleet
#

visual studio is bad

#

really slow

grizzled steeple
#

I don't like VS either

#

IntelliJ all the way xD

warm sleet
#

I just use IDEA

grizzled steeple
#

. . .

obtuse stump
#

I used to use VSC for NodeJS/React, but lately I have transferred everything to either Webstorm (NodeJS, React) or Idea (Java)

warm sleet
#

I use this as my primary tool

#

does it all pretty much

hollow basalt
#

use notepad++

obtuse stump
#

Webstorm is basically Idea with some plugins, but I like the separation.

hollow basalt
#

no no

#

webstorm is a stripped down version of ideaa

warm sleet
#

just get intellij

#

and install the plugins

#

works same

#

cheaper

hollow basalt
#

but idea is more expensive

warm sleet
#

I have professional version

obtuse stump
#

I have bundle of everything anyway

#

all of Jetbrains stuff

#

I use Datagrip a lot as well

warm sleet
#

But community edition of IDEA is good enough

#

has all the features youd want for a java program

hollow basalt
#

IDEA is pretty much all the IDE

#

you want pycharm? install the python plugin

#

you want datagrip?

#

it's built in

warm sleet
#

I have Clion seperately

hollow basalt
#

you want inner peace?
idea can't give you that

grizzled steeple
#

I have never seen the point in Webstorm, if I can do all my development in IntelliJ. That includes NodeJS, Vue/Nuxt, Angular, etc.

warm sleet
#

yeah on IDEA thats just plugins

grizzled steeple
#

The problem with the Community Edition is that many Plugins are not available for it

warm sleet
obtuse stump
#

Won't all of those plugins make it slower in the end?

hollow basalt
#

it would

#

so don't enable everything

warm sleet
#

IDEA is quite heavy because it has a huge index

#

2-3GB

#

on large projects

#

but once that index is ready

hollow basalt
#

if you want a lightweight editor, use notepad++

warm sleet
#

its very very fast

#

IDEA is generally fast when you use it

#

just startup is slow

#

Visual Studio is slow while you use it

obtuse stump
#

Yeah, I think I still prefer to have Webstorm for JS/TS and Idea for Java

hollow basalt
#

Visual Studio is slow while you use it
Visual Studio is slow while you use it

warm sleet
#

I've done MVC web development on both java and C#

#

found the java variant to be a bit saner

#

.NET adds a lot of crap

obtuse stump
#

Java is more used in the industry, so for learning purposes it might be more useful.

#

But I would think it is quite simple to transfer from C# to Java and back, haven't tried it myself though.

grizzled steeple
#

Yeah, VS is just slow AF. The only thing I like about VS is the default dark color theme. But I know I'm somewhat alone with that opinion

warm sleet
#

@obtuse stump I currently do both

#

some projects I do Java on backend

#

and .NET on frontend desktop

obtuse stump
#

I am nutty in that regard, I use all-white themes everywhere 😄

warm sleet
#

because winforms with drag and drop is easy

#

I suck at UI/UX

#

if I need to do webfrontend

#

I tend to reach for some bootstrap variant

obtuse stump
#

White theme is better visible in the sun and I like to work out on the porch 😄

warm sleet
#

and use MVC

#

with AJAX

grizzled steeple
#

Honestly, lately I've tried to work myself into Electron for App development, mostly since I'm well familiar with HTML/CSS

#

And I've kinda been transitioning to Fullstack JS/TS development anyways

obtuse stump
#

I haven't tried Electron myself, but I have heard that it is possible to make snappy/good application in it 😄

#

Haven't just seen one yet 😄

#

Slack, looking at you!

hollow basalt
#

iirc spotify used to be

grizzled steeple
#

You're litterally using an Electron App rn (unless you're using Discord in your browser)

#

Spotify is not Electron

obtuse stump
#

I cannot understand what is happening with Spotify development, management must be so bad there.

warm sleet
#

688 lines of DDL

#

For the database of my gameserver

obtuse stump
#

Nice, named constraints, hate when people don't name theirs 😄

warm sleet
#

then theres another 2000 lines

#

of SQL procedures

#

and half a dozen triggers

hollow basalt
#

Spotify is not Electron
||used to be||

warm sleet
#

some functions

#

xD

grizzled steeple
#

In many cases with Electron Apps, there's also a Web interface that looks almost identical, like is the case with Discord, Slack, MS Teams. But not always is this the Case. I ran into issues once with an experimental Nuxt implementation with Electron, because it's default Port was already used by the Logitech G Hub for it's interface xD

warm sleet
#

@obtuse stump some things are very nice if you do a bit of advanced sql

#
DROP PROCEDURE IF EXISTS proc_bungee_check_login;
CREATE PROCEDURE proc_bungee_check_login(
  IN ip VARCHAR(15), IN playerid BINARY(16)
)
  BEGIN
    DECLARE adr INT UNSIGNED DEFAULT INET_ATON(ip);
    IF EXISTS(SELECT ''
              FROM player
              WHERE uuid = playerid AND banned IS NOT NULL)
    THEN
      SELECT
        'PLAYERBAN' AS state,
        banreason,
        banned
      FROM player
      WHERE uuid = playerid;
    ELSEIF EXISTS(
        SELECT ''
        FROM ip_address
        WHERE address = adr AND banned IS NOT NULL)
      THEN
        SELECT
          'IPBAN' AS state,
          banreason,
          banned
        FROM ip_address
        WHERE address = adr;
    ELSE
      SELECT
        'NONE' AS state,
        NULL   AS banreason,
        NULL   AS banned;
    END IF;
  END;
grizzled steeple
#

And the new NZXT Cam software is Electron as well from what I can tell

warm sleet
#

this procedure checks if player is either banned or ipbanned

#

I usually define a java interface, for all my procedures

#

and just have a simple facade to interface with

obtuse stump
#

Yeah, it is sometimes much more performant to do the query/logic near data.

warm sleet
#

these are two rather big tables

grizzled steeple
obtuse stump
#

Btw, who else loves that in oracle databases '' and NULL are equivalent 😄

#

Gotta love legacy.

warm sleet
#

'' is empty string

#

if you do EXISTS

#

it just checks if theres a record in a table

#

and that table is a subquery

#

the goal of this procedure

grizzled steeple
#

We use an Oracle Database at work, and I hate it. But yeah, generally speaking if you have a VARCHAR2 column, and put an empty string in it, Oracle will store NULLinstead...

warm sleet
#

is to return 3 columns, banstate (NONE, IPBAN, PLAYERBAN)

#

then banreason

#

and then expiration date, or 0 for permanent

obtuse stump
#

Ah, I didn't even look at your code (or rather, I looked but did not catch it there), it was just a general reminder of good times debugging something.

warm sleet
#

@obtuse stump this runs on the proxy of my minecraft server xD

#

IDEA database is unconfigured, so thats red

#

my only objection in that code, is how I get the UUID into the db, I used to do the unhex on the database

#

but newer parts of software use raw bytes directly with jdbc

#

this is like a 6 year ongoing project

obtuse stump
#

Nice, longest my personal project has ever lasted is about 3 months.

warm sleet
#

This was the project I learned my craft with

#

I've got many other things since then

#

but this one still lives and breathes

#

even had some other contributors work on it too

#

closed source though

obtuse stump
#

Haven't found anything that I really would need, so most of my personal projects are just trying out some new things.

warm sleet
#

I plan on one day

#

opensourcing the engine it has

obtuse stump
#

That are too risky to try out on work projects.

warm sleet
#

Its a cross-server synchronization plugin basically

#

but it has

#

many parts

#

you have the core plugin

#

which just facilitates custom data in sql

#

and then there's a chat system ontop of that

#

these two, can then be ran with a proxy

#

and have synchronized inventories between servers

#

as well as chat

#

also, has another module you can install for things like a backend API

obtuse stump
#

Wow, that is quite sizeable project indeed.

warm sleet
#

xD

#

we had some network services

#

like profiles you could view online

#

leaderboards

#

and that project grew as well

#

and it can now grab live data from the servers

#

chat works on discord too

#

xD

#

its total about 35k lines of code

#

this is for a harry potter themed roleplay server

#

so spells, magic, plants, potions, pets

#

minigames

#

tons of scorekeeping and tracking

#

since its roleplay

#

quests as well

#

Discord implementation was quite easy actually

#

we already had this, for IRC back in the day

#

and just added another instance of that handler, with another prefix name xD

obtuse stump
#

👍

dense marten
#

I'm writing a .htaccess file and I'm getting an error about bad flag delimiters, does anything immediately stick out as being wrong to anyone?
RewriteRule ^(apis|images)($|/) - [L}

dense marten
#

oof, I mismatched the brackets

#

it's always the little things

warm sleet
#
sudo apt install npm  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 npm : Depends: nodejs but it is not going to be installed
       Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
       Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
       Depends: node-ansi-color-table but it is not going to be installed
       Depends: node-archy but it is not going to be installed
       Depends: node-block-stream but it is not going to be installed
       Depends: node-fstream (>= 0.1.22) but it is not going to be installed
       Depends: node-fstream-ignore but it is not going to be installed
       Depends: node-github-url-from-git but it is not going to be installed
       Depends: node-glob (>= 3.1.21) but it is not going to be installed
       Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
       Depends: node-inherits but it is not going to be installed
#

Anyone has an idea what is going on here?

#

I have nodejs installed

#

there's an old version of npm on my system, that was installed through source

#

that version does not work

#

but trying to then install one through my package manager, does not work

warm sleet
#

nvm

#

I figured out the issue

#

npm was installed twice, path configuration used an older version that shipped with the distro

#

/usr/bin/npm vs /usr/local/bin/npm

hollow basalt
little knoll
#

Also, you should update npm via npm (nothing wrong here)

sudo npm i -g npm@latest
warm sleet
#

@little knoll why they don't just use apt for this

#

oh well.

#

nodejs developers are snowflakes anyways

#

the problem I was having has to do with this:

#
$ apt-cache policy npm
npm:
  Installed: (none)
  Candidate: 3.5.2-0ubuntu4
  Version table:
     3.5.2-0ubuntu4 500
        500 http://nl.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://nl.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
#

didnt see that NPM was installed with the nodejs package

#

so when I searched for npm, it only listed the ancient versions from Ubuntu Xenial

#

and this is very confusing and a bit against the linux package logic

#
$ apt show nodejs
Package: nodejs
Version: 12.18.4-1nodesource1
Priority: optional
Section: web
Maintainer: Chris Lea <chl@nodesource.com>
Installed-Size: 92,3 MB
Provides: nodejs-dev, nodejs-legacy, npm
#

the nodejs package shouldn't be installing npm as well

little knoll
#

Well, that's a common thing to distribute package manager updates through the package manager itself afaik (pip also does that)
Also, due to apt and others linux packages manager, packages aren't always up to date on their repos, so the best way to get the latest npm (or even pip) version is to download the latest version from itself.

#

And furthermore, your apt-cache should point to nodesource for npm afaik so that's even weirder

grizzled steeple
#

And when it comes to Node and NPM, I'd highly suggest using NVM, as it allows for easier switching between Node versions, and completely goes around this issue

dim shard
#

Hey does anyone know where, in the US, software companies that will hire high schooler doing CompSci

warm sleet
#

@little knoll yeah I expected npm to be its own package, but its bundled with nodejs

#

I guess nodesource is nonstandard in this

#

@grizzled steeple Im not using nvm ever again.

#

I used it once

#

Its. so. slow.

grizzled steeple
#

NodeJS usually comes with NPM?
At least the Windows builds come with NPM

warm sleet
#

@grizzled steeple ye nodesource on debian does too. apparently xD

grizzled steeple
#

To be totally honest, I've been more of a Windows dev, so I don't know about Node on Linux all that much. NVM on windows isn't that bad, it's actually fairly quick, since it only switches a few sym-links around

warm sleet
#

yeah..

#

my experience with nvm on linux was, that it made my shell... crawl

#

literally, 1-2 second wait, between commands

#

not sure if this was because I use zsh

grizzled steeple
#

I couldn't tell

warm sleet
#

besides

#

if you need an older or newer variant of nodejs

#

they have different repositories for each major release

tribal root
#

public class computers{
public static void Main() {
computers mypart = new computers();
mypart.setname("Doofus");
mypart.setweight(15.0);
System.out.println(mypart.getName());
}
}

#

anybody know why setname and setweight do not work

dense marten
#

Do you have a setname and getName function?

tribal root
#

i do not have a setname method

#

function i ment

dense marten
#

for something like this it seems like it would make more sense to have the name and maybe the weight be part of the constructor

tribal root
#

so would i do public weight

dense marten
#

not necessarily but if you made a constructor it would be computers mypart = new computers("Doofus", 15.0)

#

You could do it your way now but you would need to have a method/function called setname() that updates the name variable in the class

tribal root
#

so how would you create that method

#

it says it can not find the method setweight and setname

dense marten
#
public class Computers {
    private String name;
    private double weight;

    public Computers(String name_, double weight_) {
        name = name_;
        weight = weight_;
    }

}
#

this would be an example of using a constructor in Java

#

if you want to use setname or setweight you have to write those methods

tribal root
#

so is setweight a object

#

and setname a object

dense marten
#

you could do

public class computers {
    private String name;
    private double weight;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }
}

The set and get methods are methods you have to create

tribal root
#

thsi si what i have

#

public class computers{
public static void Main() {
computers mypart = new computers();
mypart.setname("Doofus");
mypart.setweight(15.0);
System.out.println(mypart.getName());
}
}

#

it is saying setname and setweight are not a method

dense marten
#

That's because you haven't written them yet

tribal root
#

so how would i write them

dense marten
#
public class computers {
    private String name;
    private double weight;

    // Do this again but for weight
    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public static void main() {
        computers mypart = new computers();
        mypart.setName("Doofus");
        mypart.setWeight(15.0);
        System.out.println(mypart.getName());
    }
}
#

it's how I said in my last post, you have to make a method public String getName() and a method public void setName()

tribal root
#

and then the setweight into the string

#

that makes sence

light prism
#

Or in builder pattern

public class Computer {
  private String name;
  private double weight;

  public String getName() {
    return name;    
  }

  public Computer setName(String name) {
    this.name = name;
    return this;
  }

  public double getWeight() {
    return weight;
  }

  public Computer setWeight(double weight) {
    this.weight = weight;
    return this;
  }

  public static Computer newInstance() {
    return new Computer();
  }
}
dense marten
#

no you can write a setWeight that takes in a double

#

or a string, up to you

#

whatever makes sense for your workload

tribal root
#

oh i see

light prism
#

You could even make multiple versions that take either option and convert

nocturne galleon
#

what is a "procedural programming language", is it just a language with functions?

hollow basalt
#

It would be confusing to say it as functions

#

Since we have functional programming

nocturne galleon
#

damn

#

now im even more confused

dense marten
#

Functional programming to my understanding means a function must always give the same output if it is given the same input whereas procedural programming can have states (such as a global variable)

hollow basalt
#

functional programming is what mathematical functions looks like when written

hot grotto
#

ok so

#

i need a php/html which ever web text file editor

#

im building a minecraft management panel

hollow basalt
#

@hot grotto cool

hollow basalt
#

lemme find something

#

I used to try browser editors

#

some of them were PHP

hollow basalt
#

so your problem RN is the rendering is broken

hot grotto
#

none of the code i see only will open a text file

#

even if its hard coded for directory

#

in the html file

hollow basalt
#

so for simplicity it should be like this:

  1. Request file
  2. PHP read file from disk
  3. Return file contents to frontend
  4. Edit file
  5. PHP write file into disk
#

are we on the same page?

#

are we on the same page?
pun not intended

hot grotto
#

i know

#

lol

#

<?php

// configuration
$url = 'http://example.com/backend/editor.php';
$file = '/path/to/txt/file';

// check if form has been submitted
if (isset($_POST['text']))
{
// save the text contents
file_put_contents($file, $_POST['text']);

// redirect to form again
header(sprintf('Location: %s', $url));
printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
exit();

}

// read the textfile
$text = file_get_contents($file);

?>
<!-- HTML form -->
<form action="" method="post">
<textarea name="text"><?php echo htmlspecialchars($text) ?></textarea>
<input type="submit" />
<input type="reset" />
</form>

#

so many scripts out there yet none work

hollow basalt
#

can't you load the page first

#

then AJAX call to the backend to retreive the file

hot grotto
#

uhh page is loaded first

#

have tried using ajax

#

and it still wont load

hollow basalt
#

stupid question

#

Does www have permission to the file

hot grotto
#

it does indeed

#

i have put it in the web server itself as well

#

and its accessable

hollow basalt
#

so currently the problem is?

#

the text is not shown correctly?

hot grotto
#

the problem is the script code wont open any files

warm sleet
#

Can someone enlighten me on why some imports in typescript/nodejs, are prefixed with an @ ?

#

as an example:

#
import m from 'mithril';
import {MithrilTsxComponent} from 'mithril-tsx-component';
import {UmbracoBlog} from "../common/heartcore.query";
#

vs

#
import {Client} from '@umbraco/headless-client';
#

what does it mean if there's an @ ?

#

mithril is a node_module, just as the ^ headless-client

hollow basalt
#

@warm sleet isn't @ supposed by the transpiler [or bundler]?

warm sleet
#

I dont know xD

light prism
#

I that context it is just a name of a folder

#

So you should find a folder called @umbraco in node modules

hollow basalt
#

🤔

light prism
#

However there are other uses of it depending on the compiler.... For example it can be used to define the root of the project rather than node_modules root like @/src/main etc

#

In other contexts like webpack it can be part of the bundler like Can't says and be used to define a transpilation

#

So it depends on where you are using it

#

It is also sometimes used as the framework developers know that it will want to defined in a specific way

#

In conclusion: Like many things in JS it doesnt only have one single definition and can be very confusing to people that are learning the language

#

#JSForLife

warm sleet
#

I'm a java dev, new workplace

#

all is .NET and node

#

xD

#

@light prism I'm developing a new framework/toolset for their application development

light prism
#

Good man

warm sleet
#

and replaced by an all-node based app

#

currently, they are doing routing based paged as well as SPAs

#

so the framework I am setting up, has three modules

#

client side code, server side code, and a common code lib

#

libraries used by the server can also ran on the client

light prism
#

Problem I have run into when people use all node solutions

Most important thing: when running in production make sure node is set to production mode otherwise you will hit a serious performance bottleneck

warm sleet
#

things like content providing to a mithril SPA

#

@light prism I'm quite stoked on this though :D

light prism
#

Also remember node is not multi threaded

#

Dont treat it like it is

warm sleet
#

pretty cool that i can write a client in node, and use it on both server and client

#

I know node's threading model isnt the same

#

with java, you have 1 thread for 1 request

#

javascript encourages functional aproaches

light prism
#

Yeah... Ive not used mithril but I have done angular universal and react server which do essentially the same

warm sleet
#

with promises

#

Yeah

#

I'm using tsx

#

with mithril

light prism
#

TSX is nice. I have however over years of using these systems developed a hatred for any language that encourages not separating concerns

#

Like JSX, TSX, JSPs etc

warm sleet
#

JSP is argh

#

its like PHP's philosophy

#

CSS, HTML, Javascript, PHP

#

one file

#

leggo.

light prism
#

They encourage you to put your program code in the template file which is messy and leads to issues on large projects

#

I prefer templating languages like mustache which actively prevent you putting anything more than the template in the file

warm sleet
#

@light prism I'm planning on also incorporating a CDN with webpack :)

#

the bundle.js it generates

#

can be uploaded to the umbraco CDN (Umbraco is the cloud based CMS)

#

@light prism if I had to develop webpages using my own experience & tooling

#

I reach for Java using a trimmed down version of MVC

#

and handlebars for templating

light prism
#

Nice. Ensure you make your bundles small

warm sleet
#

any recommendations on doing views with node & express?

light prism
#

My preference for web is Dropwizard 2.0 > Handlebars with Typescript vanilla (No frameworks) and stylus compiled using parcel bundler

warm sleet
#

right now, its just express.use() to provide a static html file that loads mithril

light prism
#

And you are using Mithril as an SPA?

warm sleet
#

@light prism its a bit of both

#

the framework should be able to write full MVC applications

#

but also provide "drop-in" applications with mithril

#

they do a lot of interactive application development on the web

#

like product configurators for webshops

#

their current setup is something along the lines of:

#

ASP.NET Razor view, that loads mithril code

light prism
#

So real simple I use this for SPAs

    response.sendFile(path.resolve(__dirname, 'dist/index.html'));
});
warm sleet
#

Ye, I do that ^

#

But say, I want to do route resolution

#

and pick what controller I need

#

either SPA or regular page

light prism
#

So you can do that just put your SPA under a path something like /spa/*

warm sleet
#

@light prism user goes to a path, path is resolved with Umbraco, this returns a document type

#

based on the document type, I want to then select what controller I need

#

if its an SPA, is entirely defined in the controller itself

#

its not Path -> Controller, but rather Path -> Document -> Controller

light prism
#
    if (req && req.params && req.params[0]) {
        const location = islandContents.find(content => content.url_slug === req.params[0])

        if (location) {
            res.send(location)
            return
        }
    }

    console.error(`No content was found for location: ${utils.safeGetIncArr(req, 'params[0]')}`)
    res.sendStatus(404)
})```

This is a simple path resolver I made for an API recently
warm sleet
#

yeah, I might just write my own route resolver

#

Umbraco is a bit.. unique in the way it proceeds

#

@light prism ah ok

#

yeah I need to do route provision through umbraco...

#

so I request a url from umbraco, it tells me what content and what content type it is

light prism
#

Express is very flexible on routing you can pretty much do whatever you lkike

warm sleet
#

and depending on that, I Need the right controller for that type

#

@light prism it reminds me of sparkjava

#

Looks identical

light prism
#

Yeah so I did something similar to that when using Contentstack as a CMS

#

But I eventually moved that Dropwizard for the sake of my sanity

#

Its similar yeah

warm sleet
#

Well, the toolset is for either making full-fledge sites

#

or

#

making just 1 component of a site

#

while the rest is made by a third party

#

hence mithril

#

so they can use components and re-use them in other projects

#

@light prism since I can't find a reasonable alternative to maven archetypes

#

I might just use this project as a git repo that you fork for each new project

light prism
#

You can use something like a yeoman generator for boilerplate

warm sleet
#

mh

light prism
warm sleet
#

I herd you liek generators

light prism
#

Or even use npx which can do project generation for you

#

Bit more complicated cos you have to do a lot of the background work yeoman is easier

warm sleet
#

I think right now, yeoman is out of scope

#

but I can definetly put this in my documentation

#

maybe look at it in the future

#

with git, advantage is that you can just update the structure, and then merge that downstream

light prism
#

Yes assuming your fork isnt too divergent

warm sleet
#

mhmm

#

Trying to standardize the 'client and server' code by providing a layer inbetween

#

that can execute/be used by both execution environments

light prism
#

Middleware to the rescue

warm sleet
#

some things ,the client can do directly by fetching from the CDN

#

some things, are authoritative

#

so need the server to do it

hollow basalt
warm sleet
#

@light prism the beauty of this all, is that the document structure you have defined in the CMS

#

can be exported via graphQL

#

I use this as mapping in typescript

light prism
#

Ah but there you will run into deployment nightmares using graphQL the same ones I ran into

warm sleet
#

this is something they have been able to do previously, because of Razor views and umbraco's model builder