#development
1 messages · Page 55 of 1
@reef tangle i haven't work much in numpy but the way u are calling time and those below it may be the issue
instead of two argument maybe just provide t does it work?
This is for an assignment
hold on
"g = 9.81 # We are on Earth.
dt = 0.1 # 1/10 second time step
N = 100 # I'd like to see 100 points in the answer array
vi = 50.0 # initial velocity
xi = 25.0 # initial position
# first, set up variables and almost-empty arrays to hold our answers:
t = 0
x = xi
v = vi
time = array([0]) # initial value of time is zero!
height = array([xi]) # initial height is xi
velocity = array([vi]) # initial velocity is vi
# Note that 't', 'x' and 'v' are the current time, position and velocity, but
# 'time', 'height' and 'velocity' are arrays that will contain all the positions
# and velocities at all values of 'time'.
# Now let's use Euler's method to find the position and velocity.
for j in range(N):
# here are the calculations:
t = t + dt
x = x + v * dt # x = x + dx = x + v*dt
v = v - g * dt # v = v + dv = v + a*dt
# And here we put those calculations in the arrays to plot later:
time = append(time,t)
height = append(height,x)
velocity = append(velocity,v)
# Now that the calculations are done, plot the position:
plot(time, height, 'ro')
xlabel("Time (s)")
ylabel("Height (m)")
# just for comparison, I'll also plot the known solution!
plot(time, xi + vi*time - 0.5*g*time**2, 'b-')
show()
You can see on the graph below that this actually works pretty well. It's a little bit off, but not bad; you can make it better by making dt smaller and N correspondingly larger.
Assignment
Change that sample code to numerically solve Simple Harmonic Motion instead of free-fall. We’ll still use the equations for Euler’s Method, but instead of a=-g, use a=-ωx.
Define global constants x_i=1, v_i=0, and ω=1.
Plot the position for 10 seconds. Make the code put your name in the title, of course, and plot the known solution also!```
im calling numpy is from this piece of code here
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import brentq```
then your professor/teacher just asked you to use euler's form for numeric integration. you don't actually need scipy for this?
just put the new evaluated points x at each iteration in the array
if that's what the assignment does it's basically looking at the terms of the numeric integral int from 0 to 100 {x} dx
@nocturne crypt the whole point of the exercise is to use eulers method in code. its a project
then use euler's method
i don't see any inconcistincies with what i said and what you're doing
there's numerous way to what you're attempting to do. i simply stated the core idea is stemmed from integration
i only mentioned it because i thought it would help to think of each position as a term instead of some foreign idea
i won't help you in the future :)
Why is it okay to overload a const char* for using cout <<. But not a string?
If I change the operator const char* to string and then return a string instead of a char pointer it wont work. Why?
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
class Date
{
private:
int Day; // Range: 1 - 30 (lets assume all months have 30 days!
int Month;
int Year;
string DateInString;
public:
// Constructor that initializes the object to a day, month and year
Date (int InputDay, int InputMonth, int InputYear)
: Day (InputDay), Month (InputMonth), Year (InputYear) {};
operator const char*()
{
ostringstream formattedDate;
formattedDate << Day << " / " << Month << " / " << Year;
DateInString = formattedDate.str();
return DateInString.c_str();
}
};
int main ()
{
// Instantiate and initialize a date object to 25 Dec 2011
Date Holiday (25, 12, 2011);
cout << "Holiday is on: " << Holiday << endl;
return 0;
}```
Anyone here got some nodejs knowledge? I'm attempting to interact with filesystem, but the method that is called, has to exit synchronously
Even though the method I am calling inside the function, does async stuff
how can I 'await' before returning?
writing() {
//Copy package.json
fs.readFile(this.templatePath("common/package.json"), function (err, buff) {
console.log(buff.toString())
});
// I want to do some more after this readFile, but cannot because of that ^
}
@nocturne galleon Honestly, I didn't even know you could do operator overloading on a const char* type wow
string is not a operator, its a class
I can see what you're trying to do, you're supposed to overload the stream operator '<<'
Okay thanks, currently working my way through SamsteachYoureself C++ in one hour a day
string is not a operator, its a class
@tulip oracle you need to stop
?
obviously string isn't an operator
but const char * isn't as well
it has nothing to do with them being operators
it's conversions
Ahh its conversion lol

@warm sleet you found the solution?
welcome to callback hell myfriend
Its so stupid
where 4 tabs is normal
I get it makes your software async and all
but the writing of the code
is like 10x harder
Imagine combining async with multithreading....
I do multithreading when I need it to in java
not expect my language to do it everywhere
its just as confusing in C#
TBF the Async is a great idea
on paper yes
Yep
but would you want to run a sinlge threaded application on this beast 18core XEON
but not if you are writing a tool, that sequentially has to read, modify and write files
but not if you are writing a tool, that sequentially has to read, modify and write files
@warm sleet Looks at framework with CLI

context constrains me to make sure that there's no callbacks
TBF Nodejs gives me hipster vibes
I feel like the developers that read hacker news

come at me nodejs devs
@warm sleet Good job
writeFileSync.. doesnt create subdirectories
stuuuupid
it fails
says file doesnt exist
doesnt tell you that, directory doesnt exist
This is why system calls are better smh
see I expect to be able to just give an option/parameter
to create directories if not found
but no
I have to use mkdir
correction
mkdirSync
nodejs people not the brightest when it comes to sane API design
Needs a IF NOT EXISTS
Unfortunate 😦
^On your macbook xD
@nocturne galleon https://www.youtube.com/user/TheChernoProject
https://stackoverflow.com/questions/64367771/ctad-fails-differently-in-nested-class-template-with-braces-parens-on-different?noredirect=1#comment113823119_64367771 Gonna try my luck and ask here
what are you trying to do?
I am trying to know whether I was wrong or not, because it should deduce the template parameter
no it should not deduce in that circumstance
you need a deduction rule
which you can provide in C++17
in return GetB
MSVC provides broken rulesets
and has a lienient mode
stuff works in MSVC that shouldn't
OK, how do you explain GCC deduce by using () but not when using {}
{} has more strict initialization rules
than ()
{} construction is the way forward
less dumb things happen
Should work exactly the same tho, because that's the only constructor
no, () and {} have different initialization rules
they have different implementations in the parsers nad have different rulesets assigned to them by the standard
Is that a reason for GCC/Clang doesn't behave the same
Microsoft provides lienient rules that break the standard
and GCC/Clang explitely force you to use extensions
i do not believe either have CTAD extensions for what you're looking for
that's why C++17 has deducation syntax
you need to specify the Template or provide deduction syntax
so, clang is correct?
template<T> B(T ) -> B<T>;
I know deduction guide
that only works with C++17 onwards
well then you know CTAD is broken and forever will be
don't insansiate objects using parenthesis
the curly barce initialization was changed to avoid all this dumb
they would've removed if it didn't break ABI
i don't think that should ever be will defined behavior
i think it's UB at compile time
you either provide a deduction guide or ride by the seat of your pants
or explicitely mention the template parameters
I don't understand what you are talking about.
the answer is CTAD is broken
From your words, it's like it shouldn't deduce in both cases, so clang is correct
using parenthesis for construction has historically has undefined behevior at compile time
i'm simply stating that deducing a template class without paremeters should be undefined behavior
my answer is it's undefined behavior
you can come to your own conclusions
i don't think the standard gives it a clear definition in this case either
i would have to review it, this is a real edge case
i'm simply stating that deducing a template class without paremeters should be undefined behavior
@nocturne crypt Epic, so CTAD is always undefined behavior
no, just in this context
CTAD works in various situations just not with auto as a return type
with no trailing return
it probably works with auto and trailing return
So auto return type with CTAD is undefined bahavior?
i would have to check on it, but as someone who's been doing this for like 10 years now
auto without trailing return type with CTAD just sounds like you're asking for trouble
i'm not even sure it would work with the trailing return type but probably
CTAD come out in C++17, how can someone doing this for 10 years
he's in the future
auto return type come out in C++14, it's not 10 years either
auto return type come out in C++14, it's not 10 years either
@worthy dirge he said 10years of C++ experience
it was the class clown
CTAD was there in C++11
@nocturne crypt Wrong. It's in C++17
the compiler did it
it was just the class clown
the same way SFINAE was in C++98
Compiler can do all sorts of things even before the standard comes out
^
SFINAE is a bug if you're curious
they couldn't fix it
so they adopted it into the C++11 compiler
it's not a bug, it's a feature
If you can do this std::vector v{1,2,3}; in non C++17, then I will believe you
I'm not sure you could explicitely use insansiate stuff with CTAD but you could do stuff that's listed in here: https://github.com/mapbox/variant/blob/master/include/mapbox/variant_visitor.hpp
or use sfinae in constructors
just use deduction rules in C++17 if you're allowed to use it
you won't run into your problem
you should also use explicit constexpr noexcept
to avoid implicit conversions
lights go blink blink
What's the difference in using unique_pointer or making your own smart pointer class?
in c++
unique_ptr is the easiest to implement smart pointer

@simple harness shift registers?
looks more like a counter
its just like a flip flop but just 1 input. so more like a counter yeah
ill try build it again if i can remember it was pretty confusing
heres a view inside each module, not sure if this is possible in real life logic circuits
here's a clean view
sorry this is the correct circuit
shortened it
@simple harness get yourself an fpga
a what?
there's development kits, look similar to arduino boards
fully programmable gate array
you can basically design hardware logic with components like those above ^
ooh
its HDL
hardware description language
and then you and flash that onto an FPGA
and it basically emulates the logic in hardware
oh its field programmable
not so much a processor
but you can implement a processor with it xD
ill look into it
professional fpga development boards are expensive
not sure about DIY space
@simple harness this is quite cool
its small board, with an fpga and tonns of different interfaces
not too expensive
so you can turn it into basically anything
Bring the power of FPGAs to your embedded projects.
is it like a raspberry pi or no
its more like arduino
but its an FPGA, so you program it with logic gates instead of code
awe okay
what you simulate in that program of yours, you can embed onto an fpga and execute at some clockspeed
yeah. i mean i like the programming side of things so i might like doing that too yeah, thanks 🙂
FPGAs are nice because you can reprogram them with a CPU
so they can be optimized to do one task very efficiently
faster than generic purpose processors could
and ofcourse they serve as a development platform for DIY processors
The Intel® Cyclone® 10 device families are optimized for high-bandwidth low-cost applications for smart, connected systems.
I think it's possible to get an educational discount on Alteras
I too am a developer

after some time. i got a reset input to work for my flip flop thing
that's fascinating sweetie keep it up
thanks mom
I wonder how much performance I can gain through AVX/SSE/NEON by changing my ```
[R, G, B, A, R, G, B, A, R, G, B, A, R, G, B, A]
to
[R, R, R, R]
[G, G, G, G]
[B, B, B, B]
[A, A, A, A]
which lang?
and if u use avx, probably 4x performance gain as there are 4x less instructions
assuming 4 values in an avx register (or xmm or whatever its called)
got saving and loading working
@simple harness will you open source this?
This would be great for teaching digital logic
Yea I know of falstad, tho this one looks to have a nicer interface
idk, i think it's pretty shiny
iCircuit already exists as well if you want it on your system
Hmmm that looks pretty good, tho does it support purely digital circuits?
iCircuit supports logic
it has a virtual arduino too
you can literally code C in the virtual arduino
it also has a market place for custom components
maybe repository is a better word, you know what i mean
iCircuit is great on ipads
edge (& any other browser) is just downloading the php file
but tor actually shows it
whats the problem
on a low level, the http response is telling the browser to download the file. I think it's called binary serve or something like that instead of rendering the file. Tor probably blocks all those since it's meant for privacy
@tall kernel what web server are you using
nginx
i launched another vm
and i did the same thing
and it works here
interesting
@tall kernel you have php-fpm installed?
yep
while hash.__self__.__dict__["True"]+hash.__self__.__dict__["True"]==hash.__self__.__dict__["ord"]('守')/hash.__self__.__dict__["ord"]('ⷄ') and hash.__self__.__dict__["False"]!=hash.__self__.__dict__["True"]: (lambda 你,我的中文不好:print(hash.__self__.__dict__["int"].__call__(hash.__self__.__dict__["str"].__call__([[我的中文不好[hash.__self__.__dict__["False"]]*我的中文不好[hash.__self__.__dict__["True"]],我的中文不好[hash.__self__.__dict__["False"]]/我的中文不好[hash.__self__.__dict__["True"]],我的中文不好[hash.__self__.__dict__["False"]]+我的中文不好[hash.__self__.__dict__["True"]],我的中文不好[hash.__self__.__dict__["False"]]-我的中文不好[hash.__self__.__dict__["True"]]][好笑] for 好笑 in hash.__self__.__dict__["range"].__call__(hash.__self__.__dict__["len"].__call__([23423,342424,32434234,234])) if ['mul','div','add','sub'][好笑]==你]).strip.__call__('[').strip.__call__(']')))).__call__(hash.__self__.__dict__["input"].__call__('Choose an operations:\nmul for multiply\ndiv for divide\nadd for addition\nsub for subtraction\n'),[hash.__self__.__dict__["int"].__call__(hash.__self__.__dict__["input"].__call__('Enter the first number of the operation: ')),hash.__self__.__dict__["int"].__call__(hash.__self__.__dict__["input"].__call__('Enter the second number of the operation: '))])
this code runs lol
95% smaller, squish
looking for a front end web page person
you could
I know some things about web things @nocturne galleon
That's the beauty of maven
It's either you know it that it's hard to explain.
Or you don't and it's hard to learn
have you ever set up a maven project?
so, you can generate a 'default' project with an archetype, archetypes are like project templates
mvn archetype:generate
you can use this to create the initial pom.xml configuration
sry if i didnt explain nicely
do you have the java development kit installed on your system?
@warm sleet well first im installing maven so that i can use luyten to decompile
Maven needs the jdk
uh how do i check if i have it or not
ye
its in C:\Program Files\Java
in that directory, should be either jre
or jdk
with version number
lemme check
if its not there, install from here: https://adoptopenjdk.net/
Get version 11
with Hotspot
is there a way to check thru cmd prompt
yes, see if javac is available
thats the java compiler
just install openjdk, doesnt hurt having multiple java installs
i have java 8 pretty sure
basically, what you have to do
is have a JDK environment installed, and configured in PATH
so that you can access it from commandline
then, you unpack maven in a directory, I usually do it in C:\maven
and then, you go to environment variables again, and add M2 and M2_HOME
as well as adding %M2%\bin to path
this will allow you to call mvn from cmd
i am confussion lol
kk lol
after you installed that, download latest version of maven
make a new directory in C:\maven and drop the contents of the download in there
on windows, installing maven is annoying
because there's a manual step
kk
@marsh oasis after installing openjdk, open a new cmd window and run echo %JAVA_HOME%, see what it prints
%JAVA_HOME% should point to where openjdk is installed
uh just a quistion i have to make the maven folder right in my c drive
yes
so with all the program files?
or anywhere
lol
lel
once you've unpacked the maven files, show me screenshot of the directory its in
after that, search in windows start menu for Environment variables
and click on that
ye
ok
now open environment variables
create a new system variable, named M2_HOME
with value: C:\maven
kk
install location is fine
that java home is important
otherwise maven will complain it cant find java
ok, so show me the environment variables. Have you added the M2_HOME ?
next up, edit Path (should be part of system variables)
and add a new line to that one
variable M2_HOME points to C:\maven
ye
now, add another line to the existing rule Path
ye
yep
create a new line on Path (you can add more than one path to Path)
and have that one say: %M2_HOME%\bin
this should add the programs in C:\maven\bin to your commands in cmd
done
works
cool.
3.6.3
you've installed maven
Minecraft plugins huh?
started learning python and now i make discord bots and now im also learning c# for game dev and now java
also doing a course to make ios apps lmao
but yeah, you can generate a project for maven now
epik
using either an archetype, or an IDE
I just use intellij to do it
since intellij integrates with maven
lol
it truly is
why are you lol-ing
^ the only true java IDE
eclipse maven integration is awful
I've developed all my plugins with intellij xD
and there's even plugins for intellij now, to facilitate with mc development
They don't do much
why are you lol-ing
@hollow basalt just do
but its helpful for things like MCP
minecraft coder pack
for developing forge mods
I literally linked it
sry didnt see lol
why is my internet bein so slow today
the speed rn is like 495 but it takes a few seconds for it to download things
See, all those database tools, Java EE and such
are things I need
but are not needed for mc development
or vanilla java
kk
file associations are lame
dont need a full fat IDE to open a text based source file
xD
IDEA has fernflower decompiler built in
you can just open .class files
and it decompiles them
oof
im here to learn ;-;
oof
@marsh oasis there's tutorials on how to make bukkit plugins
most of the things in minecraft are relatively simple
lol
typical way you hook into minecraft is using events
player places a block, bukkit raises BlockPlacedEvent
then you can modify or change how this event gets handled
ohh thats helpfull
i do loads of discord.js and thats bassicly what i have to do lol
bukkit is quite big
has a lot of interfaces
I wrote a plugin to do cross-server synchronization
so two minecraft servers, and if players jump from one world to another
they transfer server, and it transfers profiles between them
so how hypixel works like lol
@marsh oasis all you basically need to do, is just create a maven project
u mean vape the hack client?
and add bukkit-api to your dependencies
in your resources directory, create a plugin.yml file
that plugin.yml file has some context information, like the main class of your plugin
with mvn package
it compiles and packages this into a jar file
which you can drop in the plugins/ folder
thats cool
im fine
i dont know abt that one
no.
i dont trust anyone :D
yes sir
atleast im less stupid then u
<@&750150305383186585>
Yes I do
with you.
can you ban this imbeccille
oh
rekt
small pp
he not smooth
Wrong channel :P
@marsh oasis if you need any further help or have questions
I'm here
kkk
Hey, does anyone here use self hosted task management tools similar to trello. Any recommendations?
jira is self-hostable
It is ?
I thought it was paid.
Oh I see, It's a Freemium model.
But it's not OS 😐
Who knows what they might be doing with my data.
the data is on your server
you just need a liscense key
you can always use gitea/gitlab to track issues
git is inherently great at tracking bugs
@nocturne crypt
Thx for the recommendation, I'll consider it ❤️
Git does not have issue tracking
@nocturne crypt issues and PR's are not part of git itself
@azure mica https://github.com/kanboard/kanboard
This looks good too
https://github.com/plankanban/planka
Kanboard seems little bit dated. I don't think it's still being maintained.
Kanboard has way more users
last change was 3 days ago
its actively maintained
Kanboard: https://i.imgur.com/rQD9MsO.png
Planka: https://i.imgur.com/3AyE0yx.png
github usage metrics are not a direct indicator of software quality
but its a good guideline for support status of software
👍
Most of these look much alike
Jira looks incredibly similair
I've previously used MantisBT for this kind of stuff, but it so convoluted and confusing to use
MantisBT is a popular free web-based bug tracking system. It is written in PHP works with MySQL, MS SQL, and PostgreSQL databases. MantisBT has been installed on Windows, Linux, Mac OS, OS/2, and others. It is released under the terms of the GNU General Public License (GPL).
But mantis is ancient
can someone help with c# networking
sup
I removed it
ight can someone help me in python
im rlly stuck on this and its frustrating
How do i make it print once?
^^ Code ^^
Looks like one print
^^ File being accessed ^^
output ^ ^
Im only reading line 4, but for some reason its printing it twice
idk how
Are you calling the function twice?
readYamlConfig() is working perfectly then
seems unlikely?
I doubt it would run a python script any different than anything else
your code is probably doing exactly what you told it to do
just not what you meant to do
well i printed a thing and then it prints it twice
i don' think that's what it was meant to do
is it in a loop?
nope i left it outside
when you run the code are you somehow running it twice?
what if you put a print right under the shebang
put a bunch of prints everywhere and see which ones print twice and which dont
that's all I can suggest without seeing your code
👍

