#development
1 messages · Page 59 of 1
Nope, I can later tho
Why?
why, you want an Ubuntu touch Port?
xD
I'm bad at porting tho :/
ah
i was trying to learn ethical hacking from a group but it kinda sucked the way they have a online virtualized attack machine that is very slow.
currently playing hehehe
@nocturne galleon well im assuming this is c++, so i give my advice: in ur class definition: ```cpp
class Foo {
private:
std::unique_ptr<int> ptr;
public:
void makePtr(int& number) {
this->ptr = std::make_unique<int>(number);
}
};
@crystal tundra Problem here is that you are creating the pointer already inside the private area. I need a vector<smart_pointer<classnametopointto>> smartpointerlist();. And then I need to be able to fill up that list
Oh so a vector of smart pointers
yeah exactly and the amount of smart pointers inside the vector varies from node to node
Should I just use regular pointers and then do a manual cleanup of the tree?
class Foo {
private:
std::vector<std::unique_ptr<int>> ptrVec;
public:
void makePtr(int& number) {
ptrVec.push_back(std::make_unique<int>(number));
}
};
Would this work?
How would I adjust it to this one: ```c++
template <typename T>
class smart_pointer
{
private:
T* m_pRawPointer;
public:
smart_pointer(T* pData) : m_pRawPointer(pData) { cout << "node just created" << endl; }
// constructor
~smart_pointer() { cout << "deconstructor for smart pointer called" << endl; delete m_pRawPointer; }
// destructor
T& operator* () const
// dereferencing operator
{
return (m_pRawPointer);
}
T operator-> () const
// member selection operator
{
return m_pRawPointer;
}
};```
@spring pond
some corresponding thing for make_unique
why are you making your own smart pointer class
should I learn java
if you don't have a lot of experience with programming its a good place to start
ok
Severity Code Description Project File Line Suppression State
Error C2664 'Node::Node(Node &&)': cannot convert argument 1 from 'int' to 'const Node &'
class Node {
public:
};
class Foo {
private:
std::vector<std::unique_ptr<Node>> ptrVec;
public:
void makePtr(int& number) {
ptrVec.push_back(std::make_unique<Node>(number));
}
};
int main()
{
Foo obj;
int d = 33;
obj.makePtr(d);
return 0;
}```
well your problem is that you didnt change the function signature
#include <vector>
class Node {
public:
};
class Foo {
private:
std::vector<std::unique_ptr<Node>> ptrVec;
public:
void makePtr(Node& node) {
ptrVec.push_back(std::make_unique<Node>(node));
}
};
int main()
{
Foo obj;
Node n = Node();
obj.makePtr(n);
return 0;
}
ye i forgot a : and it messed it up and I couldnt figure it out for like 20 mins
yes
PyQt5
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QPushButton
these are all the things I imported earlier
it worked before
then I added to it
def QMainWindow
label = QLabel (win)
label.setText ("Attempt one PyQt5")
label.move (50, 50)
b1 = QPushButton(win)
b1.setText ("Click this")
b1.clicked.connect (clicked)```
that worked
but ```py
class MyWindow(QMainWindow):
def init(self):
super(MyWindow, self).init()
self.win = QMainWindow ()
self.win.setGeometry (200, 200, 300, 300)
def initUI(self):
self.label = QLabel (win)
self.label.setText ("Attempt one PyQt5")
self.label.move (50, 50)
self.b1 = QPushButton(win)
self.b1.setText ("Click this")
self.b1.clicked.connect (clicked)
def clicked(self):
self.label.setText("you pressed the button")
def clicked():
print("clicked")
def window():
app = QApplication(sys.argv)
win = MyWindow()
win.show()
sys.exit(app.exec_())
window()``` does not
i mean it opens in
but no button
@crystal tundra

lets just start with some very basic stuff
def QMainWindow
label = QLabel (win)
label.setText ("Attempt one PyQt5")
label.move (50, 50)
b1 = QPushButton(win)
b1.setText ("Click this")
b1.clicked.connect (clicked)```
@umbral saffron this not good code
do not do this
ok
but ```py
class MyWindow(QMainWindow):
def init(self):
super(MyWindow, self).init()
self.win = QMainWindow ()
self.win.setGeometry (200, 200, 300, 300)def initUI(self): self.label = QLabel (win) self.label.setText ("Attempt one PyQt5") self.label.move (50, 50) self.b1 = QPushButton(win) self.b1.setText ("Click this") self.b1.clicked.connect (clicked) def clicked(self): self.label.setText("you pressed the button")def clicked():
print("clicked")def window():
app = QApplication(sys.argv)
win = MyWindow()
win.show()
sys.exit(app.exec_())window()``` does not
@umbral saffron this is mostly good
mostly
u got the __init__ almost right
however
def __init__(self, *args, **kwargs):
super(MyWindow, self).__init__(*args, **kwargs)
``` should be the first line
second of all
so replace that?
yes
to add these things
next thing
every QMainWindow needs a central widget
so after ur super function: ```python
self.centralWidget = QWidget()
self.setCentralWidget(self.centralWidget)
next to do
use a layout
look up qt layouts
try use it
make sure to pass its parent as self.centralWidget
and ping me here if u get stuck
so after ur super function: ```python
self.centralWidget = QWidget()
self.setCentralWidget(self.centralWidget)
@crystal tundra that did not work
u must ```python
from PyQt5.QtWidgets import QWidget
as well as all the other widgets u r importing
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QPushButton```
i have that
just put QWidget after
do i need another one then
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QPushButton, QWidget```
@umbral saffron
yeah ik
this is just getting the app properly working
next is
but ```py
class MyWindow(QMainWindow):
def init(self):
super(MyWindow, self).init()
self.win = QMainWindow ()
self.win.setGeometry (200, 200, 300, 300)def initUI(self): self.label = QLabel (win) #look here (change win to self.centralWidget) self.label.setText ("Attempt one PyQt5") self.label.move (50, 50) self.b1 = QPushButton(win) #same here self.b1.setText ("Click this") self.b1.clicked.connect (clicked) def clicked(self): self.label.setText("you pressed the button")def clicked():
print("clicked")def window():
app = QApplication(sys.argv)
win = MyWindow()
win.show()
sys.exit(app.exec_())window()``` does not
@umbral saffron
as well as that
clicked should be a member function
indent it properly
and do self.b1.clicked.connect(self.clicked)
in replacement of self.b1.clicked.connect (clicked) right?
yup
just remember
self.
for any member variables
u have to specify self
i.e. self.win not win
yep
so self.b1 = QPushButton(self.centralWidget)
instead of self.b1 = QPushButton(win)
so for every thing u need to import them
wait wait wait
i got it
i just need a way to call initUI
right?
actually just all of MyWindow
i might be wrong
might i ask, im new to programming, what language is that?
Python
oh ok cool
im still learning it too
ok thats all i had to ask, good luck with that project or whatever it may be
thanks
how do i do that
initUI()

