#development

1 messages Β· Page 47 of 1

grizzled warren
#

but that downloads the video in mp4

#

how do i download them in mp3

deep scarab
#

download them in mp4

#

convert using ffmpeg

ashen sky
#

in pytube ik you can download whole playlists like this
@grizzled warren Keep in mind, that downloadning from youtube is against the YouTube ToS

round dome
#

or don't; whistle-blowing is absolutely pointless on the internet

tidal osprey
#

anyone have example code for a discord music bot that i can have

olive terrace
#

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

tidal osprey
#

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

olive terrace
#

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

grizzled warren
#

@ashen sky my ffmpeg doesn't work

#

or i installed it

#

and it just didn't want to convert to mp3

quasi plover
#

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

wide carbon
ashen sky
#

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
teal crypt
#

not mine nor is it extremely up to date but its something to look at

tidal osprey
#

ive tried it but i cant get it to work

teal crypt
#

what about red bot

tidal osprey
#

not yet but ive been wanting to

reef tangle
#

hey if anyone's good at python dm me, I need some help with homework

stuck latch
#

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

peak venture
nocturne galleon
#

Feeling generous today! Anyone want something from CodeCanyon? Expensive or not go ahead and ask me :D

round dome
#

no but thank you for the offer

cloud knot
#

in case someone want to learn about web security https://web.stanford.edu/class/cs253/

smoky hound
#

You sir are a legend ty

cloud knot
nocturne galleon
#

hi, do u know where i can learn Lua for FiveM?

novel creek
#
nocturne galleon
#

Thx

nocturne galleon
#

[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 πŸ˜„

nocturne galleon
#

Does anyone knoe if theres a way to change the color of all text on a webpage by clicking a js button?

#

Its html^

mental crag
nocturne galleon
#

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.

novel spear
#

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 {

}

nocturne galleon
#

Sorry but i dont know what that means.

nocturne galleon
#

Ill learn in a few hours when i get back on my computer.

scenic hamlet
#

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;
}

nocturne galleon
#

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.

nocturne galleon
#

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

worthy dirge
#

@nocturne galleon boost.asio

nocturne galleon
#

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();

scenic hamlet
#

@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>
nocturne galleon
#

@scenic hamlet i only did like 1/4 of the css on the w3 thing.

scenic hamlet
#

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

nocturne galleon
#

I think i learned that from somewhere else. I knew about it but i forgot how to use it.

scenic hamlet
#

Cool, feel free to ping me if there's anything else you have questions about

nocturne galleon
#

Ok. Thanks for your help. I will probably be back if the tutorials arent enough.

nocturne galleon
#

@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

mighty sedge
#

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!

nocturne galleon
#

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

visual plank
#

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

nocturne galleon
vernal marsh
#

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?

neon pond
#

Oooh, a development channel. Quite a lot of interesting things here on this server :D

vernal marsh
#

@neon pond Thanks jack! just tryin to help πŸ˜›

neon pond
#

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

vernal marsh
#

lol I am here on the server for a long time too... I just kinda quit discord in general

#

I am bored too lol

neon pond
#

I didn't quit Discord, in fact I use it quite extensively, I just sometimes tend to mute and forget servers :P

vernal marsh
#

yup got it!

#

I just saw today lol Server Unavailable .. probably because of April fools day

visual plank
#

@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

vernal marsh
#

@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

vernal marsh
#

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

foggy loom
#

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 :).

shy helm
#

@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

worthy dirge
#

Define a class Range{}; Then overload[] for Range

neon pond
#

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

scenic hamlet
#

without fail, whenever github goes down, it's 15 minutes before i need to do something involving github

neon pond
#

Yes xD

#

I know, right?

scenic hamlet
#

I'm now cooking myself a nice rice lunch and hoping it'll be resolved by the time I'm done lmao

neon pond
#

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 πŸ˜›

scenic hamlet
#

I feel that

nocturne galleon
#

well aren't I glad I use my company's gitlab for almost everything

#

πŸ˜„

neon pond
#

