#development
1 messages Β· Page 47 of 1
download them in mp4
convert using ffmpeg
I have been using pytube to download youtube videos in python. So far I have been able to download in mp4 format.
yt = pytube.YouTube("https://www.youtube.com/watch?v=WH7xsW5Os10")
vids= yt.stre...
in pytube ik you can download whole playlists like this
@grizzled warren Keep in mind, that downloadning from youtube is against the YouTube ToS
or don't; whistle-blowing is absolutely pointless on the internet
anyone have example code for a discord music bot that i can have
most music bots don't actually download a file, every one I've seen uses ytdl in some shape or another to just basically stream it
i dont know what that means, im dumb
i just need a bot thats plays a url on a loop and never leaves the vc
no bot that I know of caches every single song, because that would require downloading every song
and then with bots like rhythm you'd start to run into storage constraints
@ashen sky my ffmpeg doesn't work
or i installed it
and it just didn't want to convert to mp3
hey android studio now doesn't have an offline mode switch in settings(i want it off) and it's sending me all types of errors
hey android studio now doesn't have an offline mode switch in settings(i want it off) and it's sending me all types of errors
@quasi plover Do you mean offline gradle mode? it was moved to gradle toolbar https://stackoverflow.com/questions/58138689/intellij-gradle-disable-offline-mode
most music bots don't actually download a file, every one I've seen uses ytdl in some shape or another to just basically stream it
@olive terrace Breaks ToS as well. π
@quasi plover Do you mean offline gradle mode? it was moved to gradle toolbar https://stackoverflow.com/questions/58138689/intellij-gradle-disable-offline-mode
@wide carbon thank you so much man you solved it
@tidal osprey https://github.com/Just-Some-Bots/MusicBot
not mine nor is it extremely up to date but its something to look at
ive tried it but i cant get it to work
what about red bot
not yet but ive been wanting to
hey if anyone's good at python dm me, I need some help with homework
Sounds like the program I'm writing to manage ROMs and easily copy them to emulators/physical consoles/external drives would have come in handy in the latest video lol
How to solve this problem in python ?
Feeling generous today! Anyone want something from CodeCanyon? Expensive or not go ahead and ask me :D
no but thank you for the offer
in case someone want to learn about web security https://web.stanford.edu/class/cs253/
Principles of web security. The fundamentals and state-of-the-art in web security. Attacks and countermeasures. Topics include: the browser security model, web app vulnerabilities, injection, denial-of-service, TLS attacks, privacy, fingerprinting, same-origin policy, cross si...
You sir are a legend ty
thank changelog.com π Source: https://changelog.com/news/stanford-cs253-web-security-0pJk
hi, do u know where i can learn Lua for FiveM?
https://exercism.io/tracks/lua @nocturne galleon
Thx
[Android]Howdy lads. I've got bit of a problem.
I 'm trying to set visibility of fab inside recyclerview item.
@Override
public void onBindViewHolder(NotesViewHolder holder, int position) {
Note model = noteList.get(position);
holder.title.setText(model.getTitle());
holder.text.setText(model.getText());
if (model.getColor().contains("#")) {
holder.colorFab.setVisibility(View.VISIBLE);
holder.colorFab.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(model.getColor())));
}
}
If I call setVisibility(), it set's the visibility for all items, not just the one containing color
Is there a way to change visibility of item in specific position in RecyclerView?
nvm, figured it out
I dumbass forgot to set the filter π
Does anyone knoe if theres a way to change the color of all text on a webpage by clicking a js button?
Its html^
Wanted to show off some work-in-progress glimpse into new DirectX 12 Ultimate texture streaming technology which will use Tiled Textureβs and Sampler Feedback to stream in little chunks of textures on the fly based on what you can see in a video game. This is one of the many new technologies that is going to absolutely crush loading times. https://www.youtube.com/watch?v=UywX-Deu4SE
Would i have to do an ID for every piece of text or is there a tag i dont know about?
Thats actually exactly what i want to do. Im making a dark mode.
Thanks. I also could have just googled how to do darkmode.
stick a class on the body
like "dark"
there is also "prefers-color-scheme" as a media query
ignoring that part you can do like
.dark button {
}
or if you have stylesheet parsing
.dark {
button {
}
Sorry but i dont know what that means.
Ill learn in a few hours when i get back on my computer.
it does seem like what you're looking for is mostly a CSS thing, yeah
typically the way to go would be to just add a class to the body and then use CSS to change the color from there
for example, ```js
// Javascript
const body = document.body;
const button = document.getElementByID('my-button');
button.on('click', function () {
if (body.className.includes('dark')) {
// Remove the 'dark' class
body.className = body.className.replace('dark', '');
} else {
// Add the 'dark' class
body.className += 'dark';
}
});
then you can style your page in CSS depending on whether or not the body element has the dark class, for example: ```css
/* CSS /
p {
/ Normally, paragraphs have light backgrounds and dark text /
background: lightgray;
color: black;
}
.dark p {
/ In dark mode, paragraphs have dark backgrounds and light text */
background: black;
color: white;
}
I can just set it to style whole tags correct?
<html>
<head> </head>
<body id="demo1" style="background-color:hsla(225, 100%, 2%, 1)";>
<a href="landing_page.html">
<img src=yako000.png alt="yako000" width="250" height="100">
</a>
<button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.
</button>
<script>
function myFunction() {
mode='dark';
document.getElementById("demo1").style.backgroundColor = "hsla(0, 0%, 90%, 1)";
}
function myFunction1() {
document.getElementById("demo1").style.backgroundColor = "hsla(225, 100%, 2%, 1)";
}
</script>
<button type="button" onclick="myFunction()">light mode</button>
<button type="button" onclick="myFunction1()">dark mode</button>
<p id="demo" style="color:white"></p>
</body>
</html>
thats what i have by the way and it works for the background but not the text.
its also in multiple buttons which i would like to change.
so what I've heard is that there is no way to do sockets/networking programming with the c++ standard library, is this true? and if so could someone recommend an open source library? thanks
@nocturne galleon boost.asio
Haalp. I have a RecyclerView adapter with a button inside. That button just changes data inside SQLite DB.
holder.btn_restore.setOnClickListener(v -> {
model.updateItem(itemModel.get_Id(), "state", "normal"); // This works normally
arrayList.remove(position); // throws IndexOutOfBoundsException
notifyItemRemoved(position);
});
arrayList.remove(position) throws an exception when there are two items in that arrayList and I delete both of them. Wtf am I doing wrong?
Nvm, figured it out π
forgot to add notifyDataSetChanged();
@nocturne galleon do you know any CSS? if not, you should really take the time to get familiar with it, styling things with style attributes won't get you very far. The full code would look something like this:
<html>
<head>
<style>
body {
background-color: hsla(225, 100%, 2%, 1);
}
body.dark {
background-color: hsla(0, 0%, 90%, 1);
}
</style>
</head>
<body>
<a href="landing_page.html">
<img src=yako000.png alt="yako000" width="250" height="100">
</a>
<button type="button" onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.
</button>
<script>
function lightMode() {
document.body.className = '';
}
function darkMode() {
document.body.className = 'dark';
}
</script>
<button onclick="lightMode()">Light mode</button>
<button onclick="darkMode()">Dark mode</button>
</body>
</html>
@scenic hamlet i only did like 1/4 of the css on the w3 thing.
The code I gave should work for what you're trying to do but I'd recommend going a bit further through the tutorial if you're not familiar
In general you should try to use <style> tags rather than style= attributes whenever possible, it will make it much easier to maintain your code and make changes later if you need to
The code I put inside the <style> tag here gives the body a certain background by default, and then gives it a different background if it has the dark class
Then the functions inside <script> just have to add or remove the class from the body element
I think i learned that from somewhere else. I knew about it but i forgot how to use it.
Cool, feel free to ping me if there's anything else you have questions about
Ok. Thanks for your help. I will probably be back if the tutorials arent enough.
@last ingot there's stuff in the standard library for it? do you have a link for any documentation?
I just wanted to mess with pure sockets in c++
as in
use
networking sockets
oh so they used winsock
cool, thanks
the main reason was that I was planning on creating little cloud-powered iot devices out of raspberry pi and although I probably wouldn't need to I wanted the performance of C++ to run on them
Hi, if someone of you is good at working with anaconda, I would be pretty thankfull I this person could take a look at my question at stackoverflow... https://stackoverflow.com/questions/60952055/anaconda-navigator-and-spyder-dont-start Thanks in advance!
I have a question about contributing to a github repo, where do you start? as an example, looking at something like youtube-dl they put the source code in a folder called "bin" and other repos put theirs in a folder called "src". this plus reading through the code I dont see much that will tell me what I'm looking at but instead i just feel overwhelmed.
nevermind, just googled it, got it now
can I overload subscript operator to get direct range like python lists, in c++?
std::vector<int> myVec = oldVec[0,5] ( or [0:5] or something like that)
I know I can simply do it with functions, but just asking
I did a thing: https://findtoiletpapernow.com/
range function is actually a generator function which makes the list dynamically @visual plank I don't think its possible to do it in same efficiency but there must be a way to do it hard way... anyways what are you using it for?
It is possible to make a utility function... which can take value like
auto x = range(1,5) //which would be vector
if that's what you are talking about..... I don't understand in oldVec[0,5] or [0:5] or something like that) are you talking about slicing?
Oooh, a development channel. Quite a lot of interesting things here on this server :D
@neon pond Thanks jack! just tryin to help π
And yeah, sounds like he's talking about slicing. Do you just want to do it python-like to make the syntax cleaner? :D
I joined some time, then muted it and forgot about it, now I'm back, and boredom of self isolation is driving me to explore around xD
lol I am here on the server for a long time too... I just kinda quit discord in general
I am bored too lol
I didn't quit Discord, in fact I use it quite extensively, I just sometimes tend to mute and forget servers :P
yup got it!
I just saw today lol Server Unavailable .. probably because of April fools day
@last ingot well in Python, I can do this:
arr = [ 1, 2, 3, 4]
newarr = arr[1:] # this will make newarr as [2, 3, 4]
So technically it's happening without the user needing to write a forloop. I mean obviously I can just create a function that takes in a vector and the two points for the range, but I was just wondering if I could do something on the lines of operator overloading to get that kind of feature or something.
@vernal marsh Yea I know that. Just wondering if any kind of operator overloading is possible. Cause I don't think slicing can be done in C++
Hehe. That's cool. Thanks for the info
Honestly yes it is a pain in the ass to work with. It takes me a good 5 seconds to even read the syntax
@last ingot nice! I was wondering what he was talking about at first... because he mentioned range ... I thought that was it lol... #ProblemsofskimmingOverQuestions
I too never took c++ syntax as a problem π .. although I also use python heavily other than c#....
@visual plank yes for slicing you could actually overload the [ .... although I don't think its that easy as I think it is lol, there must be some gotchas otherwise I would have seen some wide implementions till now
nice topic... I should actually try this lol
NOPE! well I as best as I could find there is no way of doing [1:2] type thingy even with overloading (to be honest that's not a overloading problem anyways, its basically different syntax) π. if anyone else finds a way to do it... be my guest
Hey guys, If any of you have a Tobii 4C Eye-Tracker and whish to help out some Masters Students on Lockdown with some testing, please hit me up, for more information π Alternately You can send an email to mta20831@create.aau.dk, We expect to roll out a software based contextual probe sometime next week, to gather information necessary to carry out a usability experiment later this month, to evaluate modalities for input. Any kind of feedback is appreciated, but more will follow if you sign up for the probe. Thank you in advance for your consideration. All findings and full paper will be linked to and available later as a forum post on LTT :).
@visual plank yes for slicing you could actually overload the
[.... although I don't think its that easy as I think it is lol, there must be some gotchas otherwise I would have seen some wide implementions till now
@vernal marsh def should not overload op[] to slice
C++ standard is pretty clear, op overloading should be implementing the logical, pre-defined meaning of the, operator
Define a class Range{}; Then overload[] for Range
The end is near.
GitHub is down.
First Corona takes my freedom, then my friends, and now my code.
Back to Animal Crossing it is I guess xD
without fail, whenever github goes down, it's 15 minutes before i need to do something involving github
I'm now cooking myself a nice rice lunch and hoping it'll be resolved by the time I'm done lmao
I decided to just ignore it for today and lean back, play some games instead
Sort of not in the mood to continue my Discord bot anyway, so might as well relax a bit π
I feel that
It's back
Managed to finally fetch changes xD
@neon pond π when did it go down... It was fine for me
@shy helm yup well aware of that π... I could have just made a function which would be like stl's implementation.... Just exploring if that was possible way π
Anyone here who has PhP and MySQL experience? I have an assignment due soon but i cant easily ask my prof questions due to Covid
Try posting your question
@brazen sluice yeah
oh aight thanks
So its probably a dumb question, but its my first time working with php or sql
<?php
//Voeg inhoud header.php toe aan pagina
include "header.php";
//Nieuwe verbinding
$conn = mysqli_connect($servername, $username, $password, $dbname);
//Haal id uit URL en sla op in variabele contact_id
$contact_id = $_GET['id'];
//SQL query
$sql = "SELECT * FROM contacts WHERE id = " . $contact_id;
//SQL query door database halen
$result = mysqli_query($conn, $sql);
//Voor iedere rij in database output geven (dat is nu maar een enkele rij)
while($row = mysqli_fetch_array($result)) {
echo "<h1> Naam:". $row["first_name"] . " " . $row["last_name"] . "</h1>";
echo "<h1>Telefoon nummer: " . $row["telefoon_nummer"] . "</h1>";
echo "<h1>Woonplaats: " . $row["Woonplaats"] . "</h1>";
echo "<h1><a href='Contact-delete.php?id=" . $_GET['id'] . "'>remove contact</a></h1>";
}
//Verbinding sluiten
mysqli_close($conn);
//Voeg inhoud footer.php toe aan pagina
include "footer.php";
?>
<?php
//Voeg inhoud header.php toe aan pagina
include "header.php";
//Nieuwe verbinding
$conn = mysqli_connect($servername, $username, $password, $dbname);
//Haal id uit URL en sla op in variabele contact_id
$contact_id = $_GET['id'];
//SQL query
$sql = "SELECT * FROM contacts WHERE id = " . $contact_id;
//SQL query door database halen
$result = mysqli_query($conn, $sql);
//Voor iedere rij in database output geven (dat is nu maar een enkele rij)
$sql = "DELETE FROM contacts WHERE id='$contact_id'";
echo "<h1>Contact deleted</h1>";
echo "<a href=index.php>Terug naar Index</a>";
//Verbinding sluiten
mysqli_close($conn);
//Voeg inhoud footer.php toe aan pagina
include "footer.php";
?>
This is my code, i have to delete a contact from a sql query using a button
This is what echo "<h1><a href='Contact-delete.php?id=" . $_GET['id'] . "'>remove contact</a></h1>"; is for
But when i run $sql = "DELETE FROM contacts WHERE id='$contact_id'"; it doesnt actually delete teh contact
@shy helm do you have any idea what im doing wrong?
Uhm, do you actually execute the query though?
To me it looks like you're just putting the SQL string into the $sql variable
Probably still have to execute the query with $result = mysqli_query($conn, $sql); like you did earlier
oh that sounds about right
Also do yourself and others a favor and comment in English π
Never done any sql so idk
Yeah sorry those comments came with the code
if i use result it gives me a warning?
Dunno, I guess $result is none now because you deleted the record? π
oh god does php not have prepared statements
Prepared statements?
I mean, as far as I remember that only makes any difference if you call that same statement a high number of times in quick succession, right?
It does
Use PDO
Prepared statements are good for a lot of things; security, performance, error reporting sometimes
Security? o.o
And error reporting? xD
Are you sure we are talking about the same thing?
what do you guys think about thia/thea lol I don't remember the spelling!
I am very sure its not for us individuals... but how does it fit the enterprise sort of things
@olive terrace Prepared statements actually aren't a protection against SQL injection attacks. But it is VERY easy to protect any SQL call against that π
Properly escape everything that goes into the query from a potentially untrusted source.
I'm pretty sure that's not true. You will probably still filter for stuff based on some user defined variable. I see exactly the same danger in both approaches π
They are fast if you have a situation where you bulk fire the same query over and over again. They are basically just preparing the SQL engine to process a defined query structure with only a defined set of variables changing each time, so it doesn't have to parse each individual query, hence the performance benefit
At least from my understanding, of course.
I have never used them myself, since I have never come across a situation where it would be beneficial to use, but I still read about that sort of stuff π
I mean, to be fair, if the statement structure is pre-defined, it could be a protection against an injection attack, since in that moment the engine doesn't expect any other query structure xD
So I give you that. But I wouldn't rely on that as a form of security.
Just escape user input properly. That's usually all you have to do xD
Some libraries are even doing that for you automatically if you use the correct functions.
who needs prepared statements, do it on the fly!
@olive terrace story of my life lol
the biggest point for prepared statements is not the security (while important), but plan caching
if you run SELECT * FROM USERS where login = 'username_string', the DB server has to figure out the plan for every execution. If you run SELECT * FROM USERS where login = ?, the DB server will see that it is the same query, so it can use the same plan and save some time while executing it
So i did the thing geo told me to but i dont know how to add in a way to change the text.
im big dumb and placed things in the wrong place
alright i have the light and dark mode working. but how do i get it into one button?
can someone help me with my program
it downloads youtube videos but tkinter just becomes unresponsive after clicking download
@cosmic kestrel i am not a python programmer, but your description fits the "function locks up the GUI thread" problem -> https://stackoverflow.com/questions/1198262/tkinter-locks-python-when-an-icon-is-loaded-and-tk-mainloop-is-in-a-thread
Here's the test case...
import Tkinter as tk
import thread
from time import sleep
if name == 'main':
t = tk.Tk()
thread.start_new_thread(t.mainloop, ())
# t.iconbitmap('icon.i...
in short, you need to implement threading
ayt guys, im learning c++ and ive some (not a lot) knowledge about c#. Ive a quick question, and this is throwing me off a little bit. an int, supposedly is a number right? similar as a float.
So, why can I write this for example
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
it doesn't return a number does it??
in c#, you use void
for void main
@nocturne galleon 0 means the program ran as expected and non-zero values means an error occurred. It's standard convention in C/C++
It does return a number.
That's a qt application. And it does return a number if you look at the console output
if this bother you, just use auto
Thanks very much @novel creek !
Nah, it doesnt bother me @worthy dirge . i was just trying to understand what int main meant and why would i use it instead of void as in c#
lol
@olive terrace Prepared statements actually aren't a protection against SQL injection attacks. But it is VERY easy to protect any SQL call against that π
@neon pond lol wut
prepared statements (which inherently means using variable binding) quite literally are a protection against SQLi
Unless the library you're using is garbage and can't bind parameters correctly, they are quite literally the best tool to protect yourself from SQLi
And yeah error reporting, generally the drivers give better errors when trying to bind a variable improperly
i think the thing with prepared statements is that if you use them, it's very hard to use them insecurely
whereas if you're using raw SQL queries, it's definitely possible to just escape input yourself, but that's another consideration you have to give when writing your code
i've always heard that prepared statements were mostly created for performance reasons, and they just have the very nice side effect of making it easier to write secure DB interactions as well
Hey guys, so now that I've understood the basics of C++, I've been thinking of writing a cross-platform application for quite a while but I'm not sure about which platform/framework I should use. I love C# and WPF but the fact that it isn't cross-platform (for understandable reasons) and the fact that you're tied to the framework (again for understandable reasons) makes me not want to use it. I've seen some people that even recommend using the raw Win32 API over WPF even though I'm not sure why. I know most programs are made with C++ (due to cross-platform as well?? please explain??).
With that said, here's my options:
- Continue to learn .NET Core WPF and then learn a different framework and recreate the application completely from scratch for that new platform (not ideal);
- Learn Qt (although, to licensing options I may have to make my application Open-Source which isn't a big deal for me);
- Learn wxWidgets;
- ?? Your suggestion?
I'm not sure which programming language to use either: C#, C++, Python, Java, etc.?
The requirements of my application are:
- A good graphical user interface (can use common controls, but I would like to style my own set of controls);
- Cross-platform (Windows, Mac);
- Fast and reliable;
I do not need direct access to hardware or any fancy stuff like that. I'm not writing a kernel, let's say I want to create an high application such as paint or notepad. I'm leaning towards Qt, but I'm afraid of C++ and that I need to pay for it (even if I make it open-source) and at the same time I'm leaning towards WPF because I really like the framework
I'd personally go down the Qt route since it's widely used and pretty much an industry standard
This is gonna sound stupid: but is there any way to use C# (managed code) with Qt?
Java could be quite a simple way to do this
and still keep it crossplatform
It'll be fairly comfortable coming from the C++ world, has good performance and cross platform support
JavaFX is also a fairly easy library to use to build UIs in
I see
but I'm comming from the c# world into c++/java... I'm still a novice programmer
I will however add that JavaFX is pretty easy to work with and style.
Qt π You can definitely create sexy looking thing with Qt. And you can either use C++ or python with it.
Isn't C# with .Net Core cross-platform also?
Doing some C++ as well, novice/beginner level.
What languages can you use in GitLab for projects?
@crystal pasture actually there no specification for that... its just a VCS , it can take whatever you give it. (technically git is VCS but whatever)
ok, i see! saw some videos from a university on a computer science course. The teachers talked about developing in GitLab. Thats why i asked.
the code didnt look like anything special..
It's basically just a remote repository for you to keep track of changes in code which makes it easy to see what's changed over time and makes it easier to collaborate with others
with git its local even
you can be in airplane mode but still undo stuff and track changes and divide stuff
so if you want to test something, then put it aside, and then test something else, then bring your other test in, then undo it all, you can do all that
offline
but changes can be grouped and named so that what they change is clear
so it can be shared with others
and then versions of code can be tagged every time you release
and stuff can be built on top of these to make collaboration platforms that you can submit to and pull from
gitlab is one such thing, with issue management, user management, pull requests, code review, that kind of thing on top
gitlab is a very similar clone of github which are very similar
both use git
No love for bazaar? π¬
git is better like in every way as per my opnion
@novel spear I don't know how i lived without it before knowing it lol
gits killer feature compared to bzr is the fast "out of the way" branching
where it doesnt teach branching as a big moment but rather treats it as just a part of your every day workflow
when I use git I branch constantly to try things and experiment and I cant do that if every time I branch it makes an entire folder
Guys, I play on developing qt applications using c++. However, since I have no knowledge on C++, would you recommend I start learning C++ without QT ("raw" C++, say in visual studio) or inside QT? I've noticed there's differences when i create a console application in both and I'm pretty sure the VS one is the "raw" one
your in the right track, shouldnt use an implicit return in your int main though
QT provides a lot of stuff for you that means you dont need to use the stdlib
you kind of "code to QT" rather than "code to C++" as you observed
and streams are dumb and confusing
if you are looking at like, getting a job in C++ though
you should know how to use the standard library, or atleast the newer stuff in the new C++ standards
or boost
but its totally acceptable to say "nah i just wanna learn QT" as long as you dont try to do anything where you talk to other libraries
know your limits
yea
if you JUST want to learn qt
look at
then the "C++" part gets (mostly) out of the way
I see
pyqt is pretty direct mappings from QT to C++ its just inside python
look at pyqt vs pyside tho
I think pyqt is the open source community one and pyside is a qt supported one
so if i were to create a new console application using python, would i be using qt's supported one, or the pyqt the open source community one?
either
but basically C++ has some complexities in that its very "raw" and lets you do things that will crash your application
or leak memory
and other languages do other things to try to avoid needing to worry about that (usually at the expense of control and or speed)
or complexity
but if you just want to make a console application, do nodejs, or python, or dot net core
whatever you want
and then learn C++
so you can get the hang of the logic first
yeah, when I was searching for c++ tutorials I've noticed that it requires manual memory management as supposed to python which has a garbage collector like .net languages
well C++ (and qt) provide layers so you dont have to
called "smart pointers"
which basically keep track of when pointers come in and go
the problem is that I really want to learn qt so it's crossplatform. I love wpf, but cross platform is a need
but it has nuance youd still have to learn
oh yeah ive heard of those
@nocturne galleon if you want cross platform gui but dont want to deal with C++ your (good) options are electron apps or a gtk binding or a QT binding or something like xamarin
there are nice (ish) GTK bindings for C#
if you prefer javascript, electron is what you want
there are way more choices on top but im being general
so many, yet so few
true
once you really drill down into it
what about qt python?
qt in python has two options, pyside and pyqt like I mentioned
yeah
id take a look at those two and see which seems better documented to you
since documentation is going to be your friend
and youll have to reference the C++ docs sometimes
since one just wraps the other
GTK is C so the bindings are less complex
damn that was long convo to catch up lol
I'm not even sure what gtk is. is it some sort of library?
does it provide common controls like buttons?
It's really confusing that you have all these libraries and languages to chosoe from jesus ahaha
wdym
I would actually recommond using bindings for most of the things... unless you know what you are doing in c++/c ... even I made dll's for CUDA code and stuff to use them in some other managed language ... because its faster and kinda safer... I don't do really memory leaks that often, but yeah that's my suggestion for begginers
if its for commercial purposes id say make an electron app or a mobile app
and learn in whatever language you are most comfortable learning with the least pitfalls
do note that electron has its own catches... and limitations..
yea they all do
GUI is difficult right now
if it was just for fun I was gunna suggest making a windows forms app in C# π
for windows
lol I would actually make a web app and use electron or something to contain it...
I already have knowledge with winforms and wpf with c# ahaha
rome wasnt built in a day π
but it seems that if you want crossplatform your options get harder and limited
correct
and more poorly documented
or documented in ways that assume you know other stuff already
yeah that's a thing but it really depends on the person I have already worked on multiple react projects open source and made my own tools
true
my personal recommendation is to scope to one platform for now, unless you want to do web/electron
at some point I even considered making my own set of custom controls not relying on anything related to the win32 api or any other api, but that's even more complicated
or unless its mobile
I see
and web/electron can be made mobile
so people end up making that choice a lot lately
true
yeah.. lots of choices
its funny tools for one project I made is in 3 different langauges.. and the project itself is in different language
not gonna lie
I kind of wish C# was a global language like c++
I spent embarrassing long time learning things
its getting more like that with dotnet core
that would make things easier
but not for GUI yet
there are options but they arent fantastic options that assume you already know other stuff
and or not well supported
the closest you can get is xamarin
right now
I hate Xamarin!
i would rather learn dart and go onto flutter or use my react knowlege and expand to react native
would you say python is similar to c# ?
no
naah naah
java, kotlin, and C# are "similar" in ways
its waayy more user friendly but doesn't let that many controls over things
I mostly suit it for ml only
python is kind of like perl in the way people use it
is ee
to be honest its pretty easy to get started in python
if you like functional programming
then F# or kotlin
kotlin has nice functional stuff
while being java
(ish)
yeah I like kotlin but not f#
and F# is C# but better for functional
but not better
kotlin is better π
but kotlin right now is very geared for like
android dev
in terms of ecosystem
yup.... its very awesome in that
I was working a littleb bit with fossasia
and their projects
I helped port some of it to kotlin.. I mean android ones
I actually think a framework is much difficult to learn than being intermediate in a language
granted framework is not puny lol
π React Native atleast
Vanilla React is pretty decent for Web UI if that's your bag.
React native tried to shoehorn that paradigm into app development and it didn't work. It blows.
yeah... @last ingot I first read your message I was like... welp react is most used framework I find its docs pretty awesome
I have no idea about react native.... I have never made a mobile specific app.. for any tool for server data-ish maintenance etc... I either have a app on my desktop and have a web hosted version for mobile access
but I assume it would be faster for me to jump into react native because I already know about react and js π€·ββοΈ
Does anyone know why i still get a gcc version error when I installed 4.9 as requested?
Try adding this as an argument to your compiler options
-std=gnu++0x
Thanks - do I do that in the shell command line or in the makefile?
It looks like this issue has been brought up, but I deleted the existing test-regex manually and it still didnβt work. https://github.com/cocodelabs/znc-palaver/issues/43
Add it in the make file if that's how you compile
What courses / tutorials do you guys recommend on Android MVVM?
Like starting from a scratch
My friends and I want to build a site that connects students in my area to internships. Theres 4 of us and we have 0 web experience, but we know a little Java (based on a high school course). Can anyone give me advice whether this is feasible? We're willing to put several hours a week on this, but don't know how long this would take.
@untold badge Honestly all of that seems fairly easy. the biggest issue is figuring out how to not only get the list of internships(using a script to search the web wouldn't be too hard but it'll likely miss some) but also getting users on the platform. but this is a good idea that I would even love to see play out
@rancid nimbus @teal crypt Thanks for the advice! Our current plan is to ask local medical professors if they're interested, but from your comments that seems difficult
I'm guessing that would be a major issue because I just learned that one of my friends sent 200 emails and only got 2 acceptances. Most of the other emails were profs who were too busy to have interns, who didn't respond at all, or were interested and never responded after that
@rancid nimbus What do you mean?
so, i'm extremely new to qt and c++ and I've been looking at qt styling but I'm not sure if the best way to style in qt is to use stylesheets and create them by hand or use a program qt provides? What's the name of this program and where can i get it? https://doc.qt.io/qtcreator/images/qmldesigner-visual-editor.png
Is there someone here who can tell me why a line of code in C# is wrong?
@nocturne galleon what's the line?
Console.WriteLine("Sorry - no delivery to" +entry "ok");
it gives me an unexpected error
Need a + sign between entry and "ok"
Sweet thanks!
You can also do something like this... Console.WriteLine(String.format("Sorry - no delivery to {0} ok", entry));
.. or if you're on a new enough C# version to support format strings:
Console.WriteLine($"Sorry - no delivery to {entry} ok");
ah, nice.
anyone knows how to animate element hiding in reactjs, im using framer motion here
what i do right now is something like
const [isDisplayed, setDisplay] = useState<boolean>(true)
return (
<>
{isDisplayed && (
<motion.div initial={anim} exit={anim} animate={something}>
<h1>Hello World</h1>
</motion>
)}
</>
)
when isDisplayed is not true, it just pop right off without animation, i would like to give some animation there
oh wait nevermind lol, i just need to render it all the time and use controlled animation
hey boys, does anyone write React Native here?
Just try posting your question. The likelihood of getting an answer increases a lot by doing that. π
Guys
how would I call an object initialization from another class in c++?
(idk if that makes sense)
you can call the constructor of the class.
generally it's either MyClass instance; (to keep it on the stack)
so I would have to create another instance of the class I'm trying to access?
Yeah, so you can create multiple instances of the class... MyClass instance1;
MyClass instance2
What do you mean when you say "class I'm trying to access"?
I have two classes and one main file. The main file creates an instance of Class1 and calls a void in Class2. Class2 uses the instance of Class1 in the Main file
However im getting an error
Ill give you an error code in 5 mins
might help to post to something like http://cpp.sh/
and then give us the link.
Or even https://repl.it that looks like a pretty good tool.
Repl.it is a simple yet powerful online IDE, Editor, Compiler, Interpreter, and REPL. Code, compile, run, and host in 50+ programming languages: Clojure, Haskell, Kotlin (beta), QBasic, Forth, LOLCODE, BrainF, Emoticon, Bloop, Unlambda, JavaScript, CoffeeScript, Scheme, APL, L...
I'm using VS
should I use #include "MainProgram.h" ?
in the class I want to call initialized objects from
oh i see
But any class would be able to instantiate and call methods on other classes.
Okay this should explain better what I'm trying to do
the red part is where I'm stuck at
in ClassOne (in your DoSomething() method)... you can just do something like...
Yeah, you can initialize as many as you want.
oh so i would just initialize it again but in separate class?
there's no problems in doing that?
So long as ClassOne can see ClassTwo.
let me try
You would usually do that by also having a header file. And adding #include "ClassOne.h" within ClassTwo
yeah, I also added that
Sweet.
for some reason, intellisense stopped working like 10 minutes ago
let me restart VS
oh, heh.
no worries. we are all newbs at some point. heh.
yeah, c++ is not an easy one. But can do some incredibly quick things once you get it.
Yeah thats why im learning it π
and i was thinking my GIT commit messages were long π https://dhwthompson.com/2019/my-favourite-git-commit
I like Git commit messages. Used well, I think theyβre one of the most powerful tools available to document a codebase over its lifetime. Iβd like to illustrate that by showing you my favourite ever Git commit.
Damn, I wonder if their repo has more metadata than actual code
And I only wrote βcleaned up old dead codeβ on a commit that had 350 files changed and 35000 lines of code removed a few days ago, I kinda feel bad
I made a bash script to help me with my Zoom calls on Linux, what do you guys think? https://github.com/BananaManCJ/zoom-helper
And I only wrote βcleaned up old dead codeβ on a commit that had 350 files changed and 35000 lines of code removed a few days ago
I feel that. But short of going into the historical context of why that code was written and why it's now no longer used.. what are you going to put in the commit? π€·ββοΈ
Yup, and at least for us, all the context is in the ticketing system - it was basically a large feature deprecation, it was dead, just never deleted, now is deleted
So if a private variable can be accessed / modified using getters and setters, what's the point of it being private?
@visual plank what language
but in general, getters/setters are for hiding away functionality
right now you might only set the actual value. in a week you might tie some functionality to it, and you can't do that if you directly modify variables. but with getters/setters, you can add new functionality to the said function
@cloud knot c++
In your setter functions you can validate the value before setting it. Like specifying maximum and minimum values .
The getter might hide how the variable is set inside the class and return it using a different type.
Also useful for memory management
lazy loading
My laptop stopped working. I accidently putted it on my heater...
can i fix this?
Assuming you're serious, the data is probably salvageable. Not going to mess with a broken battery though. That stuff is dangerous if not handled right.
@visual plank its also why many languages now dont force you to declare the private variable until you want to do something complicated - for example in C# or Java you can just do:
public string VariableName {get; set; }
and it just leaves it as such - but opens up the option to do more if you want to introduce private functionality later - its all about allowing the class to have control - the compiler will create the private variable anyway for those languages - but you dont have to as a dev
So im playing the game "Control" and i want to enable RTX but the option is grayed out because it says i dont have an RTX gpu but i have an RTX 2070 Super
Please ask in #tech-support π
anyone learning/learn cobol?
never heard of it
Itβs a very old language mostly used for mainframe applications
It's used in the banking sector
Yup, the company I work for runs the Canadian financial system and one of our main programs is cobol
Just recently replaced the other main program though
And working on replacing the one that is
I'm mistaken, ACSS hasn't fully been replaced yet but it's close
here's a public article that might be interesting if you're into fintech: https://www.bankofcanada.ca/2017/05/upgrading-the-payments-grid-the-payoffs-are-greater-than-you-think/
They need to make it so you can instantly transfer funds... it is 100% possible
Real time rail
Itβs a bit of a meme at the office because of how many issues itβs running into
But the guys working on it are great and it will happen
Not many countries have real time payment systems because of how difficult it is, weβre on track ish for getting it implemented this decade
the current goal is launching in 2022 but that seems a little optimistic
It's very exciting though
Where's this program located? https://www.qt.io/blog/2019/06/03/qt-design-studio-1-2-released
Qt Design Studio 1.2 released
I literally can't find where it is
I need a bit of help in my small java code, regarding O(n) complexity
Just tell me the O(n^1) or not
The factorial function is O(n) though the actual main function is O(n^3)
just for API stuoff on server - server end
How can I map a key to include a header file in my CPP file in vim?
Like if I type ctrl io in normal mode, I want the iostream header to get included.
@visual plank Here's some idea: You use inoremap {keys combination} {keys you want to run}
I'd probably say start with inoremap <C-i><C-o> <Esc>ggi#include <lt>iostream.h<gt><Esc><C-o>i
Tweak around with this thing a little and you should be able to do it
Don't have vim rn so can't check
@nocturne galleon https://download.qt.io/official_releases/qtdesignstudio/1.2.0/ the link was in article:
Download and try out Qt Design Studio 1.2
The commercially licensed packages are available through the online installer and on the Qt Account Portal. You can try out and evaluate Qt Design Studio by registering for an evaluation license. 2019).
The Community Edition, which does not contain the Qt Bridges, can be downloaded from here.
oh wow I didn't notice that
tyvm!
Also, (even though i should probably take a look at licensing) do you think that if I don't make my software paid, I'm fine with the community license of qt or do I need to make it open source?
Look at the licensing. You have to write open-source (GPL) in order to use it for free.
I see
that would be fine for me tbh
i just find qt much more different than wpf ahaha
it's kind of a "hassle"
qt stylesheets is different than wpf styles
and their documentation isn't very good either..
Not sure where that sentiment is coming from. Qt has top-notch documentation in my opinion.
Well for example I've searched their documentation for Qt design studio and never found a downloadable link; some of their stylesheets just don't work (so far, the button stylesheet is the only one that seemed to work) so im not sure how I'm "supposed" to learn stylesheets when i look at their own stylesheets and they just don't work
@obtuse reef what if we condense the printing side more. Plus, I think the complexity is like (n^2 * (2n))
Constants are generally dropped in big O notation
Ok!
is anyone here good in php and would like to help me?
I'm having some issues with a very basic login system which uses files and hashes
Just say the problem here so we can actually just answer immediately. (https://dontasktoask.com)
Patching prod system running it is still sort of necessary Β―_(γ)_/Β―
I would not recommend using it for new projects however
So like.. I'm thinking about a project where I use a RaspberriPi camera and use it to project the image it captures. So I could take the camera input and output it on a wall.. for like a city view or something
IDK is that neat or dumb?
Like an artificial window?
π
@obtuse reef will do. Thanks man
hi I want to write a code that contains "X time number * X probability number = as a result a number between 1 and 3"
i mean i need a exaple of code
Sorry. What language?
Also, in general, try to write your own code.
I'm not even sure what you're asking us to help with. Could you formulate it in another way? Are the X's the same variable? Is X a measure of time, probability or both? Are we talking integers or floating point? Are 1 and 3 included? Not trying to demeaning, I realize English is probably not your first language. There's just too little information for us to be of any help. @proven geyser
π
anyone know if anyone have built stand alone versions of the opix denoiser or dlss 2.0? like I have a bunch of images I would want to denoise/super sample
I see intel's open image denoise and it works but only works for 1 image at a time. how do you write a file to run it on multiple files? thanks
on windows
Iβm supposedly a C++ βexpertβ. (Not really, but I program in it anyway.) If anyone has a C++ question or just wants to went after a 238K template compilation error, feel free to ping me or/ at me or whatever it is called on Discord. π
Hey. Discord do sed? Wow.
Cool
you know how to write nice bat files?
I need to run a image sequence through a denoising filter and it only accepts one image at a time
Do you know bash?
a little
Easy in bash
probably
Can be done a million ways with a pipeline.
I usually do xargs, but smart people use find with -exec
What I do on Windows is install MSys2
I am not that advanced with linux, all I know is ssh and going around directories
Then I have a reasonable bash with basic stuff like sed, find, xargs, probably gnu awk etc
Yeah, but wsl does not easily βseeβ the windows file system as I under
Understand
MSys2 runs on the same kernel
I donβt remember bat files anymore π¦
Powershell should also be able to do this with style, but I donβt know it π¦
What would your command line be for a file?
in powershell I can just drag the file into the window and the absolute path just shows up
I will see if I stick all the commands in at once what it will do
2000+
I will write something to generate it
but it is a image sequence so it is just like 00001, 00002
Just install MSys2 and I will help you
It will be something like find . -type f -iname β*.pngβ | xargs -n 1 your stuff
It gets trickier if you need the file name not at the end of the command
it is not at the end of the command
Or more than once. But in bash/Unix it is still a one liner
it needs --hdr path --nor path --abt path
it needs 3 file path
and 1 output path
Are those separate files?
I will render out a sequence first
How do you know which ones to use together?
the 0001 will be used together
they are frame numbers
with separate passes
Can do in C++, but thatβd be way overkill
Python has awesome file system stuff etc
yeah, anything other an a very simple thing is probably over kill. need to do this once
I mean Python code would be simple I think.
Making this 2000 times by hand sounds error prone
Are those number contiguous?
Oh
I will write something to generate the commands
Then you look at the bat to make sure itβs not messed up
very easy to generate that
yeah
Awesome
Just need to make sure it waits for the first command to finish than run the second one
forgot if bat files did that
You just need to find out how to make Python write all those zeros, not just 1 but 00001
They do
They come from DOS times
I think theres number padding in many languages
They run stuff in foreground and in sequence
Except for GUI things.
Oh yeah. There is padding in every modern language.
I just donβt recall the Python one n
If you use fresh enough Python 3 they have those format string things that are awesome.
You can ember variables in strings and tell how to format them into string.
For Python itβs so easy to find out most things.
yeah
All right.
If you need help me or at me or something π
I am going to watch some YouTube
Sure, thanks for the help
No problemo
div:parent:parent[class*='blockedSystemMessage']
{
display:none;
}β¨β¨ ``` Why does this code not work? I don;t know how to select parent code (CSS)
Thanks
(-> you can't)
Guys, what's the best and most reliable way to edit qt Controls? Should I use stylesheets? or is there any better styling option? what about custom controls?
what is qml?
Hello, I wanna make a 3D Rubik's cube program thingy for fun. I know a bit of Java (I'm in a course focusing primarily on data structures and algorithms), but I have no idea if it's viable. Should I stick with Java or just switch to something like Unity?
@untold badge if you want easy... Then go for unity
It wouldn't take much if time
While sticking to Java means either you have use a Java based game engine... Or build it on your own.. offcourse using frameworks etc
@vernal marsh Would that be significantly more difficult, more time consuming, or both
Yeah, probably
hi guys i have a question
so i just learnt some c++
and i made a game:
this is the game code
so basically its a number game when i run it , it gets a random number and asks the player to guess it
but when i enter a value that is not a integer like 'f' or 1.0 it will constantly repeat itself like mad
how do i make a handler
that handles the problem and says like:
std::cout << "please enter an integer, nothing else!" << std::endl;
(the code i made only works in vs)
please dm or mention me :)
the game's executable
(sorry if in the code i dont do std:: because im lazy and i think using namespace is ezier lol)
the goto in there is er... interesting
what about it
in c++, I have this piece of code:
bool blaBla(){
//Blabla
}
Where should I put those? currently it's in my main.cpp, however there's going to be a lot of code if I stick with it. Should I create another separate file and call it from my main.cpp?
How you structure your program is really up to you. Generally you keep one class in one file, and make a directory for each namespace. However, any system that works for you is fine. The important part is compiling and linking the files in the correct order.
why no one answers to my main question?π
how do i make a handler
that handles the problem and says like:
std::cout << "please enter an integer, nothing else!" << std::endl;
@neon niche You can do some input validation by checking cin.fail()
Ya, so another way is to cast cin >> num as a boolean...
yeah..
while (!(cin >> num)) { cout << "You didn't type a number. Try again." << endl; }
oh tysm
Looks like you might need to clear the input stream also between guesses. Here is an example... https://jesushilarioh.com/error-checking-and-input-validation-in-c-plus-plus-integer/
thanks that helped me a lot
@neon niche using name spaces is kind of horrible maybe that is just me
@last ingot If you're making any sort of libraries to be shared and used in different projects, you would most likely want namespaces, to avoid naming conflicts.
@ashen sky thats what i also thought
Yeah, I didn't do it in my examples. Probably should do it though. heh. cpp isn't my primary language.
anybody good with docker/traefik here?
Junior programmer :
Stack overflow user
Senior programmer :
Professional stack overflow user
#linux #programmer #stackoverflow #code https://t.co/DgtFVyeIiU
445
1183
anyone know how to use other apis in java ?
Does anyone in here have experience with ASP.Net? I could use a hand with an admin and user login controller 

@dim shard are you thinking non-java apis? Like C libraries? If so, java has a JNI interface for that.
I indeed am @rancid nimbus
I've been having some heavy issues with it lol
That won't matter unless it's within the next 2 months, it's a school project and our teacher didn't show us that much in ASP
Doing stuff with the database and creating them is easy enough i guess, but like, roles and staffolding with them
I don't even know
Ok so I donβt know if this will work but I have I idea for compression so you know how you have bianary or on and off well what if you have on 25% 75% and off would that work if you stored data in voltages not just hard on and offs
Guys help
Thare is no reason this should not work
@last ingot @lunar quail I'm trying to make a java program that interfaces w the Amazon API and google api
I want it to search amazon for the things i put it in and get the name, price and URL put it into a google sheets
idk
it might be both ?
π€·ββοΈ
idk how to do that
Are buckets just a fancy name for array indices?
And entries are the key-value-*next residing in a bucket
Idk python
@dim shard I don't see an API for searching amazon's store. There used to be one back in the day. But I haven't seen it for a while.
How do you get to it in aws? I'm logged into mine now.
I can help you with the code in python or java, but I'd need to see the API documentation. I don't see any documentation for searching the amazon store anywhere in aws.
But I'll admit, the management console is huge and difficult to find what you're looking for. I may just not be familiar with it.
Looks like this might be it... https://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html
Use the ItemSearch operation to search for items on Amazon.
heres what I found
Create a Security Profile Map the Security Profile to the API Request LWA Access Token 1. Send token request 2. Save the response 3. Handle any error re...
This looks like the API for the amazon app store. Apps for Kindle, firetv, fire tablets.
Not for searching for items to purchase on amazon.
oh
how ab this
An application programming interface key is a set of rules that allow programs to communicate with each other. If you are a programmer and want to communicate with Amazon.com with a script, you'll need to include an Amazon API key in your code. An Amazon API key allows you acc...
Are there any trigger mechanisms in c?
It's easyly doable in CPP, not sure about c though
"trigger mechanisms"? Like event handlers?
Ummm kind of yeah. But basic ones. Like calling a function when a variable changes value or something. In c++ I can just use setters and call a function inside the set() function.
You got function pointers in C
That's what I was having a look at rn
what kind of tutorial is this: https://www.youtube.com/watch?v=uuhmSZxK1mk
In this tutorial, Bryan Cairns aka Voidreals teaches us how to create a fully-fledged application in five minutes with Qt Quick Controls.
he doesn't even explain anything
hi how do you guys send colorized code blocks in discord. check this out:
int main()
{
return 0;
}
but this isnt colorized. how do i make it format on discord
i searched and it seems only works with js and cssπΆ
anyone know anything about hackintoses
Anyone have any suggestions on general/conceptual/high level comp-sci papers for an IT guy and kinda newbish programmer to check out? βReflections on Trusting Trustβ and βFixing Races for Fun and Profitβ are ones I should probably check out in full (Iβve skimmed the first, just stumbled across the second now looking at the wiki article on race conditions)
anyone know anything about hackintoses
@golden mural They are non-compliant with the Apple MacOS license. What else do you need to know?
But why?
never used a mac
and it seems intresting
im a linux guy and winows guy , but never used mac
i wana try it
Then buy a Mac. If you install MacOS on non-supported hardware, you need to jump a lot of hoops to get things working, and something will not work at all. It will give you the wrong idea of how the OS works, and how it runs. Any mac no older than 3 years, will give a proper experience.
Also I'm pretty sure, discussing how to do it, where to find the information, how to obtain the software etc. would breach rule number 6, which is this:
- No sharing of illegal content.
β’ Broad discussion of piracy is allowed, but sharing of illegal content and discussing ways to circumvent DRM or anything similar is not allowed.
Isnt there an ltt video on hackintoshes?
Check out Displate's metal posters at https://lmg.gg/displateltt
Check out the NEW Antlion Audio ModMic Wireless at https://lmg.gg/wirelessmodmic
Hackintoshes are such a pain β You need the right hardware, and you need to invest a huge amount of time and effort EVERY TIME yo...
But not very detailed. Also they do actually obtain the software from the app store. π
But getting it from the appstore is only possible using a mac.
hackintoshing is not very hard to do and you can get most features working
updates can break things and you will have no way of knowing if they will, but if you don't update frequently/wait for someone to verify updates, it will be no big deal
the main challenge is hardware support for certain things like wifi cards
You can, but if you want to experience the OS perhaps to see if you like it, the trouble of setting it up, will not give you the right idea of how it's actually working on a mac. For first time users, an old mac will be better, if you don't want to get a negative experience with the OS due to hardware incompatibilities and other problems.
but most desktop pc hardware is supported
Yeah, for the time being, that'll stop when they switch to ARM. π
Snazzy Labs shows the latest all-AMD Corsair Vengeance 6182 Gaming PC running macOS Catalina using OpenCore. You can make your own too!
Follow me on Instagram - http://instagram.com/snazzyq
Follow me on Byte - snazzy
Support us buying a 5700 XT GPU (or anything else!) - https...
this is a great tutorial for amd
it's fairly straight forward
@golden mural
No kidding...
@golden mural You'll need at LEAST 8GB. There's a reason Apple don't sell Macs with less than 8GB.
That reminds me I still need to tear down the iBook I got from my buddy so I can have it ready to drop the cheap 120GB SSD currently in my Tower when I finally upgrade
An old PowerPC machine?
Nice. Kinda slow for most things today, but a fun novelty. π
macos can run on 4gb if you dont multitask too much
8gb is definitely way better though
Nope, today they are much more capable machines. I used an old power mac to produce news programs for a local TV station back in like 2006 or something. I think it was a G5.
Yeah I know, it was a Stargate SG-1 joke lol
@vast echo If you don't open a web browser, or any productivity app, most likely, however, my work mac uses about 4GB when started.
Until last summer I was using a 2013 macbook air with 4gb of ram
I was doing programming and cad work on it for my engineering degree and various jobs
it's not ideal but it works
I wouldn't have the patience for that. π
If you just want to mess around with a hackintosh, it's totally fine
Depends on the propose of doing it. If you do it for the challenge of actually getting the system running, sure, if you do it to figure out if the OS is something you can work with, I'd say it ain't fine. π
It's still a perfectly valid comparison to windows with the same amount of ram
No. I'd say MacOS has an advantage on 4GB. π
(That is, until Safari goes crazy, and tries to use 80GB of RAM)
@ashen sky i was thinking doing an older mac os
Anyone know how to deal with jar files here?
I have some jar files but when I try to add them to my build path in eclipse it says there is no source attachment
??
please
anyone who knows how to code scripts PLEASE MESSAGE MEEEEEE i just need to know how to make it so my macro presses a button which then runs my script
does anyone know of any job openings for IT tenichnician online
Anyone knows what the feck angular is doing? I'm like lost, that happens if I do
ng new hello-world
It creates the files but fails at the package installations, I tried clearing the cache multiple times, and thats the only solution i found on google.
This is for my amazon program whatcha guys think and what should i do to make it better?
Good effort, granted I'm not sure what this is for. @dim shard
I would close the scanner instead of supressing the warning. Look into "Try with Resources".
Give all the functions an explicit access modifier instead of relying on the default one.
In the case of the following constructor, wouldn't it make more sense to just do the work in here instead of calling another function?
Items(int length) {
setItems(length);
}
What happens if I call String getSItem(int i) but I specify a number outside the bounds of the array. Or a negative one? Might want to do a check on that.
Ok so I'm making a program that's going to use Amazon's ad API and search amazon get the prices of the items and put it into a google spread sheet this program gets all of the items that the user would like to search
I tried doing it in the Items program but I kept getting a null pointer exception and I will check on the last part but that's mostly just for the program to use not the user
I am having an issue with giving multiple HTML elements that have class an onclick through a for loop
I have to copy and paste this like 8 times and only change the number for the class
I tried using a for loop to give all of those elements an onclick, but for some reason only the last item for the class had a working onclick
I need someone who does to help π
obviously π
I literally copy and pasted code from google but it gave the same issue of only working for the last element
π€·ββοΈ
Ok so I'm making a program that's going to use Amazon's ad API and search amazon get the prices of the items and put it into a google spread sheet this program gets all of the items that the user would like to search
I tried doing it in the Items program but I kept getting a null pointer exception and I will check on the last part but that's mostly just for the program to use not the user @novel creek
forgot to @ him whoops
iirc OpenJDK 14 has a feature that prints more helpful NPE messages
It might be worth using if you're trying to find the cause of the NPE
https://openjdk.java.net/jeps/358
I believe it requires you to use the -XX:+ShowCodeDetailsInExceptionMessages flag
hey, I'm pretty new to making websites, how would i go about making a button make a pop up for a webGL
How would one authenticate a user's credentials on Linux without having access to /etc/shadow, my current implementation uses su to the user, with the password, and if it works, sees the user as authenticated, however this seems like a budged solution, and I was wondering if anyone knew of a slightly more practical one, I want to avoid using pam_authenticate, as it should preferably work without being pam aware.
@rustic mantle Aren't there any auth apis? Also there's probably the option of using PAM.
@ashen sky Yeah, PAM is probably the best way, but I don't think there is any real authentication syscall, it seems that SSH just reads the /etc/shadow file to solve it
I suppose with "UsePam = Yes" in sshd_config, it uses pam? π
yeah, but I was talking about a non-pam solution
Well, you can always require your binary to be suid root. π
I don't have much experience with JS so I'm kind of a noob to this but does anyone have any compelling reasons to choose nvm or n or nave?
I don't have much basis for this but because of the popularity I was leaning towards nvm
Ay anyone have a clue how I could take a string in bash and add quotes around it if it contains spaces?
so this:foobar foo barbecomes this:```
foobar
"foo bar"
would probably be easier if you just quote every line
do you have more context to what you're trying to do?
I'm gonna squeeze them together on the same line and separate them with spaces afterward
I'm guessing this is reading through a file line by line
so you want it to become foobar "foo bar"
Yeah, that way I can avoid confusion
is there an issue with doing "foobar" "foo bar"
because then wherever you read in your lines you just put quotes around that
There isn't really any problem with that, I was just thinking it would be nicer to only quote things that need quotes. Much like ls
what's your code for reading in a line?
here are some ways to check for spaces
Aiight will take a look.
I currently just have this ls -1v | grep "jdk-*" | sed -e "s/^jdk-//" |
which looks in the directory and lists the folders with jdk-* as a prefix, and removes the prefix
oh you're not doing what I thought you were doing
I'm adapting it for some other uses but in the case that the folder contains a space (god forbid) it'll add quotes
hol up 1 sec does ls automatically output it with quotes ._. nvm
ls | sed -e 's/^/"/g' -e 's/$/"/g' | tr '\n' ' '
this will output everything in quotes on the same line
I can't think of a way to easily do it only if theres a space
Aiight thanks, for trying. I'll probably stick with just adding the quotes for now until I build some loop or something that'll do that
Yeah I probably could, I settled with just not adding the quotes because the values should only contain version numbers without spaces.
I just finished the script tho. It modifies the PATH to use a JDK that's in the same directory as the script.
https://gist.github.com/mtraverso3/5449bc9a587f92409aa1bd4ed38a91c8
Anybody got MC server experience, I tried to assign more ram but its not working
probably not the channel but alright, what have you tried?
I tried tech support but nobody knew anything about it. I'm using a server pack from FTB for skyfactory. There was a file called I think settings and I changed the Xms to 4g and xmx to 8g when that didnt work I tried using a console command to set it and then I tried inserting a line of code at the start of the serverstart.bat that should change it
Java -xms4g -xmx8g -jar minecraft_server.jar
I'm like 5% sure that putting the -xmx and -xms after the -jar will fix it will 100% work
so try ```
java -jar -Xms4G -Xmx8G file.jar
If you typed exactly what you're running, it's probably that Xmx and Xms are case-sensitive and you've got lowercase xs in your command
I don't think java -jar moreoptions... file.jar is valid
but don't have java installed on my machine to test
Just tested it , It's case sensitive.
The filename doesn't need to be next to the -jar option.
Yeah putting it after -jar would throw an error.
The correct way is itβs case sensitive
Flutter is pretty good imo, wbu?
so apparently a few ranters over at #build-a-pc claim that you don't need the source code of a program to compile it
they also claim you can install Xcode from apt and pacman
@main night they are idiots
lol
how do you want to compile something without source code
compile magical backend out of thin air?
ahh just write code compiled yeah
So I have an idea that could potentially revolutionize the budget gaming pc
It has to do with Crossfire/SLI but Instead of using a second gpu, a dedicated video memory expansion would allow for higher res textures to be loaded and reduce stuttering. Or it could be used for a dedicated ray tracing card that would allow non rtx/rdna cards to utilize hardware accelerated ray tracing.
So you're making the PhysX card for ray-tracing?
Or a vram expansion for high res textures with lower end/older cards
I thought it was a good use to revive the dying technologies
But now that u mentioned the physx card, I see that this is more realistic than I thought
This could actually happen
Depends if we're talking realistic in the engineering sense or the commercial sense
Does anyone know python?
def roll(num2):
for round in range(5):
user = input("user " + str(num2) + " please press e to start")
if user == "e":
print("Rolling the dice...")
dice1 = random.randint(1, 6)
dice2 = random.randint(1, 6)
print(
"You rolled a",
dice1,
" for your first dice and a",
dice2,
"for your second dice! Which gives you a total of ",
dice1 + dice2,
)
for _ in range(5):
roll(1)
for _ in range(5):
roll(2)```
I have this code
and one person suggested a fix with the bottom bit
Which I did
And it worked
but I got no clue what the "role" does
So if anyone knowns it would help alot!
roll is a custom function
defined above with this line:
def roll(num2):
it rolls dice
the roll function is called 5 times twice, with a different user each time
1 and 2
for _ in range(5):
roll(1)
for _ in range(5):
roll(2)
the roll function then rolls dice 5 times each time it's called, asking the user to send 'e' to start
for round in range(5):
user = input("user " + str(num2) + " please press e to start")
the 'round' variable will count from 0 to 4
if the user sends 'e':
if user == "e":
it then uses random.randint() to calculate two values between 1 and 6, then prints the result and sum
print("Rolling the dice...")
dice1 = random.randint(1, 6)
dice2 = random.randint(1, 6)
print("You rolled a",
dice1,
" for your first dice and a",
dice2,
"for your second dice! Which gives you a total of ",
dice1 + dice2,
)
so for each user, it rolls the dice 25 times
since theres two for loops that go 5 times each
does this answer what you were wondering?
with .NET development in Visual studio, what does this Icon mean?
it shows up next to certain things in my code but I don't know what it is
integration maybe?
@main night they might mean the compatibility NPM modul https://www.npmjs.com/package/xcode π
@nocturne galleon https://www.microsoft.com/en-us/download/details.aspx?id=35825 and search for your icon
@nocturne galleon maybe one of these ?
@vast echo you wouldn't happen to be doing the GCSE OCR programming project would you?
wait sorry @brazen vector
kekw
if you want I can send you some of my code I'm using atm for my own GCSE game
since I'm making mine now atm
quick question
when building a werbsite for someone
is there a website to find legal images to use
or acn you just get them off the internet
@pastel silo you just need to check licensing, and assume it is not legal to use them if you can't find the license or if license prohibits you from using them
https://ccsearch.creativecommons.org/ for example, if Creative Commons is fine for you
@pastel silo or just use google images with filter of usage rights in Tools
that said, you need to check up on usage rights even if you pick those
@main night they might mean the compatibility NPM modul https://www.npmjs.com/package/xcode π
@cloud knot nope, they meant the full IDE
anyone have experience with a store website?
i need help with mine
which
@pastel silo are you using an ecommerce solution?
im not sure its a app through shpify
typeof NaN == "number" // true
I love javascript
["10", "10", "10", "10", "10"].map(parseInt) // [10, NaN, 2, 3, 4]
It's traversing the keys for everything but the first item? π
parseInt takes two arguments, the string to parse is the first, and the base to parse is the second
array.map passes three arguments to its predicate, the first is the array value, the second is the index of the value in the array
so what's getting called is
parseInt("10", 0)
parseInt("10", 1)
parseInt("10", 2)
parseInt("10", 3)
parseInt("10", 4)
base 0 isn't a thing, so it defaults to using base 10 and returns 10, and base 1 can't contain the "1" character, so it returns NaN for an invalid input given that base
you can get more sensible output by using .map(num => parseInt(num, 10))
Makes sense then..
record yourself reading the code aloud and upload it to audible.com
thanks VSCode..
epic
any1 here good with unity ??
which parts of Unity?
art assets... nah I'm terrible at that
scripting... not bad
but its been a long time since i used it
it was the scripting part, but i figured it out :3
Anyone got experience with creating a rust (language) server? (REST API to be more specific)
Does anyone know a good alternative to Azure DevOps? Specifically looking for something that handles work items in a similar way(boards), with integration to Visual Studio. I found DevOps very clunky too use :/
Try having a look at github, gitlab and bitbucket. All based on git, all have at least one extension for VS as far as I remember.
For the board, I know bitbucket, when paired with jira, does a pretty good job. (Actually jira does a good job for task, bitbucket for the source)
Oooh, i haven't tried bitbucket yet, thanks! I'll give it a shot π
Thanks a lot @ashen sky this is everything that i was looking for, it's so simple and user-friendly, which is exactly what i needed! I just want to code, not sit here and spend a whole day setting things up. So thank you very much π
@earnest rivet We use jira and bitbucket at work, and now about a year after switching, no one knows how we ever managed to do useful work without (Switched from SVN)
@last ingot For private projects, what makes GitHub better than BitBucket?
And that applies to the selfhosted github as well?
I really like BitBucket and Jira, i had no issues setting it up... Well i did, but it was on the Visual Studio side, nothing on BitBucket and Jira.
Both with Github and GitLab i had issues with, same goes for DevOps. They were all clunky to use, especially for me who doesn't have a lot of experience using Git :P
So thanks again @ashen sky for recommending it, it was really easy to setup and had built in tutorials that was straight to the point(unlike DevOps with their 2 hours long tutorials) and has the possibility for extending its usage in the future.
That's a showstopper for us then, we don't want our code hosted by a 3rd party
Yeah, that's the other thing. BitBucket allows for your own hosting, i really like having that possibility.
