#development

1 messages · Page 38 of 1

dreamy finch
#

I need help making the program report how long it took to execute. Any ideas? This is in C.

nocturne galleon
#

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

stiff gull
#

@dreamy finch high res timers

#

take time at start and at end, subtract em and you'll have the duration

plucky vector
#

looking for some Oracle SQL help if anyone has any knowledge

dreamy finch
#

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

stiff gull
#

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

dreamy finch
#

20 times each using the same matrices you think?

stiff gull
#

not even 20

dreamy finch
#

Then average them?

stiff gull
#

more like a million

#

and average it yeah

#

just for(... 1000000..) it

dreamy finch
#

Calculate the same matrix a million times?

stiff gull
#

yeah

dreamy finch
#

Gotcha.

stiff gull
#

input and output should be the same in both test cases

#

as should the amount of tests

dreamy finch
#

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.

stiff gull
#

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

dreamy finch
#

Yeah, but I thought I'd make a graph too. My professor loves diagrams.

stiff gull
#

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

dreamy finch
#

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!

stiff gull
#

so yeah you'd forloop this part

#

(and time)

dreamy finch
#

That's what I thought. Nice!

stiff gull
#

because file loading and init is irrelevant

#

as its only done once

dreamy finch
#

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!

tropic grail
#

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

dreamy finch
#

What do you mean?

jade nova
#

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

dreamy finch
#

Oh, jeez. It got rid of my code I posted here, huh...