It's back
Managed to finally fetch changes xD

vernal marsh
#

@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 πŸ˜‚

brazen sluice
#

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

novel creek
#

Try posting your question

shy helm
#

@brazen sluice yeah

brazen sluice
#

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?

neon pond
#

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

brazen sluice
#

oh that sounds about right

neon pond
#

Also do yourself and others a favor and comment in English πŸ˜‰

brazen sluice
#

Never done any sql so idk

#

Yeah sorry those comments came with the code

neon pond
#

Dunno, I guess $result is none now because you deleted the record? πŸ˜›

elder ivy
#

oh god does php not have prepared statements

neon pond
#

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?

shy helm
#

It does

#

Use PDO

#

Prepared statements are good for a lot of things; security, performance, error reporting sometimes

neon pond
#

Security? o.o

#

And error reporting? xD
Are you sure we are talking about the same thing?

vernal marsh
#

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

neon pond
#

@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.

fresh jacinth
#

who needs prepared statements, do it on the fly!
@olive terrace story of my life lol

cloud knot
#

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

nocturne galleon
#

So i did the thing geo told me to but i dont know how to add in a way to change the text.

nocturne galleon
#

im big dumb and placed things in the wrong place

nocturne galleon
#

alright i have the light and dark mode working. but how do i get it into one button?

cosmic kestrel
#

can someone help me with my program

#

it downloads youtube videos but tkinter just becomes unresponsive after clicking download

cloud knot
#

@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

#

in short, you need to implement threading

nocturne galleon
#

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

novel creek
#

@nocturne galleon 0 means the program ran as expected and non-zero values means an error occurred. It's standard convention in C/C++

nocturne galleon
#

i understand

#

but why use int

#

does it return a number?

novel creek
#

It does return a number.

worthy dirge
#

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

nocturne galleon
#

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#

scenic hamlet
#

lol

vernal marsh
#

Lol @last ingot

#

Watching paint dry type of situation

shy helm
#

@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

proud elk
#

someone into programming here?

#

I'm not really an sql dude gimme mongodb

scenic hamlet
#

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

nocturne galleon
#

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:

  1. 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);
  2. Learn Qt (although, to licensing options I may have to make my application Open-Source which isn't a big deal for me);
  3. Learn wxWidgets;
  4. ?? 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

novel creek
#

I'd personally go down the Qt route since it's widely used and pretty much an industry standard

nocturne galleon
#

This is gonna sound stupid: but is there any way to use C# (managed code) with Qt?

shy helm
#

Java could be quite a simple way to do this

nocturne galleon
#

and still keep it crossplatform

shy helm
#

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

nocturne galleon
#

I see

#

but I'm comming from the c# world into c++/java... I'm still a novice programmer

shy helm
#

Oh, well C# and Java are extremely similar

#

more similar then C++ to either of the two

nocturne galleon
#

i see

#

I like both Qt and JavaFX options

novel creek
#

I will however add that JavaFX is pretty easy to work with and style.

worthy dirge
#

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?

crystal pasture
#

Doing some C++ as well, novice/beginner level.

nocturne galleon
#

@worthy dirge yes, but WPF isn't...

#

cool @crystal pasture

crystal pasture
#

What languages can you use in GitLab for projects?

vernal marsh
#

@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)

scenic hamlet
#

Version control system

#

A tool used to keep track of revisions to your code

crystal pasture
#

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..

dense marten
#

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

novel spear
#

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

woven scroll
#

No love for bazaar? 😬

vernal marsh
#

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

novel spear
#

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

nocturne galleon
#

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

novel spear
#

your in the right track, shouldnt use an implicit return in your int main though

nocturne galleon
#

That's just the default empty projects without any modifications

#

to both

novel spear
#

is it, weird

#

anyway yea iostream is C++ standard library

nocturne galleon
#

nice

#

should I learn that first? or since I plan on using QT should I use qt? KEKW

novel spear
#

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

nocturne galleon
#

I see

#

you can use the standard C++ libraries in qt though cant you?

