#development
1 messages Β· Page 64 of 1
yes
same thing still
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)
no nothing
just the mic error
which is weird
bc "Microphone" is coming from speech_recognition but its identifying it as from PyAudio
Any .net core developers here? I need help with a project
Dm me
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
@obtuse night stay away from spring if you create new projects
its often over-complicated
and makes software more difficult to maintain
What would you recommend using for APIs?
what, rest API ?
Yeah
JAX-RS
its a JavaEE API
there's many implementations for it
so your application code only depends on interfaces from javax.ws.rs.*
Which do enterprises usually use? Do they use JAX-RS?
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
just watched this guy
gave me motivation
What is Competitive Programming: https://www.youtube.com/watch?v=ueNT-w7Oluw
I don't know how I won again, but I'll gladly accept it :)
Contest site: https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ff43
Explanations video: https://youtu.be/jlWA73MDrC4
Website: https://williamlin.io/
Instagram: https://www.instagram.com/...
xD
i want to keep my eyes healthy
he got that keyboard mashing down
thats kinda racist
wat?
tf?
27:49 = "Did I win again?"
AHHA
it's a joke
@midnight wind I get it
@midnight wind but I also know the origins of the 'asians are smarter' meme
the google speech to text can interface with python right
Yep
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)
how do you get discord.py to install?
pip install discord.py
k
thats a thing?
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
does anyone here know css?
no
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
what language?
python
k
im trying the cses to improve my skills in specific languages
like python, up next, javascript
while its still vacation time
remove second line you dont need it
then there is no more optimizations i can think off
F, python does not accept multi-line input
it does
? im running it in vsc, it wont π¦
shift enter does not work to make it a 2nd line input
idk then
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
gg
@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)
kinda, not really
and 2
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...
A processor is not a trusted black box for running code; on the contrary, modern x86 chips are packed full of secret instructions and hardware bugs. In this talk, we'll demonstrate how page fault analysis and some creative processor fuzzing can be used to exhaustively search the x86 instruction set and uncover the secrets buried in your chipset....
This talk will demonstrate what everyone has long feared but never proven: there are hardware backdoors in some x86 processors, and they're buried deeper than we ever imagined possible. While this research specifically examines a third-party processor, we use this as a stepping stone to explore the feasibility of more widespread hardware backdoo...
Oh yeaaa, noted, thank you!
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.
and it isnt bugfree either https://www.tomshardware.com/news/intel-me-new-firmware-bugs,37492.html
Yeah this is pretty common IPC work that can be done in python
you can't use native threads though because of the GIL which prevent parallelism
@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.?
Yeah honestly I avoid doing any difficult programming task in python, I donβt think itβs well suited to handle a lot of complex code, I would suggest using Java for this probably, parallel multi threading is quite easy there
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...
If it can run microsoft office
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 :
hey any of you guys know about app development?
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
@deft sigil
Ah gotcha, I personally like Java, itβs got some very easy ways to do parallelism safely, build/packaging/dependency management is easy too
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 π
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
What's VLC?
ohh VLC media player! I thought you were talking about something else
sure
ffs
youtube not playing on vlc with linux for some reason
and I can't get a friggen videofile lmao
@tribal trail https://i.imgur.com/ue9tn7L.png
well
that looks terrible xD
when I resize the window
the program crashes
nice, but my engine outputs the ASCII characters in black and white.
I don't think this is a 'stable' feature xD
lmao
@tribal trail I also bolted ProjectM onto my install lol
its included by default now I think
Anyways, someone played a game engine demo of my engine, and sent the gameplay footage.
You know these oldschool visualizations? https://i.imgur.com/a25QVTP.jpeg
They used to be part of windows media player
Yeah, thats built into vlc now
cool
You can add your own milkdrop prefixes
and it just cycles them
I grabbed this awesome lib off a psychedelic subreddit https://i.imgur.com/gBPlGIL.png
Bunch of fractals
Anyway, this is an old game demo from 2 months ago, the engine can now do much more
oddly satisfying...
looks like some sort of super nova or something...
my curated list of presets ^
~1000 of em
All you need to do is dump them in a directory and set it here: https://i.imgur.com/RJ4SbNq.png
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
nice
can I just say
I hate CSS.
It just makes me angry
fucking a. https://i.imgur.com/6SfeYBA.png
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 
Sometimes all I want is readable text
especially blogs and articles
no need for smoke and mirrors
Is anyone very familiar with docker? I could use someones help with a couple lines fro mad ocker file
Anyone here have a TCP proxy that proxies depending on hostname that they want to send me? π

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
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
Sure, but this is not a TCP proxy, it's a minecraft proxy
haha my bad
Yes, for the transport layer
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
Yes, but entirely tangential
Not anymore, new standards use UDP too. Yes the domain name is passed in the HTTP header
it's QUIC now, right?
Yeah, HTTP3 uses QUIC as standard for transport
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
BGP uses TCP/IP
This has very little to do with Python.
^^
It was trying a bunch of options to connect to something over serial. But then it gave up.
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
It's failing to connect to a device.
could that be the fault of a cable that is connecting it?
how do I run POST requests from a *.http file?
do you mean html file?
no
what's http file, then?
so such thing as an http file
http is a protocol
can you show the contents of that file as an example
no such thing as a http file
?
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
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 :))
idk
you could use curl or wget to manually make types of HTTP requests
anyway, I just installed the Rest client extension and it allows me to run it
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?