obsidian bluff
#
subprocess.call(["sh", <instert path to script as string here>])``` @jade nova
jade nova
#

Alright

#

Thanks

dreamy finch
#

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

stiff gull
#

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

dreamy finch
#

Gotcha. No Worries I just messaged my professor about it.

proper gale
#

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

waxen summit
stiff gull
#

wut

#

its always been open source

#

just under contract

#

which is as easy as signing up for nvidia gameworks

waxen summit
#

So now it goes to BSD-3 And not only for games.

stiff gull
#

and I know since I have the actual source on my PC

stiff gull
#

Nvidia to the rescue

nova moth
#

Hello!
Does somebody here know how to find offsests using a decompiler?

calm knot
#

Anyone here doing advent code 2018

#

If so what algorithim is best for day 3

glad terrace
#

Finally close to my office being totally set up... Still need some major cable management work though lmao. And a third 1440p monitor...

ionic hull
#

@glad terrace specs?

glad terrace
#

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.

ionic hull
#

Damn

#

Looking really sexy

glad terrace
#

About as close to no wires showing as possible =P

#

Damn the video card power being on the top...... Lol

proper gale
#

@glad terrace solution to not not showing wires, show off some good ass cables.

ionic hull
#

Totally not sponsored by cablemod

little knoll
glad terrace
#

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

proper gale
#

@ionic hull I wish, I paid for those fuckers.

ionic hull
#

@proper gale I have stock cables and I don't even care if they are organized, as long as the PC works

proper gale
#

but, but

#

i have a custom loop, so the cables were the least of my expenses.

#

@ionic hull

solid horizon
#

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)

solid horizon
#

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

winged obsidian
#

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

winged obsidian
#

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

fiery onyx
#

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;
}
deep scarab
#

looks more like c than c++ tbh

winged obsidian
#

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.

fiery onyx
#

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

winged obsidian
carmine ice
#
Windows Developer Blog

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

weak nest
#

If I'm reading that correctly, this is dope af.

solid horizon
#

hm interesting

stiff gull
#

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

ripe fable
#

Thats actual Minecraft 1.13 observer placement code

glad terrace
#

getOpposite twice? I'm not familliar with their code but... Wouldn't that be the same direction it started with? lmao

solid horizon
#

^

#

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

stiff gull
#

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"

proper gale
#

@ripe fable how can you look at 1.13 code?

#

MCP for 1.13 is not out afaik

ripe fable
#

@proper gale Who needs MCP

#

We have our own deobfuscator with mappings xD

granite fog
#

Who do you mean by we?

ripe fable
#

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

granite fog
#

Ah yeah, I remember seeing that stuff

ripe fable
#

Yep, earth's

#

Just checked, youre in eigen as well

granite fog
#

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)

ripe fable
#

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

granite fog
#

Yeah, we have access to similar tools

ripe fable
#

I mean its not just you xD

granite fog
#

Ours work with any new versions immediately, even the snapshots

ripe fable
#

Ofc

granite fog
#

Mainly we use them for matching stack traces in crash reports to eliminate duplicate reports

solid horizon
#

hmm

#

i never authorised access, nor isnt any of their bots in those servers

vestal glen
#

well, you are clearly logged in, so you must have authenticated at the very least?

solid horizon
#

its not authenticated to my discord acc

vestal glen
#

well, then they could still have built that based on data they got from other accounts they have authorized.

solid horizon
#

i dont think theres anyone with this many mutual servers to me

vestal glen
#

there doesn't have to be one person.

#

there just has to be a person per server^^

solid horizon
#

oh

#

fair enough

vestal glen
#

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

solid horizon
#

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

gentle summit
#

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

vestal glen
#

so far no question?

#

(very confused as to how that relates)

#

depends on the dynamic content, my friend^^

gentle summit
#

well, my question is like: is there any other elegant way or is this pretty good?

vestal glen
#

also, you rarely need jquery.

gentle summit
#

dynamic content is basically plain text/html.. nothing fancy

vestal glen
#

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

gentle summit
#

hmm im looking into that.

#

(just fyi: navbar will be added in next update)

vestal glen
#

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

gentle summit
#

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

vestal glen
#

nice way to let me read any php file on your server 😉

gentle summit
#

thats the point

#

it worked but not that nice

vestal glen
#

well, usually the point isn't to be able to include any php file, but I know what you mean 😃

gentle summit
#

that solution requires whole content in the div right?

vestal glen
#

yes, that means you load everything in a single html file

gentle summit
#

hmm. i will try to use that.

nocturne galleon
#

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?

gentle summit
#

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

stiff gull
#

@nocturne galleon if it's not a paid app there's no reason to not share the source

nocturne galleon
#

Well, guess that changes things then.

stiff gull
#

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

solid horizon
#

^

winged obsidian
#

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

obsidian bluff
#

If your security program is well-made having the source code out would only make it more secure.

winged obsidian
#

Yes I agree, in some cases with the key word being well-made or rather, having a security-focused team leading the development.

timber prawn
#

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.

cloud knot
#

@gentle summit thanks for your password file 😃 your.php?s=../../../../../../../../../../../../etc/passwd

round dome
#

he knows please move on

cloud knot
#

the worst things were stuff with SQL injection with null characters i seen

#

(i mean putting %00 in URL)

round dome
#

you mean white spaces to bypass WAF ?

#

most people use %0A

gentle summit
#

@cloud knot its shared hosting so i don't care

cloud knot
#

@round dome no, it was a MySQL SQL Injection

#

%00 null-terminated the string

tropic grail
#

@cloud knot That's literally only user accounts, and maybe hashed passwords. Even with that file, you have nothing.

haughty linden
#

Sanitize the input is one quick method.

cloud knot
#

@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

hybrid quiver
#

has somebody good knowledge of programming on java basis?

deep scarab
#

no

vestal glen
#

it is forbidden to get good at java.

fresh lance
#

lol

#

everyone thinks they're good at java until they learn what a design pattern is

proper gale
#

@last ingot i dont see what is sooooooo bad about Java itself

winged obsidian
#

^ 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
proper gale
#

@winged obsidian dont forget about BrainFuck ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

stiff gull
#

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

proper gale
#

ofc it is.

ionic hull
#

Better compatibility?

#

There must be a reason that big companies separate everything 🙄

indigo stump
#

@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

proper gale
#

jesus fuck

indigo stump
stiff gull
#

APL is worse

#

I don't think Discord even supports the full char set

#

life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}

kind portal
#

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?

granite fog
kind portal
#

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

sacred shuttle
#

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

proper gale
#

@kind portal IDEA has jframes, never used it but the features are there

upbeat folio
#

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.

peak mica
#

Never did jframe. did stages and scenes

proper gale
#

@upbeat folio thats now how this works, thats not how any of this works.

upbeat folio
#

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.

ionic hull
#

Can't you tell someone

#

That the guy is ruining everything

upbeat folio
#

Manager is on his side, because he’s local and I’m remote.

granite fog
#

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

obsidian bluff
granite fog
#

That looks pretty clean, but my poor eyes can't read the blue comments 😂

obsidian bluff
#

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

granite fog
#

Oh sure, but using c isn't used for its simplicity 😃

obsidian bluff
#

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

granite fog
#

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

obsidian bluff
#

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.

granite fog
#

I'd never do backend JS though, recipe for disaster when you can use strongly typed languages that can be properly portable

obsidian bluff
#

I'm 20

granite fog
#

I'm a c# dev by trade, so tend to go for netcore stuff

obsidian bluff
#

I haven't done any work that involves a database.

#

At least not beyond the very basics

#

not much to look at

grand hornet
#

Use json as a database

#

/kidding/

obsidian bluff
#

I was about to say lol

granite fog
#

Look at the MSSQL one..

obsidian bluff
#

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

#

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?

reef bay
#

goeicool theres a library that does it.

#

Its worth if you want multithreading why wouldnt it be

#

its pretty simple to use

obsidian bluff
#

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

upbeat folio
#

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

tired rampart
brazen sluice
#

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)

peak mica
brazen sluice
#

aah so it would be like
// text here
(code)

or
/* text here
or here */

#

thanks 😃

peak mica
#

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

brazen sluice
#

we have to program in (i think java) with mindstrom bricx stuff

peak mica
#

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

brazen sluice
#

aah yeah the thingy medjiging for the shortcut to the other thingey

#

im not very code name savy

peak mica
#

No worries.

brazen sluice
#

on an unrelated note, their site is atrocious

peak mica
#

Indeed

brazen sluice
#

thanks for the help, ill go try it out now

peak mica
#

Happy to help 👍🏻

oak parrot
#

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

oak parrot
#

So @last ingot I got the code somewhat working haha

#

only issue is now that it doesn't get the positions correct xD

oak parrot
#

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 you run it and type 42 you get 15

#

100 = 14

proper gale
#

@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

jolly warren
#

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

winged obsidian
#

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");
}
vestal glen
#

or use addEventListener because inline scripts D:

winged obsidian
#

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.

bronze crater
#

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

glad terrace
#

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

bronze crater
#

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

glad terrace
#

@last ingot I may actually check out that django tut. It will give me a reason to learn python lol

proper gale
#

@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

leaden solstice
#

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.

#

-_-

proper gale
#

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

nocturne galleon
#

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?

proper gale
#

@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

nocturne galleon
#

oooh ok

proper gale
#

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

nocturne galleon
#

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?

proper gale
#

tldr: yes.

nocturne galleon
#

cool, thanks

proper gale
#

that is a hell of a lot easier said than done though.

nocturne galleon
#

thats probably why it almost seemed too simple

#

because I was thinking "theres no way thats all there is to programming"

proper gale
#

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.

nocturne galleon
#

I see what you mean

#

so theres more to it

#

than meets the eye

proper gale
#

there is a hell of a lot more to it, as there is with everything

nocturne galleon
#

is the 'more to it' the complexity of said problem solving?

proper gale
#

the problem solving is a good section of it

#

but there is also knowing how to use your IDE

nocturne galleon
#

like the built in tools etc?

proper gale
#

basically, yes.

#

making code both maintainable and fast.

#

choosing the correct language and library for the job.

#

etc

nocturne galleon
#

aaah ok

#

so you choose the language based on which one is made for that sort of purpose?

proper gale
#

most are general purpose, soooo, no not really.

#

it usually comes down to ease of writing and speed

nocturne galleon
#

ok

proper gale
#

easier to write generally means slower

#

faster, generally means harder to write

nocturne galleon
#

would c++ be a faster but generally harder to write language?

proper gale
#

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.

nocturne galleon
#

"dm me what you said, i could see that you pinged me." are you talking to me there?

proper gale
#

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.

tropic sapphire
#

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.

proper gale
#

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

tropic sapphire
#

@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

vivid wasp
#

C++ is an "extension" to C

proper gale
#

no, Objective-C is

tropic sapphire
#

I use node at work, inside aws lambdas it's super good.

proper gale
#

if you want to bash on design flaws, i could go on for quite a while about C++

vivid wasp
#

Didn't say they are equal. 😄

proper gale
#

and mostly the libraries

timber dagger
#

hello

proper gale
#

i think its fair to include the stl as part of the language.

#

and the language (no libs) has its flaws aswell

tropic sapphire
#

@last ingot python docs are great but so is c#. Microsoft has put a tonne of resources into docs over recent years

proper gale
#

the standard library for a language, they all have them, i think its fair to bundle them.

#

i wish docs were good for C++

tropic sapphire
#

We have .net core.

proper gale
#

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

nocturne galleon
#

Anyone here good at basic java? I need someone to help me look over my program

proper gale
#

@nocturne galleon i am

nocturne galleon
#

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

proper gale
#

what is it not cacluating correctly?

#

i also dont know the formulas for this math.

nocturne galleon
#

the output file jumbles up the monthly payment, principle and interest payments.

proper gale
#

System.exit(0); <- dont use this

#

this looks completely seperate``` }