novel spear
#

yea

nocturne galleon
#

like

#

oh

novel spear
#

but if you dont understand them

#

you are going to get confused

nocturne galleon
#

I probably will get confused

#

since I'm totally new to c++

novel spear
#

if you JUST want to learn qt

#

look at

#

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses includin...

#

then the "C++" part gets (mostly) out of the way

nocturne galleon
#

I see

novel spear
#

pyqt is pretty direct mappings from QT to C++ its just inside python

nocturne galleon
#

so, I've heard python is as hard/easy as c#

#

not sure if thats true?

novel spear
#

look at pyqt vs pyside tho

#

I think pyqt is the open source community one and pyside is a qt supported one

nocturne galleon
#

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?

novel spear
#

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

nocturne galleon
#

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

novel spear
#

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

nocturne galleon
#

the problem is that I really want to learn qt so it's crossplatform. I love wpf, but cross platform is a need

novel spear
#

but it has nuance youd still have to learn

nocturne galleon
#

oh yeah ive heard of those

novel spear
#

@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

nocturne galleon
#

damn so many options

#

yeah ahaha

novel spear
#

so many, yet so few

nocturne galleon
#

true

novel spear
#

once you really drill down into it

nocturne galleon
#

what about qt python?

novel spear
#

qt in python has two options, pyside and pyqt like I mentioned

nocturne galleon
#

yeah

novel spear
#

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

nocturne galleon
#

what about GTK?

#

like you mentioned

novel spear
#

GTK is C so the bindings are less complex

vernal marsh
#

damn that was long convo to catch up lol

novel spear
#

but more verbose as a result

#

and there are lots of GTK bindings

nocturne galleon
#

I'm not even sure what gtk is. is it some sort of library?

novel spear
#

its like qt

#

(not really, but for this purpose it is)

nocturne galleon
#

does it provide common controls like buttons?

novel spear
#

yes

#

in that sense

nocturne galleon
#

It's really confusing that you have all these libraries and languages to chosoe from jesus ahaha

novel spear
#

well

#

what do you want to do with this experience

nocturne galleon
#

wdym

novel spear
#

once you do this

#

why

#

resume? experience? fun? commercial?

vernal marsh
#

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

nocturne galleon
#

well it's kind of for a commercial purpose

#

and experience

#

and fun

novel spear
#

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

vernal marsh
#

do note that electron has its own catches... and limitations..

novel spear
#

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

vernal marsh
#

lol I would actually make a web app and use electron or something to contain it...

novel spear
#

yea but then you are dealing with web stacks

#

so like

nocturne galleon
#

I already have knowledge with winforms and wpf with c# ahaha

novel spear
#

rome wasnt built in a day πŸ˜›

nocturne galleon
#

but it seems that if you want crossplatform your options get harder and limited

novel spear
#

correct

#

and more poorly documented

#

or documented in ways that assume you know other stuff already

vernal marsh
#

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

nocturne galleon
#

true

novel spear
#

my personal recommendation is to scope to one platform for now, unless you want to do web/electron

nocturne galleon
#

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

novel spear
#

or unless its mobile

nocturne galleon
#

I see

novel spear
#

and web/electron can be made mobile

#

so people end up making that choice a lot lately

nocturne galleon
#

true

vernal marsh
#

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

nocturne galleon
#

I kind of wish C# was a global language like c++

vernal marsh
#

I spent embarrassing long time learning things

novel spear
#

its getting more like that with dotnet core

nocturne galleon
#

that would make things easier

novel spear
#

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

vernal marsh
#

I hate Xamarin!

novel spear
#

yea thats why im not suggesting it

#

but like if you really want

#

its there

vernal marsh
#

i would rather learn dart and go onto flutter or use my react knowlege and expand to react native

nocturne galleon
#

would you say python is similar to c# ?

novel spear
#

no

vernal marsh
#

naah naah

novel spear
#

java, kotlin, and C# are "similar" in ways

vernal marsh
#

its waayy more user friendly but doesn't let that many controls over things