I am having some trouble with trying to do a very basic thing in JS canvas 😢
I am basically trying to get a police car image to change the src value lets say... Every 500ms so that it looks like the lights are flashing when its in "chase" mode
It's my friends project and I thought this would be super easy to add in, turns out its not lol
I tried using setTimeout and setInterval however because the function is running 60 times per second (60fps), those things glitch out and don't actually delay the amount specified
I found a sketchy way to get it to work however the timing is inconsistent, sometimes its changing the src normally so it looks good, other times it is spazing out and changing it super fast
I'll paste my code below and if anyone has a better idea of how I can fix this, please let me know
(Keep in mind there is a crap ton of other code doing other things in this file, I will just show the code for my issue)
... (This runs in the function 60 times per second when "chase" is equal to true)
startInterval()
this.myBitmap = copSirenIMG
...
... (This is outside of that function and runs normally)
function startInterval() {
setInterval(switchSiren(), 500)
}
function switchSiren() {
sirenNum++
console.log(copSirenIMG)
if (sirenNum >= 1) {
sirenNum = -1
copSirenIMG = copPicBlue
} else {
copSirenIMG = copPicRed
}
}
...
I also wanna know if there's a way to control what is run client-side and if I can make it certain things will only run server-side
what I gather from this is use Blazor if I want a clientside app and razor if I want serverside, would that be correct?
I'm confused about this paragraph, what does it mean by migration? and whats a schema?
ok so I just googled it and that makes more sense now
google cant even help me figure out what this get set shit means
C# magic
Forget manually writing getter and setter
Let c# compiler do it for you