while (again == 'Y' || again == 'y');```
#

how is the intrest suposted to compound?

vestal glen
#

(man, tolower/uppercase is a magic transform)

proper gale
#

least of issues

#

i would have expected to use the continual compound, but i dont see the pert formula anywhere

vestal glen
#

oh, I know, it's a symptom for a whole class of things to come

nocturne galleon
#

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

proper gale
#

figure out the math first, then try and do it in java.

ionic hull
#

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

proper saddle
nocturne galleon
#

gtlst that looks like compound interest if I paid attention in maths, from what I read here tgmackel16 is trying to do simple interest

proper gale
#

@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

ionic hull
#

@nocturne galleon ye I know, I realized it after I wrote that shit down :(

#

And too lazy to delete

proper gale
#

@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

nocturne galleon
#

what is it?

proper gale
#

@nocturne galleon what is what?

nocturne galleon
#

the thing mrmetech is looking at buying

little patrol
#

if I wanna have a file that has all my functions for CRUD for example... in Express where should I place those?

proper gale
#

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

nocturne galleon
#

aah ok

proper gale
#

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

glad terrace
#

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

random bough
#

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

wheat dock
#

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

tropic grail
#

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.

#

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.

limpid reef
#

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

tropic grail
limpid reef
#

Ummm... is that a good reaction because it works, or... did I make your server catch fire?

tropic grail
#

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 FIIIRRREEE

limpid reef
#

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

tropic grail
#

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.

limpid reef
#

just a sec, gonna finish this overwatch game then look

tropic grail
#

Tested it alone in the file, but still sets the rest on fire.

deep scarab
#

should be able to just change the regex?

#

^(.*)$

limpid reef
#

That's what I'm thinking yeah.

tropic grail
#

Testing now, but seems to work with some half-assed regex I tossed in.

limpid reef
#

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]
tropic grail
#

👀 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

deep scarab
#

i've no clue what that language is

tropic grail
#

What do you mean?

vestal glen
#

that's apache htaccess with some regexp^^

limpid reef
#

just a min i have the code here for that

#

overwatch then code

vestal glen
#

well, you could avoid the loop by telling it not to redirect in the /pics subfolder

limpid reef
#

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]
vestal glen
#

or that

tropic grail
#

@limpid reef I swapped your [L] for [END].

limpid reef
#

lol i totally forgot to re-add that.... oops

tropic grail
#

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.

limpid reef
#

I'm getting a 404 error page ... a green custom one for both of those links.

tropic grail
#

Ah, one sec, that new line borked it on everyone else's end.

#

Caching

#

Fixed.

limpid reef
#

yuppers, looks good to me now. 😃 silly discord, trix are for wumpus.

tropic grail
#

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

limpid reef
#

oh wait hold on

tropic grail
limpid reef
#

I see that yeah, the poop failed embed has the extra slash

tropic grail
#

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.

fervent orbitBOT
ionic hull
gentle summit
#

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

tidal tusk
#

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.";
}```
deep scarab
#