#

I mostly suit it for ml only

novel spear
#

python is kind of like perl in the way people use it

nocturne galleon
#

is ee

vernal marsh
#

to be honest its pretty easy to get started in python

novel spear
#

its easy to get started in node and python

#

and lua

vernal marsh
#

yeah... the hardest one for me was f# ... i wanted to see how it is

#

and nopeeee

novel spear
#

if you like functional programming

#

then F# or kotlin

#

kotlin has nice functional stuff

#

while being java

#

(ish)

vernal marsh
#

yeah I like kotlin but not f#

novel spear
#

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

vernal marsh
#

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

woven scroll
#

πŸ‘† 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.

vernal marsh
#

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 πŸ€·β€β™‚οΈ

marble burrow
#

Does anyone know why i still get a gcc version error when I installed 4.9 as requested?

novel creek
#

Try adding this as an argument to your compiler options

-std=gnu++0x
marble burrow
#

Thanks - do I do that in the shell command line or in the makefile?

novel creek
#

Add it in the make file if that's how you compile

marble burrow
#

Hm or wait I see an existing -std switch

nocturne galleon
#

What courses / tutorials do you guys recommend on Android MVVM?

#

Like starting from a scratch

untold badge
#

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.

teal crypt
#

@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

untold badge
#

@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?

nocturne galleon
nocturne galleon
#

Is there someone here who can tell me why a line of code in C# is wrong?

lunar quail
#

@nocturne galleon what's the line?

nocturne galleon
#

Console.WriteLine("Sorry - no delivery to" +entry "ok");

#

it gives me an unexpected error

lunar quail
#

Need a + sign between entry and "ok"

nocturne galleon
#

Sweet thanks!

lunar quail
#

You can also do something like this... Console.WriteLine(String.format("Sorry - no delivery to {0} ok", entry));

woven scroll
#

.. or if you're on a new enough C# version to support format strings:
Console.WriteLine($"Sorry - no delivery to {entry} ok");

lunar quail
#

ah, nice.

nocturne galleon
#

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

modest dock
#

hey boys, does anyone write React Native here?

novel creek
#

Just try posting your question. The likelihood of getting an answer increases a lot by doing that. πŸ™‚

nocturne galleon
#

Guys

#

how would I call an object initialization from another class in c++?

#

(idk if that makes sense)

lunar quail
#

you can call the constructor of the class.

#

generally it's either MyClass instance; (to keep it on the stack)

nocturne galleon
#

so I would have to create another instance of the class I'm trying to access?

lunar quail
#

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"?

nocturne galleon
#

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

lunar quail
#

and then give us the link.

#

Or even https://repl.it that looks like a pretty good tool.

nocturne galleon
#

I'm using VS

#

should I use #include "MainProgram.h" ?

#

in the class I want to call initialized objects from

lunar quail
#

typically it would be the other way around.

#

Main program calls other classes.

nocturne galleon
#

oh i see

lunar quail
#

But any class would be able to instantiate and call methods on other classes.

nocturne galleon
#

the red part is where I'm stuck at

lunar quail
#

in ClassOne (in your DoSomething() method)... you can just do something like...

#

Yeah, you can initialize as many as you want.

nocturne galleon
#

oh so i would just initialize it again but in separate class?

#

there's no problems in doing that?

lunar quail
#

So long as ClassOne can see ClassTwo.

nocturne galleon
#

let me try

lunar quail
#

You would usually do that by also having a header file. And adding #include "ClassOne.h" within ClassTwo

nocturne galleon
#

yeah, I also added that

lunar quail
#

Sweet.

nocturne galleon
#

for some reason, intellisense stopped working like 10 minutes ago

#

let me restart VS

lunar quail
#

oh, heh.

nocturne galleon
#

Cool, it's working!

#

thanks very much, I'm still a newby in c++...

lunar quail
#

no worries. we are all newbs at some point. heh.

nocturne galleon
#

haha true!

#

I'm trying to learn it by myself

#

it's kinda hard ...

lunar quail
#