what does that mean tho
i get ID and title are variables
but im used to something like int VarName = 0; or something
not int VarName {get; set;}, I've never used that kind of syntax before
Do you know getter and setter?
learn that first then you'll understand me
hmm
what is the point of making variables private if you are going to have public methods to access them
why not just make them public?
Welcome to OOP
so basically the whole thing is a bruh moment?
C# assumes the pattern that everything has a getter and a setter
because C# is Java
and thus suffers from all of the problems that plague Java
this is why in C++ they simply left structs, it was both for ABI compatibility and the fact that sometimes you just want public instance variables
C# is an intepreted language. or JIT (Just in Time) compiled languages, it has a lot of nuances
btw if you're deploying ASP.net in the wild you probably shouldn't
especially if it's a new project. C# just like Java is really expensive to host, debug, and deal with on a daily basis
I think he's learning, not actual work
C# has the advantage of having MSDN documentation, which is actually well done
it uses visual studio as ide, which i kinda prefer
I find it hard to follow some of MSDN
especially some of the legacy stuff, but I mean, thats understandable I suppose.
All of microsoft's stuff is confusing
@nocturne galleon {get; set;} is for properties
these are fields of a class, that have their own get and set method
so you can have
class Foo {
int someField {get; set;}
}
// outside you can do this:
var foo = new Foo();
foo.someField = 1;
Console.WriteLine(foo.someField);
with languages like java, you'd have to make two methods for this, getSomeField and setSomeField
in C# you can just write your own getter like so:
private int internalField;
int someField { get { return internalField; }; set { internalField = value } }
you can also make getters public, and setters private like so:
int someField {get; private set;}
@nocturne crypt I find debugging Java much easier and nicer than .NET
There's more "gotchas" with .NET
and stdlib in C# is messy/confusing
ASP is even worse in that regard
is does a lot of things behind the scenes, which you have little control over, and its not immediately obvious
I find C++ easier to debug than all of them
because I have full view of all the symbols
reverseing java apps with ida pro and optimizing is actually impossible
i can't optimize the JVM
Yes, its a VM language
nor can i promise the JVM won't be a huge dick
you shouldn't be optimizing that
if you need native optimization, don't use java
or use a library that uses native bindings
i always need native optimization
pfshh
using C++ for applications that have to deal with business rules, is like stabbing yourself in the back
much rather use higher languages for this
you can do it, sure, but probably not as fast (development time)
naw C++20 is really fast to develop with
yes, but its still just gcc
it's designed so you don't have to
gcc is a compiler
you can use any compiler you want
??
yes, its a language spec
but really, the language is just C with a new typing system
no thanks
if I need native stuff, I just go straight for C
C++ is not C
it's not just a typing system on top of C
you're just ignorant, which is fine
C++ has backwards compatibility with C for people who want to use it, but honestly you're encouraged not to use that segment of the language
tl;dr Rust is literally just C++ with more compile time rules being enforced at comiple time
Hallo. This may or may not be the right place to ask but anyhow.
anyone where i can buy small boards with onboard Bluetooth which can have a code on it like controling led lights and stuff like that. hope it makes sense and if i does not pleas let me and i would try to explain it better
and pls do @ me or dm me
raspberry pis have on board bluetooth and you can put LEDs on them @cunning flume
which one can you recommend then snice cheapest i can find cost 500 DKK or 75 USD
@nocturne crypt
you can buy a rpi zero for $5 USD
https://www.amazon.com/s?k=pi+zero+w&ref=nb_sb_noss_1 @cunning flume
i'm sure you can find it for $5 USD somewhere, i'm just not sure where. i guess shipping costs went up
its fast enough to play Pong
How can i stop a css hover transition when the page refreshes
Ya the circle thing
Its radius resets to 0% when i refresh the page, then goes to %50
When you hover over it it will be at 25%
Im not sure why it starts at 0% radius and moves to %50, i have never specified that to happen in the css file
its a transition there is not animation tags
took a while to align them all but hey 🙂
video, running slow because i had to zoom out and im recording
i mean, maybe, maybe not
- have to then program different gate type. all the gates just now are one class
- you can make them from other gates and save them as blueprints, and I'm gonna be working on a way to save blueprints so you can just copy them to different files easily
also here's the link to the git. gotta get that plug: https://github.com/DylanMcBean/LogicCircuitSimulator
Looks good, too bad I don't know processing
@hollow basalt its just java
processing just creates a context so that you don't have to worry about access modifiers or imports
but processing is stupid lol
you can use it, as a standalone java library
or groovy/scala if you hate java
but its also its own language
well
some people dont want to learn java
and just want to make stuff
typical PApplets have a setup() and draw() function
all you need, to do simple rendering
you can handle keyboard events, and make simple platformer games with that
never used those tbh
but I understand that part
i mean if you could focus more on the logic
than whether or not this access modifier makes sense in the graphical part
I once got an F for an assignment with processing
they wanted me to store points as type int[][]
but I just did some imports at the top (since its just java)
and used List<Point>
wait that's illegal
are you sure the assignment isn't about multidimension array
after he told me, I fixed it