because they both pass the second condition

#

i think you want &&

vestal glen
#

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.

proper gale
#

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.

proper gale
#

i use gitlab, but it supports both

clever cairn
#

y is my name this

kind portal
#

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

kind portal
#

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

proper gale
#

@last ingot found a new keybind, press ctrl+shift+r for the missing features of the N++ replace i didnt find.

still rock
#

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

supple abyss
stiff gull
#

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

supple abyss
#

hmm thanks

#

do you perhaps know if this thing might influence my C code?

#

is it being read like a character, similar to \n?

stiff gull
#

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

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

fresh lance
#

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

supple abyss
#

Man page? Whats that

fresh lance
#

are you on a linux machine?

supple abyss
#

No

fresh lance
#

ah

#

there you go

supple abyss
#

I'm confused, what should I be looking for?

fresh lance
#

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

supple abyss
#

Great, thanks fam

wicked frigate
#

MS visio c# in linux?

#

Anyway to gen visio files from linux

obsidian bluff
#

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.

glad terrace
#

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.

proper gale
#

@glad terrace why not ask for an actual linux machine?

glad terrace
#

Cause everyone else has a mac

proper gale
#

so?

ionic hull
#

Let the company spend them moneys? Haha

little knoll
#

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

glad terrace
#

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

little knoll
#

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