yeah, c++ is not an easy one. But can do some incredibly quick things once you get it.

nocturne galleon
#

Yeah thats why im learning it πŸ˜„

cloud knot
nocturne galleon
#

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

nocturne galleon
woven scroll
#

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? πŸ€·β€β™‚οΈ

nocturne galleon
#

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

visual plank
#

So if a private variable can be accessed / modified using getters and setters, what's the point of it being private?

cloud knot
#

@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

visual plank
#

@cloud knot c++

novel creek
#

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

visual plank
#

Okay so the validation before setting makes sense.

#

Never thought of that

balmy compass
#

My laptop stopped working. I accidently putted it on my heater...

#

can i fix this?

novel creek
#

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.

nocturne galleon
#

@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

nocturne galleon
#

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

novel creek
nocturne galleon
#

oh shit

#

i thought i was in that chat

#

my b

astral garnet
#

anyone learning/learn cobol?

proud elk
#

never heard of it

vast echo
#

It’s a very old language mostly used for mainframe applications

novel creek
#

It's used in the banking sector

vast echo
#

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

astral garnet
#

They need to make it so you can instantly transfer funds... it is 100% possible

vast echo
#

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

nocturne galleon
#

I literally can't find where it is

nocturne galleon
#

I need a bit of help in my small java code, regarding O(n) complexity

#

Just tell me the O(n^1) or not

obtuse reef
#

The factorial function is O(n) though the actual main function is O(n^3)

dire harbor
#

just for API stuoff on server - server end

visual plank
#

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.

obtuse reef
#

@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

cloud knot
#

@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.

nocturne galleon
#

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?

novel creek
#

Look at the licensing. You have to write open-source (GPL) in order to use it for free.

nocturne galleon
#

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..

novel creek
#

Not sure where that sentiment is coming from. Qt has top-notch documentation in my opinion.

nocturne galleon
#

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

nocturne galleon
#

@obtuse reef what if we condense the printing side more. Plus, I think the complexity is like (n^2 * (2n))

obtuse reef
#

Constants are generally dropped in big O notation

nocturne galleon
#

Ok!

keen tapir
#

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

obtuse reef
obtuse reef
#

Patching prod system running it is still sort of necessary Β―_(ツ)_/Β―

#

I would not recommend using it for new projects however

astral garnet
#

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?

ashen sky
#

Like an artificial window?

astral garnet
#

yup

#

but like capture the stuff from a window 😐

astral garnet
#

😐

visual plank
#

@obtuse reef will do. Thanks man

proven geyser
#

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

obtuse reef
#

Sorry. What language?
Also, in general, try to write your own code.

novel creek
#

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

astral garnet
#

😐

hearty steppe
#

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

craggy jasper
#

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

hearty steppe
#

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

craggy jasper
#

We try to avoid bat files in this pandemic situation

#

Is this Windows?

hearty steppe
#

how about a c++ solution

#

yes

#

that thing goes with linux as well

craggy jasper
#

Do you know bash?

hearty steppe
#

a little

craggy jasper
#

Easy in bash

hearty steppe
#

probably

craggy jasper
#

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

hearty steppe
#

I am not that advanced with linux, all I know is ssh and going around directories

craggy jasper
#

Then I have a reasonable bash with basic stuff like sed, find, xargs, probably gnu awk etc

hearty steppe
#

I do have wsl set up with Ubuntu

#

and git bash

craggy jasper
#

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?

hearty steppe
#

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

craggy jasper
#

How many files?

#

If hundreds, don’t do it by hand

hearty steppe
#

2000+

#

I will write something to generate it

#

but it is a image sequence so it is just like 00001, 00002

craggy jasper
#

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

hearty steppe
#

it is not at the end of the command

craggy jasper
#

Or more than once. But in bash/Unix it is still a one liner

hearty steppe
#

it needs --hdr path --nor path --abt path

#

it needs 3 file path

#

and 1 output path

craggy jasper
#

Are those separate files?

hearty steppe
#

yes

#