and I got an A
and I got an A
@warm sleet that's a 0 from 100 real quick ngl
nah, it was the first programming course from my university lol
"Structured program development"
yea
my uni used C++ as the first programming course
2nd semester they move onto OO-principles

and teach people java
if you can even call it teaching
my teacher literally spent an entire afternoon teaching people what a 'singleton' is
even though, singletons are by far the worst pattern in OO-design

my teacher went fast and furious with design patterns
we are like burning 5 patterns in one class
so at the end
I only appreciated singleton , factory, adapter
Architectural patterns are the stuff
the others, I forgot
There's only a handful of patterns that I use readily
I abused singleton so much
I don't use singletons in the traditionl sense
I don't need factories
and adapters, yeah, those are kinda typcal to have for interfaces that dont make sense
I think my programming in android made me abused singleton
cause the class is a schodinger
I don't know if it's alive or dead
well yea
and singletons & factories are kinda irrelevant when you start doing IoC and DI
tbf it taught me lessons about dividing the right process
Inversion of Control & Dependency Injection
DI is really good
ikr
IoC means, that you do not instantiate new objects
I think my knowledge is mostly DI, and I didn't understand the IOC as a whole
you merely provide types that will be created by the framework
so things like with webservices in java
you just create service classes, and the framework creates instances for requests that are made
you never actually instantiate objects of your service classes
thats handled by the framework
this is typical IoC stuff
DI can help you tie into IoC
I still remember the Rx
dunno if it actually got big in other countries