So like, im trying to code a bot that gives out notifications when a tiktok is posted and/or youtube vid is posted. Can anyone help?
idk, maybe use the youtube api
or you could build a web scrapper
use node.js puppeter
Don't get tiktok
@hollow basalt wdym?
I mean what I mean
So like, im trying to code a bot that gives out notifications when a tiktok is posted and/or youtube vid is posted. Can anyone help?
@twilit pawn there is a tiktok api u can use
Just look up tiktok api python
And ull find the download and docs for it
I own an Among Us bot(It is discord verified) Dm if interested
Hey guys, I need a bit of direction in this python project I'm working on.
I found this JavaScript library that I could use for my project. But I don't know JavaScript and I don't find an equivalent python library.
Is there any way I can use the JS library in my python project?
How?
I don't think speed is going to be an issue here.
It's just a basic prototype so far.
Hey guys someone can help me with phpmyadmin?
For some reason it stopped working.
I can't do anything inside it.
When I try to click something there it just refresh the page.
I'm using phpmyadmin only for viewing
phpmyadmin not really the best solution for managing an sql database
@rotund plover workbench can directly connect to the sql server
so you dont need php, or phpmyadmin
Is there a good workbench for Linux ?
it runs on linux too
Except terminal
Its a desktop program
@rotund plover it has a table inspector, database inspector, as well as the regular tree-view on the left side like in phpmyadmin
Now works except viewing tables
SELECT * FROM table
I hate php
That's not PHP, but SQL
Ya
I never had a great time with phpmyadmin
Not even good time
Always had problems
phpmyadmin is commonly used by those 'managed website' hosting
where you get FTP, and phpmyadmin to manage everything
Yes like cpanels directadmin and etc
cpanel is a bit more
I hate it
phpmyadmin is specific to webapplication hosting with php
Ya
SQL development I do from within my IDE
viewing, migrating and managing databases I do with the workbench
That SQL Workbench has a built in ssh client, so you can use it as a proxy
so you can tunnel sql over ssh
over a firewall
most sql servers only accept connections from localhost
Ya but I have private IP at home
So I can use it Normally
See this ^
I hate MySQL.com
Always want me to register
😠
I guess I'll need a real email there
Oh nvrm
Didn't noticed to the download hehe
looks identical to the features that phpmyadmin has
@rotund plover xD https://i.imgur.com/UZFnIPS.png
majority of that is minecraft inventories
I saw 60gb
And 120
No just saves cache and logs in db
Not something important
I wondered what will happen if I remove all of it without the customer permission
Didn't went well
But I was able to blame his programmer because he already fucked up the vps disk
compress the file and scp it to another machine
Replication of 120gb db to another server in another DC out of my country
When my country doesn't have good internet to outside of the country here
sounds like you need fiber
Fiber will not help to
I got a 1G x-connect to my VPS in the datacenter :)
Nah, I ment as in. My home internet has 1G to the VPS, and 250M to the wider internet
Ya
never again.
Our ISPs here don't want to be connected to each other directly and lower out latency and ms to each ISP here
Each company connect only them self's
they don't peer among eachother?
And building not private houses so I'm fucked up
they don't peer among eachother?
@warm sleet nope
I can ping my friend IP and get like 40ms
yeah but adsl already has poor latency
Even the fiber not peered
My friend have it he pinged someone that in different ISP he got like 45ms