glad terrace
#

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.

proper gale
#

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

glad terrace
#

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.

nocturne galleon
#

you REALLY like putting caps locked words in the MIDDLE of your sentence

#

maybe I should START doing that

lofty jolt
#

Or learn to do this

nocturne galleon
#

I dont really feeel like It

lofty jolt
#

Lol

summer mountain
#

What is the easiest way to transfer an int from c++ to python?

full berry
#

O.o???

#

you mean interop?

#

or maybe use pipes?

summer mountain
#

thanks interop was what i needed👌

full berry
#

easy would prob be 127.0.0.1 lol

#

not very elegant though imo

winged obsidian
#

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.

full berry
#

i set on blues tbh

nocturne galleon
#

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

winged obsidian
#

Excellent much appreciated, I was considering this keyboard already so hearing some more positive feedback really sells it for me

full berry
#

hmm stay away from razer....

#

lol

winged obsidian
#

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.

round dome
#

ew razer keyboards

full berry
#

^^^ what he said

full berry
#

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;
        }
    }
}
winged obsidian
#
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();
        }
    }
}
round dome
#

ew C#

jade nova
#

Is there any way in JavaScript where I can calculate how many bytes are in a HTML/CSS/JS file?

bleak parrot
#

maybe with fetch All 🤔

obsidian bluff
#

@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

full berry
#

@obsidian bluff swatted the bug congrats

#

No they are in an encoding scheme only aliens know

#

And ofc bigint is cheating...

winged obsidian
#

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.

obsidian bluff
#

Lol. Makes sense to me. A class named BigInteger can do floating-point

full berry
#

