#development

1 messages Β· Page 64 of 1

umbral saffron
#

right under the try?

spring pond
#

yes

umbral saffron
#

same thing still

spring pond
#

it should have printed something

#
listener = sr.Recognizer
try:
  print(sr.Microphone())
    with sr.Microphone() as source:
        print("Go ahead...")
        voice = listener.listen(source)
        command = listener.recognize_google(voice)
        if 'computer' in command:
            print(command)
except Exception as e:
  print(e)
umbral saffron
#

no nothing

#

just the mic error

#

which is weird

#

bc "Microphone" is coming from speech_recognition but its identifying it as from PyAudio

nocturne galleon
#

Any .net core developers here? I need help with a project

warm sleet
#

@nocturne galleon C# sure

#

whats up

#

I've done minor .NET ASP on Core

nocturne galleon
#

Dm me

obtuse night
#

Any Spring Boot Java Devs have a go-to open source repo that follows good practices and design they use as a reference? I'm a C# Dev diving into Java and the tutorials all follow very different designs

warm sleet
#

@obtuse night stay away from spring if you create new projects

#

its often over-complicated

#

and makes software more difficult to maintain

obtuse night
#

What would you recommend using for APIs?

warm sleet
#

what, rest API ?

obtuse night
#

Yeah

warm sleet
#

JAX-RS

#

its a JavaEE API

#

there's many implementations for it

#

so your application code only depends on interfaces from javax.ws.rs.*

obtuse night
#

Which do enterprises usually use? Do they use JAX-RS?

warm sleet
#

Yeah

#

so the idea is that, java enterprise provides a set of libraries that implementation code uses

#

you package this up into a servlet

#

and then you run it on an application server like tomcat or glassfish

#

that appserver provides the actual webserver and stuff

#

go dm

urban comet
#

@obtuse night quarkus is a very very very good platform

#

Supports jax rs

hollow basalt
#

@obtuse night spring boot

nocturne galleon
#

just watched this guy

#

gave me motivation

ancient thunder
#

no

#

hes using white theme

#

not watching that

nocturne galleon
#

xD

ancient thunder
#

i want to keep my eyes healthy

nocturne galleon
#

lmaooo

#

yes its kind of a pain in the eyes

warm sleet
#

he got that keyboard mashing down

nocturne galleon
#

i def need more practice this vacation

warm sleet
#

thats kinda racist

nocturne galleon
#

wat?

nocturne galleon
#

AHHA

midnight wind
nocturne galleon
#

its a compliment somehow, but im asian and im still dumber than that guy

#

xD

warm sleet
#

@midnight wind I get it

#

@midnight wind but I also know the origins of the 'asians are smarter' meme

nocturne galleon
#

the google speech to text can interface with python right

urban comet
#

Yep

nocturne galleon
#

i just saw how expensive that is

#

and im not paying for it

umbral saffron
#

wdym

#

its free

#
import speech_recognition as sr

with sr.Microphone() as source:
    print('Say something : ')
    audio = r.listen(source)

    try:
        text = r.recognize_google(audio)
        print(text)
    except:
        print("Sorry, cannot understand")```
#

@nocturne galleon should work I think

#

or what me an ImTheSquid talked about ```py
import speech_recognition as sr

listener = sr.Recognizer
try:
print(sr.Microphone())
with sr.Microphone() as source:
print("Go ahead...")
voice = listener.listen(source)
command = listener.recognize_google(voice)
if 'computer' in command:
print(command)
except Exception as e:
print(e)```

#

but u also need to install pyaudio

#

(these are examples of what you can use format it any way)

bronze hollow
lament cave
#

pip install discord.py

bronze hollow
#

k

umbral saffron
#

thats a thing?

nocturne galleon
#

someone that can help me create a cog?

#

it justs needs to do [prefix]join and then assign a role and [prefix]leave and unassign the role and [prefix]list to show all members with the role

random plaza
#

does anyone here know css?

hollow basalt
bronze hollow
#

why?

nocturne galleon
#

hello

#

Know any better ways to optimize this one?

#

hahah

#
i = int(input())
j = input()
res = list(map(int, j.split(' ')))
num = 0
while num < i:
    num+=1
    if num not in res:
        print(num)
        break```
#

when it comes to huge numbers, i exceed the time limit of 1 second

bronze hollow
#

what language?

nocturne galleon
#

python

bronze hollow
#

k

nocturne galleon
#

im trying the cses to improve my skills in specific languages

#

like python, up next, javascript

#

while its still vacation time

bronze hollow
#

remove second line you dont need it

nocturne galleon
#

wat

#

uhm okay

bronze hollow
#

then there is no more optimizations i can think off

nocturne galleon
#

F, python does not accept multi-line input

bronze hollow
#

it does

nocturne galleon
#

? im running it in vsc, it wont 😦

#

shift enter does not work to make it a 2nd line input

bronze hollow
#

idk then

nocturne galleon
#
def algo():
    listTotal = 0
    i = int(input())
    j = input()
    list1 = list(map(int, j.split(' ')))
    for n in range(0, len(list1)):
        listTotal+=list1[n]
    total = i * (i + 1) // 2
    mis_num = total-listTotal
    print(mis_num)
   