The ISP told him that because he is too far from their rack thats why he get such high ping
All the ISPs here togther if they'll be connected to each other will have max of 2tb bandwidth
hmm private peering is expensive
Not sure you understand what peering is
Fortnite updates crashed all the outbound traffic 2.5 weeks ago

Not sure you understand what peering is
We had no access to facebook youtube google play store apple store and all the services that not hosting in my country
1 day
and you expect peering to solve that?
No I except they will be able to handle it
We had no access to facebook youtube google play store apple store and all the services that not hosting in my country
@rotund plover sounds like time for a holiday

We had internet only to services that hosted here
My dedicated server hosted in Germany and this hosting provider have more than 5TB of peering
thats not peering
They are connected all over europe I wish our ISPs here will do that
Thats just a traffic allowance
but that's not what peering is...
They are not peered to anything
That's not really meters
We want low latency with fiber 40ms inside the country is fucking high
I'm talking about latency not peering now
I know that is peering I just not talking about it right now
They are connected to IIX but still shit.
The ISPs here are not good enough
Wanna hear something funny
My ISP said it's ok to get 600ms to their gateway
get different isp 
All of them like this here
I have 3 fibers under my house 🏡 and none of those ISPs willing to connect me
Oh ya after they said that the started to blame my hardware
When creating a resource using a REST api, should I only reply with a 201 Created, or should I also show the created data?
vs
You should return the created resource
Is there a reason why you’re building a “response” object? All that data should just be in the HTTP response header, no need to add it to the body
^
Most if not all of the response object is unneeded. You could maybe use the message string, but it is probably unnecessary
actually im 99% sure that you will not need it because you shouldnt be rendering a response directly
@gusty girder depends. what kind of API style you are using.
pure REST always expects you to return the content you sent
except POST
if you create a new item with PUT you should return the object.
This is useful for things like generated primary keys (by the database)
@shy helm not nessesarily.
Hypertext Application Language for PSR-7 Applications
you can have things like "_status": "201 Created" in the top
I mean sure, but there's really no point
ehhhh
I'm not a big fan of custom headers, too much tie in
If you can't return the data you need in the body or in standard HTML headers, you're doin something odd
Auth is the only place I use it strictly
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:8090/;
proxy_redirect http://localhost:8090/ http://$server_name/nexus/;
}
Nginx <3
@shy helm in my application APIs I embed exceptions into API responses
when the API returns a non 200 code, the client unmarshalls the exception (instead of the expected object) and throws it
private static T Deserialize<T>(string data) {
try {
var serializer = new XmlSerializer(typeof(T));
using (var reader = new StringReader(data)) {
return (T) serializer.Deserialize(reader);
}
} catch (TargetInvocationException) {
try {
var serializer = new XmlSerializer(typeof(ApiError));
using (var reader = new StringReader(data)) {
throw new ApiException((ApiError) serializer.Deserialize(reader));
}
} catch (InvalidOperationException) {
throw new ApiException(new ApiError {code = -1, message = "Unknown Error", status = ""});
}
}
}
You use XML responses o.O
I love xml
pain
@shy helm I will use json when they finally standardize a schema
all the types the API provides I export as xsd
The actual client is an interface facade implemented with rest
the java server interfaces are identical to the C# client interfaces
There's a bunch of standards for JSON schemas
I've yet to find one that can generate it from java source files
the REST interface itself can speak both XML and JSON
But I choose the use XML, its just easier to do with .NET
Cool
I've been looking for a way to improve on this
I'm using a deprecated java tool to do this
JXC was removed in java 10
TBH though, most people are moving towards doing it the opposite way
schema -> code gen for classes
I'm aware
Protobuf, Apache Avro, etc
this workflow kinda grew out of a pure java environment
I'm a big fan of protobuf tbh
@shy helm https://i.imgur.com/JcarbHK.png
great performance, small message size
If you want to do pure Java then why do you need to export schema?
Just use GSON and annotate your class, move classes to a shared lib
That's a different project ;)
Website of the EclipseLink project.
MOXy is why I use JAXB for this
EclipseLink
w/e, they just offer a way to use the XML APIs from java
to do json as well
I'm just bugging you 😛
Code first
I know schema first is the new hotness
those objects are modelled after what comes out of the database
It's the new hotness because schema registries are becoming hot
tbh though, I don't hate it, very useful when doing large distributed projects
good way to do schema/interface evolution
@shy helm GSON fails for me
when I try to do things like lists
@Data
@NoArgsConstructor
@AllArgsConstructor
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Profile")
@XmlType(name = "Profile")
public final class Profile implements Serializable {
private Player Player;
private Highscore Highscore;
@XmlElementWrapper(name = "Spells")
private List<Spell> Spells;
private boolean Online;
private Family Family;
}
Why does it fail for lists?
long time ago, but I always had issues with the annotations it provides
And the beauty of using JavaEE interfaces, is you do not need any additional dependencies to use
though.. that holds true for GSON, annotations are not required runtime
hmmm, idk I haven't experienced these issues, couple of years ago I worked on a big big rest API for a very popular mobile app, we used GSON extensively
was a Spring Boot app though so 😛
@shy helm MOXy also ties into the JAXBContext
and the rest server I use, Jersey, can use it too
@shy helm this is pretty much all JavaEE
@GET
@Path("{id}")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Override
public Player getPlayer(@PathParam("id") String uuidString) {
UUID uuid = parseUUID(uuidString);
PlayerDao dao = provider.getDao(PlayerDao.class);
Player player = dao.getPlayer(uuid);
if (player == null)
throw new NotFoundException("No player with that UUID was found");
return player;
}
sorry for the many pings
bad habbit from IRC
heh no worries I do it too
You could do rest applications without any of this nonsense
If you just write JavaEE provider classes
you can use an Appserver like Tomcat
to provide all of this crap for you
heh yeah, there's tons of ways to skin the cat
@shy helm this just gets called by maven during the package step
but oracle been cleaning up the tools.jar
@warm sleet thanks
@gusty girder forgot to mention
Look up 'rest idempotency'
An idempotent HTTP method is an HTTP method that can be called many times without different outcomes. It would not matter if the method is called only once, or ten times over. The result should be the same.
Idempotence essentially means that the result of a successfully performed request is independent of the number of times it is executed. For example, in arithmetic, adding zero to a number is an idempotent operation.
POST to create new content, PUT to update existing content
any one fuck with dbus on linux? I'm trying to get output of something run from dbus if that makes sense
@rotund plover workbench can directly connect to the sql server
@warm sleet
I have problem with this bench.
I can't view inside the tables
@rotund plover what user account are you using to log in ?
need to have the right permissions to view info schema
You can set perms on the info schema I think
Never apt mysql from current ubuntu sources.
why, are they outdated?
It won't even use password auth. Uses something otherworldly. You won't even be able to login with -u -p unless you kill the service; start it up manually with some flag to ignore auths. Then you get in as root only to find out that you don't own the schema with users
Turns out you gotta flip the auth module and even then, it autogenerates a password for a real "root" user called debian-sys-maint
I guess this is the Debian distrib for 8.x; not just Ubuntu
why, are they outdated?
@midnight wind Nah, too updated for my taste
ah ok
It's ok, though. 5.6 is manually installed through deb packages anyways 🤷♂️
MySQL 8. What is MySQL 8? Never heard of him
You run the darn thing under a separate user, allow only local connections, who even needs a password. If there are multiple apps that shouldn't access eachothers' dbs, you can use something other than root
(The joke being <=5.6 because I would only use MySQL for legacy/compat reasons)
MySQL 8 is the newest MySQL engine that got released recently.
But I still prefer Mariadb.
I mean, they should be compatible
Ya
I just don't know why MySQL workbench not working as it should on fedora after connecting my server
This is the error
I'm using root
From my phone it's working perfect
Only MySQL workbench gives it
your select or update clusterfking of columns
fff
You need brackets
Nope not it either
I think it's backtick instead of quote
Or you're running just the single line instead of the whole script if you define the global var earlier
@rotund plover what sql server version are you running
@silver furnace this the schema inspector of the mysql workbench
it fires off a big query to fetch context information
It's pretty the same and it's fucking dumb if it's not working with mariadb
newer versions of mariadb are not compatible with the workbench
Ah
SQL queries themselves will fire properly
Well fuck it
but database context that the workbench uses will fail
THat's another client that works relatively well^
HeidiSQL is a free and powerful client for MariaDB, MySQL, Microsoft SQL Server, PostgreSQL and SQLite
I guess the update for mariadb fucked something
@rotund plover nah the server is fine
MySQL Workbench is only officially supported for MySQL
not for MariaDB
That's why phpmyadmin got broken I think
I did update to the server
https://www.heidisql.com/
@warm sleet I'll test it later now I'm zooming 😆
HeidiSQL is a free and powerful client for MariaDB, MySQL, Microsoft SQL Server, PostgreSQL and SQLite
This is only for windows 😔
It works but the look of the program is yak 🤣
Now to fix my saving option in my website
is there anyone with even the most basic skills in python here rn?
i need some help
i am trying to use the pyautogui library to make like...a macro
i wanna use it as a bot in skyrim
but my script stops running in the background when i switch over to skyrim
i just want someone to kindly look over my poorly optimised code and see if thats the issue here
i havent even done that yet
i havent seen a single guide
i am... a fucking idiot who decided to use a script instead of a proper macro lmao
import pyautogui
import time
pyautogui.FAILSAFE = True
print('starting in')
print(5)
time.sleep(1)
print(4)
time.sleep(1)
print(3)
time.sleep(1)
print(2)
time.sleep(1)
print(1)
time.sleep(1)
print(0)
x = 1
while True:
pyautogui.click(duration=1.5)
time.sleep(0.5)
pyautogui.click(duration=1.5)
time.sleep(0.5)
pyautogui.click(duration=1.5)
time.sleep(0.5)
pyautogui.click(duration=1.5)
pyautogui.press(keys='f5')
here