I finally got something figured out, ping au.ipv4.perth.mitch.gq with https://tools.keycdn.com/ping
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
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/
reinstall windows
I guess that's an option
lemme watch the video
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!
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": "/"
}
idk if you actually understand HTTP. Do you have a webserver on localhost:8080 to handle the request?
it's an internal server error so something went wrong internally
ummm, I'm just starting out, but before I added the new column, it was ok
in the database
why are you using HTTP in the first place?
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
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
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
it's for making backends
that's why I'm asking for help from people, so I can do it the right way.
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
so you are making some sort of web app?
or an app in general
with a backend and front-end
I assume you are using spring for the backend?
yes
yeah, I can't really help you, idk spring. It's an internal server error which means something went wrong in your backend
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?
well u just want it to turn on and off right?
Something like that
I've never done anything physical with any programing language
you can use something like https://pypi.org/project/RPi.GPIO/
you could use an arduino for something lower level
and use a compiled language like C or Cpp
thats also an option, it just depends if you want an interface like debian or if you are ok with programming using a pc
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
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
yeah if you already have a pi, then you could use it @nocturne galleon
Just realized I had a couple of these sitting around
And a couple of these
And an arduino uno in an old project
Man I just realized how much stuff I have sitting around
yeah those would be good
well that's a bootloader
I have so much random stuff
so little time
And like 4 feet of these rgbs
And
A router?
Not a clue where that came from
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
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
part of the thing with something like a school website is that it needs to be easy to manage. That means generated html, not just random hard-coded html. This is why things like wordpress are popular
whats wordpress
CMS
it's a content management system
very popular
is there something better
@umbral saffron just saying
there's more than one choice
just search google for 'open source cms'
@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
wasn't recommending it, idk what other CMS's are good
Well
Since this is what i use currently
The simple, flexible and friendly ASP.NET CMS used by more than 500.000 websites - umbraco/Umbraco-CMS
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
and it has things like cloning from test to production
does require windows to run
which is unfortunate
@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
my school needs a website and since i dont have access to the stuff theyre using i have togo from scratch
what it is is ur on the website
and u log in'
and when oneof ur periods is live
u clikc a button
@umbral saffron mh
so its a very small and specific set of things it needs to do?
pretty much
@midnight wind this is so simple
oh if it's that then maybe you could use something simplier
at this point you just might toss in any webserver
and start coding
put a small sql database behind it
and you're good
because usually school website for me means a full on information site that needs to be updated constantly by non tech savvy people
@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
i mean theres an assignment thing but that wouldnt be too hard right
i have never used html
they use a thin client, that connect to internal APIs and SQL databases
html is more a markup language, not a programming language
that generates a simple mobile app view
the real coding is the javascript behind it
@umbral saffron HTML is just markup language to instruct the browser where elements on the page are
i mean i cant send u a link but it has a whole thing
CSS is to then apply styling and visual elements
and lastly, HTTP is to transport it all between server and client
ah so is that the interactive part
js can generate html and css
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
wait can I use just js and http
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
and then you have js frameworks like vue and react
bootstrap is what
@umbral saffron look at this ^
Its a set of CSS and HTML tools
to make making websites easier
oh ok
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>
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
what type of graphics? I only ever used imgui for making menus for Xplane plugins
oh, then idk
i made x and o once but just used cout lol
- why?
- just install a webserver (nginx, apache) and open the ports
- I would not reccomend
why wouldn't you recommend
I am working on getting a server
Are there any webservers that I could use python in?
whats the issue
dont look at vertexes please its my first model
theres a hole here
most webservers just serve static content
oh
and there shouldnt be
what software
that's blender
yes
@fallow coral recalculate normals
blender 2.91
can you show me how to do it?
yeah because the normals are the wrong way?
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?
Visual design is hard
frick it im just gonna edit it and make new one
I touched blender once and I'm pretty sure I died
well i need to play with it cos im making a game
How do I mask my IP with a domain when hosting a webserver
you don't mask an ip with a domain. A domain just points to an ip. I can easily find your ip by just doing dig yourdomain.com
what you are looking for is a proxy
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
What's the catch with the free proxy
privacy
Ok
https://pythonbasics.org/webserver/ does this seem informative enough for me to start doing things
yeah but here that's python running the server which is inefficent
it still needs to serve files
that could be used for a backend
I only know python
but you need to write html, css, and js
well then you gotta learn
there is django
I'm taking a javascript class next year
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
yeah try out django
I have to take python this semesster
some of my friends took it and said it was incredible boring
could I code my own coding software
of course
sounds weird ik but could I
some people even code their own compliler
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
wait what do u want ur ui to do
I mostly just want to learn how to do it
codeacademy.org is good
right?
no wrong link
hands on is the best
I've mostly learned by looking at snippets on the python website and then integrating it into what I want to try to do
how I learned is doing a project and trying to figure out what part does what @nocturne galleon
and then put a note
Here is one of my first projects
eh, I think it depends what you're trying to do
want to be a good software engineer? Classes help
want to be able to program stuff, diving headfirst is easy
true
I'm doing this mostly so that I can understand things
And it looks good on a resume
so
try coding ur own ai assistant that was one of my favorite personal projects when I was learning python
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
again how do i connect things together
i want them to connect im in edit mode
they are in object mode as a one object but in edit they arent connected
yeah I get what you mean, bad practices. Needs to be a combination of learning, looking at docs, and some classes. Looking at other's code also helps a lot
press f
I don't plan on doing anything on a professional level
i just makes faces on both of the circles but doesnt connedct them
see
hey arent connected like the higher one
it's a different type of face, I havn't used blender in a while
I don't even have it installed rn
I have it installed but i opened it and got scared and ran away
what django?
Blender
Visual design is scary
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
you would probably need to store it in a database or file
yep some sort of database or key storage like in a json file
i found something on the internet about reading and writing files
and i started working with it
i still havent fully grasped it yet
Python?
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
anyone know how to overload in C++ without copy pasting entire code if one thing needs to be changed?
pls ping me
what?
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
you have one call the other
c++
c++
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
this is what they get
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
if you dont have a domain just type the ip of the webserver in your browser
the tutorial hes working through is about virtual hosts on apache
@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 
its easy on apache too, hes just wondering about the tutorial not explaining something
space duck
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;
}
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
then you probably want some dynamic reversetunneling service
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
hello
hi
i need help again :/
i wanna use sfml
but i cant get it to work on visual studio
@nocturne galleon dynudns
i think i got it kind of sorted out
https://pagekite.net/ was one I was thinking of, which is a bit more complicated
just know only dyndns doesn't hide your IP: https://mxtoolbox.com/SuperTool.aspx?action=a%3Aproofofconcept.ddns.net&run=toolpage
Hello, world.
@nocturne galleon just making sure you have read this
right, just making sure because you said "i dont want to give away my ip"
I won't
wasnt that the point in this whole thing or was it ease of use?
(I took that as you want your IP to be protected)
i dont want it to be obvious that my ip is there
But I would'nt post it somewhere public like this
and easy to remember
anyhow, if you ever want to actually keep your IP hidden, https://pagekite.net/ seems like a good place to start.
im probably gonna start that now
will it work with newer versions of python?
because i wrote this in 3.9
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
hey so i have a problem
with unreal
if anybody can help with this ill be gratefull
here
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
and this is the bug
kay got it
i dont know how i did it but i did it somehow
just sticked this here and it worked
@vital blaze oh I see, not quite but I think this is pretty interesting and would definitely be able to be used somehow
having problem again
weird one
here on thiss we can se they are in the middle of the screen
they are moved but why?
when i click play...
andd it crashed
okay nvrmd fixed it
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
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...
whats the best software to run html in
you don't run html, you send it to a browser?
you mean browser (client) or webserver (server)
yea but from where
wdym
where do i actually write the code
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
oh ok
wait how do u send it to the place u want to use it for
you can technically debug just in a browser, but the extension allows you to set breakpoints directly in the editor
wdym
it's just a file
you open it
or you run a webserver to serve the files
I do not think so
you could technically take and save html of an existing website that wouldn't really work out great
what if I just get an api from the website and write it in javascript in vscode