algo()```
#

solved it

bronze hollow
#

gg

bleak breach
#

@nocturne galleon you could just do mis_num=(n*(n+1) / 2) - sum(list1) if you want to simplify things I think.

#

Where n is len(list1)

nocturne galleon
#

Will using a linux vm to go on sketchy websites protect me from viruses

#

?

deft sigil
#

is there a way in python , for a cli app that spawns several child procs (io tasks) to have the child report back to the main thread (more than one report over the entire runtime of the child ) and have the main thread act(start a new proc, depending on the contents of the report) on the moment when a child sends a report , all while avoid using globals and if possible only using pure functions

#

dunno if posssible in the wild , but i guess it would be , if you can find the instruction to send to the x86 cpu to engage the ME(intel) coprocessor and have it execute your code, point it to ther right spot in the sys memory , overwrite it and escape any sandbox or jail,... there was a alk about this a couple years back (2years in a row) on blackhat with a poc. title of the ta.lk was breaking the x86 instruction set , and the second one something with x86 godmode...

nocturne galleon
deft sigil
#

you could think of it this way ,(not saying that is is , and it may be farfetched) but intel me has prolly more power than that DEC of via, if the only security for controlling this core (running minix apparently for intel me) is not publishing the instructions , then i guess that an operation similar to the one of Γ‰pstein, targeting people with access to those codes and howto implement them , could have these isntructions in no time. just because the guy in the clip has to slowly dig everyting up for himself doesnt mean that for those with funding there might be other ways of obtaining more and better documentation on the subject , the fact that intel ME runs its own networkstac out of band , aits directly on the systembus , it could theoreticly be remotly controlled and circumvent every encryption you can think of ,.... secondly on the part where you say that you cannot escape a vm this way... you are optimistic , because the way i see it , in the current virtualisation solutions (unles you are virtualizing a different platform (eg arm) the instructions from the client get passed trough the host directly to the hardware and thus the cpu. and lastly , there might be a reason that DELL has the option of buying a pc , with the ME disabled / completly removed /not included , and they sell them only to us gov officials.

shy helm
#

you can't use native threads though because of the GIL which prevent parallelism

deft sigil
#

@shy helm , i have been trying to get it using both ThreadPoolExecutor( as its an io-heavy task) and ProcessPoolExecutor / multiprocessing.Process, but using pure functions , and no classes im stuck , i kind of can get it sort of to work but its supposed to write lines in console above the userinput (sys.stdout.write+ \r\r\r) but i get or its printing fine but it wout show the userinputline , or it wil only start writing to cli after user input has occured,... long story short i need a callback without the ease of use of a class to transfer data. maybe its time to have a look at how decorators work, as a golden rule from one of my mentors was to never use decorators unless you know everything about them that there is ,or trouble awaits you ,...

#

@rancid nimbus just out of curiosity , but with the massive progres that was made in the wine dev. past few years, and also with the new prepack systems being seemlessly integrated (snap and flatpak) , we might have to start wondering if that is an invite for viruses on the linux platform , or is this still to far off in fairyland.?

shy helm
deft sigil
#

i mean ... its not that far away anymore... and IE11 runs fine on wine as wel,... not saying that it is a sec risc , i have no idea, (since wine is not an emulator... i dont have a clue how haedware interaction is regulated for aps running with wine... but as you can see on my screensnip downloading an exe file asks to be run right away with wine...

worthy dirge
#

If it can run microsoft office

deft sigil
#

and yeah python isnt my "native"language either so to speak , i only used it for maths and automation , im more used to programming low level electronics stuff , so VHDL and STL wich has no resemblence to python at all. (just on a sidenote , i get why people like C, even why some like VB and even Perl or Pascall but i never understood why on earth someone would pick java πŸ™‚ ... but im helping on a friends project atm. so im using it as a way to scharpen my skills a little ... i found one not verry pretty way that it somewhat works , main just serves as a launcher for the threads , and im basicly passing the whole module as an argument along with each process , so werre one step closer to figuring out a decent way

#

quick search in lutris gives that custom installers are availeble to install office :

fresh flint
#

hey any of you guys know about app development?

deft sigil
#

and there is more on playonlinux so .. i guess office is not a problem

worthy dirge
#

None of playonlinux works when I tried, in 2019

#

Haven't tried lutris yet

deft sigil
#

i must admit i dont have experience with office (when i im in linux and i need office i run my windows install with vmware as unity) but a quick search on google seems to point out that allot of people do have success with it...

#

lutris can both use the steam version of wine and the proton version of wine along with the vannilla version , you can also try installing as you would in windows without a custom setup (i could not get ableton to run with the custom setup but the regular setup worked fine after al the required dot net and vb runtimes were installed

shy helm
shy helm
deft sigil
#

the threads wer actually needed i think, or wanted should i say, as each of the n threads start an os.walk on one disk in the array, and doing that sequentially storing all output in memory and writing it to screen and pickeling it to disk afterwards seem a bit inefficient. , and i didnt say something was wrong with java , i just dont get it πŸ™‚ same way i dont understand why every webpage today has a javashript library or 10 loaded of wich they use 2 functions. its like doing from imightneedthis import * in python

#

or pep8 something else i dont get πŸ˜›

tribal trail
#

I made a console Ascii game engine in C#
Basically it renders graphics by placing letters and symbols on screen in console application and use those as "pixels"

What do you guys think of it? https://github.com/AAli107/Consyl-Engine

GitHub

This is an ASCII Console Game Engine! Go to Releases and select the latest release to download. Once you download it, read the documentation if you're new to the game engine. - AAli107/Cons...

warm sleet
#

@tribal trail neat

#

@tribal trail pretty sure VLC has something like this too

tribal trail
#

What's VLC?

warm sleet
#

@tribal trail media player

tribal trail
#

ohh VLC media player! I thought you were talking about something else

warm sleet
#

lemme take a screenshot

#

its bugging out for me on windows

tribal trail
#

sure

warm sleet
#

ffs

#

youtube not playing on vlc with linux for some reason

#

and I can't get a friggen videofile lmao

#

well

#

that looks terrible xD

#

when I resize the window

#

the program crashes

tribal trail
#

nice, but my engine outputs the ASCII characters in black and white.

warm sleet
#

I don't think this is a 'stable' feature xD

tribal trail
#

lmao

warm sleet
#

@tribal trail I also bolted ProjectM onto my install lol

#

its included by default now I think

tribal trail
warm sleet
#

They used to be part of windows media player

tribal trail
#

yeah

#

I know

warm sleet
#

Yeah, thats built into vlc now

tribal trail
#

cool

warm sleet
#

You can add your own milkdrop prefixes

#

and it just cycles them

#

Bunch of fractals

tribal trail
tribal trail
warm sleet
#

O.o

tribal trail
#

looks like some sort of super nova or something...

warm sleet
#

my curated list of presets ^

#

~1000 of em

#

you can set texture size for higher resolution, though this taxes the CPU more

#

my laptop can't handle this at that resolution xD

#

@tribal trail First time I saw milkdrop outside of Windows media player was on KODI with a 4K TV

#

Found out that its actually an open source project you can just bolt onto any kind of media player

tribal trail
#

nice

warm sleet
#

can I just say

#

I hate CSS.

#

It just makes me angry

#

I need to demonstrate a project tool, but I want my presentation to at least have a little css xD

#
export class Footer extends MithrilTsxComponent<IFooter> {
    view(v: m.Vnode<IFooter>) {
        const {languages} = v.attrs
        return m("footer", {class: "navbar fixed-bottom"}, m("div.flag-container", languages.map(l => {
            return m("img.flag", {src: "assets/" + l + ".png", alt: l})
        })))
    }
}
#

javascript frameworks to generate html KEKW

hollow basalt
#

Sometimes all I want is readable text

#

especially blogs and articles

#

no need for smoke and mirrors

tall hedge
#

Is anyone very familiar with docker? I could use someones help with a couple lines fro mad ocker file

molten meadow
#

Anyone here have a TCP proxy that proxies depending on hostname that they want to send me? πŸ‘€

rocky yacht
#

What's the docker question?

#

@tall hedge

shy helm
#

The closest you can probably do is TCP proxy by port number

#

PITA though

#

so each domain would have a different incoming port number on the proxy, and then you forward it to the correct server

molten meadow
#

Look at this

#

This is what I was looking for

#

If the hostname matches one in one of the configs, it proxies to the associated ip

#

And this as a load balancer

shy helm
molten meadow
#

haha my bad

shy helm
#

The TCP spec does not support domain names

#

It supports IP addresses and ports

molten meadow
#

I know that

#

Doesn't mc use the tcp protocol?

shy helm
#

Yes, for the transport layer

midnight wind
#

HTTP is TCP for the most part? So HTTP provides additional data that allows proxies to work (by hostname). I think the same happens with MC

shy helm
#

Yes, but entirely tangential

shy helm
midnight wind
#

it's QUIC now, right?

shy helm
#

well no, HTTP1.1 and HTTP2 had to use TCP

#

Obviously ignoring tunnelling, which ultimately still uses TCP, since that's the standard for the underlaying server

#

and just to be clear, what actually happens is that the data gets sent down the stack from the application (simply, it picks the transport type it wants), the network, link, and physical layers are not choosable (you get what the network supports)

#

good luck sending data over the internet and not using IP network layer

#

CloudFlare supports it as does some newer versions of web browsers (anything Chromium based)

#

I think the estimate is about high single digit % of devices have browsers that support it now

#

that's still IP though πŸ˜›

#

the v6 and v4 just mean version 6 and version 4

#

Pretty much most routable traffic uses IP, even ICMP and IGMP packets are just IP packets with extra flag fields

shy helm
#

BGP uses TCP/IP

fresh flint
#

Hey does anyone read Python if so can you tell me what this means?

pliant siren
#

This has very little to do with Python.

umbral saffron
#

^^

vital blaze
#

It was trying a bunch of options to connect to something over serial. But then it gave up.

fresh flint
#

octoprint its an application that is used to remotly access a 3D printer

#

so is it recognizing that there is a device connected.

#

cause the problem is i don't know if it even seeing anything connected, or if it doesn't

vital blaze
#

It's failing to connect to a device.

fresh flint
#

could that be the fault of a cable that is connecting it?

hidden kettle
#

how do I run POST requests from a *.http file?

fallen cedar
#

do you mean html file?

hidden kettle
#

no

fallen cedar
#

what's http file, then?

midnight wind
#

http is a protocol

hidden kettle
#

there certainly is a file like that

#

IJ Ultimate detects it

midnight wind
#

well then it's probobly just a text file

#

idk

fallen cedar
#

can you show the contents of that file as an example

midnight wind
#

no such thing as a http file

fallen cedar
#

?

midnight wind
#

^

#

is it encoded in plain text

hidden kettle
midnight wind
#

when looking it up it looks like it's a type of file to write http requests. The only place I see it mentioned is in the REST Client for VSCode

fallen cedar
#

yeah, to me this just looks like some proprietary format that some tool would import/export (postman for example <- i don't know if postman actually uses a format like this :))

hidden kettle
#

idk

midnight wind
#

you could use curl or wget to manually make types of HTTP requests

hidden kettle
#

anyway, I just installed the Rest client extension and it allows me to run it

nocturne galleon
#

there is a button on my kvm switch, which I want to put on my mouse as a hotkey

#

does anyone know I can do this?

nocturne galleon
molten meadow
nocturne oyster
#

can someone help me with a c++ problem i have for class

#

i keep getting a lambda error

#

never heard of it b4

#

and idk what t odo

#

nvm,

#

solved it

#

lol

hidden kettle
#

I'm following this tutorial, and I want to remove all of the entries in my database. how do I do that? https://www.youtube.com/watch?v=gf-kjD2ZmZk

Let's build our first Spring application with Kotlin!
This one is a simple REST service that stores data in the H2 database and serves the entities in the JSON format.

Anton Arhipov @antonarhipov

Follow Kotlin on Twitter @Kotlin
Visit our web portal https://kotlinlang.org/

β–Ά Play video
hollow basalt
#

reinstall windows

hidden kettle
#

I guess that's an option

hollow basalt
#

or you could buy a new pc

hidden kettle
#

also an option

#

but I'm talking about commands

hollow basalt
#

lemme watch the video

hidden kettle
#

it's an H2 database

#

I can send the GH repo if you want

hollow basalt
#

truncate

hidden kettle
#

where do I run it

#

when I open the h2 console, my db doesn't show up

#

I fixed it

#

just had to add sql truncate table messages to my schema.sql

#

thanks!

hidden kettle
#

so - I tried to add another column to my table, but when I send this POST request: ```
POST http://localhost:8080
content-type: application/json