my unnecesarily over complicated script
the first part is just a countdown
then its a loop
There is someone who can help me with python flask and flastdb ?
I'm trying to print something from my db into a webpage on my site and it's only gets the id numbers without all the other things like name and etc.
How can I fix it
then its a loop
we can read it from the code
There is someone who can help me with python flask and flastdb ?
I'm trying to print something from my db into a webpage on my site and it's only gets the id numbers without all the other things like name and etc.
How can I fix it
can you show us your code?
wait thats how a loop is done?
is it legit?
daaaaaamn
i thought i just jerry rigged that one
i feel so legit rn
if someone can find a flaw pls ping
can you show us your code?
@hollow basalt sure here it is
thanks,
i suspect its system optimisations
cuz even the countdown just stops
None of them worked
so your code prints the id right
can you show us how you print it
i mean I don't even know the url
Ya
Basic website
Paint saves the paint into the db
The save link should show all the paint info
Because it's not showing the information the search link doesn't work either
I mean can you show the template
Oh
Sure
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
save template
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
save.js
so you manually added a file into the DB to test your select?

Search.js ?
- trample
?
search.js
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
no no, the python one
search.html
I sent you in the photo
but here you go
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
The real cur.execute is the one in comment.
The second one is the last one I tried
shouldn't you like return all the possible filenames if it's a get
def search():
if request.method == 'GET':
return render_template("search.html")
aren't you returning an empty template