Yea... I think he meant bigdecimal

#

And not sure about javas implementation but I think .net bigint is base256

sacred shuttle
#

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

obsidian bluff
#

Not related to gamemaster's question but I thought this was a funny excerpt

sacred shuttle
#

Mention me if you've answer me, otherwise I won't see it

stiff gull
#

@sacred shuttle I'm sure there is some kind "on-react" event going on or similar

#

something you could deduce that from

restive estuary
#

There is. Let me find.

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

restive estuary
#

Any errors?

obsidian bluff
#

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 == "✅"

sacred shuttle
#

Already found it

#

It didnt work because it cant read old messages after a restart

#

Needed to use the raw thing

ionic hull
#

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?

full berry
#

@ionic hull that already exists

#

and... WHY? I doubt phone speakers are going to be better than the ones builtin

nocturne galleon
#

hey guys, im new to github, how do I access the releases of someones repo? thanks

vestal glen
#

you click on "releases"

ionic hull
#

@full berry I've Ben in this situation many times

#

Thought that other could be too

#

And there can be better things

full berry
#

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

vestal glen
#

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

full berry
#

One would have to capture audio anyways for the dlna server

vestal glen
#

pretty sure on the good OSes (linux) it's pretty straight forward and a solved problem. Never tried it on something else.

full berry
#

And I'd argue dlna is kinda overkill lol

vestal glen
#

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 😮

full berry
#

I'd just ffmpeg on both ends. One encodes, other decodes

ionic hull
#

I would have to stream the sound on local network

full berry
#

No need for all the protocol mumbo jumbo

ionic hull
#

I'm a web dev :/

full berry
#

Rip

ionic hull
#

I'm kinda used to that protocol mumbo jumbo

full berry
#

Id argue apis and protocols are dif

#

If that is what you are thinking

ionic hull
#

This is just some "idea" on my head

#

Because I want to expand my horizons beyond web

#

Like apps

full berry
#

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

ionic hull
#

I'm a backend dev

vestal glen
#

hates overly opinionated single-minded devs these days ;)

ionic hull
#

That does front end if needed

#

In some ocasions

full berry
#

And that is why dlna died.... You welcome

ionic hull
#

Software is dying

full berry
#

O.o

ionic hull
#

No one wants to install programs

full berry
#

I wouldnt go that far lol

#

Huh?

ionic hull
#

Spotify, discord

full berry
#

The code you write doesnt need to be installed to be considered software

#

And... Electron is trash

ionic hull
#

It's node.js nickCreep

#

Based onn

#

JavaScript

full berry
#

Node is okay i guess... But electron is trash

#

I wished web devs would stop pretending to be app devs

ionic hull
#

:'(

full berry
#

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

ionic hull
#

Ain't nobody got time for that

#

Ahahahh

full berry
#

Lol

ionic hull
#

As long as it works

full berry
#

Thats the thing it doesn't...

#

Have you tried the discord for linux

ionic hull
#

No

full berry
#

Utter trash

ionic hull
#

Send them a complaint

full berry
#

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

ionic hull
#

You can always use the web version 😂

full berry
#

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

ionic hull
#

Are you older than 27?

full berry
#

Yes

#

Why?

ionic hull
#

That explains a lot hahahh

full berry
#

-.-

#

You kids and all your frameworks.... Lol

ionic hull
#

I hate js

full berry
#

Well you could meet in the middle and learn a relatively lower level language like java, c#, vb, c, cpp

ionic hull
#

I'm not gonna say that I know c# or Java or c++ but I've used them for a few projects

full berry
#

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

ionic hull
#

I just don't see what I could do with them rn

#

If web development gets me money, that is what am doing

full berry
#

Sure, I wont argue against that.

#

But how are you going to make device drivers in js?

ionic hull
#

For what?

#

The app?

full berry
#

Im guessing you dont plan on going that far lol nvm then.

ionic hull
#

