#development
1 messages · Page 38 of 1
Is your GPU Cuda compatible?
I don’t really mess around with GPU development so IDK if it can accomplish what you want it to do
@dreamy finch high res timers
take time at start and at end, subtract em and you'll have the duration
looking for some Oracle SQL help if anyone has any knowledge
@nocturne galleon Yeah it's cuda compatible, It's a GTX 660. Old, but at least had cuda for me to do this final project.
@stiff gull Thanks! I looked into it some more and figured out how to get the time for how long it took to run only the calculation of the matrix. The point is to show the time difference of execution on the GPU and CPU. Like that's what my lab report is on; The benefits of CUDA.
don't forget you have to run it multiple times
not do a single check
since that might influence timings due to start up costs and OS business etc
20 times each using the same matrices you think?
not even 20
Then average them?
Calculate the same matrix a million times?
yeah
Gotcha.
I'll have to make it output how long it took for each calculation to a file so I can import those times into excel and get the average of them.
but what you want to prevent is tests being skewed by for example its location in memory (maybe a slower bit of RAM) or the OS process getting a bit less time or more interrupts and all the micro-stuff
thats why you run a whole bunch of them
you could do that inside the program
Yeah, but I thought I'd make a graph too. My professor loves diagrams.
so for example if I were to bench my distance function:
auto timestart = time();
float dist = FLOAT_MAX;
int shortestPairIndex = numPairs;
for(int i = 0 ; i < numPairs; i++)
{
float distance = Distance(pairs[i]);
if(distance < dist)
{
dist = distance;
shortestPairIndex = i;
}
}
auto timeend = time();
this would be wrong
it only runs once
auto timestart = time();
for(int n = 0; n < 1000000; n++)
{
float dist = FLOAT_MAX;
int shortestPairIndex = numPairs;
for(int i = 0 ; i < numPairs; i++)
{
float distance = Distance(pairs[i]);
if(distance < dist)
{
dist = distance;
shortestPairIndex = i;
}
}
}
auto timeend = time();
this would be better
then you div the end result by a million (operations) and you get the time per op
I haven't tested this running on my GPU yet.
Only CPU for now to get the code working
Also, I have to go get lunch with my dad and brother, so I'll be back in a bit.
But thanks for the advice!
That's what I thought. Nice!
Yep. Exactly what I thought I was going to have to do.
I'll see you in a bit. I have to go for a bit.
Thanks, though!
@dreamy finch perhaps a good idea to use pastebin and to put your thoughts in a single-message. Bot tends to smite people that send too many messages of short length in a short period of time.
What do you mean?
How can I run an SH script on the Python interpreter after SSH login? What it does is after SSH login, it checks who the private key belongs to on the SQL database and then checks if the account associated with it is currently suspended or is denied access to SSH, and if so it kills the connection process
Oh, jeez. It got rid of my code I posted here, huh...
subprocess.call(["sh", <instert path to script as string here>])``` @jade nova
@stiff gull Do you know anything about getting code to run on CUDA? If so, would you mind helping me figure out where these pragmas go so that OpenACC works properly? You seem to know more than me on this.
pff I've done one CUDA project really and know nothing about OpenACC
all I know is you gotta init CUDA, write a cuda kernel (CUDA code), compile it and run it
I used a cuda template which was made for CUDA 8 which is outdated now
anyhow im off to sleep now so can't really help much more
Gotcha. No Worries I just messaged my professor about it.
@dreamy finch i know how to use OpenCL.
also, to get a proper benchmark, using the same data multiple times is not a good idea.
GPUs use prefetch even more heavily than CPUs do, and that could give the GPU even more of an advantage over the CPU.
Oh, PhysX is now open source: https://blogs.nvidia.com/blog/2018/12/03/physx-high-fidelity-open-source/
wut
its always been open source
just under contract
which is as easy as signing up for nvidia gameworks
So now it goes to BSD-3 And not only for games.
Nvidia to the rescue
Hello!
Does somebody here know how to find offsests using a decompiler?
Finally close to my office being totally set up... Still need some major cable management work though lmao. And a third 1440p monitor...
@glad terrace specs?
Built it over a year ago but... i7-7700k, ASUS STRIX GTX 1080, 16GB ram, 256GB Boot SSD, 1TB HD, 1TB SSD, and a 500GB m.2 NVMe (both of the last 2 added recently), Liquid Cooled CPU and... ASUS Maximus IX MB.
Bought the 34" 1440p alienware ultrawide during Black Friday along with the NVMe drive and the, Electric Sit/Stand Desk (VertDesk V3), the standing pad and the monitor arms.
About as close to no wires showing as possible =P
Damn the video card power being on the top...... Lol
@glad terrace solution to not not showing wires, show off some good ass cables.
Totally not sponsored by cablemod
A really interesting story which also explain a lot about Google technical history which indirectly changed a lot of things in programming.
https://www.newyorker.com/magazine/2018/12/10/the-friendship-that-made-google-huge
@proper gale Meh, It's not enough of an issue for one cable to justify that. Especially since you cant see it unless you're looking for it when the side panel is on.
@ionic hull I wish, I paid for those fuckers.
@proper gale I have stock cables and I don't even care if they are organized, as long as the PC works
but, but
i have a custom loop, so the cables were the least of my expenses.
@ionic hull
any c# developers here? i have an issue where i cant properly update a winforms
it doesnt seem to be redrawing correctly, regardless if i call Form.Refresh()
(that white box is supposed to be a label)
its an empty form, just added a label, went into the designer cs and changed it to public
form is under MCClone/UI
for opening the window, see MCClone/MainWindow.cs:26 and MCClone/MainWindow.cs:163
@last ingot @peak mica
@nova moth It's pretty straight forward.
Use IDA to decompile the process, look for strings and names hinting at locations of functions using the offsets, you will likely see the pointers + offsets used right there.
Failing that look at that location in a debugger (CheatEngine is easy to learn), set a breakpoint, let it break and follow through the ASM if you want to be thorough.
If the process is written in some higher level language though there is almost always better ways to tackle a problem such as reflection for C# etc. and just modify the ILASM. <- almost any unity game for example. Great for modding.
@solid horizon Without looking into it too much it looks like you are creating STA UI within an MTA model. This is probably your issue, also the MTA attribute doesn't have an affect on any other method than Main according to the MSDN documentation.
Someone else may have more insight for you. Hope that helps.
You will need to set it explicitly with the [STAThread] attribute as C# uses the MTA model by default I believe. (Unlike VB.NET)
Might be some race condition or blocking that I can't see but I would put my money on this being the issue.
Just coded a college student simulator in c++
struct collegeStudent
{
bool alive = true;
const bool degree = false; //to make sure you never graduate
int assignments = 0;
int gpa = 4.0;
int happiness = 100;
int sanity = 100;
int avgHrsOfSleep = 8;
int debt = 0;
}
int main()
{
struct collegeStudent newFreshman;
int financialAid = 24000;
for(money = financialAid, money > -36000, money--)
{
newFreshman.assignments++; //Get a shit ton of homework
newFreshman.happiness = -.01 * newFreshman.assignments; //Get sad with more assignments
newFreshman.avgHrsOfSleep = newFreshman.avgHrsOfSleep * (newFreshman.assignments/10000); //Loose sleep as you reach your assignment threshold
newFreshman.sanity = avgHrsOfSleep/8 //Loose touch with reality the less sleep you get
newFreshman.gpa = (sanity/100) * 4 //Your GPA is only as good as the health of your brain
}
do
{
newFreshman.debt++;
if(collegeStudent.gpa <= -7)
{
break; //just drop out
}
} while(newFreshman.degree == false); //wasn't newFreshman.degree a const tho...
newFreshman.alive = false;
}
looks more like c than c++ tbh
this is why I recommend using if(someBool) and if(!someBool)
instead of if(someBool == true) and if(someBool == false)
to avoid those typos like accidentally using the assignment operator, and it is more concise.
holy fuck I forgot the ==
lmao there's like no reason why I'd do that...
the language I knew before c++ did == as well
typos can happen to anyone
WPF, WinForms, and WinUI will be open-sourced by MS under the MIT license:
https://blogs.windows.com/buildingapps/2018/12/04/announcing-open-source-of-wpf-windows-forms-and-winui-at-microsoft-connect-2018/
At Build 2018, I outlined our approach to helping you be more productive when developing apps, including the introduction of .NET Core 3.0. We also started decoupling many parts of the Windows development platform, so you can adopt technologies incrementally. Today at Microso...
If I'm reading that correctly, this is dope af.
hm interesting
struct collegeStudent newFreshman; wut
not even sure what it does but since collegeStudent is already defined, you don't need to put struct in front of it
@fiery onyx
getOpposite twice? I'm not familliar with their code but... Wouldn't that be the same direction it started with? lmao
^
they may have went like "oh heres some code, i want it opposite direction of player" and some other dev went like "lets make that the opposite"
idk but sounds possible
Nah I think during testing they went like, "Aand.. I'll probably need the opposite of this" then tested it: "Oh no the opposite of that should work"
Who do you mean by we?
The server i play on, and a couple of other people
Someone from there just made a deobfuscator for 1.13 xd
We also have a bad universal MC one
So works in any MC version
Doesnt work outside MC tho
But those mappings are shit
Ah yeah, I remember seeing that stuff
If I cared enough about why I'd ask the devs but its pretty trivial thing to disturb them for (I'm a moderator on the minecraft bug tracker)
xD
Ye ik
We also do have the mappings for 1.13 but youre not allowed to distribute them so... xD
The offical ones that is
They give them to anyone who asks xD
Yeah, we have access to similar tools
I mean its not just you xD
Ours work with any new versions immediately, even the snapshots
Ofc
Mainly we use them for matching stack traces in crash reports to eliminate duplicate reports
well, you are clearly logged in, so you must have authenticated at the very least?
its not authenticated to my discord acc
well, then they could still have built that based on data they got from other accounts they have authorized.
i dont think theres anyone with this many mutual servers to me
so unless you have some server that only this very account is on that shows up in this list I'd very much assume that's how they got the data^^
though i dont think api users can see server members without logging in as bot?
i dont think the api has a way of tellign you the member list of a server as long as you dont log in as bot
I have several questions regarding webdeveloping in html/css and jquery. anyone here to help?
well here is my question: i got a pretty basic html site. now i wanna load content dynamically into the div, for example that the user clicks on the navbar links. i tought about something like this: https://www.jqueryscript.net/other/Dynamically-Load-Content-Into-A-Container-with-jQuery.html
so far no question?
(very confused as to how that relates)
depends on the dynamic content, my friend^^
well, my question is like: is there any other elegant way or is this pretty good?
also, you rarely need jquery.
dynamic content is basically plain text/html.. nothing fancy
@gentle summit it's fine, but use a recent version of jquery at the very least.
(I'd presonally not load that stuff in dynamically and instead just show/hide it if I wanted to keep it on one page, but w/e)
no.
you can use jquery with static html files served by apache/nginx/whatever juuuust fiine.
and vanilla JS too^^
I don't think about how your site works, sorry.
(I've also tried to not assume gender, just btw)
my point remeains, no need for a backend for what they're asking to do.
will they end up needing a backend for other reasons? Possibly, but not what they asked about.
dynamic content = client side modifications.
at least from how they described it.
who said there has to be an API backend if they want to load some HTML in? (also, nice tie fighter ascii art 😉 )
(and yes, they specified they wanted to load in html)
@gentle summit to loop back to your question, you can also do this in a couple of vanilla JS lines assuming you have an iframe in your page. And as I alluded to, there's nicer ways to do such things these days (SPAs, history API etc). ```js
document.addEventListener('click', function(e) {
if(e.target.matches('a')) {
document.querySelector('iframe').href = e.target.href;
}
}, true);
@gentle summit hm, actually I wonder if target navigation works with iframes like in the good old frameset days, but I don't care enough to look into that.
hmm im looking into that.
just for clarification, this is my current site in buildup. (no fancy stuff, just information) https://thurrax.evonix.eu/
(just fyi: navbar will be added in next update)
@gentle summit you may want to avoid this dynamic navigation stuff if you want to be able to link to individual subpages unless you want to write code for that.
(history API or using URL hashes)
(or use a potentially js free approach with hashes and toggling visibility 😉 )
i once had some similar way but not that dynamic 😄 i just wanted one index file and "semi-dynamic" content.
<?php
if(empty($_REQUEST["s"])){$s = "home";}
else{$s = $_REQUEST["s"];}
if(file_exists("./sites/".$s.".php"))
{include("./sites/".$s.".php");}
else{include("./sites/home.php");}
?>
and site was like: http://mysite.gov/index.php?s=home
dunno if that is pretty but it worked
nice way to let me read any php file on your server 😉
well, usually the point isn't to be able to include any php file, but I know what you mean 😃
(btw. this is how to do css only "navigation" with toggling visibility https://www.w3.org/Style/Examples/007/target.en.html and if you want a challenge, try to do it without using z-index)
that solution requires whole content in the div right?
yes, that means you load everything in a single html file
hmm. i will try to use that.
can someone help me - i need them to test my program and try to essentially break it,
explanation: i made a youtube to .mp4/ .mp3 converter. i would like others to see if they can break the code - as no code is perfect. i prefer not sharing the source code (cause this took days to make it to the stage it is, even though it is a simple library of videolib and ffmpeg but non the less), so anyone?
oof. now i tried abit jquery and locally it works but i uploaded it onto the webserver and now it doesnt work 😄 wut
^forget that.. stupid cloudflare cached my css..
@nocturne galleon if it's not a paid app there's no reason to not share the source
Well, guess that changes things then.
Just saying that because all you're doing by hiding the source is making it look like there's something to hide (a virus?)
especially if its just a small project glueing some libs together
^
In this case yes, there is no reason to hide the source, but that is certainly not always the case for all not-for-profit projects.
Anything that has security measures IMO should not be public otherwise those measures can be bypassed without risk of detection or reversed (more easily) to gain access to information for malicious purposes.
(gaming, anti-malware, security, password managers to name a few off the top of my head).
If your security program is well-made having the source code out would only make it more secure.
Yes I agree, in some cases with the key word being well-made or rather, having a security-focused team leading the development.
To be honest... gluing some libraries together isn't anything special. I could make exactly what you described in ~30 minutes w/ NodeJS.
Sharing the source doesn't hurt, not to mention that it gives the opportunity for improvements.
@gentle summit thanks for your password file 😃 your.php?s=../../../../../../../../../../../../etc/passwd
he knows please move on
the worst things were stuff with SQL injection with null characters i seen
(i mean putting %00 in URL)
@cloud knot its shared hosting so i don't care
@cloud knot That's literally only user accounts, and maybe hashed passwords. Even with that file, you have nothing.
Sanitize the input is one quick method.
Ensure the input is only a-Z0-9 and sanitize everything else. Otherwise I'm not familiar with Python so idk how you would even approach prepared statements much like PDO.
https://stackoverflow.com/questions/15856604/django-mysql-prepared-statements
@last ingot that was 2004 and codebase i took over 😃
a horrible web game. stopped helping them a decade ago too 😃
but at least i fixed them the crazy security bugs
has somebody good knowledge of programming on java basis?
no
it is forbidden to get good at java.
@last ingot i dont see what is sooooooo bad about Java itself
^ yep and comparing it to any crappy esoteric or interpreted language will speak volumes to this
On that note look at this gem
//pikalang hello world - https://esolangs.org/wiki/Pikalang
pi pi pi pi pi pi pi pi pi pi pika pipi pi pi pi pi pi pi pi pipi pi pi
pi pi pi pi pi pi pi pi pipi pi pi pi pipi pi pichu pichu pichu pichu ka
chu pipi pi pi pikachu pipi pi pikachu pi pi pi pi pi pi pi pikachu
pikachu pi pi pi pikachu pipi pi pi pikachu pichu pichu pi pi pi pi pi
pi pi pi pi pi pi pi pi pi pi pikachu pipi pikachu pi pi pi pikachu ka
ka ka ka ka ka pikachu ka ka ka ka ka ka ka ka pikachu pipi pi pikachu
pipi pikachu
@winged obsidian dont forget about BrainFuck ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
I'm 100% sure pikalang is just brainfuck but + replaced by pi, [ replaced by pika, > replaced by pipi etc..
just by looking at it I can see the pattern
ah.. there we go:
ofc it is.
Better compatibility?
There must be a reason that big companies separate everything 🙄
@proper gale you missed malbolge ```
hello world in malbolge:
(=<$9]7<5YXz7wT.3, +O/o'K%$H"'~D|#z@b= {^Lx8%$Xmrkpohm-kN
i;gsedcba`_^][ZYXW
VUTSRQPONMLKJIHGFED
CBA@?>=<;:9876543s+
O<oLm
jesus fuck
And here's 99 bottles of beer on the wall: https://pastebin.com/9aeWznRm
APL is worse
I don't think Discord even supports the full char set
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
lads
big issue here
Im learning java at school and im using IntelliJ while everyone else is using Netbeans
Were now on Jframes and IDEA doesnt have Jframes
any workaround?
huh.. of course intellij can do stuff like that, its just an IDE, see https://www.jetbrains.com/help/idea/gui-designer-basics.html
Also, Im setting up Netbeans 8.2 on a mac just in case. It for some reason refuses to work
oh god I have no idea how this GUI designer works
I'm trying to use weweave commerce with docker.
But on step 4 it says:
Use a cloud native edge router like Traefik (or nginx or haproxy):
Route all incoming requests to /api/ to the backend.
Route all other incoming requests to the frontend.
How can I route that via Traefik? There is no example in the docs.
Please do @GameMaster2030 🎄#3358 when you answer me
@kind portal IDEA has jframes, never used it but the features are there
Need to vent for a moment. Codeveloper is acting senior despite betraying the fact that he doesn’t know what he’s talking about, and has management support. He’s pushing us to use a shit ORM because he sees a little bit of raw SQL and panics—essentially, he wants to use the ORM and for me to not use SQL because he doesn’t know SQL and doesn’t want to learn.
Never did jframe. did stages and scenes
@upbeat folio thats now how this works, thats not how any of this works.
Doesn’t help matters that he just unwrote a month’s worth of code because the return was formatted incorrectly, because he never bothered to tell me he’d established the format to meet another team’s needs, and said nothing despite me showing the change off repeatedly on scrum and demo.
Been with this company for seven years and this is the first time I’ve considered quitting.
Manager is on his side, because he’s local and I’m remote.
ORMs have their places, but not always. Also imho you can't judge how good an ORM is unless you can understand the SQL it produces. If you can't understand the SQL its producing you'd have no hope in fixing issues
At least you don't come in contact with me
https://cdn.discordapp.com/attachments/347254691966615552/522188154250199043/unknown.png
That looks pretty clean, but my poor eyes can't read the blue comments 😂
compare it the python (or insert any higher level language here) equivalent though and it looks truely dreadful
I wasn't even using smart pointers
Oh sure, but using c isn't used for its simplicity 😃
Idk... I've just been conflicted lately. I've always been super elite to myself not allowing myself to have any fun. I always limited myself to C++ no matter what. And up until recently I even tried to only use native windows API calls.
So I rarely code
I will go without coding for months and then do a small project
And I just feel like even though I've been trying to learn for years and years I just haven't gotten very far
I always had an aversion for libraries for some reason.
And higher level languages for that matter
I agree, use what is sensible, avoiding libs really isn't practical but don't feel like you need to use a lib for everything (cough JS cough)
I agree to some extent, but I prefer using typescript
I even screwed up getting a programming summer job because I was too afraid to get back to them when they asked me to do python. I was too afraid that I would be too slow since I don't have much experience with python.
I'd never do backend JS though, recipe for disaster when you can use strongly typed languages that can be properly portable
I'm 20
I'm a c# dev by trade, so tend to go for netcore stuff
I haven't done any work that involves a database.
At least not beyond the very basics
not much to look at
I was about to say lol
sigh.. I feel its time to bring out http://howfuckedismydatabase.com/ 😄
Evaluate how fucked your database is with this handy website.
Look at the MSSQL one..
https://www.youtube.com/watch?v=rOn6UppYUyo
https://www.youtube.com/watch?v=IErS--_Hn2g
https://www.youtube.com/watch?v=IluuAlO5EZE
https://www.youtube.com/watch?v=kLD2ZfZr5Vk
https://www.youtube.com/watch?v=vT-dBGGdD00
https://www.youtube.com/watch?v=QedXnITbyVg
https://www.youtube.com/watch?v=7OpOsV2xX-Y
https://www.youtube.com/watch?v=NwjbC7nOb5M
These are the highlights of what I've achieved in ~5 years
Pssssh
I mean I'll take it as a compliment
The code is fucked
I went through so many different graphics API's
First GDI
Then Direct2D
then something else
I don't even remember them all
Microsoft has loads of graphics API's
And I kept reusing the same code
With preprocessor directives to adapt it
well I'm mixing syntaxes basically
This may give you an idea of how fucked it is
Those are all GDI functions
That I've "hooked"
into a different graphics API
I don't even remember what half of this does
I had a single buffer that I was writing to, and if it ran out at the end it would copy the remainder to the start of the buffer
I have long abandoned this project
I'm sorry I'm just a bit stressed and insecure. I didn't realise how stressed I really am until I started to talk these things over
giant switch statements for win32 windows :/
My situation is more complicated and I'm not going to bother people with it here.
Thanks for listening though
I need to see a therapist for real...
I use linux now as my main OS so all the shit I learned about win32, winsocks, COM etc, etc is all useless
The most problems I've had switching involved NVIDIA drivers in one way or another. Most other things were pretty smooth
Python has zero multi-threading support?
goeicool theres a library that does it.
Its worth if you want multithreading why wouldnt it be
its pretty simple to use
Yeh no multithreading didn't sound right
Multithreading on windows 😅
If you don't use the c++11 or whatever thread functions in the standard library
HANDLE thread =CreateThread(...
You'd think though that even with multiple instances you still have to lock at some point. I guess mySQL would handle all the locking internally
If you’re going MySQL, make sure your tables are using InnoDB for row locking, unless you have some compelling reason to use table locks with MyISAM
raytracing on Vega 8 is a... cinematic experience to say the least 
hi im back with questions about programming for school? we moved on to java ish stuff, how do i add comments in my code? (is there a way like <-- in html)
@brazen sluice Try this: https://www.tutorialspoint.com/java/java_documentation.htm
Java Documentation Comments - Learn Java in simple and easy steps starting from basic to advanced concepts with examples including Java Syntax Object Oriented Language, Methods, Overriding, Inheritance, Polymorphism, Interfaces, Packages, Collections, Networking, Multithreadi...
You're welcome! 😃
When I took Java, the instructor told us that after the second homework assignment that he'd take off quite a few points if we didn't have javadoc on everything in the code
we have to program in (i think java) with mindstrom bricx stuff
this is to make it drive forward and turn 180
Not sure the IDE, but I do know that IntelliJ has some shortcuts for making the blank templates for your code. Sadly I don't remember those off hand
I'll have to find my flash drive with some of those code pieces
aah yeah the thingy medjiging for the shortcut to the other thingey
im not very code name savy
No worries.
http://bricxcc.sourceforge.net/ this is the stuff we work with
on an unrelated note, their site is atrocious
Indeed
thanks for the help, ill go try it out now
Happy to help 👍🏻
Could someone maybe help me figure out how to do something in Python?
this is the thing I have to do
Write a program that takes a string of numbers from the user and displays the first occurrence of that value in pi. For instance "42" occurs at position 92. It should at a minimum work for this value
and I can't figure the thing out to save my life lol
Like I can't figure out how I'm sopose to write this I know I need to import math as well as use math.pi have an input and probably a loop but other than that I'm lost
Yeah
It's just right now I'm so scatter brained and stressed out due to finals
Ok
Thats all I have to do?
Oh sorry
I'll prob send you the source after to see if it's right
I'm still lost rn but I'm going to try to figure this out
yes?
just gotta fix something in it lol
ah
yeah
it's just i'm so stressed out rn due to other finals
yeah
yeah
yeah i'm just starting Python
this is just stressful when you have to write 21 paragraphs by tomorrow
So @last ingot I got the code somewhat working haha
only issue is now that it doesn't get the positions correct xD
anyone have any ideas
import math
value = math.pi
Pi = str(value)
number = input("Enter your number: ")
Pi2 = Pi.split(str(number))[0]
Pi3 = Pi.split(Pi2)[1]
PiL = len(Pi2)
NL = len(number)
PiP = PiL - NL
print("Pi position:",str(PiP))
@oak parrot if(string == "42") return 92;
It said it at bare minimum needed to work for that value
Meets requirements
T'was a joke anyway
who the hell wants to help out here
i got a website im working on
and i want to be able to hit a Button to change the HTML Nav Bar Class
<nav class="white">
i was to hit a button so it changes to
<nav class="black">
Class list is available in modern browsers (>IE10)
There is plenty of ways to do it, this is one.
<nav class="white" id="navBar">
...
<button onclick="toggleNavBarClass()">Toggle Nav Bar Class</button>
function toggleNavBarClass() {
const navBar = document.getElementById("navBar");
navBar.classList.toggle("white");
navBar.classList.toggle("black");
}
or use addEventListener because inline scripts D:
For Nintendo Switch owners into homebrew:
In case anyone missed it Atmosphere now supports firmware 6.2.0.
Nintendo's "unhackable" firmware that was beat in ~4 days by motezazer.
Anyone interested should check it out, there is some great libraries for js, python, c++, etc. for developing homebrew for the Switch. And there is some awesome projects by the community to check out.
Sorry if I just randomly started asking things out of the blue
But let's suppose that I'm capable of designing a web page and so forth, but I want to set up a system behind it. For example, like sending a person an email if they put their email in the "Subscription" box
Or like a "Member login" thing if you want to be able to use the website to it's full potential
@bronze crater The common term is backend. You should probably just do some research on it. Theres a thousand ways to do it. Probably should find some tutorials/videos on Full Stack development.
Alright thank you @glad terrace
I've already done research by the time you got to me and i'm currently trying something
Are you talking about League?
lol
@last ingot I may actually check out that django tut. It will give me a reason to learn python lol
@last ingot i dont know who you are, but i will find you, and i will kill you
collecting all the data do doo lol
the reference is what im complaining about
Do you guys have any Discord Bot ideas? I'm really bored and have like no creative sense. So if you have a good idea and it doesn't already exist I would love to hear it lol
doesnt matter
i just want ideas
Well I already have my main discord bot now made in d.js
how come?
ermmm, probably not, im used to the djs api
someone literally told me to basically exactly that in the dapi server ksksksks
Can I just get a normal idea lul
hhhh
I just want a normal idea ples.
-_-
@last ingot https://js.tensorflow.org/api/latest/
didnt say it was common, but it exists.
there is Python, JS, C++, Java, Go, Swift, (3rd party now) C#, Haskell, Julia, Ruby, Rust, and Scala
im aware of that, never contensted that python is the dominant language.
simply that other language bindings, exist
good, YTR2018 is #1 now.
its at 11.1 million now.
well, last i checked a few hours ago it was
11.48
83.8%
they did a bad, take the damn backlash
kind of a silly question, but do professional programmers just learn the syntax and control structures of the language they are using plus any libraries they need for the program they are making? or is there something else they need to learn as well?
@nocturne galleon i mean, the syntax, control structures, and libraries for a language basically is that language, so to literally answer the question, mostly yes.
the hard part to learn is the problem solving
oooh ok
a coding language is just a way to express a solution to a problem.
i could write code that solved the same problem in 4 languages
so if I know how to use a language and I learn the libraries I need for a program im making thats all I need to 'learn' aside from the problem solving?
tldr: yes.
cool, thanks
that is a hell of a lot easier said than done though.
thats probably why it almost seemed too simple
because I was thinking "theres no way thats all there is to programming"
saying thats all there is to programming is similar to saying that all there is to:
driving is watching the road, turning the wheel, and pressing the pedals
painting is mixing paint and putting it on a canvas
using a computer is pressing the correct buttons
its not wrong, but it doesnt really explain everything.
there is a hell of a lot more to it, as there is with everything
is the 'more to it' the complexity of said problem solving?
the problem solving is a good section of it
but there is also knowing how to use your IDE
like the built in tools etc?
basically, yes.
making code both maintainable and fast.
choosing the correct language and library for the job.
etc
aaah ok
so you choose the language based on which one is made for that sort of purpose?
most are general purpose, soooo, no not really.
it usually comes down to ease of writing and speed
ok
would c++ be a faster but generally harder to write language?
this is rule of thumb, and is not true in all cases.
C++ is a fast but absurdly hard language.
dm me what you said, i could see that you pinged me.
i didn't specify IDE
i guess i specified Integrated, but you do you and use a non integrated environment.
and? how is that bad?
its quite nice to have an IDE do some of the work for you.
"dm me what you said, i could see that you pinged me." are you talking to me there?
no.
also, the syntax highlighting and project awareness of an IDE, very, very, nice.
i use CLion for C++
i dont even bother to target mac
why cant windows error like Linux?
also, WTH GCC, give me better errors like Clang does.
and CLion would have caught those type errors for you
afaik, yes
what specifically are you looking at?
i am
Clion has regex search
double shift you can search symbols, etc.
yup, double shift is search everywhere
and you can include non-project files.
yes
i use it for both C++ and Python personally
C++, Java, Python, Lua
and somewhere GLSL and OpenCL C
of which, Clion supports all but Java
Lua has an easily integratable interpreter
how is Java bad?
people hate on it, i fail to see its fatal flaws.
its not, particularly.
i dont know.
i can talk about things Java does well compared to C++ and Python, as i have experience with those languages.
How about the fact that JavaScript doesn't have any type support? Or that [] == 0 is true?
Or that although the async nature is super good it's harder for people to get their head around.
in order:
Generics is a problem
static, nuff said
problem with teaching, not the language
this is annoying, and thats about it
operator overloading is both good and bad
this could be solved at the compiler/vm level
again, compiler/vm level
same as other languages,
haven't use the lib
no other language is any better
i wont say its good, but its not all that bad either
C
C is very close to a subset of C++
C++ was originally called C with classes
@last ingot I know that it was to your comment about dart and js beating It
Plus I thought we were just bashing on design flaws. :O
C++ is an "extension" to C
no, Objective-C is
I use node at work, inside aws lambdas it's super good.
if you want to bash on design flaws, i could go on for quite a while about C++
Didn't say they are equal. 😄
and mostly the libraries
hello
i think its fair to include the stl as part of the language.
and the language (no libs) has its flaws aswell
@last ingot python docs are great but so is c#. Microsoft has put a tonne of resources into docs over recent years
the standard library for a language, they all have them, i think its fair to bundle them.
i wish docs were good for C++
We have .net core.
they really aren't
you mean the iterator loops?
index loops are still faster, no?
im using the C++2a CLang 8 lib, soooo
and that depends on impl.
i have some of the repos opened up on gitlab.
gitlab, not github.
that they are
make one what?
just download gitlab and run it yourself
correct link, https://about.gitlab.com/pricing/#self-managed
Anyone here good at basic java? I need someone to help me look over my program
@nocturne galleon i am
@proper gale I have this fairly simple loan amortization java project for my university, but my output text file is not computing the math right for some reason. Do you mind taking a look?
the output file jumbles up the monthly payment, principle and interest payments.
@proper gale Here is the output when I input a $10000 loan at 5.9% for 1 year
System.exit(0); <- dont use this
this looks completely seperate``` }
while (again == 'Y' || again == 'y');```
how is the intrest suposted to compound?
(man, tolower/uppercase is a magic transform)
least of issues
i would have expected to use the continual compound, but i dont see the pert formula anywhere
oh, I know, it's a symptom for a whole class of things to come
@proper gale the interest rate is fixed, so it should just calculate the percent of what is left of the loan after each payment. and ya i took out the system.exit(0);
figure out the math first, then try and do it in java.
Formula is:
investment * ( 1 + ( rate_grow /100) ) ^ num_years```
If not mistaken
Oh wait
I misunderstood
I thought it was a *how much money I will have in my bank with interest in x years"
Didn't read fully the text
@Nick_Craver pls don't ever wipe the StackOverflow databases
the dev ecosystem would crumble
and I'd be out of a job
323
gtlst that looks like compound interest if I paid attention in maths, from what I read here tgmackel16 is trying to do simple interest
@last ingot you can try it free for 30 days, and Imho, yes.
For python, yes
There is the all product pack
And make sure you are looking at the personal license, unless you are having work pay for it.
Get a student license
Student is all product
17
It's not that hard
Ofc
Yup
Yes
I did
@nocturne galleon ye I know, I realized it after I wrote that shit down :(
And too lazy to delete
@last ingot they usually respond in under 24 hours.
Done it twice, both times they responded in under 24 hours
Consider, it costs them nothing to let you use the software, and if you like it you will buy it later
I am one such person
what is it?
@nocturne galleon what is what?
the thing mrmetech is looking at buying
if I wanna have a file that has all my functions for CRUD for example... in Express where should I place those?
@nocturne galleon the IMO best suite of IDEs available.
in that specific case, he was looking at CLion, the C/C++ one.
so is IDEA
i fail to see your point here.
then why the fuck you talkin'?
aah ok
@last ingot Android studio is built of the idea community platform, same as intellij idea (first one) and pycharm community. Rest are professional/ultimate versions.
I pay for Jetbrains all products pack
I love their software
I use Webstorm at work and they said they would pay for it but... I want to own it for myself. Not them lol
question, what are some good ways to host node.js applications online? i am just getting started in node.js and am interested in how one can host node scripts online for all to access
I’m so glad I get Jetbrains EDU pack. Although my University is super broken so when it comes time to reauthenticate my student status it is a super pain in the ass
Anyone care to help with something being extremely annoying?
RewriteCond %{REQUEST_FILENAME}.png !-f
RewriteCond image-dir/%{REQUEST_FILENAME}.png -f
RewriteRule (.*) image-dir/$1.png [L]
Basically, if the image (image.png) doesn't exist in https://website.com/'s root, check https://website.com/image-dir/ for it. If it's there, show the image as if it were served from the main site (https://website.com/image.png).
Hastily trying to fix my screenshot links now that Discord introduced a new bug that no one cares to acknowledge, so I'm forced to change a system that's worked flawlessly for years on the account that their shit's borked.
It's an htaccess file.
@last ingot As i'm serving content from a sub-directory, it's the only way to possibly achieve such a thing without a gaping security issue.
I hate dealing with these files because they're buggy af half the time.
At least the main placeholder page works, and the music bot always works
https://m.dooleylabs.com/
I use Cloudflare for that, but memcached and other configurations with a caching VM would work in your case.
Other thing is, the server handles the request so quickly, I'm not able to see if the rule's remotely doing anything, or if the 404 page is taking everything over and ignoring the htaccess file.
Boom @tropic grail -- hides the SubDir too. Also, Document_Root may not be needed, but it's what I tested it with. Removing it & the / before pics still works.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/pics/$1 [L,NC]
Tested on a cPanel server running Apache on top of CloudLinux. (and it's not even good hosting either - it's an old HostGator account I still have.... for some stupid reason.)
My reaction that it works 👀 https://giphy.com/gifs/reactionseditor-wtf-mind-blown-l0IypeKl9NJhPFMrK
Ummm... is that a good reaction because it works, or... did I make your server catch fire?
Both.
So in the way you provided it, it works, but only for the images in the sub-dir, which is great, but everything outside the image dir becomes a 500 error, and for some reason, it's recursing into itself to find a non-existant favicon. @limpid reef
@limpid reef I'd like to be able to only catch image files from this directory as long as they're in the first position of the URL, which works in your example, but bricks the rest, lol. So far, yours does more than mine did, but sets other stuff aflame 
😄 hey now, i didn't say my solutions are perfect. 😛 do you have a RewriteBase specified? I forgot about that, just a moment. ... oh wait, i dont have one either, but I can access files inside my test directory just fine so....
png, jpg, jpeg, bmp, gif, webp, webm << those are the only extensions I need, others aren't needed, and favicon.png or ico can be ignored.
just a sec, gonna finish this overwatch game then look
Tested it alone in the file, but still sets the rest on fire.
That's what I'm thinking yeah.
Testing now, but seems to work with some half-assed regex I tossed in.
Yeah, I understand the concept of RegEx but am definitely not an expert. This seems to work in my test case. Leaves my other files alone.
RewriteRule ^(.*\.(jpe?g|gif|png|txt))$ pics/$1 [L,NC]
👀 I'm tired, lol.
So if I try a file that doesn't exist, it goes into a loop instead of redirecting to a 404.
@limpid reef @deep scarab
i've no clue what that language is
What do you mean?
that's apache htaccess with some regexp^^
well, you could avoid the loop by telling it not to redirect in the /pics subfolder
This makes sure the file actually exists, otherwise 404 or whatever your server is configured to do. Give it a go Dooley, then I'ma sleep.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond pics/%{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(jpe?g|gif|png|txt))$ pics/$1 [L,NC]
or that
@limpid reef I swapped your [L] for [END].
lol i totally forgot to re-add that.... oops
END is only for the last line of the file though.
I've popped your tweak in there just in case since it's a smart thing to add, but I'm happy that the old links redirect into the new ones at least, lol. It's all about simplicity.
^ Weirdly, Discord won't let the old links function anymore, but the new ones do. New "features," eh? https://dooleylabs.com/nerd3x.png
I'm getting a 404 error page ... a green custom one for both of those links.
yuppers, looks good to me now. 😃 silly discord, trix are for wumpus.
Click the image that didn't embed, then click Open Original. Look at the link. They're throwing in an extra / for no real reason. Wtf!?
oh wait hold on
See this shit? https://dooleylabs.com/tf7l5c.png
I see that yeah, the poop failed embed has the extra slash
Useless. Utterly useless. Hate it when my stuff gets broken by poorly-tested updates. It's not even about the banana. ANY query string breaks. It's bugged af.

c#:
i get error codes as string. format is like: IM_ERROR_PLEASE_HELP 24 0 -1
can i check that string for that number code like errormsg.Contains("24 0 -1"); or does it doesnt work? the text at the beginning is not for use and can change with error type. only important part is the numberic code to check
Why is my output Domain Not Pointed instead of Successful Point?
$bar = 'ns4.domain.com';
if ($foo !== 'ns3.domain.com' || $foo !== 'ns4.domain.com') {
echo ' <input type="hidden" name = "firstns" value = "'.$foo.'">';
die ('<i class="fa fa-times-circle" aria-hidden="true"></i> Domain Not Pointed');
}
elseif ($bar !== 'ns4.domain.com' || $bar !== 'ns3.domain.com') {
echo ' <input type="hidden" name = "secondns" value = "'.$bar.'">';
die ('<i class="fa fa-times-circle" aria-hidden="true"></i> Domain Not Pointed');
}
else {
echo "Successful point.";
}```
I mean, they both pass their respective conditions, since they are one of the two that they shouldn't be, so the if's true.
i wouldn't plug it if it wasn't good
may not be for everybody, but it is still a good IDE platform.
i use gitkraken because it has better submodule support, but other than that the integrated VCS support is great.
i use gitlab, but it supports both
y is my name this
Ok so
Im using netbeans 9
trying to install a plugin
the only file i found is a zip, and netbeans wants a nbm package
the zip doesnt have an nbm inside
this is what i see
nvm lmao im dumb
for those having the same issue: this theme was actually a code theme thing, which is imported as a zip at the fonts tab
i recommend the sublime dark or visual studio 2012 ones
@last ingot found a new keybind, press ctrl+shift+r for the missing features of the N++ replace i didnt find.
Hey guys..
Anybody know a good place where I can start learning solidity?
Yeah.. I'm an electrical engineer with some programming background..
Yeah, but I need a good resource on the Internet for learning it as most of the ones I found couldn't really explain it that well..
Guess I should really get into the habit of seriously reading the docs.. 😉
@last ingot Thanks though..
In my case, I guess, it's not the language itself that bothers me but finding the answer that why should blockchain be used for an app (dapp in this case) when the same thing can be done better via another language..
Excluding the security and other applications of blockchain though..
You can't do much about the stuff uploaded on the blockchain but the website where the dapp is uploaded is vulnerable..
So it's not exactly "decentralised"..
@last ingot What do you mostly code in and for what purpose if you don't mind me asking..
So you do it just for fun and not, like, professionally?
Oh, good luck then..
Well I guess I should better get some sleep.. Its 3.19am here..
anyone knows what this last weird character is after the K?
Get the complete details on Unicode character U+2592 on FileFormat.Info
Block Elements is a Unicode block containing square block symbols of various fill and shading. Used along with block elements are box-drawing characters, shade characters, and terminal graphic characters. These can be used for filling regions of the screen and portraying drop...
hmm thanks
do you perhaps know if this thing might influence my C code?
is it being read like a character, similar to \n?
depends do you handle unicode?
normal characters only go from 0 to 128 (or 255 with extended format)
you'd need widechars for anything beyond the ascii set or you'll read em as 2 seperate (and wrong) characters
@supple abyss
What I'm trying to do is split an input file into strings via strtok and then see if all elements from the input file are valid and make sense
that might be an end of file character
check the man page for whever you're using to read the input file, and see if it leaves an eof character in
if so, you need to account for that
Man page? Whats that
are you on a linux machine?
No
I'm confused, what should I be looking for?
I ask because there's a nifty feature in Linux where you can run the command "man [command]", where [command] is a bash command or C function
and it gives you the manual page for it
this site emulates that
enter the c function you're using into the site search
for example, fscanf
or strtok
and it'll tell you everything you need to know about how that function works, including how it handles things like eof
Great, thanks fam
Microsoft has split-personality disorder when it comes to linux
They say they "love" linux but when it comes to targeting windows from linux or vice-versa you're shit out of luck unless there's a FOSS alternative.
I use a Macbook Pro for work (All the devs do now) mainly because its closer to linux than Windows is. When I first started here I told them I wanted a windows machine. 1 week later I asked to switch to a mac because its way more performant with what we do as far as running linux commands and all our software runs on linux machines. Now... I'd never personally buy a mac (way overpriced for the hardware) I'd just get a laptop i can install Linux on lol.
@glad terrace why not ask for an actual linux machine?
Cause everyone else has a mac
so?
Let the company spend them moneys? Haha
I spend 4hrs just to make my XPS 15 9560 to work with Debian 9 just because of this Nvidia Optimus (iGPU/dGPU switching) mess... Now it's working but man, I had to add some acpi arguments on grub just to make it work correctly (or it would just do a hard freeze anytime Bumblebee was trying to enable the dGPU)...
@proper gale I also received it as a hand me down basically lol. The lead dev got a brand new one and I got his old one. It's still a Macbook Pro 15-inch (mid-2015) with an i7 and 16GB ram. And also what @little knoll said. If I were to have asked for a laptop and then have issues getting linux to run properly on it... I'd be back to being stuck on windows lol
It's just easier when everyone has the same hardware too.
What's funny too is that I've installed Debian on my XPS to be able to work with tensorflow and cuda in a easier way, but I think it's worse now XD
If it makes you feel better I did cover the apple logo with a Black Rifle Coffee Company sticker and a Walther sticker.
@little knoll lol
TBH though I'm surprised this thing runs as well as it does with all the programs/windows and monitors I have running... Jetbrains Software eats memory lol
2 Webstorm Projects open, Photoshop, slack, terminals, chrome with 10 tabs and still smooth as can be shrug
On a 3440x1440 monitor and a 2560x1440 monitor and the laptop screen
Working from home today.
@glad terrace i just got my 1700x back (literally just got it to boot with all 64GB of memory a couple of minutes ago), it was painful to use CLion on an R3 1200, cant imagine using a laptop as a daily driver for anything IDEA based.
IDK why but the mac handles it wonderfully.
I'm by ZERO means a mac fanboy either
I would NEVER personally buy an apple product. In fact... I own a total of 0 apple products.
you REALLY like putting caps locked words in the MIDDLE of your sentence
maybe I should START doing that
Or learn to do this
I dont really feeel like It
Lol
What is the easiest way to transfer an int from c++ to python?
thanks interop was what i needed👌
Any opinions on best key switches and keyboard for coding 70%, design 20% and gaming/chill 10%. I work from home so need it for very heavy use, mostly development work.
i set on blues tbh
@winged obsidian I've been using this for a few months and I am a software engineer, but it would definitely be great for gaming. It's a great keyboard.
I've got their linear switches as with the non linear when coding the keys take more of a press to execute it fully.
And it comes with that wrist rest which is really nice.
I also have it paired with this on a large mousepad and it's great.
https://www.logitechg.com/en-us/products/gaming-mice/g502-hero-gaming-mouse.html
I put all the weights in the bottom to give it some weight. I feel like most mice are wildly inaccurate because they fly all over the mouse pad.
And I have a quad 4k monitor setup which is very useful
Excellent much appreciated, I was considering this keyboard already so hearing some more positive feedback really sells it for me
Too late for that lol, but to be fair I have had this one keyboard for 5+ years and it has never ever let me down. I haaaate the cosmetic design though and it only has green LEDs.
ew razer keyboards
^^^ what he said
Lets play, "Swat the Bug"
using System;
namespace LargeSum
{
class Program
{
static void Main(string[] args)
{
string s1 = "12345678901234567890123456789012345678901234567";
string s2 = "91234567890123456789012345678901234567890123456789";
string result = Sum(s1, s2);
Console.WriteLine(result);
Console.ReadLine();
}
public static string Sum(string s1, string s2)
{
string result = "";
if (s1.Length < s2.Length)
{
string temp = s1;
s1 = s2;
s2 = temp;
}
bool carry = false;
for (int i = 0; i < s2.Length; i++)
{
int sum = int.Parse(s1[s1.Length - (i + 1)].ToString()) + int.Parse(s2[s2.Length - (i + 1)].ToString());
if (carry)
sum++;
if (sum > 9)
{
carry = true;
sum -= 10;
}
else
carry = false;
result = sum.ToString() + result;
}
for (int i = s1.Length - s2.Length - 1; i >= 0; i--)
{
int sum = int.Parse(i.ToString());
if (carry)
sum++;
if (sum > 9)
{
carry = true;
sum -= 10;
}
else
carry = false;
result = sum + result;
}
if (carry)
result = "1" + result;
return result;
}
}
}
using System;
using System.Numerics;
namespace Example
{
class Program
{
static void Main(string[] args)
{
string s1 =
"12345678901234567890123456789012345678901234567";
string s2 =
"91234567890123456789012345678901234567890123456789";
//why not this - (see Sum(string,string))
Console.WriteLine(Sum(s1, s2));
//or even this since we know the input?
Console.WriteLine(BigInteger.Parse(s1) + BigInteger.Parse(s2));
Console.ReadKey();
}
public static string Sum(string s1, string s2)
{
if (!BigInteger.TryParse(s1, out BigInteger out1))
return "N/A: Cannot parse input string 1";
if (!BigInteger.TryParse(s2, out BigInteger out2))
return "N/A: Cannot parse input string 2";
return (out1 + out2).ToString();
}
}
}
ew C#
Is there any way in JavaScript where I can calculate how many bytes are in a HTML/CSS/JS file?
maybe with fetch All 🤔
@full berry Bug is in the second for loop which decrements. iterator integer gets converted to a string and then parsed and is used as the sum. Instead of course you should be indexing s1 (the longest string)
So it would be int sum = int.Parse(s1[i].ToString());
Also me personally I'd assume the strings are in ASCII and just subtract 0x30 from the raw characters so you wouldn't have to call ToString or int.parse
Though that's probably bad practice in some way or another
And biginteger is probably more efficient anyway because I assume it stores the numbers in base16
And probably has various other optimisations
@obsidian bluff swatted the bug congrats
No they are in an encoding scheme only aliens know
And ofc bigint is cheating...
Yeah pretty much, in that BigInteger does use the char values to make the calculation. Uses the NumberBuffer struct, so not base16, just an array of bytes representing each digit, the precision, scale and sign are stored in that struct also.
BigInteger also handles white spaces, grouping, negative numbers (sign), floating point numbers, currency, hex numbers, parenthesis, exponents, etc. Very robust.
It also has a ton of built in methods as you would imagine.
yeah cheating, but worth mentioning for sure.
Lol. Makes sense to me. A class named BigInteger can do floating-point
Yea... I think he meant bigdecimal
And not sure about javas implementation but I think .net bigint is base256
How can I do like in #472210112686325770 that when you click on an emote it gives you an role? I'm working with discord.js
Mention me if you've answer me, otherwise I won't see it
@sacred shuttle I'm sure there is some kind "on-react" event going on or similar
something you could deduce that from
There is. Let me find.
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-messageReactionAdd @sacred shuttle
Will look at that
client.on("messageReactionAdd", (reaction, user) => {
let member = reaction.message.guild.members.get(user.id)
if(!reaction.message.id === "526372510200233984") return;
let role = reaction.message.guild.roles.find("name", "Updates")
if(reaction.emoji === "✅") member.addRole(role);
});
This code doesn't work. Can someone help me?
Mention me if you've got an answer
Any errors?
I'm no JS expert but maybe try two equals instead of three?
@sacred shuttle
And Shouldn't you use like !== instead of !something === something else?
because I think
if(!reaction.message.id === "526372510200233984") return;
reads as whatever the result is of !reaction.message.id and see if it's === to that number string.
reaction.emoji is apparently a "ReactionEmoji" object or an "Emoji" object
if you check a string to be equal to an Emoji with === no type conversion will be done so it will always return false
You should do reaction.emoji.toString() === "✅" or reaction.emoji == "✅"
Already found it
It didnt work because it cant read old messages after a restart
Needed to use the raw thing
Guys I had an idea for an app. Are you watching a movie or listening to a music on your laptop with shitty built in speakers or no speakers at all? What if you could use your phone as a speaker? Your smartphone and computer would connect via WiFi ( Bluetooth if available ) and just. Reproduce the sound on your phone. Obstacles to overcome? Latency. What do you think?
@ionic hull that already exists
and... WHY? I doubt phone speakers are going to be better than the ones builtin
hey guys, im new to github, how do I access the releases of someones repo? thanks
you click on "releases"
@full berry I've Ben in this situation many times
Thought that other could be too
And there can be better things
Well, if you really want to its entirely possible and on local network latency should be negligible
It would basically be a client server environment
Good luck, happy coding
wonders if you couldn't just use DLNA for that, but nobody even remembers DLNA anymore now that we've been forced to use proprietary things like google cast or airwhatever
One would have to capture audio anyways for the dlna server
pretty sure on the good OSes (linux) it's pretty straight forward and a solved problem. Never tried it on something else.
And I'd argue dlna is kinda overkill lol
I mean, it kinda is, but it's something that is out there and works modular, so you can just take a random client and it'll work with your server. So it's even more than phones 😮
I'd just ffmpeg on both ends. One encodes, other decodes
I would have to stream the sound on local network
No need for all the protocol mumbo jumbo
I'm a web dev :/
Rip
I'm kinda used to that protocol mumbo jumbo
This is just some "idea" on my head
Because I want to expand my horizons beyond web
Like apps
Good... The faster you get away from web dev the better
Jk
I just hate these so called web devs these days
But to each their own
I'm a backend dev
hates overly opinionated single-minded devs these days ;)
And that is why dlna died.... You welcome
Software is dying
O.o
No one wants to install programs
Spotify, discord
The code you write doesnt need to be installed to be considered software
And... Electron is trash
Node is okay i guess... But electron is trash
I wished web devs would stop pretending to be app devs
:'(
No offense
I'm just saying you wanna make native apps then make native apps. Dont pretend to...
Like discord.... Because they electron sure they have high portability but in terms of quality its shit
The linux version has so many bugs
Windows version doesnt behave as expected either
Ofc the reason is cost and time
Aka cutting corners
Rant over
Lol
As long as it works
No
Utter trash
Send them a complaint
Lol its already been...
Because its electron there are just things which will never be fixed because it cant be fixed
Unless electron is fixed
You can always use the web version 😂
Again... If I want a web app ill use a web app.. If I want a native app ill use a native app
And I for one like native apps
Are you older than 27?
That explains a lot hahahh
I hate js
Well you could meet in the middle and learn a relatively lower level language like java, c#, vb, c, cpp
I'm not gonna say that I know c# or Java or c++ but I've used them for a few projects
Js was made for scripting... I like to keep it that way. If I want lower level capabilities I use a lower level language/environment
I just don't see what I could do with them rn
If web development gets me money, that is what am doing
Im guessing you dont plan on going that far lol nvm then.
The app im sure can be done. At least the client side easily enough by you. The serverside is what im wondering
How do you plan on capturing desktop audio etc?
There sure is some c++ lib for that
So you arent using js? Thank goodness
Ofc not
I would use c++ with what I know ( basically gluing a lot of libraries together )
And here i was thinking sonehow this websev was gonna do it all via web dev lol
It would be funny if there was a way to do it in mode and Electron
Im sure there is
And save the audio to an mp3
But plesse dont
Id capture. Encode and send the bytes on the line asap
Cya
how does someone doing a c++ project go querys in a mysql database?
(i have one setup with xampp)
*do
Grrr... Linux hates my ethernet chip on my motherboard. Had issues with Antergos not seeing my ethernet so installed POP OS and the exact same crap. Spent like 8 hours trying to compile/install the driver in like 30 different ways and no matter what I did it would never show up in ifconfig. Gave up and took my wireless card out of my "server" and that worked immediately.
Intel I219-V on a Maximus IX motherboard.
Lol
Probably just going to go out and buy an ethernet card and use that.
Compiling a single kernel module was surprisingly easy when I last tried it
I was able to compile snd-pcsp.ko which provides you with an ALSA sink for the built-in PC speaker with PWM
@full berry the ad that YouTube showed me
"JavaScript for better or worse is everywhere"
It isn't...
Also I'm using spigot
Not for a Minecraft server 😂
well no, but "work for free" 😛
Have you never heard of a paid intern? They're fairly common here
Hey I'm looking for someone to work on a project that I will make money off, you will not be paid because I want the money, thanks pm me for more info
/r/ChoosingBeggars/
Lmfao
;-; i am officially brain fked right now - been trying to figure out how to get audio device information and finally i have a lead, was on some russian looking website before which gave me a start then went onto japanese programming website which gave me more incite, and now my brains cluster fked. GG Me
http://qaru.site/questions/12935319/how-to-get-whether-a-speaker-plugged-or-unplugged
https://blog.techlab-xe.net/archives/tag/core-audio
Я использую Visual Studio 2013 для Visual Basic, и я хочу проверить, подключен ли динамик или отсоединен от гнезда динамика. Является ли это возможным?
google translate worked pretty well for the most part,
@nocturne galleon https://stackoverflow.com/a/35626120 ?
ima be frank im not gud yet converting c# nor c++ to vb.net
ive had some experiance with c#, so i can do basic conversions of if statements and all but if it comes to high lev programming i can try for hours n stil not get it right ;-;
https://docs.microsoft.com/en-us/windows/desktop/coreaudio/mmdevice-api
@nocturne galleon Tear your heart out
Eat*
fuck it's 1AM nvm that sentence
I just meant to say: Here you go
I cant find a button called releases @vestal glen
@nocturne galleon if there's no "N releases" stat in the bar above the files browser there are no releases. If there is, click on it...
Except there are releases because I have gotten to them from direct links but there is no button for it
If there are releases/git tags it'll have the "n releases" thing (in the upper middle) like this repo. If that's not there, the releases aren't managed via github.
@obsidian bluff thanks - I've been using the core audio api which includes the mmdevices - unfortunately the device state only gives me the driver name (weird maybe it's different per device),
Non the less if I do find a way to get this working I'll probs share it on the web to make it easier for others
DB question: are there any technologies out there that do a best-of-both-worlds approach regarding SQL and NoSQL? Or is there any reason I shouldn’t write a data layer to my app that does that?
You can't really get a "best of both worlds" between SQL and NoSQL
unless you mean something that's not the main benefit of one of these
Well you can use a hybrid of both
And Postgres scales pretty well up to 40-60TBs
After that it gets a bit trickier
@vestal glen does that screenshot show releases?
@nocturne galleon yes, in the middle top bit. I'm now at a desktop machine and can make you a screenshot with a big red arrow
@nocturne galleon
Aah ok, thanks
(CTRL + F -> "release" would also have found that one, I'd think...)
What exactly are you making?
Without knowledge of why you need charts, we can't tell why That wouldn't be worth it
You were asking for advice about charts
Anyway, chart.js is what I always use
I use chart.js on server side too
I.e node.js to generate .pngs and save them
@last ingot Chart.js is good. Have you tried react before? A lot of templates come with great starting points for a site and charts that are pretty plug and play.
I've been using React front end with an ASP.NET Core MVC back end (w/Entity Framework) lately and it's been really nice.
Can Java get all active network connections to a computer like netstat?
All I’m seeing on Google is about network interfaces and determining if internet is available
I'm sure it can
Even if it can't you could write a library for it with JNI
Or if you can't do that for whatever reason you could use runtime.getruntime().exec and parse the output of netstat.
Should be straightfoward enough
And on Linux it'd be just /proc/net/tcp
There isn't a linux discussion (Please add one) But anyone fancy helping me figuring out a solution to something I need done on bash? I'm trying to figure out how to put file names in to a output.txt file if the filename doesn't already exist in the output.txt I know I can use a ls > output.txt but trying to figure out the best method to check if the filename is there and if it is do nothing but if not get it to append the new filename in to the output.txt file, any pointers would be great 😃
do a 'ls' into a temp file then use comm and get the difference and add the difference to output.txt
You don't even need to put it into a temp file actually. I use this to compare branches between my local and remote git "comm -12 <(sort <(git branch)) <(sort <(git branch -r | sed -e "s/origin///"))"
It just tells me which local branches are also on the remote so I know which of mine I need to remove from remote
I figured out a way, I needed to do it in a temp file using batch to monitor specific file changes for a certain docker environment I run
Sorry stuck at work so took a while to respond
Does anyone know vbs script and can explain what this code is doing?
Set colSettings = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'")
For Each objIP in colSettings
For i=LBound(objIP.IPAddress) to UBound(objIP.IPAddress)
If InStr(objIP.IPAddress(i),":") = 0 Then Echo objIP.IPAddress(i)
I don't know vbs but by looking at it it seems to be to display ip addresses that are using ipv6 based on the ':' part in the InStr function.
actually
The opposite.
IP's not using ipv6
@glad terrace the opposite because of the = 0 part?
yes
Based on the assumption that if it contains a : it would return a 1 I didn't look at any docs
@glad terrace hmm. Is it also safe to assume that if it locates a : symbol, that it would skip the entire IP address object and read the next one?
Not sure about 'skipping' but it wouldn't echo it I'd think. I have never worked with VBScript and am completely unfamiliar with it's syntax so take everything I say with a grain of salt lol
@glad terrace thanks for your input
it loops through each item in colSettings and iteratates through all of the address, if the ip address doesnt contain ":" then echo the ipaddress
anyone know how to access (read/write) files in C# via volume ID?
windows explorer works but .net doesnt
InStr gives the position (starting at 1) of the first occurrence of a string within another string. 0 is returned if an occurrence doesnt exist.