render template?
Ya
you need a view + model to render a template
what template engine are you using?
most of them work similairly
from my code:
/**
* Compiles and returns a final HTML DOM.
*
* @return String value containing a HTML DOM.
*/
@Override
public String render(ModelAndView modelAndView) {
if (modelAndView == null) {
return null;
}
String viewName = modelAndView.getViewName();
try {
Template template = handlebars.compile(viewName);
return template.apply(modelAndView.getModel());
} catch (IOException e) {
logger.debug("Failed to render object", e);
throw new RuntimeException(e);
}
}
Yea, I mean shouldn't you query the database for everything then return it in the search.html
e
@rotund plover yeah, you're supposed to pass models as parameters to render_template
render_template("view.html", name="hello world")
^ this tbh
name is then available inside the view
Am ok
I agree that's how the other person did it that's why I never considered change it 😅
My other functions return more the just html file
What MySQL fetchall does ? Only takes all the info from the table ?
it fetches all from the cursor (last executed statement)
Ok

Like print(files)
python print() can pretty much do anything
Ya but I call it in my site
no
It's raining in background
if you want you can store it in a string then yeet that string into your html
Well if I change the for files in files in template to , for file in files I get output
But all duplicated
All the first and second rows
can you show us
Ya you can surf to my website in 10 second and see it under gallery
Oh wait
Stoped working completely
Now you can see it
All row 2 duplicated all over the page
Any ideas ?
I can only see banana10
Ya
That's the problem
This is only row number 2 from the table
If I change 1 letter you'll see only the numbers again
I can send you the original code
Before I tried to implement it to my site
I changed it to MySQL and implemented it to my site
At least my login and register works perfect
@hollow basalt nghhh typescript so powerful
public async getByUrl(url: string, culture: string = this.culture): Promise<Content> {
return this.client.delivery.content.byUrl(url, {culture: culture});
}
default parameters done easy
interseting
using this in default params
thats kinda weird
so it would use the current value everytime you call it without params


I mean I'd rather want it to be undefined
if it still fucks up
guess it isn't your type
I fixed my phpmyadmin
Now all good, the problem I had because something with my Domain
Change the domain I use for it and now it's good
Im trying to make a block go to the players position
My current code is
$(“block”).left = $(“player”).left;
And it automatically runs 60 times per second but does nothing
Its meant to be an object that will stick to the player

:FeelsWOW:
@hollow basalt I still encountering this issue with the images save
I think I'll change it to save actual file instead in db
can be
But I'm 2 tired and need to do homework so...
Maybe in another time when I'll be bored while listening to my teacher
Because he can't teach
that moment when you just procrastinate for 3 weeks about writing a script XD
and contemplate procrastinating another week or two
What would be a good language to learn after JS
python
I mean you never finish learning a language
If you going with js, there are so many frameworks you can learn
You can learn front end like react, vue, etc.
Or backend like node.js
@next igloo
Learn about databases like mongodb
Then make a project
Anyone here familiar w/ writting windows drivers and/or applications that allow you to send and recive signals over usb?
Combine your knowledge
I too "know" js and html and css, but in practically it's hard
Then make a multiplayer snack game
Node.js with socket.io for backend
Js for the game
The game im making is a run and gun (super mario with a gun bassically)
It uses jquery
No its a single player game, i think you misunderstood
Its for a grade 10 computer science class, so no multiplayer servers yet
And the game is pretty complex compared to the simple space invaders some people are doing
@west garden what do you need help in
I'm a full beginner with no experience of coding. I need to learn to code in Arduino because I need to make a project for my Research Defense, if you can, please help me to learn how to code

log( )
I mean I can't really help you if you are unwilling to learn yourself. For the most part you need to learn C, because that's arduino. I recommend platformio on vscode.
Just saying please learn me how to code doesn't help
For the most part coding is looking at tutorials and videos already out on the net
If you need SPECIFIC help, like a program not working, that's showing initiative
I'm being nice here
I can understand, thanks for the explaination 🙂
is there a channel for linux stuff?
I'm trying to figure out why ls just returns Failed
trying to look on google but they all talk about other errors, mine is just literally only returns one word Failed with capital F
nvm, idk what happened but apparently it's a file named Failed in the home dir