Just an idea on my head

#

Don't know if I am going to start it or not

full berry
#

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?

ionic hull
#

There sure is some c++ lib for that

full berry
#

So you arent using js? Thank goodness

ionic hull
#

Ofc not

#

I would use c++ with what I know ( basically gluing a lot of libraries together )

full berry
#

And here i was thinking sonehow this websev was gonna do it all via web dev lol

ionic hull
#

And make the app in java

#

With Android studio

full berry
#

Son. Im proud of you

#

Now make it happen

#

:)

ionic hull
#

It would be funny if there was a way to do it in mode and Electron

full berry
#

Im sure there is

ionic hull
#

And save the audio to an mp3

full berry
#

But plesse dont

ionic hull
#

And request it an API

#

Hahahha

#

With*

#

Latency 999ms

full berry
#

Id capture. Encode and send the bytes on the line asap

ionic hull
#

Well

#

Nice talk

#

But I gotta go

#

Kinda late here

full berry
#

Cya

upbeat elbow
#

how does someone doing a c++ project go querys in a mysql database?
(i have one setup with xampp)

#

*do

glad terrace
#

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.

full berry
#

Lol

glad terrace
#

Probably just going to go out and buy an ethernet card and use that.

obsidian bluff
#

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

ionic hull
#

@full berry the ad that YouTube showed me

#

"JavaScript for better or worse is everywhere"

full berry
#

It isn't...

unkempt otter
#

Also I'm using spigot

ionic hull
#

@unkempt otter your expectations for this are too high

#

No one is gonna work for free

stiff gull
#

Hey

#

There's interns 😛

ionic hull
#

Not for a Minecraft server 😂

stiff gull
#

well no, but "work for free" 😛

obsidian bluff
#

Have you never heard of a paid intern? They're fairly common here

ionic hull
#

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/

full berry
#

Lmfao

nocturne galleon
#

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

#

google translate worked pretty well for the most part,

cloud knot
nocturne galleon
#

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

obsidian bluff
#

Eat*

#

fuck it's 1AM nvm that sentence

#

I just meant to say: Here you go

nocturne galleon
#

I cant find a button called releases @vestal glen

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

nocturne galleon
#

Except there are releases because I have gotten to them from direct links but there is no button for it

vestal glen
#

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.

nocturne galleon
#

@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

upbeat folio
#

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?

fresh lance
#

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

analog tapir
#

Well you can use a hybrid of both

#

And Postgres scales pretty well up to 40-60TBs

#

After that it gets a bit trickier

nocturne galleon
#

@vestal glen does that screenshot show releases?

vestal glen
#

@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

vestal glen
#

(CTRL + F -> "release" would also have found that one, I'd think...)

stiff gull
#

Been recreating Dungeon Keeper for my grad project

#

getting quite lively 😄

wintry lark
full berry
#

code your own

#

no license baggage

dapper thunder
#

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

dapper thunder
#

I.e node.js to generate .pngs and save them

nocturne galleon
#

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

nocturne galleon
#

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.

jade nova
#

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

full berry
#

I'm sure it can

obsidian bluff
#

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.

#

And on Linux it'd be just /proc/net/tcp

waxen leaf
#

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 😃

analog tapir
#

I can think of multiple ways

#

But why specifically bash

glad terrace
#

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

waxen leaf
#

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

native shoal
#

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)
glad terrace
#

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

native shoal
#

@glad terrace the opposite because of the = 0 part?

glad terrace
#

yes

#

Based on the assumption that if it contains a : it would return a 1 I didn't look at any docs

native shoal
#

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

glad terrace
#

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

native shoal
#

@glad terrace thanks for your input

full berry
#

it loops through each item in colSettings and iteratates through all of the address, if the ip address doesnt contain ":" then echo the ipaddress

full berry
#

anyone know how to access (read/write) files in C# via volume ID?

#

windows explorer works but .net doesnt

full berry
#

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.