{
"author": "TheOnlyTails",
"text": "hello!"
}

this appears as the result: ```HTTP/1.1 500 
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 19 Jan 2021 15:07:05 GMT
Connection: close

{
  "timestamp": "2021-01-19T15:07:05.434+00:00",
  "status": 500,
  "error": "Internal Server Error",
  "message": "",
  "path": "/"
}
midnight wind
#

it's an internal server error so something went wrong internally

hidden kettle
#

ummm, I'm just starting out, but before I added the new column, it was ok

midnight wind
#

umm, colums?

#

that has nothing to do with HTTP

hidden kettle
#

in the database

midnight wind
#

why are you using HTTP in the first place?

hidden kettle
#

I don't really know what I'm doing

#

so I'm learning as I go

midnight wind
#

what are you making?

#

this is what happens when you don't understand the technology which you are using and why you are using it

hidden kettle
#

I'm trying to learn how to use spring with kotlin

#

and my way of learning stuff was always to try and make something basic with and move my way up into more complex stuff

midnight wind
#

yeah same, but I often go back to my old projects because I realized I have been doing things completely wrong

#

so spring seems to be a java framework, never used java so idk what it does

hidden kettle
#

it's for making backends

hidden kettle
midnight wind
#

yeah so what the context of HTTP?

#

why are you using HTTP?

hidden kettle
#

from what I understand, if I send a POST request to my backend, my code will take the json and put it into my database

midnight wind
#

so you are making some sort of web app?

#

or an app in general

#

with a backend and front-end

hidden kettle
#

I think a web app

#

for now, just a backend

midnight wind
#

I assume you are using spring for the backend?

hidden kettle
#

yes

midnight wind
#

yeah, I can't really help you, idk spring. It's an internal server error which means something went wrong in your backend

hidden kettle
#

hmm

#

I'll try to figure it out

#

thanks anyway!

nocturne galleon
#

So I'm thinking about getting a raspberry pi and a motor controller board to attempt to make something

#

How do I control a motor in python?

umbral saffron
#

well u just want it to turn on and off right?

nocturne galleon
#

Something like that

#

I've never done anything physical with any programing language

spring pond
midnight wind
#

you could use an arduino for something lower level

#

and use a compiled language like C or Cpp

spring pond
#

thats also an option, it just depends if you want an interface like debian or if you are ok with programming using a pc

midnight wind
#

with a pi you would usually ssh into it

#

with an arduino you just upload the code via serial (usb)

#

pi is more powerful, but sometimes overpowered for the application

nocturne galleon
#

I've been using IDLE for a while so I'm relatively familiar with python

#

I will probably end up reusing a raspberry pi over and over again for different projects

midnight wind
#

yeah if you already have a pi, then you could use it @nocturne galleon

nocturne galleon
#

And an arduino uno in an old project

#

Man I just realized how much stuff I have sitting around

midnight wind
#

well that's a bootloader

#

I have so much random stuff

#

so little time

nocturne galleon
#

And

#

Not a clue where that came from

umbral saffron
#

lmao im gonna try to code a new website for my school bc everyone hates the current one

#

any tips on where to learn HTML

lament cave
#

w3schools is pretty good

#

you should also use a framework like bootstrap since writing your own css can be a pain sometimes, especially if you want it to be responsive

midnight wind
umbral saffron
#

whats wordpress

midnight wind
#

CMS

#

it's a content management system

#

very popular

umbral saffron
#

oh cool

#

thanks

warm sleet
#

@midnight wind its 2021

#

why are you recommending wordpress

umbral saffron
#

is there something better

warm sleet
#

@umbral saffron just saying

#

there's more than one choice

#

just search google for 'open source cms'

umbral saffron
#

well i never have used html

#

ok

warm sleet
#

@umbral saffron if you've never even done anything like that

#

@umbral saffron maybe start with static HTML

#

and if you don't want to use html, just have an easy way to make pages..

#

then idk

#

currently, my occupation is literally writing code to work with a CMS

midnight wind
warm sleet
#

Well

#

Since this is what i use currently

#

comes with tonns of plugins

#

and you can easily add your own code

#

its basically just bolted ontop of ASP.NET

#

and you debug and modify your instance within visual studio

umbral saffron
#

oh ok

#

thx

warm sleet
#

and it has things like cloning from test to production

#

does require windows to run

#

which is unfortunate

umbral saffron
#

oh i have a mac

#

ill keep looking

warm sleet
#

@umbral saffron but what is it you are trying to archieve

#

because i've set up websites using static page generators

#

if you have a simple blog, you can just write in markdown

#

and generate a website from that

umbral saffron
#

my school needs a website and since i dont have access to the stuff theyre using i have togo from scratch

warm sleet
#

yeah

#

but

#

'a website'

#

what.

umbral saffron
#

for digital learning

#

like linked to zoom and stuff

warm sleet
#

Right

#

so you have an informational page?

#

with links to various pages?

umbral saffron
#

what it is is ur on the website

#

and u log in'

#

and when oneof ur periods is live

#

u clikc a button

warm sleet
#

@umbral saffron mh

umbral saffron
#

and u join

#

mh?

warm sleet
#

so its a very small and specific set of things it needs to do?

umbral saffron
#

pretty much

warm sleet
#

@midnight wind this is so simple

midnight wind
#

oh if it's that then maybe you could use something simplier

warm sleet
#

at this point you just might toss in any webserver

#

and start coding

#

put a small sql database behind it

#

and you're good

midnight wind
#

because usually school website for me means a full on information site that needs to be updated constantly by non tech savvy people

warm sleet
#

@umbral saffron I think a CMS is not nessesary in this situation

#

@midnight wind yeah just have an admin page

#

this is just simple CRUD

umbral saffron
#

i mean theres an assignment thing but that wouldnt be too hard right

warm sleet
#

my school has something like this

umbral saffron
#

i have never used html

warm sleet
#

they use a thin client, that connect to internal APIs and SQL databases

midnight wind
#

html is more a markup language, not a programming language

warm sleet
#

that generates a simple mobile app view

midnight wind
#

the real coding is the javascript behind it

warm sleet
#

@umbral saffron HTML is just markup language to instruct the browser where elements on the page are

umbral saffron
#

i mean i cant send u a link but it has a whole thing

warm sleet
#

CSS is to then apply styling and visual elements

#

and lastly, HTTP is to transport it all between server and client

umbral saffron
midnight wind
#

js can generate html and css

warm sleet
#

and javascript is for all the interactive jank in a webpage

#

and stuff that requires server verification

#

is called a 'backend'

#

that has certain functions where you can send a form, or data to, to get a response from the server for

#

backends can be

#

in any language

#

it just needs HTTP

#

Umbraco CMS uses .NET

#

and its written in C#

#

webserver is IIS

#

wordpress is written in PHP, runs usually with apache or nginx

#

but wordpress is way to much crap for a simple page as you described

umbral saffron
#

wait can I use just js and http

warm sleet
#

so HTTP is to transport information between the server and the browser

#

it means Hyper Text Transfer Protocol

#

the documents you send are HTML files, or Hypertext Markup Language

#

and then CSS is Cascading Style Sheets, that define color, fonts, text size and block layouts

#

but usually, there are frameworks you can use to make it easier to write pages

#

Like there are tutorials to write bootstrap sites

midnight wind
#

and then you have js frameworks like vue and react

umbral saffron
#

bootstrap is what

warm sleet
#

@umbral saffron look at this ^

#

Its a set of CSS and HTML tools

#

to make making websites easier

umbral saffron
#

oh ok

warm sleet
#

Its basically a collection of CSS and JS to make common elements easy to use

#

like menu bars

#

with dropdown and highlighting

#

their functionality ofcourse, is up to you to implement

#

it just makes it easier to write

#
<div class="jumbotron text-center">
  <h1>My First Bootstrap Page</h1>
  <p>Resize this responsive page to see the effect!</p> 
</div>
  
<div class="container">
  <div class="row">
    <div class="col-sm-4">
      <h3>Column 1</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
    </div>
    <div class="col-sm-4">
      <h3>Column 2</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
    </div>
    <div class="col-sm-4">
      <h3>Column 3</h3>        
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
    </div>
  </div>
</div>
nocturne oyster
#

hey does anyone have some graphic library recommendations for newbies in c++?

#

I know how to do algorithms and stuff

#

but I've only done so much until classes

#

I know some object oriented programmming

#

please @ if you have any easy graphic library recommendations :D

midnight wind
nocturne oyster
#

to make some simple games

#

like idk snake or x and o

midnight wind
#

oh, then idk

nocturne oyster
#

i made x and o once but just used cout lol

nocturne galleon
#

How do I host a website off of my computer

#

Also can I use base64 with html

midnight wind
nocturne galleon
#

why wouldn't you recommend

midnight wind
#

you don't program in html

#

you program in js

#

security

nocturne galleon
#

I am working on getting a server

fallow coral
#

hey so

#

um

nocturne galleon
#

Are there any webservers that I could use python in?

fallow coral
#

how to fix this

umbral saffron
#

whats the issue

fallow coral
#

dont look at vertexes please its my first model

fallow coral
midnight wind
umbral saffron
#

oh

fallow coral
#

and there shouldnt be

umbral saffron
#

what software

midnight wind
#

that's blender

fallow coral
#

yes

midnight wind
#

@fallow coral recalculate normals

fallow coral
#

blender 2.91

fallow coral
fallow coral
#

thanks

#

ah the hole is in unreal engine

midnight wind
#

yeah because the normals are the wrong way?

nocturne oyster
#

hey so i searched reddit for some ideas and found that you can render sprites in libsdl2, do you think its a good idea for me to start there?

fallow coral
#

okay clicked it and now what

#

export it?

#

ITS BROKEN EVEN MORE

nocturne galleon
#

Visual design is hard

fallow coral
#

frick it im just gonna edit it and make new one

nocturne galleon
#

I touched blender once and I'm pretty sure I died

fallow coral
#

well i need to play with it cos im making a game

nocturne galleon
#

How do I mask my IP with a domain when hosting a webserver

midnight wind
#

what you are looking for is a proxy

nocturne galleon
#

Ok

#

How hard is that

#

And does it cost money?

midnight wind
#

you can't host a webserver without other's knowing your ip without a proxy because the client needs to know where the server is located.

#

Cloudflare has a free tier free proxy

nocturne galleon
#

What's the catch with the free proxy

midnight wind
#

privacy

nocturne galleon
#

Ok

fallow coral
#

@nocturne galleon when's new episode of grand tour?

#

🀣

midnight wind
#

it still needs to serve files

#

that could be used for a backend

nocturne galleon
#

I only know python

midnight wind
#

but you need to write html, css, and js

#

well then you gotta learn

#

there is django

nocturne galleon
#

I'm taking a javascript class next year

midnight wind
#

I hate programming classes

#

learn yourself

nocturne galleon
#

I basically taught myself all the python I know

#

But I basically just want to make a proof of concept

#

Like "wow text on a screen" levels of basic

midnight wind
#

I have to take python this semesster

#

some of my friends took it and said it was incredible boring

umbral saffron
#

could I code my own coding software

midnight wind
#

of course

umbral saffron
#

sounds weird ik but could I

midnight wind
#

some people even code their own compliler

nocturne galleon
#

Also I know almost nothing about making a user interface with python

#

Like the most I know how to do in that department is an input and then printing

umbral saffron
#

wait what do u want ur ui to do

nocturne galleon
#

I mostly just want to learn how to do it

umbral saffron
#
#

right?

midnight wind
#

eh

#

I dislike classes

umbral saffron
#

no wrong link

midnight wind
#

hands on is the best

nocturne galleon
#

I've mostly learned by looking at snippets on the python website and then integrating it into what I want to try to do

umbral saffron
#

how I learned is doing a project and trying to figure out what part does what @nocturne galleon

#

and then put a note

nocturne galleon
#

Here is one of my first projects

shy helm
#

want to be a good software engineer? Classes help

#

want to be able to program stuff, diving headfirst is easy

midnight wind
nocturne galleon
#

I'm doing this mostly so that I can understand things

#

And it looks good on a resume

fallow coral
#

so

umbral saffron
shy helm
#

I've had to work on people's code who were self taught (and whos main job was not coding directly), very hell to maintain

fallow coral
#

again how do i connect things together

#

they are in object mode as a one object but in edit they arent connected

midnight wind
midnight wind
nocturne galleon
#

I don't plan on doing anything on a professional level

fallow coral
#

i just makes faces on both of the circles but doesnt connedct them

#

hey arent connected like the higher one

midnight wind
#

I don't even have it installed rn

fallow coral
#

okay got it

#

ctrl e and edge loops

nocturne galleon
#

I have it installed but i opened it and got scared and ran away

nocturne galleon
#

Blender

midnight wind
#

ah

#

blender is pretty easy

#

tbh

nocturne galleon
#

Visual design is scary

midnight wind
#

installing blender rn

#

@fallow coral it's ALT-F btw

fallow coral
#

gotta fix the vertexes now but tommorow now i will go to sleep

nocturne oyster
#

hi

#

i have a question

#

so lets say i input integer x, how do i save the data for next time i run the program

obtuse night
#

you would probably need to store it in a database or file

midnight wind
nocturne oyster
#

i found something on the internet about reading and writing files

#

and i started working with it

#

i still havent fully grasped it yet

nocturne galleon
#

Are there any motor driver boards for raspberry pis that can drive decently sized motors

#

A motor that could move one of those doors that are like cardboard

#

And then eventually be reused as a robot or something

storm plume
#

anyone know how to overload in C++ without copy pasting entire code if one thing needs to be changed?

#

pls ping me

umbral saffron
#

what?

storm plume
#

like i mean i have 2 functions right

#

they take different parameters

#

basically i wanna overload it without copy pasting entire code if the overloaded code just wants to change one thing

strange pawn
#

you have one call the other

nocturne oyster
hollow basalt
#

c++

nocturne galleon
#

guys im trying to set up an apache server, and the tutorial says that by following the configuration that you can access it from "gci.example.com"

#

I'm unable to get this working, mine just takes me to the "example.com" website, as in the real one, not something running on my machine

#

and I don't know why, because the tutorial doesn't mention anything to do with name server configuration to get it working

strange pawn
#

its an example

#

like youd replace with your own domain or you could setup something in your hosts file on your computer for testing purposes ig

ancient thunder
#

if you dont have a domain just type the ip of the webserver in your browser

strange pawn
#

the tutorial hes working through is about virtual hosts on apache

warm sleet
#

@nocturne galleon what are you attempting to do?

#

set up your own webserver?

#

@strange pawn this stuff so ez with nginx

#

just have to set server_name my.subdomain.com;

#

apache configuration is meh

#

xml KEKW

strange pawn
#

its easy on apache too, hes just wondering about the tutorial not explaining something

warm sleet
#

vhosts require DNS

#

and HTTP/1.1

#

does apache even do HTTP/2 ?

nocturne galleon
#

space duck

vital blaze
# storm plume basically i wanna overload it without copy pasting entire code if the overloaded...

If this is the type of thing you want

int myFun(int a){
  return a + 2;
}
int myFun(int a, int b){
  return a + b;
}

You can use default arguments:

int myFun(int a, int b=2){
  return a + b;
}

https://www.geeksforgeeks.org/default-arguments-c/

nocturne galleon
#

is anybody familiar with cloudflare?

#

i dont have a domain and i dont want to spend any money on one

#

i am making a proof of concept website and it is available straight from my ip but obviously i dont want to give away my ip

vestal glen
#

then you probably want some dynamic reversetunneling service

nocturne galleon
#

do you know any good ones?

#

or a good way to do it?

vestal glen
#

never used any myself, always been fine with exposing my IP to the web. I also can't remember any of their names right now or how to best search for them, sorry. But such things exist. As kind of a mix between dyndns and vpn, essentially

nocturne oyster
#

hello

nocturne galleon
#

hi

nocturne oyster
#

i need help again :/

#

i wanna use sfml

#

but i cant get it to work on visual studio

midnight wind
#

@nocturne galleon dynudns

nocturne galleon
#

i think i got it kind of sorted out

vestal glen
vital blaze
#

Hello, world.

nocturne galleon
#

YES

#

it works

#

not pretty but it worked

obtuse night
nocturne galleon
#

well

#

you guys arent gonna do bad things

#

hopefully

vestal glen
#

right, just making sure because you said "i dont want to give away my ip"

vital blaze
#

I won't

obtuse night
#

wasnt that the point in this whole thing or was it ease of use?

vestal glen
#

(I took that as you want your IP to be protected)

nocturne galleon
#

i dont want it to be obvious that my ip is there

vital blaze
#

But I would'nt post it somewhere public like this

nocturne galleon
#

and easy to remember

vestal glen
#

anyhow, if you ever want to actually keep your IP hidden, https://pagekite.net/ seems like a good place to start.

nocturne galleon
#

im probably gonna start that now

#

will it work with newer versions of python?

#

because i wrote this in 3.9

obtuse night
#

it should be like running it as localhost, but you run an extra program (from pagekite) written in python 2.7

#

so as long as it works locally, you should be fine i believe

fallow coral
#

hey so i have a problem

#

with unreal

#

if anybody can help with this ill be gratefull

#

i have made a quick script to make a scene? when starting the game and when it ends it goes back to the player model but the camera is stuck inside the character

fallow coral
fallow coral
#

kay got it

#

i dont know how i did it but i did it somehow

storm plume
#

@vital blaze oh I see, not quite but I think this is pretty interesting and would definitely be able to be used somehow

fallow coral
#

having problem again

#

weird one

#

they are moved but why?

#

andd it crashed

fallow coral
#

okay nvrmd fixed it

gusty girder
#

Other than the official documentation, can someone recommend good resources for setting up webmin/virtualmin/usermin on a vps?
I'm trying to migrate away from shared hosting and I've been having a lot of trouble setting things up, as before, the provider took care of a lot of things things and cpanel abstacted away others

#

like for example, does the hostname of my VPS matter? Do I need to have a server in virtualmin that matches my VPS's hostname for email to work or not? etc..
So far I got patchy knowledge built by browsing stackoverflow and youtube tutorials

nocturne galleon
#

Any keyboard wizards here

#

I want to make a shortcut to perform a mouse right click... My laptop don't have a menu key and i use that on my external keyboard every time...

umbral saffron
#

whats the best software to run html in

midnight wind
#

you mean browser (client) or webserver (server)

umbral saffron
#

yea but from where

midnight wind
#

wdym

umbral saffron
#

where do i actually write the code

midnight wind
#

just view an html file you just open it locally with a web browser

#

anywhere

#

it's plain text

#

I use vscode

#

you can use any text editor

#

vscode is nice because it has chrome and firefox extensions for debugging javascript

umbral saffron
#

oh ok

umbral saffron
midnight wind
#

you can technically debug just in a browser, but the extension allows you to set breakpoints directly in the editor

midnight wind
#

it's just a file

#

you open it

#

or you run a webserver to serve the files

umbral saffron
#

like lets say i need to edit a website that already exists

#

how

midnight wind
#

depends

#

does that website have a CMS

umbral saffron
#

I do not think so

midnight wind
#

you could technically take and save html of an existing website that wouldn't really work out great

umbral saffron
#

what if I just get an api from the website and write it in javascript in vscode

midnight wind
umbral saffron
#

wait nvm thats dumb

midnight wind
#

that sentence makes no sense

#

I don't think you know what an api is

umbral saffron
#

I do im just being dumb

pliant siren
#

I would just like to express my desire to strangle whoever wrote the Javascript Date API πŸ˜„

hollow basalt
#

Moment.js

#

sadly the developer move on

#

though it isn't considered deprecated

warm sleet
#

@pliant siren right?? xD

#

I actually worked on a javascript script host/daemon

#

and that environment didnt have the standardlib for js

#

so I just implemented my own standard library

pliant siren
#

Moment is not great either.

warm sleet
#

including a date parser using java's date parsing xD

pliant siren
#

You have never lived through date /time hell until you have had to write code that deals with dates on both ios and Android. Omfg.

#

Ios does not adhere to iso8601.

warm sleet
#

@pliant siren Java has its share of libraries yes

#

even within that ecosystem there's 3 APIs

#

java.lang.Date

#

java.lang.LocalDateTime

#

which is part of the new spec

#

and then there's people who use thirdparty libs

#

to add even more confusion

pliant siren
#

Does anyone ever use Gregoriancalendar? 17 lol

warm sleet
#

@pliant siren if you have to reference calendar dates, yes

#

But i always try to reduce them to UNIX timestamps

#

as a developer you shouldnt ever have to deal with timezones

#

all APIs should use UNIX time

pliant siren
#

Honestly FFS this Samsung bullshit keyboard, it auto completes numbers like that 17 there. Shittest predictive text/keyboard ever.

warm sleet
#

and only local presentation does the conversion

#

@pliant siren KEKW


/**
 * Parses a date using the java.text.SimpleDateFormat
 * @param date the datestring
 * @param format the format
 * @return {int} the unix timestamp of the date
 */
function parseDate(date, format) {
    var SimpleDateFormat = Java.type("java.text.SimpleDateFormat");
    var parser = new SimpleDateFormat(format);
    return parser.parse(date).getTime();
}
#

thats a big middlefinger to javascript

pliant siren
#

Did you know that ios does not honour local timezones if you don't specify an offset, as the ilo spec requires?

warm sleet
#

I've never done iOS development

pliant siren
#

FFS keyboard. I want to throw this piece of sit

#

As you can probably guess, I didn't type sit either

pliant siren
#

If ios gets "2020-10-17 11:23", it will interpret that as UTC. Not the local rhinestone as the iso spec requires

warm sleet
#

what

#

that sounds reasonable

pliant siren
#

Rhinestone. Are you fucking kidding me!?

warm sleet
#

that string is without a timezone

#

Inferring timezone would be an unwanted side effect

pliant siren
#

Yes. So it should be local to the device,unless you specify +1100 for example

#

No.

#

Iso data are always assumed to be the local device timezones unless specified

warm sleet
#

Time zones in ISO 8601 are represented as local time (with the location unspecified), as UTC, or as an offset from UTC.

#

They can be local time, but doesn't have to

pliant siren
#

No. If a time zone is not specified, it is to be assumed to be in the locale of the device parsing the data. That's the iso spec.

warm sleet
#

If no UTC relation information is given with a time representation, the time is assumed to be in local time.

#

True

#

but i guess apple doesnt agree

pliant siren
#

Exactly. So the same code if you run it on anxious might be say.... 10 hours or of tow in Melbourne..

warm sleet
#

isnt a workaround easy?

pliant siren
#

Which is great when your app is telling students their exam time.

warm sleet
#

if you make sure you do the time checks in 1 location

#

minimizes chances of bugs in your code

pliant siren
#

It's easy *once you know the problem exists *

warm sleet
#

lol

#

fair

pliant siren
#

For four years we had an app that published student exam timetable and the devs didn't know about it. Not did the team responsible for the data api care, or understands timezones.

warm sleet
#

APIs should give out UTC. at all times

#

Timezone should be seperately supplied

#

or handled by the client

#

server doesnt have to know

pliant siren
#

Each year they would put in 'fixes' for the time zone 'bug' to deal with daylight savings for example.. Then they'd get retorts of it displaying the wrong time. So they're 'fix' it. Which broke it on Android, or ios, or desktop.... Then it was fucking whack-a-mole.

warm sleet
#

DST is a non-issue

#

its just that some areas have two timezones that alternate

#

but if you start manipulating timezones in your code

#

you end up with stupid bugs like you described

pliant siren
#

Apis can give our whatever time they want if they specify the time zone. It makes no real sense to give an exam time as 1am UTC if the business operates entirely on three local timezone of one city

#

Dst was a huge issue :D

#

Because data was published without the time zone data. Again, it's about how iso8601 interprets it. Even Google calender gets it wrong. If you create an event now, for say, after the daylight savings change in either country, when you get to that event it will be wrong.

warm sleet
#

humans are shit

#

would be so much easier if everyone used UTC

pliant siren
#

Eg, my trip to Las Vegas/Los Angeles in 2017, which I did some bookings in September, some in early October, showed in late October, then the trip was in late November, just after the US DST change. My google calendar was fuuuuuucked lol. I had to be so careful with flight times.

#

Aus DST change is start of October, us is start of November.

warm sleet
#

UTC doesnt change

#

again, all of these things you are describing

#

are non-issues

pliant siren
#

The real world doesn't use UTC.

warm sleet
#

Yes, but code does.

#

And all time is UTC + some offset

pliant siren
#

It really doesn't

warm sleet
#

Then your code is poor.

#

I've never had to deal with timezones, ever.

#

And I've written plenty of timeseries databases

#

localization is handled by the local client

#

not by the server

#

so you do the conversion to local time, on the last moment

#

just before it hits the user's screen

pliant siren
#

My jobs in my teens through to 30s were working in motorsport timing at a very high level, and working on satellite communications. Believe me, I know about timezones.

#

You might want to stop taking an idealist attitude and look at how things are done in the real world.

warm sleet
#

nope

hollow basalt
errant path
#

I just did a yup-phone PR; It's my first PR. What do you think, shouldn't Yup's .required be used to invalidate null or undefined and not .phone?

#

"Just" (as in 10 days ago), but would love some support or feedback! πŸ™‚

#

NetNinja demo's Yup well, if you want to chime in. πŸ™‚

#

Hey gang, in this React Native tutorial I'll show you how to validate your forms easily with a 3rd party package called Yup.

πŸ±β€πŸ’» πŸ±β€πŸ’» Course Links:

Course files - https://github.com/iamshaunjp/react-native-tutorial

πŸ±β€πŸ’» πŸ±β€πŸ’» Other Related Courses:

β–Ά Play video
nocturne oyster
#

hello

#

any idea on how i should start implementing collision to objects in sfml ?

#

please

hollow basalt
#

implement it

trail prism
#

Why is c# pain?

nocturne oyster
#

but it's so hard

hollow basalt
#

understandable

#

have a great day

ebon viper
#

Hey guys, im drawing a blank here, but you know how in mobile development you use android studio from both the UI and the code

#

What if you wanted to make a software program

#

how do people develop softwares, UI included, I think ive only ever used NetBeans, never one with UI

warm sleet
#

@ebon viper netbeans is poor, regardless of the language

#

if you want a nice java IDE, try IntelliJ

#

if you want a GUI editor, java may not be the best language

#

.NET WinForms are quite eays to assemble with Visual Studio

#

though that is .NET C#

#

@ebon viper but UI stuff on android is always going to be like that

#

There might be frameworks to make it easier

#

Just as an example

ebon viper
#

for desktop apps, is that right?

warm sleet
#

@ebon viper no if you are developing for android

#

you have to use Android Studio

#

which is IntelliJ

#

@ebon viper I misread your question initially

deft sigil
#

does anybody know if a lib or plugin for whatever ide exists that expands python code to oldf*** (me) readable code, now i dont need linenumbers and goto statements instead of for loops i'm not that old, but it would be nice if there was something to expand lambda functions to what they are in long format same with decorators , and something that unfolds oneliners , because i feel these are more ofthen than not used to obfuscate code rather than to reduce amount of codelines. ??

the current piece im trying to understand adapt to my needs is the following but its by far not he most complicated one but i find myself writing the whole thing in its long format for the maybe 15th time today and figured there must be some tool to do this for me , but i cant find one (hoped that some of the stuff wouldnt be supported int python 2 and a 3to2 tool would do half the work for me but python2.7 seems to already support most of the things

    def __new__(S, *more):pass
    callback = property(lambda self: object(), lambda self, v: None, lambda self: None)
warm sleet
#

python 2.7 is dead

ebon viper
deft sigil
#

python 2.7 is still the one being used in Ableton Live 10.1.50 (latest version) so not that dead just unsupported by the python dev team

warm sleet
ebon viper
#

oookaaaay

#

that makes things a bit easier..

warm sleet
#

@ebon viper this editor generates code for the interface

#

you can then give it functionality by assigning event handlers

deft sigil
warm sleet
#

Qt yeah

#

@deft sigil Does Qt have a visual editor though?

#

paid service..

deft sigil
warm sleet
#

I do mostly backend development

ebon viper
warm sleet
#

put me on an island and force me to make a GUI to get off it

#

I will die.

midnight wind
#

I thought qt was open source?

warm sleet
#

@midnight wind yeah the lib is

#

but they also sell a fancy editor with it

midnight wind
#

ah

warm sleet
#

@ebon viper you can write windows desktop applications in .NET just fine

deft sigil
#

i kindoff hate it but i must also mention the use of java for many applications (desktop) and the fact that mobile apps are just apps running on a java vm...

warm sleet
midnight wind
warm sleet
#

@deft sigil FX works fine for GUI creation with java

deft sigil
#

@warm sleet yes qt has a visual editor , much more advanced than the .net editors,but it needs a little getting used to

ebon viper
#

thank you

warm sleet
#

@ebon viper its not the standard

#

but it is a way to easily write apps for windows

deft sigil
#

because you have to "divide your window into areas that have static or dynamic sizes

warm sleet
#

I think WPF is the standard for .NET desktop apps these days

#

but WinForms is just easy for something quick and simple

#

WPF uses XAML to define layout and design

#

And this is why I avoided FX and Swing in the first place :P

deft sigil
#

here is one i made in qt-creator and running pyQT as binding to the code , made with one day of experience in QT bt so not that hard neither

warm sleet
#

@deft sigil I'm glad I do backend dev

#

xD

#

JSON is my interface

deft sigil
#

that was also a long time ago (had to cut the winXP tasbar of the screenshot to not make it a megafail :P)

warm sleet
#

layout and styling makes my brain crash

deft sigil
#

i dont do java nor do i do java script (and yes i have made websites for business clients in the past), just out of my love for the internet and keeping it free of bloath and as lean (with full functionality) as i can on my part... no need for javascript unless you have bad intentions , you dan do everything you wish to do with html(5) and CSS(3

warm sleet
#

@deft sigil lol and currently, I am writing a framework for web development

#

specifically, SPA's with MithrilJS

#

the entire HTML DOM is described with code xD

#
export class Articles extends MithrilTsxComponent<IArticles> {
  view(v: m.Vnode<IArticles>) {
    const { content } = v.attrs
    return m("ul.list-group", content.items.map(a => {
      return m("li.list-group-item", m(m.route.Link, {href: a._url}, a.title))
    }))
  }
}
#

xD

deft sigil
#

i did make a framework using python (pyramid/pylons) to profide a backend for clients to update there site withing modx (wich i was using at the time as backend but i provided a fully operational site in a zip , that a client just needed to unpack to his webspace no install needed , server needed python php and sqlite support wich was not that common actually)

warm sleet
#
export class HomePage extends MithrilTsxComponent<IHomePage> {
  view(v: m.Vnode<IHomePage>) {
    const {content} = v.attrs
    return <div>
        <h2>{content.m.pageTitle}</h2>
      <div class="body">
        <p>{content.m.body}</p>
        <Articles content={content.articles}/>
      </div>
    </div>
  }
}
deft sigil
#

whitin'

warm sleet
#

See the <Articles> ?

#

That's a reference to another type, the one above

#

Hyperscript ftw

deft sigil
#

you mean same as include somefile.php πŸ˜› for php or fstrings in python πŸ˜„

warm sleet
#

@deft sigil nah the entire tree is dynamic

#

when you make a modification to the structure of the mithril DOM, it updates the page view dynamically

#

the code is mounted to an HTML tag, in this case <body>

#

and this is entirely client side

#

server is only there to provide .js code chunks

#

The system I came up with, actually pre-renders the HTML when you first visit the site

#

any further links you click on, are handled by the browser entirely

deft sigil
#

by the time i found some time to start learning Rust , i will find you an alternative for now if its clientside i know you can dynamicly change css sheets depending on the viewport or the size of it.

warm sleet
#

so it makes a content fetch directly from the CDN, without ever hitting the app server

#

after it fetched content, it looks at what controller is required, and downloads the required code from the server

#

and then renders the view

#

makes for very responsive sites

#

like 35ms click to screen time

deft sigil
#

only i found that including some images , and some text that might not need to be shown to the user because its in another tab or behind ... read more is less overhead than the overhead i usually see when they start including ajax libs jquerry jquerry-ui and other libs to load it dynamicly from server , (unless its like a chat app that needs to be updated on the fly

warm sleet
#

@deft sigil the trick there is to use a single pixel placeholder using base64

#

and after page has been loaded, you update the src addresses

#

so the browser loads them after the fact

#

the single pixel image is scaled up to the required dimensions of the target image

#

so this makes your page not jump all over the place when it is loading

#

@deft sigil and the overhead with loading js code, is made easy with webpack

#

you can 'chunk' each view into its own code file

#

so you end up with little 1-5kb files

#
module.exports = env => {
  return {
    entry: {app: path.join(__dirname, "src/spa/app.tsx")},
    devtool: "source-map",
    output: {
      filename: "[name].bundle.js",
      chunkFilename: "[name].chunk.js",
      path: path.join(__dirname, "dist"),
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: "ts-loader",
          options: {
            configFile: "tsconfig.client.json"
          }
        },
      ],
    },
    resolve: {
      extensions: [".tsx", ".ts", ".js"]
    },
    optimization: {
      chunkIds: "named"
    }
  }
}
#

Its a bit complicated, and magic.

#

But it works ;)

#

It provides an entrypoint, and any references that are made are included into the bundle file

#

external views are downloaded the moment you call import()

#
const getComponentByAlias = (alias: string): Promise<{ default: any }> => {
    switch (alias) {
        case 'home':
            return import('./home')
        case 'article':
            return import('./article')
        case 'about':
            return import('./about')

    }
}
#

in my case its a simple switch block, that uses the content type alias to resolve the view

deft sigil
#

you can just use <img src=jajadjaflk.png" loading=lazy to achieve the images loading after the fact ...

warm sleet
#

@deft sigil that loads before the js code is loaded

#

All script files are at the bottom anyways

#

loaded last

deft sigil
#

most browser (aside for IE) ,suports it (ff , chomr,edge,opera)

warm sleet
#

@deft sigil thankfully, this is for someone else to know and implement :)

#

I'm only concerning myself with seamless integration with a CMS

#

and providing a platform to write apps with

#

its nice, server and client side code lives in the same codebase

deft sigil
#

just in case your intrested πŸ™‚

#

im not trying to bash on java or js (for now) but its a flexible language (not always good thing as things that throw errors in other languages just give unpredictable outcome in js) , and the fact that most peope need a linter (or a like in order) to be able to write code in it is not a good sign either , and lastly what i dont like about most ways its being used these days (not saying you are ) is when i have 300 or more open tabs in my browser and open another one to see about:performance , and see how much cpu and memory each of those pages consumes to just display text (most of the time)

warm sleet
#

I'm a java dev by heart

#

currently working an internship

#

brand new languages: javascript, typescript

#

never worked with these before

#

@deft sigil there's just some fundamental things about NodeJS that I don't like

#

like, the nonexistence of integers

#

its all floats

#

and debugging nodejs is a hellhole

#

bunch of async garbage

deft sigil
#

had java in college , 15years ago but if its still the usual , big.bag.longername.maybe.sublib.yessyoulike.typing.lots.ofwords() i dont wany end up in a typeracer contest with you πŸ˜‰

warm sleet
#

@deft sigil lol its not that bad

#

for a lot of verbose blocks in java, I've started writing my own live templates

#

like the classic JDBC boilerplate

#

You get used to it

#

@deft sigil and the language has received a lot of new features

#

with java 8 the language finally became useable

#

lambdas, and function references

#

(s) -> System.out.println(s)

#

and function references: Object::function

#

I think java 14 introduced 'Records'

#

this is comparable to .NET's Property

#

with built in getters/setters

#

I use compiler tricks to generate getters/setters xD

deft sigil
#

i dunno if its still aroun but there used to be a saying about java,... wich i just remembered , but obviously java has had some updates or there wouldnt be as much apps for mobile platforms these days

warm sleet
#

@deft sigil its not that common on the desktop

#

but in the enterprise, on servers, its still no. 1

#

and most android apps are built with java 7

#

kotlin these days is a compelling argument for using java

#

it removes a lot of boilerplate

#

java gets a lot of hate for no reason

#

people calling it 'slow'

#

which is not true

deft sigil
#

even pycharm (a python ide based onIntelliJ IDEA) is written in java, so is freeoffice i think , much is actually written in java if i think about it

warm sleet
#

@deft sigil its a nice language for code reuse

#

ecosystem with maven is just perfect

#

@deft sigil and the JVM allows you to all kinds of dark magic

#

like implementing your own classloader to provide hot-compilation :D

#

being able to reload parts of the software with new code, while its running

grave gazelle
#

JVM is just an emulated Necronomicon