in different folders, names could be different, I will check

craggy jasper
#

Oh. Same base name or different?

#

Ok

hearty steppe
#

I will render out a sequence first

craggy jasper
#

How do you know which ones to use together?

hearty steppe
#

the 0001 will be used together

craggy jasper
#

Ah

#

Hmmm

hearty steppe
#

they are frame numbers

craggy jasper
#

I see

#

Then Python maybe a good idea here

hearty steppe
#

with separate passes

craggy jasper
#

Can do in C++, but that’d be way overkill

#

Python has awesome file system stuff etc

hearty steppe
#

yeah, anything other an a very simple thing is probably over kill. need to do this once

craggy jasper
#

I mean Python code would be simple I think.

#

Making this 2000 times by hand sounds error prone

#

Are those number contiguous?

hearty steppe
#

na, I am not making 2000+ code by hand

#

yes

craggy jasper
#

Oh

hearty steppe
#

I will write something to generate the commands

craggy jasper
#

Then just make Python write out a .bat file

#

Yeah

hearty steppe
#

it is like
0001
0002
0003

#

yeah

#

that is what I am thinking

craggy jasper
#

Then you look at the bat to make sure it’s not messed up

hearty steppe
#

very easy to generate that

craggy jasper
#

Then run it

#

Yeah

hearty steppe
#

yeah

craggy jasper
#

Awesome

hearty steppe
#

Just need to make sure it waits for the first command to finish than run the second one

#

forgot if bat files did that

craggy jasper
#

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

hearty steppe
#

I think theres number padding in many languages

craggy jasper
#

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.

hearty steppe
#

yeah

craggy jasper
#

All right.

#

If you need help me or at me or something πŸ™‚

#

I am going to watch some YouTube

hearty steppe
#

Sure, thanks for the help

craggy jasper
#

No problemo