seems nobody appreciated rxjava that much
Idea is great, but it is pretty much handled by frameworks
@hollow basalt there's bunch of libraries to do observers
Akka is a toolkit for building highly concurrent, distributed, and resilient message-driven applications for Java and Scala.
Libraries like Akka
for message driven application development
Akka is nice for Scala
since Scala has special operands for actors
ah yes observe pattern
This was an actor hooked up to redis
haven't heard that in a while
actor ! call
was the syntax
and actor looked like this
package chat
import akka.actor.Actor
class MessageActor extends Actor {
def receive: PartialFunction[Any, Unit] = {
case (c: String, p: Profile, m: String) =>
println("[" + c.split('.')(1).toUpperCase + "] " + p.getFullname + ": " + m)
}
}
One of the primary annoyances with scala that I had
c: String instead of String c
@hollow basalt yeah, I remember this now
this code, was from an assignment in school
I used my minecraft server's chat system, to 'test' actors
since that was already message driven
package chat
import java.util.UUID
import akka.actor.{ActorRef, ActorSystem, Props}
import com.knockturnmc.api.util.Utils
import com.knockturnmc.api.util.Utils.formatUUID
object ChatMonitor {
val system = ActorSystem("ChatMonitor")
val messageActor: ActorRef = system.actorOf(Props[MessageActor], name = "MessageActor")
val host = "localhost"
val port = 6379
val db = 0
val timeout = 10000
val auth = ""
var listener: Redis = _
def main(args: Array[String]): Unit = {
listener = new Redis(host, port, timeout, db, auth)
listener.pSubscribe("chat.*", (channel, data) => {
messageActor ! (channel, getProfile(formatUUID(data.substring(0, 32))), data.substring(32))
})
}
/**
* Fetches a profile from redis
*
* @param id the player id
* @return the profile
*/
def getProfile(id: UUID): Profile = {
val redis = listener.pool.getResource
val profile = Profile.fromJson(redis.get(Utils.getBytes(id)))
redis.close()
profile
}
}
printed:
hehe
why would anyone want a RTL
I actually tried to create a observer library just for the lulz and to learn
i yeeted every observer into a list
lol
and iterated the list everytime something happens
should at least organize it somewhat
so it takes less computation
Observer pattern makes sense in code
but once you go to networked systems
oberver pattern is more that of event driven programming
@hollow basalt its quite funny
in some assignments in school
minecraft is my 'case' to test around
yeah, I needed something to apply actors to
and what better, than a global, already decoupled chat solution
that just needs redis to hook into
@hollow basalt ah yes, My motiviation for doing so
is right hre
interesting, I might come up of a different way like a simulation or some sht
Minecraft is a good subject indeed
lel my creativity is down the gutter
teacher LOOOVE seeing diagrams
have one.
be satisifed
@hollow basalt the goal was to show off the simplicity when working with scala
a similair solution in java would require double the boilerplate
show off the simplicity
words to live by
@hollow basalt KISS principle is still a good thing to follow
I like KISSDRY
obvious isn't enough
ye its a mess
the goal was to have a seperate module for generated source code
in common/
and main project source lives next to it
i'm still used to seeing public folder
@hollow basalt its a bit odd. so the master project calls a generate step on common
which generates schema and client code for a given CMS configuration
and after that, it just includes it as a dependency in npm
the tsconfig is there, to just transpile the typescript code into js
hmm
I'd rather build it in build/ then i'll know what to ship
or
dist/
that includes css
makes more sense
ffs
a language is supposed to be a tool
but typescript is being really obtuse.
its making me angry
even its OO principles dont work
I defined a constructor in a supertype, I try to extend it, and the super type constructor does not exist
this doesn't refer to an instance, supposed to use super
it means typescript isn't your type
but super resolves to undefined at runtime, while this is filled with supertype fields at runtime
but this cannot be used instead, because then compiler complains
this is so confusing
Foo extends Bar, Bar defines fields
if you want to access those from Foo, you have to do super.fieldOfBar
but runtime, super doesn't exist
only this
but compiletime, this is invalid
because it says this.fieldOfBar is undefined