wait nvm thats dumb
I do im just being dumb
I would just like to express my desire to strangle whoever wrote the Javascript Date API π
@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
Moment is not great either.
including a date parser using java's date parsing xD
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.
@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
Does anyone ever use Gregoriancalendar? 17 lol
@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
Honestly FFS this Samsung bullshit keyboard, it auto completes numbers like that 17 there. Shittest predictive text/keyboard ever.
and only local presentation does the conversion
@pliant siren 
/**
* 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
Did you know that ios does not honour local timezones if you don't specify an offset, as the ilo spec requires?
I've never done iOS development
FFS keyboard. I want to throw this piece of sit
As you can probably guess, I didn't type sit either
If ios gets "2020-10-17 11:23", it will interpret that as UTC. Not the local rhinestone as the iso spec requires
Rhinestone. Are you fucking kidding me!?
that string is without a timezone
Inferring timezone would be an unwanted side effect
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
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
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.
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
Exactly. So the same code if you run it on anxious might be say.... 10 hours or of tow in Melbourne..
isnt a workaround easy?
Which is great when your app is telling students their exam time.
if you make sure you do the time checks in 1 location
minimizes chances of bugs in your code
It's easy *once you know the problem exists *
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.
APIs should give out UTC. at all times
Timezone should be seperately supplied
or handled by the client
server doesnt have to know
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.
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
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.
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.
The real world doesn't use UTC.
It really doesn't
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
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.
nope

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:
- Complete React Tutorial - https://www.youtube.com/watch...
hello
any idea on how i should start implementing collision to objects in sfml ?
please
implement it
Why is c# pain?
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
@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
so so using IntelliJ/VS for coding, and .NET WinForms for the UI would give me the Desktop equivalent of android studio
for desktop apps, is that right?
@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
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)
python 2.7 is dead
no for windows, I mean a desktop application
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
@ebon viper https://i.imgur.com/iBGJISG.png
@ebon viper this editor generates code for the interface
you can then give it functionality by assigning event handlers
@warm sleet have you looked at http://qt.io , might be a better toolkit for the purpose of multiplatform compat..
or https://kivy.org but thats pyton only i think'
I do mostly backend development
and it depends of course, but desktop apps are generally written in C++, or should I go for python?
I thought qt was open source?
ah
@ebon viper you can write windows desktop applications in .NET just fine
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 https://github.com/qt-creator/qt-creator ?
@deft sigil FX works fine for GUI creation with java
@warm sleet yes qt has a visual editor , much more advanced than the .net editors,but it needs a little getting used to
Oh okay, I never used .NET before but if it's the standard for Windows Desktop apps I'm willing to look into it
thank you
because you have to "divide your window into areas that have static or dynamic sizes
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
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
that was also a long time ago (had to cut the winXP tasbar of the screenshot to not make it a megafail :P)
layout and styling makes my brain crash
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
@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
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)
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>
}
}
whitin'
See the <Articles> ?
That's a reference to another type, the one above
Hyperscript ftw
you mean same as include somefile.php π for php or fstrings in python π
@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
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.
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
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
@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
you can just use <img src=jajadjaflk.png" loading=lazy to achieve the images loading after the fact ...
@deft sigil that loads before the js code is loaded
All script files are at the bottom anyways
loaded last
most browser (aside for IE) ,suports it (ff , chomr,edge,opera)
@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
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)
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
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 π
@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
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
@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
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
@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
JVM is just an emulated Necronomicon