what kind of meme is this
idk ok, I was trying to re-setup bunch of thing on diff server
apt install mariadb-server got hang so I killed that and stuff, then was doing bunch other thing cuz of locked dpkg thingy and after all that I just do ls to see the directory and got that returned so I got even more panic
it's fine now though
@ivory bear if you need linux stuff it's basically #networking All the linux people are over there
I will keep that in mind, it looked like it's fine... for now™
@midnight wind did you manage to find the cause of the problem with the vpn?
nope, I never had the time to look at it
just want to use the deconstructor and constructor to debug my tree to see my bugs and how the program works
u gotta learn c/c++ coding before you get into arduino
thats the language arduino uses
and if u dont know it
u will be really stuck coding for arduinoi
well you only need the really basics of c/c++ to code arduino for your home projects to work
For anyone that has experience with linked lists in c++; If I want to access the 5th node in a linked list do I need to traverse the previous 4 nodes before accessing the 5th node?
That's how the data structure would work, yes.
these data structures are blowing my mind. I never thought trying to figure out the best way to store/search data would be this interesting.
I just looked up hash tables. You turn what you want to store into an index which determines where its stored in the array so you can access it immediately without searching. THATS SO FREAKING COOL
So, I'm learning python and I'm trying to create a simple program that accesses a local db, reads a csv, writes the contents to a table (id, firstname, lastname, email, password), then run a query that can fetch the id/password and then hash the passwords.
The literature reading is not going well for me and I don't know where the ideal resources for figuring this out might be, lol.
Sure
My suggestion is:
- Find a library to read csv
- Find driver for database, is it mysql/mariadb ? Postgre?
- Hash the password when saving to database, not when fetching it
mysql, and I have been able to figure out a method that should work, but now weird errors galore, lol.
using a dictionary approach to input the contents of the table,; however now my program in the middle of it gets a "mysql" not defined.
I imported like this at the top, was I incorrect?
import mysql.connector as MySQL
from mysql.connector import errorcode
import os
from csv import reader, writer
import random
import time
from passlib.hash import argon2
import csv
can you like, send the whole thing
|| ```
#import from csv
import mysql.connector as MySQL
from mysql.connector import errorcode
import os
from csv import reader, writer
import random
import time
from passlib.hash import argon2
import csv
conn = MySQL.connect(
host='localhost',
database='LAB5',
user='root',
password='')
cur = conn.cursor()
cur.execute('DROP TABLE IF EXISTS users')
DB_NAME = 'LAB5'
TABLES = {}
TABLES['users'] = (
"CREATE TABLE 'users'("
"'ID' int(11) NOT NULL,"
"'firstname' varchar(45) NOT NULL,"
"'lastname' varchar(45) NOT NULL,"
"'email' varchar(45) NOT NULL,"
"'password' varchar(22) NOT NULL,"
"PRIMARY KEY ('ID')"
") ENGINT=InnoDB")
for table_name in TABLES:
table_description = TABLES[table_name]
try:
print("creating table{}: ".format(table_name), end='')
cur.execute(table_description)
except mysql.connector.errors as err:
if err.errno == errorcode.ER_TABLE_EXISTS_ERROR:
print("Exists currently")
else:
print(err.msg)
else:
print("OK")
#infile
infilecomp = open("data.csv")
csvReader = reader(infilecomp)
#next(csvReader)
#print
print("moving along...")
for row in csvReader:
try:
cur.execute("INSERT INTO users VALUES (%s, %s, %s, %s, %s)",
[row[0],row[1],row[2],row[3],row[4]])
conn.commit()
except:
break
#done?
print("Complete")
cur.close()
conn.commit()
conn.close()
haven't gotten to the hashing part yet, but I can get parts of this to work individually, but not as a whole lol
which line is the error
39
except mysql.connector.errors as err:
this one?
"excepts mysql...
use
except mysql.connector.Error as err:
or in your code
except MySQL.Error as err:
Since you imported it as
Solid, thank you very much.
it works, but I'll be breaking it again when I try to add the part that hashes; before saving to the db
backing it up right now lol
ok ok, see ya later when you break it or something
are you using git
if not, you should
not github, just plain ol git
@lone cairn
I'm getting chastised irl for not using git, so I'm now looking into git lol
It's not fun at first, but it's way more fun than crashing a production server and having no way to revert
crashing a production server and having no way to revert
I mean you rely on git for stability

@lone cairn so in your case, instead of making a current copy, you would just make a new branch and once it works, you would merge it into master.
Ahhh thanks for the suggestion
@hollow basalt nah it's:
myproject
myprojectfinal
myprojectfinalfinal
myprojectfinal1
...
ngl, we used google drive
cause back in my days, git weren't taught yet (not part of curriculum)
so i had to teach my teammates how to use git
Hellp guys
Im a newbie in programming branch
My uni gave us an assignemnt regarding it
we were asked to code for the pac man game
can anyone help ? or any ideas ?
Does anyone know if the ursina game engine works with macOS?
I have an idea
Anyone here into Unity Development?
yea ?
yea
theres two examples with 20 sec of googlin
Part 1 - Drawing the Pacman Sprite
Learn how to design and create your own fully working platform game using the free online programming tool Scratch. Create multiple levels, sprites, enemies and challenges!
This 13 part tutorial series takes you through every step of the way, teaching you key programming skills along the way. Don't just build...
This video is part of a series in which I am using python and the pygame library to make a replica of Pacman. The editor I am using is atom and I highly recommend it even if you use languages other than python! You can treat this as a tutorial to follow along with and I Hope it helps. Feel free to comment below with any of your coding problems!!...
just search for the programming lang you prefer

Hiya. Anybody around to answer a simple question?
depends
Basically
I have a very very very long line with a ton of code. Is there any tool online that'll separate each tag into a different line?
Like say I have: <div class="w-full sm:w-1/2 p-6"><div class="w-full sm:w-1/2 p-6"><div class="w-full sm:w-1/2 p-6">
Instead of it being in a line, I'd get an output with each of those in a diff line
I kinda did it with find n' replace using VSCode but I'd figured there's a tool that'll make that easily.
so you just want to format your code
pretty much
I've been downloading some svg illustrations but it gives me everything in one line and when I put it in my website it's a pain to modify the colors and stuff
Notepad++ have it to if I remember correctly
I'm still looking for this option in vscode
VSCode has a beautify plugin, not sure if it inserts line breaks for you but worth a try:
https://marketplace.visualstudio.com/items?itemname=hookyqr.beautify
it kinda works but I dont like it so much
Try Beautify like @nocturne mist said and see if it works
Yeah, I don't use it but it seems like it would probably serve their requirements.
assembly
sure
exactly
Beautify is for code formatting.
Is it dumb to call a function with the name of the class the function belongs to every time like: ClassName::FunctionName(). Or is it good coding practise
because my code ends up looking pretty messy with all the ClassName::
if (Rules::IsItOutOfBoard(MoveFormatting::oldx(BoardClass::ScanGetCordinatesW(x + counter, y)), MoveFormatting::oldy(BoardClass::ScanGetCordinatesW(x + counter, y))))
I'd say the lack of line breaks is worse for readability than the class names.
how would you write it
Rules::IsItOutOfBoard(
MoveFormatting::oldx(BoardClass::ScanGetCordinatesW(x + counter, y)), MoveFormatting::oldy(BoardClass::ScanGetCordinatesW(x + counter, y))
)
)```
thx
That third line should be indented, seems Discord isn't liking it though.
I took this a few steps further for learning AI/ML and created a Pac-Man where the ghosts were, well... smart. WAYYYY too smart. They would pack-hunt. It was not fun to play. You died very quickly.
In C, is unsigned from, unsigned to the same as unsigned int from, to?
From what
daamn, thats cool. I dont know much about AI stuff, just basics
@frigid magnet from twt
Yeah I know and I don't really care anymore
Sounds cool
Send us we wanna play
@pliant siren I double this (let us play pacman)
if you can also give the source if that's aight
I know this is a little late but I feel like the ban was good since now I have to concentrate in real life and then I don't have more servers distracting me
so i'm learning c++ and i have no idea what's the difference between endl and n\
any ideas ?(exept that n\ can be included inside a string)
endl is just \n but with a flush as well
so I have an HTML question. How do you align the text in the center(in a table) in HTML but without it looking like a pyramid or something. I mean it's cool but I want to align the first row in the center and then every other under it. If I do align=center it just goes center for every text so it becomes like a pyramid
How can I align it in the center but like every text begins where the previous one does,without an indent?
@tired juniper got a photo of what you’re going for?
@tired juniper You're looking for CSS here, not HTML
align is a style
Though there are elements you can use for 0-width and merging cells
its the colspan property of a table cell
You will ultimately have to make a grid
like a 9x9 grid, and use colspan to merge cells
though using tables for alignment is a kind of dirty solution. div's are your friend
Hey! I want to make an app that tracks your app usage and analytics for a school project, but I'm new to app development. Do you guys know a useful guide for me to start with?
@outer fjord You probably need to start by choosing a platform you want to develop the app for. Android or iOS?
Android, for android 8.1 and up
tracks your app usage
Do you mean tracks usage of your app, or other apps on the device?
The other apps on the device, so social media and games that kind of stuff
If I've googled correctly you'll need to develop an android app that requests the android.permission.USAGE_ACCESS_SETTINGS permission.
Here's a tutorial to get you started: https://www.youtube.com/watch?v=Ob4vSoWud9k
Want to build your first Android app? In this tutorial series let's get started with Android Studio and app development. We'll build an inventory management app that allows us to add products, then list them so that we can scroll through them. This app will be created using Kotlin and not Java. Kotlin is the current and future of Android, and Ja...
Thanks! Probably waited to long to start with this project. I have to finish it by the 8th of January
@outer fjord Code Academy has good tutorial on android
assuming you already know java, it has some good explanations on how android activities work
It also assumes you use Android Studio ofc
Yeah I'm gonna use Android Studio, but I'm new to coding, I know a bit of PHP but that is about it. Luckily my partner knows a lot more about coding
@outer fjord Android has a bit of a confusing API
the idea is you have an Activity, with elements you define in an xml file
you can then use code in the activity to make it do things, all elements you put on screen like a button, text input etc, are configured in the xml layout
Android has some good documentation on how this all works
I'm gonna look up some guides to get a basic understanding
if you want to try something more modern you could try jetpack compose https://developer.android.com/jetpack/compose
its still in development tho
so what are the benefits of Jetpack compose compared to Android Studio?
jetpack is just a framework to design apps with
Oh okay
It also uses kotlin instead of java
nothing wrong with that, Kotlin is a fine language
Compose is just nice if you want rich media applications
with lots of visual flare
Android window (activity) kit is a bit crude at times
i believe that jetpack compose is just a declarative version of the android ui builder
yea
it looks really similar to swiftui
Oh yeah, I'm gonna follow a basic guide so I get an understanding of Android Studio
you definitely want to do that first
@outer fjord do you have a phone to test with?
If you enable developer mode, you can link it up with Android Studio
and run the app on the phone, debug on the computer
I hate building android apps, but for wildly different reasons
mainly because standard library in android is not the same as with java
wdym
i havent actually built android apps but i was considering porting a currently in-dev ios app to android eventually
im hoping compose will be good enough to use by the time i start
And I mostly write enterprise apps in java
swiftui definitely is not a finished product
and all the JavaEE interfaces don't exist on android
Not that you need them necessarily
but makes life easier
what does java ee do? is it just a bunch of language extensions?
@spring pond JavaEE is just interfaces
huh
they define a common interface between the application and the application server
the idea is that things like databases, rest services and all that crap, is not handled in user code
but by the application server instead
so you just request an instance of an interface, and dont care how it gets created
ok
In software engineering, inversion of control (IoC) is a programming principle. IoC inverts the flow of control as compared to traditional control flow. In IoC, custom-written portions of a computer program receive the flow of control from a generic framework. A software architecture with this design inverts control as compared to traditional pr...
im probably just gonna try to learn kotlin for android and hope it goes well
from what ive done before its quite similar to swift so thats nice
@spring pond the benefit of JavaEE is that everyone uses it
so any library that has to work with enterprise stuff, uses JavaEE
and you need less glue code
Inversion of control serves the following design purposes:
To decouple the execution of a task from implementation.
To focus a module on the task it is designed for.
To free modules from assumptions about how other systems do what they do and instead rely on contracts.
To prevent side effects when replacing a module.
considering your comment that the code is "not in user code" does that mean that ee is server-side only?
ah ok
If you develop servlets, you just ask for database access
and the servlet host, Tomcat, Glassfish, or whatever, has implementations for that
so it dont matter if you use MySQL or OracleDB
@spring pond https://i.imgur.com/e6Sgqhh.png
javax.ws.rs is the interface you can use to develop rest services
In JavaScript, is there a way where you can get the center of an object
$(“#Thing”).position().top does not work because the object is rotating and pointing to the cursor
Which means even though the center has not moved, the top-left corner has
you can get the bounding box and calculate the center from that, probably.
Does anyone use ue4 here?
A little
Could someone here help me with java ?
ye
alright I need to sort a int[] that's full of numbers from smallest to biggest
using a for loop and positions
well you could just use a sorting algo
public static void intExchange(int[] table, int pos1, int pos2)
thats all he gave us
positions
but what are you supposed to do with them? are they meant to represent the bounds of a subarray or what
huh the positions of the smallest ones I think
are you supposed to swap pos1 and pos2 in the array? thats what would make the most sense with the header
I think im supposed to out print
here's what I have
it just out prints the list of "players"
so do you want to sort the players based on an attribute?
i'm not sure how far along you are in cs, but i'd strongly recommend making an object out of all of these players
how can I do that
huh yea
nomJoueur = playerName
pJoue gamesPlayed
nbBut ammountGoals
nbPasse ammountPasses
points = points
minuteP = minutesPlayed
ok, working on it
@wind oracle
class Player {
private String name;
private int gamesPlayed, goals, passes, points;
private long minutesPlayed;
Player(String name, int gamesPlayed, int goals, int passes, int points, long minutesPlayed) {
this.name = name;
this.gamesPlayed = gamesPlayed;
this.goals = goals;
this.passes = passes;
this.points = points;
this.minutesPlayed = minutesPlayed;
}
public String toString() {
return padLeft(name + " " + gamesPlayed + " " + goals + " " + passes + " " + points + " " + minutesPlayed, 35);
}
public String padLeft(String s, int n) {
return String.format("%" + n + "s", s);
}
}
now you can turn your old arrays into an array of objects and then use a sorting algo to sort by goals
@wind oracle you can use objects to group data together
and have them represent some concept
like a Player has properties such as name and gamesPlayed
so given the code that @spring pond posted
you can do things like:
Player[] players = { new Player("name", 1, etc), new Player("name2", 2, etc) }
but at this point, I would recommend using lists, its much easier
List<Player> players = new ArrayList<>()
you can then players.add(new Player(...));
Arrays cannot change in size, but Lists can