yeah
the magic of transpiling
its stupid
as if node wasnt bad enough, now typescript is being snowflake
import express from 'express';
import {UmbracoBlog} from "./heartcore.query";
const client = new UmbracoBlog("dev-test-project-01", 'en-US');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
client.getArticles().then((d) => res.send(JSON.stringify(d)))
});
app.listen(port, () => {
return console.log(`server is listening on ${port}`);
});
this is the tiny fragment that I am trying to test lol
but it stumbles with the instance of UmbracoBlog
that constructor it has, is defined in a supertype called UmbracoClient
but typescript cannot find it, so i had to declare the same constructor in the subtype
idk why
what i find interesting is in a dual stack host
when you receive an ipv4 address as a web server
it appears as ffff:ipv4 address
and now you understand why i just use ma C++
boost beast makes designing websites so much easier
its in preperation for ipv6
boost beast makes designing websites so much easier
@nocturne crypt C++ web building sounds like cancer 😛
Give me Spring Boot pls thx
I like C++, but making web services in it does not sound fun lmao
you can even use rsockets in C++ if you want some of that goodyness
boost beast makes websockets soooooo easy
and it's a header only lib with the header only lib asio
in C++23 they'll be in the standard :)
Dependency management in C++ is just cancer
and dependencies are v useful for a lot of web building
i mean it's easy enough for me
most of my stuff is just header based libs
cmake makes building other stuff super duper easy
like which part are you talking about? your headers don't show up? or you get like the can't find .so lib error?
when building web services it's super important to only use either static libs or header only libraries
or spam docker really hard
Just in general, installing and managing C++ dependencies and getting them to work and compile correct is just suchhh a head ache
Especially compared to other build systems
even using static libs
Java? use gradle or maven and add a few lines to a config, bam, downloads, compiles, whatever automatically