green remnant
#
div:parent:parent[class*='blockedSystemMessage'] 
{
    display:none;
}

 ``` Why does this code not work? I don;t know how to select parent code (CSS)
deep scarab
green remnant
#

Thanks

vestal glen
#

(-> you can't)

nocturne galleon
#

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?

untold badge
#

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?

vernal marsh
#

@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

untold badge
#

@vernal marsh Would that be significantly more difficult, more time consuming, or both

placid lotus
#

Yeah, probably

neon niche
#

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)

spiral obsidian
#

the goto in there is er... interesting

neon niche
#

what about it

nocturne galleon
#

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?

ashen sky
#

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.

neon niche
#

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;

lunar quail
#

@neon niche You can do some input validation by checking cin.fail()

neon niche
#

oh

#

can you give me an example of it on code like how can i use it

#

@lunar quail

lunar quail
#

Ya, so another way is to cast cin >> num as a boolean...

neon niche
#

yeah..

lunar quail
#

while (!(cin >> num)) { cout << "You didn't type a number. Try again." << endl; }

neon niche
#

oh tysm

lunar quail
neon niche
#

thanks that helped me a lot

ashen sky
#

@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.

neon niche
#

@ashen sky thats what i also thought

lunar quail
#

Yeah, I didn't do it in my examples. Probably should do it though. heh. cpp isn't my primary language.

dense cedar
#

anybody good with docker/traefik here?

cloud knot
dim shard
#

anyone know how to use other apis in java ?

glacial leaf
#

Does anyone in here have experience with ASP.Net? I could use a hand with an admin and user login controller GWslippyPeepoHuggedlinuth

lunar quail
#

@dim shard are you thinking non-java apis? Like C libraries? If so, java has a JNI interface for that.

glacial leaf
#

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

nocturne galleon
#

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

dim shard
#

@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

visual plank
#

Are buckets just a fancy name for array indices?

#

And entries are the key-value-*next residing in a bucket

dim shard
#

Idk python

lunar quail
#

@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.

dim shard
#

you have to go to AWS

#

ive already found it

lunar quail
#

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.

dim shard
#

heres what I found

lunar quail
#

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.

dim shard
#

oh

#

how ab this

visual plank
#

Are there any trigger mechanisms in c?

#

It's easyly doable in CPP, not sure about c though

ashen sky
#

"trigger mechanisms"? Like event handlers?

visual plank
#

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.

worthy dirge
#

You got function pointers in C

visual plank
#

That's what I was having a look at rn

nocturne galleon
#

he doesn't even explain anything

neon niche
#

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😢

golden mural
#

anyone know anything about hackintoses

worn stump
#

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)

ashen sky
#

anyone know anything about hackintoses
@golden mural They are non-compliant with the Apple MacOS license. What else do you need to know?

golden mural
#

thats cool , im aware of that

#

i want to do it

ashen sky
#

But why?

golden mural
#

never used a mac

#

and it seems intresting

#

im a linux guy and winows guy , but never used mac

#

i wana try it

ashen sky
#

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:

  1. 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.
vast echo
#

Isnt there an ltt video on hackintoshes?

worn stump
#

Several actually

#

Up to part 4 now IIRC?

vast echo
ashen sky
#

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.

vast echo
#

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

ashen sky
#

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.

vast echo
#

but most desktop pc hardware is supported

ashen sky
#

Yeah, for the time being, that'll stop when they switch to ARM. πŸ˜‰

vast echo
#

this is a great tutorial for amd

#

it's fairly straight forward

#

@golden mural

golden mural
#

im using a core 2 duo

#

and 2gb ram

ashen sky
#

2gb of RAM for MacOS? Yikes.

#

Even on a Mac it's too little.

worn stump
#

No kidding...

ashen sky
#

@golden mural You'll need at LEAST 8GB. There's a reason Apple don't sell Macs with less than 8GB.

worn stump
#

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

ashen sky
#

An old PowerPC machine?

worn stump
#

Yup!

#

The HDD is hosed so I’m just gonna toss an BSD onto the SSD

ashen sky
#

Nice. Kinda slow for most things today, but a fun novelty. πŸ˜‰

worn stump
#

Exactly!

#

β€œThey do not build them as they once did”

vast echo
#

macos can run on 4gb if you dont multitask too much

#

8gb is definitely way better though

ashen sky
#

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.

worn stump
#

Yeah I know, it was a Stargate SG-1 joke lol

ashen sky
#

@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.

vast echo
#

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

ashen sky
#

I wouldn't have the patience for that. πŸ˜‰

vast echo
#

If you just want to mess around with a hackintosh, it's totally fine

ashen sky
#

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. πŸ˜‰

vast echo
#

It's still a perfectly valid comparison to windows with the same amount of ram

ashen sky
#

No. I'd say MacOS has an advantage on 4GB. πŸ˜‰

#

(That is, until Safari goes crazy, and tries to use 80GB of RAM)

golden mural
#

@ashen sky i was thinking doing an older mac os

dim shard
#

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

nocturne galleon
#

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

nocturne galleon
#

does anyone know of any job openings for IT tenichnician online

main root
#

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.

dim shard
#

This is for my amazon program whatcha guys think and what should i do to make it better?

novel creek
#

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.

dim shard
#

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

pale onyx
#

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

dim shard
#

idk anything ab web development

#

srry

pale onyx
#

I need someone who does to help πŸ˜‚

dim shard
#

obviously πŸ˜‚

pale onyx
#

I literally copy and pasted code from google but it gave the same issue of only working for the last element

dim shard
#

πŸ€·β€β™‚οΈ

#

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

placid lotus
#

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

chrome verge
#

hey, I'm pretty new to making websites, how would i go about making a button make a pop up for a webGL

rustic mantle
#

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.

ashen sky
#

@rustic mantle Aren't there any auth apis? Also there's probably the option of using PAM.

rustic mantle
#

@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

ashen sky
#

I suppose with "UsePam = Yes" in sshd_config, it uses pam? πŸ˜‰

rustic mantle
#

yeah, but I was talking about a non-pam solution

ashen sky
#

Well, you can always require your binary to be suid root. πŸ˜‰

dense marten
#

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

placid lotus
#

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"

vast echo
#

would probably be easier if you just quote every line

#

do you have more context to what you're trying to do?

placid lotus
#

I'm gonna squeeze them together on the same line and separate them with spaces afterward

vast echo
#

I'm guessing this is reading through a file line by line

#

so you want it to become foobar "foo bar"

placid lotus
#

yeah

#

I was thinking something along the lines of piping it into sed

vast echo
#

why is that formatting not working

#

there we go

placid lotus
#

Yeah, that way I can avoid confusion

vast echo
#

is there an issue with doing "foobar" "foo bar"

#

because then wherever you read in your lines you just put quotes around that

placid lotus
#

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

vast echo
#

what's your code for reading in a line?

#

here are some ways to check for spaces

placid lotus
#

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

vast echo
#

oh you're not doing what I thought you were doing

placid lotus
#

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

vast echo
#

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

placid lotus
#

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

placid lotus
unkempt cloak
#

Anybody got MC server experience, I tried to assign more ram but its not working

scenic hamlet
#

probably not the channel but alright, what have you tried?

unkempt cloak
#

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

placid lotus
#

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

scenic hamlet
#

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

placid lotus
#

Just tested it , It's case sensitive.
The filename doesn't need to be next to the -jar option.

loud python
#

Yeah putting it after -jar would throw an error.
The correct way is it’s case sensitive

proud elk
#

Flutter is pretty good imo, wbu?

main night
#

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

proper gale
#

@main night they are idiots

scenic hamlet
#

lol

proud elk
#

how do you want to compile something without source code

#

compile magical backend out of thin air?

#

ahh just write code compiled yeah

half warren
#

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.

novel creek
#

So you're making the PhysX card for ray-tracing?

half warren
#

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

woven scroll
#

Depends if we're talking realistic in the engineering sense or the commercial sense

brazen vector
#

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!

vast echo
#

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?

nocturne galleon
#

it shows up next to certain things in my code but I don't know what it is

twin bolt
#

integration maybe?

cloud knot
cloud knot
nocturne galleon
#

aah thats it

#

thanks

pastel gull
#

@vast echo you wouldn't happen to be doing the GCSE OCR programming project would you?

#

wait sorry @brazen vector

brazen vector
#

Umm,

#

That may be correct.

pastel gull
#

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

pastel silo
#

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

cloud knot
#

@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

#

that said, you need to check up on usage rights even if you pick those

main night
pastel silo
#

anyone have experience with a store website?
i need help with mine

main night
#

which

nocturne galleon
#

@pastel silo are you using an ecommerce solution?

pastel silo
#

im not sure its a app through shpify

nocturne galleon
#

ah

#

then idk sry

peak venture
#

Anybody online ?

#

Guess not

#

Bye

viral stratus
#

typeof NaN == "number" // true
I love javascript

#
["10", "10", "10", "10", "10"].map(parseInt) // [10, NaN, 2, 3, 4]
ashen sky
#

It's traversing the keys for everything but the first item? πŸ˜›

scenic hamlet
#

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))

ashen sky
#

Makes sense then..

warm estuary
#

record yourself reading the code aloud and upload it to audible.com

nocturne galleon
worthy dirge
#

epic

nocturne galleon
#

Join afk

#

Plz join afk

fluid ruin
#

any1 here good with unity ??

hexed imp
#

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

fluid ruin
#

it was the scripting part, but i figured it out :3

fierce shoal
#

Anyone got experience with creating a rust (language) server? (REST API to be more specific)

earnest rivet
#

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 :/

ashen sky
#

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)

earnest rivet
#

Oooh, i haven't tried bitbucket yet, thanks! I'll give it a shot πŸ™‚

earnest rivet
#

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 πŸ™‚

ashen sky
#

@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?

earnest rivet
#

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.

ashen sky
#

That's a showstopper for us then, we don't want our code hosted by a 3rd party

earnest rivet
#

Yeah, that's the other thing. BitBucket allows for your own hosting, i really like having that possibility.