#development

1 messages · Page 43 of 1

novel spear
#

Server has secret, hmac the cookie with your secret, check hmac matches, if so, cookie is good. Store a session id in the cookie

#

If you want you can include source ip as part of that session and check that it matches. You can also include an expiry. It cant be modified since the hmac wouldn't match anymore

#

And if sever side you want to de auth you just delete the session from the db

#

If you aren't comfortable with that use a library doing this all for you.

#

And dont check your secrets into version control

native shoal
#

I just dont get why it warrants being put there in the list of issues... just to keep the known issues area populated with something

#

That is literally the only reason.

nocturne galleon
#

how do I delete my visual studio profile/account?
nvm figured it out

main root
#

uhhh

#

ty for the reminder to search my vs installation on my old boot drive 👀

#

but i can't help ya sry

nocturne galleon
#

im so lazy, i keep telling myself to learn c++ but I just never do it

nocturne galleon
#

yeah i am gonna do a little project to learn

#

but i wanna get the fundemental syntax down first

zealous kayak
#

Guys .. Adonis OR Express? and why :\

ionic hull
#

Isn't express more main stream? Always use main stream

main root
#

value = 5
if(int(someEntry.get()) == value):
print("Something")
else:
print("else")

if i type in 5, then it always goes into the else block 👀

#

wtf im doing wrong

plush pollen
#

is that python?

tropic grail
#

@main root someEntry.get() != 5

main root
#

ye python

#

if i type != value it jumps into the if block
if i type > value
it jumps into the if block too
so apparently 5 > 5

#

(if i type 5 into the entry field)

#

its some logic error

woven flower
#

python is fun

#

my discord bot is written in python, so if you have logic questions hmu

main root
#

idk how useful the gui stuff in python is but its my first real try doing something with a gui

#

ignoring webstuff 👀

woven flower
#

i mean there's prolly a ton of different GUI libraries

#

only one I've ever used, BARELY is Tkinter which was... weird

main root
#

tkinter is that little guy 🤔

jolly pelican
#

I didn't like any of the more native python GUI libraries

#

They all kinda sucked

#

Could try GTK bindings though

grizzled kite
#

Is anyone here good with HTML?

median spire
#

@grizzled kite what'ca got?

grizzled kite
#

I tried using display: inline but it didnt work

median spire
#

You are going to want to use display: inline on each element additionally it helps to define the width of each element with width=15% or something similar

grizzled kite
#

hmm ok

median spire
#

<div> is a block element, anytime you use it it will create a new line, you can tell it not too. you can also try having your entire banner in one div so that it doesn't break like that.

#

<span> is similar to <div> but without the line break and might also be usefull to you

main root
#

oh and also

#

<header></header> is a thing

#

idk when that stuff got introduced but
<header>
<nav>
<footer>

#

just make it easier to read

velvet pawn
cold oar
#

question

#

why is it that when you buy a software

#

you are not allowed to modify or copy it.

#

I think thats a stupid thing

#

because, you paid for the software

#

its your code now

#

i dont understand this logic

#

when you buy a car you can do whatever you want with it.

turbid delta
#

sadly many publishers say that you don't really buy there software rather you buy there rights (license) to use it. therefore your not allowed to modify or copy it.

cold oar
#

its stupid

turbid delta
#

well i cant agree more with you xD
but that's how this world has become
i can understand the companies that do this to some extent as many people that modify the Software claim that its buggy or is unusable in order to harm or take advantage of the company.
And think of the persons / customers that use the software and install modifications and start finding bugs that are not inside the original version. That would make a support team struggle to explain what's going on.
i hope that's helpful to you @cold oar

next flax
#

yea, in that analogy it's kind of like assuming buying a car meant it came with all of the r&d materials, schematics, etc to build it

#

food doesnt come with the recipe to recreate it

cold oar
#

Well this will never make sense to me...
I think my explanation with a car is pretty accurate.
You get a copy of a software that is already made that you don't have any knowledge of on how to modify it.
Same as with a car,
You get a replica of a car that you have no knowledge of on how to modify it.
Same thing.
Then why can you resell the car but not the software...

nocturne galleon
#

Not sure why you should feel entitled to get the source code just because you bought the software. If that were the case, all software companies would go out of business. 🤦

little knoll
#

The "you can modify your car how you want but not the software that I paid" thing doesn't work if the software is offering you an API or a plug-in SDK. In that case, you effectively have the possibility to modify the software.

And even if you don't, well the contract you accepted when you bought your software is telling you anyways that you can't. If you don't agree to it, then don't buy it.

novel spear
#

its very unlikely having read access to source code would cause a company to go out of business

#

they still have patent protection and copyright on the code

#

and anyone who really wants to can figure out what a compiled binary is doing if they want to steal its secrets

#

unless its SAAS, its unlikely it would be an issue

next flax
#

releasing source can be a huge headache; most major closed source software you use probably has lots of variably licensed bits inside it, the legal hoops they'd have to jump through to release it may be insurmountable

novel spear
#

yea, thats the main reason companies dont do it

next flax
#

and even if they are surmountable, why bother? it's easier to just.. not

novel spear
#

it has very little benefit to them and costs money and time and legal exposure

#

but it wouldnt cause them to go under or anything

#

unless its SAAS, then the service nobody could reverse engineer

next flax
#

i'd really like to open source the stuff at my day job, but it's not practical until we start building stuff against a whole new stack -- one freshly engineered with being open sourced in mind

novel spear
#

then there is a big argument

#

yea thats the third problem

#

if you license an ip which doesnt let you open source

#

and even if you dont, it limits options down the road

#

but also many of these companies just slap a "you agree not to reverse engineer this" then pack the binary and call it a day on their binaries

#

although in some countries those legal protections dont apply in some cases, like in Canada you can reverse engineer for the purposes of compatibility

#

like an old game which doesnt run on newer windows

#

but its unclear if you can legally publish your findings

#

or what "compatibility" means hasnt been tested in court

novel spear
#

A lot of big known stuff is either black box reverse engineering or clean room reverse engineering

#

and potentially before DMCA

#

or not from the USA

nocturne galleon
#

There's many reasons it would cause immense harm to a business. I don't have the energy right now to explain all of them though. I'm sure if you think about it, you can come up with a lot of reasons.

vernal marsh
#

Tensorflow's website is awesome.. I guess that is made by Angular right? I can't think of any reason for google's team to not use that

novel spear
#

Tensorflow isn't related to angular

#

Oh the website

#

Idk

#

Looks like its polymer stuff

sacred shuttle
#

Need some help, in the log it logs numbers correctly and the servers, icons and names array are populated when I log them. When I hard code the number to for example 1 so it becomes: {{servers.[1]}} it works fine. Logging {{@index}} works fine, but logging the arrays with @index as number doesn't work. Having that console.log to look why it doesn't write the <a> tags correctly

{{#ifEqualOrHigher servers.length 1}}
    <h2>The bot is in {{servers.length}} servers where you have Manage Server permission.</h2>
    {{#each servers}}
      <script>
        console.log(`{{@index}} - {{servers.[@index]}} - {{icons.[@index]}} - {{names.[@index]}}`)
      </script>
      <a href="/{{servers.[@index]}}"><img src="{{icons.[@index]}}"></img>{{names.[@index]}}</a>
    {{/each}}
  {{/ifEqualOrHigher}}
#

@ me if you can help

#

nvm for now, think I found it

vernal marsh
#

@novel spear AAH... THAT MAKES SENSE

next flax
#

i used to do web stuff, went into game engine dev... every once in a while i get a real urge to revisit web dev and make a framework in c/c++ -- it could be so fast! -- but maaaan im pretty sure that is a terrible idea

ionic hull
#

@next flax ebay is doing that

vernal marsh
#

is there a limit to intellisense of visual studio for python? like it can only provide intellisense upto this level of the lib complexity because somehow in vs2019 python doesn't provide any intellisense for keras inside tensorflow but does provide for tensorflow ..

obsidian sluice
#

Does anyone have any recommendations for a second hand laptop under £500 that has a 1080p screen, decent processor (maybe 8th gen Intel or a quad core Ryzen) and at least 8GB ram? I'm hoping that laptops from a couple of years ago can now be found much more cheaply but I'm not sure what to even look for. I'm a Web developer working full stack in both ASP.Net Core C# stack and Node.js stack simultaneously with frontend JS frameworks thrown in too so I'm not exactly a light user. Any advice would be greatly appreciated!

spring radish
#

Anyone know the name of this practice

Boolean ? true : false;

And if lua have an eqv of it?

proper gale
#

being stupid? see previous answer because lua.

spring radish
#

...

#

There's no need to be an arse about things

#

To anyone else that might be interested in what it's called. Ternary and lua's eqv is ```lua
Condition and "result if true" or "result if false"

proper gale
#

oh, i thought you meaning using it actually as condition ? true : false; not what the structure is called.

#

ive seen code like that because reasons

#

i also dont like lua, at all

nocturne galleon
#

when you realise your project is due in 4 weeks and not october
😄 🔫

nocturne galleon
#

im making a program that automatically schedules your homework and revision

#

and yeah, just found out i have half the time i thought i did

nocturne galleon
#

does anyone know how i can use .gitignore to stop including __pycache__ in my repository? i tried using **/__pycache__/** but it's still being tracked

nocturne galleon
#

im not using python 2

#

and where is the period?

nocturne galleon
#

nvm figured it out

bright hazel
#

Hmm development. Does this also Count for coding ?

woven flower
#

yes indeed @bright hazel

bright hazel
#

Nice :). I am a php scripter and Made a script but I need Some one to test something out xd

#

In short. I created a filehost script That works with x-sendfile. Added a bit of code to iT so I can show the file as. Preview ( like mp3 Or video. All html5 stuff )
But I need to know If a timeframe of 5 seconde is enough to bypass the download protection

#

On iPhone iT works ( movie of 3gb can be watched ). But I do not know If iT works for pc. I mean If the video need to be started before iT sinds the code to the server Or That iT cach iT On load ?

#

Sorry for bad typing. iPhone autocorrects

#

To give a idea. This is the code for the file

#

<source src='./{$link}/{$tscheck}' type='video/mp4'>

median spire
#

are you trying to avoid triggering the download protection in web browsers?

bright hazel
#

Or In short. I am just looking for a kind of hot link protection

#

No. I got a download button users need to press to download the files

#

As those files are stored outside www folder. And I do not want them to hotlink them

#

A link looks like this. Website/code. Download happens with same link but with a post request so they can not directly link them

#

To let the video tags work I need to hotlink the file else it won’t load ( also because they are stored with out extension ) But I do not want it that users are able to share that code or to bypass the countdown counter

#

The problem is that I do not know if a video tag to the file with a time limit of 5 seconds is enough. Or that a user need to interact first before the “streaming” starts

bright hazel
#

Or that there is. a other way to prevent hotlinking

limpid reef
bright hazel
#

@limpid reef thank you , but htaccess wont do the trick this time , as it downloads the file that is outside public html, so a external file need to be called, that file is also used to serve normal downloads

#

in meantime i solved the problem i think

$domain = parse_url($http_origin, PHP_URL_HOST);
$domain = str_replace('www.','',$domain);
$allowed_domains = array(
  'dir.nu',
);
if (!in_array($domain, $allowed_domains))
{
             
            exit;
}```
nocturne galleon
#

yeah it's just for lols

odd cypress
#

I would exclude "I can't believe he [...] what I want". Just start with "The program gets a fatal exception..." However I like to see the use of code blocks. 😉

proper gale
#

i mean, this case its not that horrid, you can clearly see that the call to widget is where the error occurs, so its the call before returning NoneType

#

now imagine if it was an index out of bouds, that could be anywhere

proud ermine
#

hi there, just wondering if anyone here has done some sort of openssl programming? I ran into some issues with my rsa implementation using openssl for Intel SGX and the message doesn't seem to be decrypted in Enclave, it always says the padding error and I have noticed that it will always fail to decrypt as long as there is 0x00 inside the cipher text

mellow hound
#

my epic code

woven flower
proper gale
#

@proud ermine if you were using CryptoPP i could actually help you with that

proud ermine
#

@proper gale i need to use openssl because of its intel sgx support.

proper gale
#

What do you need sgx for?

proud ermine
#

it's a experimental project from my uni

#

but my problem is when decrypting cipher it says padding error and i noticed that it will definitely fail to decrypt when "0x00" exists within the cipher

#

i've written two different versions of rsa implementation, one from openssl and another one from intel-sgx-ssl implementation

#

intel-sgx-ssl implementation fails to consume the cipher with "0x00" and openssl does not

nocturne galleon
#

GUESS WHOS AN IDIOT

#

ME

#

i spent the last 2 days trying to fix 'NoneType' object has no attribute 'widget' without realising that the function i call it in literally removes that widget 1 line before it's called

peak mica
#

Nah, you're not an idiot

nocturne galleon
#

im still in a kind of shock that it was that easy

#

😄 🔫

vernal marsh
#

flutter? @nocturne galleon

nocturne galleon
#

yeah

#

atleast i think that's what it was, i haven't actually tried yet

#

there we go

#

now i can finally close that issue and move on

bright hazel
#

can you send headers from inside a class ?

#
class Header
{
 public function Gone(){
            header("Cache-Control: no-store");
            header("HTTP/1.1 410 Gone", TRUE, 410);
            exit;
}
} ```
#

or should i use return instead ?

deep scarab
#

you might want to learn to code first before doing whatever you're doing

bright hazel
#

already solved

#

but this is just strange

#

let me trow in the code ... so you can see

#
$bind = array(":link" =>$link);
$control = $db->select("files", "link = :link", "", $bind, "fetch");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://{$control['host']}/ajax/check.php?check=download&download={$link}");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($curl);
curl_close($curl);
$output = $output?$output:"404 Not Found";

i got this exact same code in a header file that get included , it shows the stuff i need , but in my other page it does not get the string value even it does show it in var_dump

if ($output == "virus")

 public function Check($link)
            {
            $bind = array(":link" =>$link);
            $control = $this->db->select("files", "link = :link", "", $bind, "fetch");
            $exist =  file_exists(Config::DOWNLOAD.'/'.$link);
            if ($exist AND $control){
            return "Download {$control['file']} now from fileshare.site";
            }
            elseif (!$exist AND $control)
            {
                return "virus";
            }
            else
            {
                return FALSE;
            }
            } 
#

and because you ask it so nice, to make the code complete

switch ($check)
{
    case "download":
    echo $checkfile->Check($download);
    break;
}

also @deep scarab , i am writing a download script , so far it works , now i just need to get my multiserver check to work 😄

#

return value is this => string(7) "virus" , header file takes it as it sets it as title like it need to be , but the script does not get the variable to use as check, why does it do that ?

#

nvm , it seems that curl provide a whitespace or whitetab for some reason ... it shoulnd do that 😦

proper gale
bright hazel
#

xD

burnt walrus
#

It's so beautiful 😿 linusKappa

bright hazel
#

o well , some one need to code to get the job done 😄

inner wraith
#
import requests
from bs4 import BeautifulSoup

credit_url = 'https://m.telstra.com/boost/viewBalanceAction.mml?a=view'
raw_credit = requests.get(credit_url).text
parse_credit = BeautifulSoup(raw_credit,'html.parser')
parsed_credit = parse_credit.findAll('p')
data_allowances = []
for i in parsed_credit:
    tag_contents = i.contents[0]
    if 'GB' in tag_contents:
        data_allowances.append(float(tag_contents.split()[0][:-2]))
    elif 'MB' in tag_contents:
        data_allowances.append(float(tag_contents.split()[0][:-2])/1000)

for i in data_allowances:
    print(f"{i} GB")
print(f'{round(sum(data_allowances),3)} GB total')
#

^ Works for Telstra, Boost, maybe others that use Telstra's network.

fickle abyss
#

do you need to login or anything?

inner wraith
#

No.

#

Assuming you're on the network in question, it just works.

fickle abyss
#

ah

#

interesting

inner wraith
#

Scrapes their little webportal for credit.

#

URL might need a tiny tweak for other carriers bar Boost.

distant dome
#

a few Znver2 benchmarks via gcc10

late pollen
#

Hi guys, does anybody know a way to write documentation for software on GitHub pages?

#

Are there any templates available?

nocturne galleon
#

how come I can't get self.setWindowIcon to work? it doesn't crash the program or anything, my application's icon just doesn't show up

#

nvm

#

i forgot relative paths were a thing

ripe summit
#

@inner wraith should you not be dividing by 1024?

inner wraith
#

Not here. @ripe summit

#

Blame the telco.

ripe summit
#

Interesting... I know Vodafone MVNOs use 1024

nocturne galleon
#

stack overflow is bullying me 😢

near prism
#

sad boi hours

nocturne galleon
proven yacht
#

++

vernal marsh
#

what do you guys use for getting time intervals in cpp? like for a function? @proper gale

proper gale
#

what do you mean time interval?

#

@vernal marsh

vernal marsh
#

yeah

#

I tried using std::chrono but somehow I am getting 1001067ms for running a function lol @proper gale

#

1001.067 seconds that is Lol

proper gale
#

how are you measuring it?

vernal marsh
#
int main()
{
    const int arraySize = 5;
    const int a[arraySize] = { 1, 2, 3, 4, 5 };
    const int b[arraySize] = { 10, 20, 30, 40, 50 };
    int c[arraySize] = { 0 };

    // Add vectors in parallel.
    auto starttime = chrono::high_resolution_clock::now();
    cudaError_t cudaStatus = addWithCuda(c, a, b, arraySize);
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "addWithCuda failed!");
        return 1;
    }

    printf("{1,2,3,4,5} + {10,20,30,40,50} = {%d,%d,%d,%d,%d}\n",
        c[0], c[1], c[2], c[3], c[4]);

    // cudaDeviceReset must be called before exiting in order for profiling and
    // tracing tools such as Nsight and Visual Profiler to show complete traces.
    auto endtime = chrono::high_resolution_clock::now();

    auto totaltime = endtime - starttime;
    cout << "totalTime : " << totaltime / chrono::microseconds(1) << endl;
    cudaStatus = cudaDeviceReset();
    if (cudaStatus != cudaSuccess) {
        fprintf(stderr, "cudaDeviceReset failed!");
        return 1;
    }

    return 0;
}```
#

that's cuda project template's main funtion.. and that's how I did it

proper gale
#

is it taking 16 minutes for that function to run?

vernal marsh
#

nope lol not even a second

#

simple vector addition that is

proper gale
#

if the answer is no, thats because its actually in ns when you get it.

vernal marsh
#

aaaahh but why ..

#

I am dividing it by microseconds 😕

proper gale
#

thats, not how that works

#

also, high_resolution_clock is shitting out nanoseconds

#

assuming you are x86 linux or windows, its technically implementation defined and can be different but ns is the most common

#

what do you want your output in, microseconds?

vernal marsh
#

ye

#

oooh.. is there any other way to get time intervals? I just want to verify

proper gale
#

std::cout << "total time : " << std::chrono::duration_cast<std::chrono::microseconds>(totaltime).count() << std::endl;

#

besides system specific ways that is how std::chrono is, not really.

#

besides, std::chrono is fine, and is very accurate if used correctly.

vernal marsh
#

thanks @proper gale I will just check that..

#

aaaa what?

#

cuda profiler says 0.3 ms for application level after a few launches

#

and chrono almost comes near 0.4

#

@proper gale

    std::chrono::duration<double> totaltime = endtime - starttime;
    std::cout << "total time : " << totaltime.count() << std::endl;
#

this worked

#

I still wonder why didn't that work

proper gale
#

you realize that cuda.exe is .28 seconds, or 280ms, right?

#

they aren't measuring the same thing

vernal marsh
#

I think its just measureing kernel time ryt?

proper gale
#

no

#

no, thats not at all what its measuring

vernal marsh
#

oo its the entire applicatoin

proper gale
#

and then some

vernal marsh
#

soory I read that 0.28 ms

mortal lagoon
#

I've been wanting to write my own fan controlling program in C to optimally use a touch screen i got my hands on. Does anyone know how to interact with the PWM chip on the motherboard?

next flax
#

if you are trying to measure gpu time you need to force cuda to block/sync

#

or iirc cuda has native timing stuff

#

you should use nsight tho, not just the overall trace timing, it has really precise timing/perf metrics

vernal marsh
#

nsight is good for kernel timings and memory debugging in gpu as other tools doesn't have access to those things

#

I was just wondering about doing it programmatically ... I knew I could use VS's debugger and just breakpointed before the function and just run that... this would have also given me the timing

#

LOL yesterday I think I just looked the timing 0.28 and just assumed it in ms and further considered it as kernel time as.. the function coming just above that 😛

terse jay
#

Is this channel suitable for asking computer architecture questions? (no coding)

tulip oracle
#

Compute arch? like x86 or arm?

hushed onyx
#

Quick question, does anyone here know how to deal with steam API for html webpages? If so, HMU in the DMs please

next flax
#

@vernal marsh cudaEventElapsedTime looks like the way to go for prorammatically doing it

spare mason
#

Anyone know any good resources for Haskell?

lavish stream
#

okay why does my CMD if statement completely break if it tests for an undefined variable?
shouldn't it just... not read the if statement?
say the variable test is never set, shouldn't it just completely ignore the if statement?

next flax
#

quote it, i think?

lavish stream
#

I'll try.

#

didn't work.

#

one moment

#

it doesn't completely crash now but now it won't test for the variable?

#

the directory does exist and I did specify y (i want to delete the directory), however it goes to the else part of the "%delete%"

#

@next flax thanks for the insight regardless of the outcome 👍

next flax
#

batch files are terrifying

lavish stream
#

oh my I think I might have made a big error

#

I uh

#

I am ashamed to say

#

it was my messy quotations

#

in line 66 I opened and closed quotations in my declaration of the delete variable (in the user prompt text) and then the (y/n) closed the if statement prematurely, causing it to read the = " as a new command completely breaking the script

#

@next flax just updating you idk if you care about this but yea...

next flax
#

no worries :) glad it works!

lavish stream
#

It totally hecking works

#

one fourth of the script is now finished

#

ok so apparently the solution/reason i described above wasn't the reason

#

but it's okay

#

i've just removed the entire freedom of the user

#

just deleting the existing folder automatically

#

:sigh:

#

until i find a fix that'll have to do

lavish stream
#

after hours of painstaking work in batch (i barely know batch or cmd so yes it was painstaking)

a cool little script to install a quick spigot test server (minecraft)
https://youtu.be/Fb6HGGUwhhE

a little script to quickly install a spigot test server paper, bungee and waterfall support coming soon :D

▶ Play video
lavish stream
#

@next flax it finally works without hiccups now

#

with the help of the kind folks over at adafruit we figured out you can't set variables with /p tags inside if statements

#

unless you add extra options to the top of the script

vernal marsh
#

@next flax well that's a good idea.. thanks

vernal marsh
#

I went back to my testing project last time to check on the cudaEventElapsedTime

#

only lead I have is.. this might be running on gpu instead of that might result in delay

next flax
#

what do you mean "changing" ?

#

the times are different because they are tracking different things

#

the cpu-side one is probably just checking how long it takes to tell the gpu to do something, not timing how long doing that thing actually takes

#

you can't really time graphics/compute stuff by taking cpu timers

#

unless you force the gpu/cpu to sync up a lot

inner wraith
#

For some reason I have a snippet of code that only sometimes is a syntax error in Python, but then nothing changes and it works. Same Python version for all occurrences and it's driving me nuts.

#
class easy_deploy:
    def __init__(self,
        routeros_packages: dict,
        firmware_version: str,
        firmware_local_path: str,
        firmware_path: str,
        <more of the same>
    ):
#

The line with routeros_packages: dict, occasionally throws a syntax error.

#

Python 3.7.3

#

This happens when loading the file... sometimes... But not other times. I can't think of a sane reason why this would occur.

inner wraith
#

It's freaking out over the variable annotations.

#

But... only sometimes, and only in VS Code, same interpreter started from a shell works fine.

#

I've checked VS Code is using 3.7.3.

spring radish
#

Anyone got any suggestions/solutions for tracking changes in large files

#

git LFS wasn’t a solution that worked

#

The final repo size was too big

stray acorn
#

How big are you talking about?

nocturne galleon
#

ok now im just confused. i have 3 python files, 2 of them access a list in the third, the problem is, the first file can see the list and its contents, but when I try and print the contents of it or do anything with it through the second file, it thinks it's empty, no runtime error or anything

spring radish
#

@stray acorn it’s about 5600 files or so total to be tracked, the biggest ones being 35mb a pop

next flax
#

svn/perforce are common at game studios, where many/large binaries are important

#

(terabytes sometimes!)

spring radish
#

Ah

vital shuttle
#

Hey, would this be the right place to ask for some coding advice? 🤔

vernal marsh
#

@next flax right.. I should have deleted that message... I realized that after posting ... thanks though

nocturne galleon
#

HOLY SHIT MY CODE FINALLY RUNS LETS GOOOOOO

mild patrol
#

Hey does anybody know a good server provider for high volume file storage? (like amazon s3)

limpid reef
#

Amazon, Google Cloud, Microsoft Azure - those are the big 3 providers.

mild patrol
#

I think i'll go with amazon then, a bit worried about performance

ancient loom
#

Faded's typing intensifies

#

.......

#

I am confused with the idea

#

Location based games console

#

for android

#

A device that turns something on when you get near it?

#

Pretty sure things like that exist

#

You mean it streams your PC to your phone

#

You mean an emulator?

#

Play phones games on the PC?

#

That's just streaming your phones display to your PC

#

Airserver does that

next flax
#

@still seal might burn through a lot of phone battery acting as a streaming server

main root
#

i somehow got from learning angular to... 2048 as weird Javascript game

vast echo
#

angular is awesome

vernal marsh
#

isn't 2048 angular's one of the official tutorial if I remember correctly

#

🤔

#

or was it react.. I don't remember

main root
#

i built it in plain js

#

👀

#

ok i used jquery but i count jquery as kinda plainjs

proper saddle
#

Jquery is just simplified vanilla JS. :V

graceful silo
nocturne galleon
#

gl

vernal marsh
#

@main root yes I was just thinking if that was a thing that my brain remembered correctly after seeing kewords web dev and 2048 LOL.. and it was react tutorial

rough bridge
#

I'll just use python that way i can use "elif"

shut stump
#

What's the best way to detect if a message contains a password?

#

It's for my discord bot to delete the message if the user sends a password in their message

vast echo
#

seems like a hard thing to do without having a list of passwords

#

the only thing I can think of is blacklisting the phrases: "my password is" or "the password is"

deep scarab
#

yeah, how would you differentiate a password from just a normal word?

#

if the user just has a randomly generated password, how would that be any different from someone smashing random keys on their keyboard

proper gale
#

@rough bridge reeeeeee, elif

next flax
vast echo
#

thanks I hate it

proper gale
#

^

proper saddle
#

wtf

fervent thicket
#

if i got a variable that gives back an array of text, and the total of those array together is more than 2k what can i make so it stores it in someway or form in batches below 2k characters

nocturne galleon
#

@fervent thicket Would help to know what language, and what you mean by "batches below 2k characters"

fervent thicket
#

Sorry i wrote that when i was pretty tired and slept after

#

Its in javascript, for a discord bot using discord.js

nocturne galleon
#

Ok, so you have 1 array with a single string of 2k characters or 2k different strings in an array?

#

And what do you want as the end result?

fervent thicket
#

Well I got one string that is over 2k characters

#

What I want it to do is for the bot to check if the string is longer than say like 1950 characters or such cut it and send the first half then the second etc.. until it is all sent

#

I can share my code if you that helps?

#
let emojiList = message.guild.emojis.map((e, x) => (`\`${x}\`` + " = " + e) + " | " +e.name)

  message.channel.send(emojiList)```
nocturne galleon
#

Instead of mapping into a string, do a for each into an array of strings.

#

Then loop through all your array items and build out a single string message

#

Inside the loop, if you're message is greater than 2k characters, then post it.

#

At the end of the loop, post your message.

#

I'm out at the moment but when I get back I can write it out.

hazy bobcat
#

So I want to do 3 things in this project of mine. Basically it's a mod manager in Python that just installs mods however the 3 steps I want to get done are a bit circling me.

  1. have a list of MD5's and have a for loop check if either the files extracted or the ZIP equals a md5 hash or whatever hash is better in them
  2. check if the filename of the zip such as development-1.1.1-mod for a list of words and if it finds a exact word in it, to report true else false so if I wanted the development word flagged, I would want to get it out of the file name of the ZIP.
  3. hide said code in a existing py with a obscure important name to avoid people trying to reverse engineer it

Thing is that several mods are banned from the main hub and people are still distributing it so I would like it to NOT be used for those mods and hopefully get others who have the same idea as mine that don't have it to enforce said policy

#

I know the md5 import but unsure on actually making a define or class to be called in the middle of it

nocturne galleon
#

@fervent thicket

// Fixed number for message length
const maxMessageLength = 1950;

// Store our running length as we post the messages
var messageLength = 0;
var msg = "";

// Loop through all our emojis
msg.guild.emojis.forEach((emoji, i) => {
    // Build out the string we will add to our message
    var newEmoji = (`\`${i}\`` + " = " + emoji) + " | " + emoji.name + "\n";
    let newEmojiLength = newEmoji.length;
    
    // If our message will exceed 2000 characters, 
    // then we need to send it before we add this to our message
    if (messageLength + newEmojiLength > maxMessageLength) {
        message.channel.send(msg);
        
        // Reset for next message
        messageLength = 0;
        msg = "";
    } else {
        // Add to the message and carry on
        msg += newEmoji;
        messageLength += newEmojiLength;
    }
});

// If we have a message to send at the end
if (messageLength > 0) {
    message.channel.send(msg);
} else {
    message.channel.send("No emojis! :sad:"); 
}
fervent thicket
#

@nocturne galleon oh wow! Thank you! the variable emojiList does bring back a array of strings etc.. unless i .join(" ") them, ill tey your code ^^ :D momento

#

it works! Holy crap! Thank you so much :D

nocturne galleon
#

@fervent thicket of course, enjoy

nocturne galleon
#

@fervent thicket just reread it. You'll want to take the contents of the else block outside of the if statement because you'll miss that 1 emoji if it sends the blocked message

teal wolf
#

They changed the blender UI?

#

why the hell did they do that

#

im so confused rn

shut forge
#

atom best editor? atom best editor

/s

nocturne galleon
#

if vscode could stop crashing every 10 seconds I might be able to fix it

main root
#

vscode can crash?

#

it seems to me that that thing is the most stable out of all of Microsofts software

ruby path
#

ive never seen vsc crash tbh

nocturne galleon
#

if your python program stops responding and you close vscode's terminal, the whole thing becomes unresponsive

main root
#

websites are a mess change my mind,
Javascript + jquery
angular
HTML
css + bootstrap
a way to connect to a database
database
:|

#

aaand im having trouble understanding angular

main root
#

im wiser but not smarter

#

after that guide

quasi plover
#

Why I am not getting manifest, Java, and res folders in my Android studio?

deep scarab
#

try file > sync project with gradle files

ember kiln
#

@quasi plover That looks right to me - you are viewing the directory structure rather than the module structure, so the stuff you're looking for is in app/src/main

quasi plover
#

thx for helping guys

novel spear
#

Yalls ever notice how the hardest part of fixing bugs isnt fixing them. Its reproducing them

next flax
#

most of my week has been trying to set up dumb environments to repro :(

#

sometimes being the multi-platform guy is the worst!

next flax
#

debugging controller hotplug issue on linux:

  • fire up vmware
  • vmware graphics driver crash (weird, i've used this a lot before)
  • ok, uh, let's swap to my unraid box to give physical gpu to linux
  • unraid not so happy about usb hot plugging
  • ....
  • go to QA and get a real bare metal linux box and bring it back to my desk
fervent thicket
#

I dont think I quiet understand object blocks and stuff, I got

let {body} = await superagent.get("https://api.adviceslip.com/advice")
    console.log(body.advice)
    if(!{body}) return message.channel.send("Error")
    )```
But my `body` and rest from the API all come back undefined, could someone teach me how to do it correctly 

I am using superagent in node js with discord.js
spring musk
#

Anyone active?

#

Use of unassigned local variable

#

even though they are assigned

#

Any clue why?

fervent thicket
#

@last ingot the link gives back {"slip": {"advice":"The best nights out are when people around you are simply having fun.","slip_id":"204"}} which is a json I believe 🤔

#

im confused, i did this same thing with another api link and it worked tho ? :/

fervent thicket
#

Do you happen to know any advice api's?

#

This is the api's website, not that i understand it xD

#

You mean grab the whole advice list?

plush walrus
#

Hi I’m new here and unsure who to talk to so...I think I have a solution to ransomeware

#

My laptop was infected a while back and I got rid of it easily

novel spear
#

Typical ransomeware encrypts files so the only solution to getting rid of it is a restore from backup

#

Because encrypted files can not be recovered without the key

proper gale
#

@spring musk they are declared, not assigned. and have you gone over arrays yet?

sturdy scaffold
#

If you have ransomware, call the local Police station NON-EMERGENCY line. They should be able to remove familiar types of ransomware from your PC.

#

DO NOT CALL 911 over this.

deep scarab
#

@spring musk you didn't initialise them

#

so they'll contain garbage values

icy stone
#

I need some Java Node.js Discord bot collab help. Anyone who reacts on this means that I will put us in a group chat so we can all collab on it. I will give you the code file (not showing the token) and you can change it to the desired commands/arguments/administratives.

#

I would recommend putting const lines at the top if you need it.

#

If we need to voice chat, we can, but I am limited to my parents as a 13 year old, so I'll need you to not use curse words a lot, and I can't deal with derogatory words.

#

I will do it tommorow at 3:00-4:00 central.

deep scarab
pure estuary
#

🤔

icy stone
#

delayed til august 28

quasi plover
#

hey

#

can u tell me what's wrong with that ?

quasi plover
#

plz help

woven flower
#

bruh you really think you can ping luke and he's gonna reply... the man has a job lmao

#

you'll prolly just have to wait for someone to see this

quasi plover
#

well he made floatplane he can probably answer me

woven flower
#

I'm sure he could answer your question but pinging him and expecting a reply is a bad move

#

considering...pinging staff is against the rules afaik

quasi plover
#

pinging what ?

#

i didn't know that

deep scarab
#

it's common sense to not ping mods for trivial issues

#

and i don't think ids can start with numbers

nocturne galleon
#

who's pinging who?

nocturne galleon
#

aaah shit this project will not be finished on time ☹ 🔫

split condor
#

@quasi plover, it looks like you are trying to do variable.number which you cannot do

#

what are you trying to accomplish with that?

#

if you are trying to add .3 onto it you can do variable + .3

#

(please ping me if you respond or I probably will forget to check again :/)

quasi plover
#

@split condor i just wanted to make a calculator and i got figured out somehow thx anyway
btw that's my first project ever i'm still new and don't even know java just googling stuff

quasi plover
#

is there a smthg.setText(dfd + ""); equivlent ?

split condor
#

String#valueOf can be used in place of that

#

Not sure exactly what you’re doing though. Glad you figured out the other thing.

nocturne galleon
#

I have a Game Development opportunity available. We are basically making Star Wars Battlefront 2 2005. There is currently no pay as we are working on the demo to submit for funding.
What we have:
Many developers with programming, modding & other experiences. We already have the game networked online with selectable classes & enterable tanks.

What we need: More programmers
If you're interested, complete the following lessons:
https://www.codecademy.com/learn/learn-git
https://www.codecademy.com/learn/learn-java
Following this, there must be pre-existing examples of Unity projects or completion of:
https://learn.unity.com/tutorial/survival-shooter-training-day-phases?projectId=5c514921edbc2a002069465e#

Finally, submit a demo with the Mirror API obtained from the Asset store in Unity 2019.3's newest edition. Documentation available here:
https://mirror-networking.com/xmldocs/

These are the pre-requisites because you'll need to know these things on a daily basis.

Age, sex, & experience doesn't matter. We want drive to work in a structured team. PM me if interested.

FAQ:
I know Java...
It'll take you no time to complete that short lesson then.
What's the pay?
We don't have pay right now. We're searching for funding after we develop a more complete prototype.

next flax
#

java+unity ?

nocturne galleon
#

@next flax Java is similar enough to C#. I need people to understand OOP.
@last ingot no.

#

I’m not about to have a language debate.

#

Yes. It's a cross platform language designed to be usable by C++ and Java programmers. I know. I've been using it for 5 years.

#

What's your point?
I want people to understand OOP principles so I gave them a lesson that teaches that.

#

Okay?

next flax
#

not debating which language(s) you should use, but if you're trying to get people with that little experience in, you should probably find lessons to match the language

#

if they are really really new to programming they will be struggling enough with it, don't add in transferring concepts between languages

nocturne galleon
#

@next flax I'm requesting anyone & everyone. If they're new to programming, this will get them up to speed rather quickly. Most of Java's core syntax is exactly the same as C#. When they do the Unity Tutorial, they'll learn C# but have a good deep understanding of the design structure. Syntax is nothing.

sterile lily
#

Any thoughts on the Rust programming language?

vestal glen
#

it's neat, and like all languages has its tradeoffs

novel spear
#

Its good for anything you want to be fast and essentially gaurenteed safe

#

But is rather verbose

cloud knot
main root
#

that chart is wrong

#

reality usually drops below 0 in the middle

manic plover
#

does anyone here use python?

#

need some help dealing with datetime

woven flower
#

sure what's up

#

I've done a little bit of datetime stuff

manic plover
#

i'm getting a value from database as a datetime.deltatime object, is there anyway I can convert it easily into a datetime.time object?

woven flower
#

deltatime is an amount of time between two measurements, yeah?

manic plover
#

yeah

#

so the deltatime object actually has the time of day

woven flower
#

I'm not sure what you mean by converting that back to a time object, since isn't it inherently mostly like an integer/value?

#

hmm ok

manic plover
#

but the ORM i have is returning it as deltatime

woven flower
#

so like a time elapsed from midnight for the date or something?

manic plover
#

yeah time from midnight

woven flower
#

ok and you're trying to turn that distance from midnight into the actual current time object?

manic plover
#

yep

#

i already tried time.mid + deltatime

woven flower
#

hmmmm. cause that was gonna be my guess
iirc you can just add deltatime to a datetime.time object and it just work™

#

or that's how it's supposed to go

manic plover
#

that gave me an error saying unsupported operand '+' for time and deltatime

woven flower
#

hmmm

#

there's a way to add those together but I can't remember it off the top of my head

#

lemme do some research

#

so apparently there's a method to go about this

#

there's no native "datetime.time + deltatime" support which seems odd

#

but you can combine a datetime.time object with a deltatime using datetime.combine

manic plover
#

oh cool

#

i'll try that

quasi plover
#

what are the minimum specs to run and use android studio

#

and is android studio or visual studio is better

#

plz help

manic plover
#

what do you mean? they are meant for different things

#

android studio is used for building apps for android
and visual studio for mostly building .net apps and some other stuff

woven flower
#

yeah Android Studio is for building android apps
while VS is made for coding in general, w/ focus on Windows-oriented stuff too

quasi plover
#

well visual studio can also be used for android apps with xamarin

manic plover
#

well are you using xamarin or are you using the native android sdk?

quasi plover
#

idk i'm new to this but i'm goona buy a new pc so i just want a the minimum specs that i can buy

manic plover
#


    Microsoft® Windows® 7/8/10 (32- or 64-bit)

    The Android Emulator only supports 64-bit Windows (learn more).
    4 GB RAM minimum, 8 GB RAM recommended
    2 GB of available disk space minimum,
    4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
    1280 x 800 minimum screen resolution

quasi plover
#

i'm using linux

#

manjaro deepin

manic plover
#

Linux

    GNOME or KDE desktop

    Tested on Ubuntu® 14.04 LTS, Trusty Tahr (64-bit distribution capable of running 32-bit applications)
    64-bit distribution capable of running 32-bit applications
    GNU C Library (glibc) 2.19 or later
    4 GB RAM minimum, 8 GB RAM recommended
    2 GB of available disk space minimum,
    4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
    1280 x 800 minimum screen resolution

#

basically the same thing

quasi plover
#

cool so no 2gb ram

#

that's some extra 20$

manic plover
#

i'd suggest a minimum of 8GB tho

#

unless you can bare with a particularly slow experience

quasi plover
#

well i'll see i can still upgrade tho it has 2 ram slots i'll try 4gb if it's slow then i'll try 8

#

which means more money

#

damn

quasi plover
#

manjaro is way better it has AUR and blackarch repos + you can install .deb files in it

#

and with the deepin envirenment you i'll be stunned with it's looks

#

@last ingot

manic plover
#

eh fedora is better

#

no need to pacman -Syu to download a gig of updates everyday

inner wraith
#

KDE's great.

snow harbor
#

Hi everyone. I don't know if this is the correct place for this but anyways. As you may know Valve has released a modified Wine, which is called Proton (Steam Proton) for gaming on Linux. But It still has flaws. There is one problem we are trying to solve here : https://askubuntu.com/questions/1169612/how-to-lock-mouse-cursor-to-the-middle-of-the-screen-18-04

#

Basically, (although not always) whenever you alt-tab from game and alt-tab back to the game, game behaves like as if there is a cursor on the background and when you try to look around, you just can't after a certain angle. Because cursor hits the screen border, there is no more room for it to go.

#

Anyone has any idea how to fix this, or find a way around?

#

This is a huge problem specially in FPS games (or basically any games where you have crosshair). Also in strategy games, since you can't move camera around by just moving your in-game cursor to screen borders (I guess It recognizes it as a desktop cursor, I dunno).

next flax
#

fix as like an end user?

#

as a hack workaround can you run a script that just constantly sets the mouse to the center or something?

snow harbor
#

we have tried xdotool and swarp for that. xdotool's mouse reset works not like a reset, but more of a traceback, which resulted in : lets say, rotating left with user input, rotates back to right due to xdotools

#

swarp did something similar, except it also does a left mouse click whereever it warps, in this case middle of the screen, which resulted in us having difficult time to even close the script

#

im not primarily into coding so i might need some time to figure out how xautomation works but will definitely try that

snow harbor
#

apparently xautomation also does a "move" action rather than "set". it mimics mouse movements to a position you enter. any solution that does a "move" action/mimic won't work. it should just snap and sets the mouse at x,y

sturdy scaffold
#

So, if I wanted to record infrasound, what would be the best method? Take a woofer and convert it into a microphone, create a microphone from phone barometer, or create a resonance microphone using steel wire and electric guitar pickups? Which one would be the best value (quality/cost)?

#

The phone barometer has an effective resolution of 10Pa.

quasi plover
#

hey

#

i need help

#

why doesn't the top bar in the viewer doesn't show up

#

in the place of tha rred box

novel spear
#

I assume it means its broken

#

But you didnt post any code or xml

main root
#

ye code would be great

shadow hawk
cursive umbra
#

If anyone is familiar with Google Sheets, I'm having a brain-fart in regards to Lookups.

My current formula is: =IF(DB_VehicleRecipe!$U$28=0,0,DB_VehicleRecipe!$U$28)

My goal is to make the row number (ie 28 in this example) a variable.

Essentially, =IF(DB_VehicleRecipe!$U$var1=0,0,DB_VehicleRecipe!$U$var1) where var1's value is in another cell. I'm lost in how to achieve this.

cursive umbra
#

Nvm I just learned about INDIRECT and that solved my issue! 🙂

visual plank
#

Is there any way to know the type of a template variable at runtime?

#

In c++

#

I'm trying to write this piece of code which uses templates and I've hit a dead end of some sorts. I've gotta do something if its of type 'a' and something else of its of type 'b'
I tried using typeid and demangling the result but didn't work out for me as the code doesn't compile. I get an undefined reference to demangle ABI::cxx

deep scarab
#

maybe template specialisation?

visual plank
#

But in my case it'd make my code redundant

#

Like there's this function which remains the same until this very line where the data type is to be considered

#

I can just write it in a different function but I just wanted to learn a bit bout demangling

deep scarab
#

hmm, typeid works ok for me

#

have you included typeinfo?

visual plank
#

Yep

proper gale
#

@visual plank decltype

#

theres a whole bunch of fancy bullshit you can do with templates.

dim shard
#

@quasi plover is that Java

#

just making sure

quasi plover
#

yes @dim shard

visual plank
#

@proper gale I know. Very hard to understand and debug errors though. I need two monitors just to be able to read those error messages

#

Which don't make much sense anyway

visual plank
#

Kinda like template overloading?

fallow lantern
#

I'm having trouble connecting to SFTP from a ubuntu console..

I'm always getting connection timeout. Tested 2 servers already to connect with, both work trough filezilla no issue..

proper gale
#

how are you trying to connect to them?

raven kernel
#

is the server local or over the internet?

#

Try checking the firewall of the system your connecting to to see if it allows port 22

cloud knot
zealous kayak
#

anyone here using laravel?

worthy dirge
#

@visual plank check out std::is_same<>

proper gale
#

@worthy dirge dont forget std::enable_if

worthy dirge
#

lafrChamp Thx man, I need to refer to cppreference

upbeat folio
#

tfw your coworker didn't specifically target his assertions, so you have to rewrite his entire testing suite because your code affects the output.

worthy gulch
#

has terminal-based C++ development any benefit over a full IDE?

#

in linux

thin cobalt
#

Anyone good with Electron/Nativefier?

#

Im trying to make native versions of G suite where they each open in the correct app

#

The trouble is passing the urls to the electron apps

#

And getting them to open it properly

proper gale
#

@worthy gulch there is a lot of inbetween there too, but what are you really asking about?

#

both lightweight/minimalistic development enviornments and full heavy weight IDEs have their advantages

#

and everything inbetween does too

worthy gulch
#

@proper gale I just started developing C++ in Linux

#

found the terminal and scripts to build, and embedded code app to be pretty comfortable

#

and less distracting than Visual Studio in Windows for example

#

but I don’t know what are the limitations of such method, I’m not very advanced

proper gale
#

the main benefit of IDEs, is project awareness

#

the main disadvantage of IDEs, is project awareness

worthy gulch
#

lol

proper gale
#

ill explain

#

basic code linting is pretty easy to do, you misspelled a word, missing semicolon, etc, eazy.,

#

undefined variable, ok, doable.

worthy gulch
#

oh yeah im missing a debugger

proper gale
#

but, what happens when you want to know what file you need to include something from

#

small project, no problem, chrome, oh god oh fuck

#

I would recommend you get yourself Clion

#

its the IDE i use for C++, and it uses cmake.

worthy gulch
#

oh, is it free?

proper gale
#

nope

#

if you are a student you can get it for free though

worthy gulch
#

might want to look at it, I haven’t been having much luck with recommended IDEs

proper gale
#

you ever used IntelliJ IDEA?

worthy gulch
#

oh alright, will check it out

#

nope

proper gale
#

anything from Jetbrains?

worthy gulch
#

tried netbeans and eclipse

#

i think i tried something but i dont remember

proper gale
#

Android Studio?

worthy gulch
#

nope

proper gale
#

hmm, well, its JB's C/C++ IDE, sooo

worthy gulch
#

sublime text is not a proper IDE is it

#

its usually recommended as it but it’s more of a plain text editor with useful developing tools

proper gale
#

yea, no, thats one of the inbetween ones.

worthy gulch
#

i see

worthy dirge
#

why not visual studio

proper gale
#

because Linux?

worthy gulch
#

will check everything you suggested

#

VS Code aint a ide sadly

worthy dirge
#

you can do ssh remote connection in visual studio

proper gale
#

fuck that shit

#

development over ssh isn't nearly as nice as on the computer you are on

worthy gulch
#

meh would rather mess with the terminal

proper gale
#

i say this as i have remote dev setup to two servers right now

worthy gulch
#

lol

proper gale
#

i also find Clion to be a beter C++ IDE than VS, but thats mostly preference.

worthy dirge
#

For me , have gui -> Clion, if not -> visual studio ssh

worthy gulch
#

I’m a student but outside software developing field

#

so even if I qualify it wouldnt be profitable for me, im just an enthusiast

#

thats why id test out an open source alternative

proper gale
#

they dont really care, doesnt cost them anything to give it to you, and if you like it they do get money later

worthy gulch
#

oh its like autodesk

proper gale
#

@worthy dirge i also deal with ROCm a lot myself, which requires Linux, so i have a few reasons to not develop from Windows

worthy dirge
#

ok

worthy gulch
#

@proper gale imma check Clion then, thank you!

proper gale
#

i really need to move my project to a different SSD, but ehh, and what one to use.

#

i got both of my NVME drives, but do i want to use one for projects, or not, or should i clean off my old windows one, decisions decisions

worthy dirge
#

JetBrain IDEs are slow as ever. I really want to avoid them if possible

proper gale
#

oh, i just built my computer do handle it

#

and will be getting a new CPU as soon as TR3000 comes out

#

hmm, maybe i should give it more than 32GB, its complaining about being low on memory

shut grove
#

Jetbrains IDEs are awesome

peak mica
#

Yes they are.

brazen sluice
#

Ok, so im afraid to ask this question in an actual Programming discord, so ill just ask it here. What is the best way to scrape this table from this site? (im trying to have an automatically updating work schedule offline, incase my work tries to do some funny business)

vast echo
#

do they have an api?

brazen sluice
#

I doubt it, its just a part-time job since im still in school

#

how do i know if they have an api?

limpid reef
#

You ask if they have an API, or you find out what vendor they're using and research if they have an API. Chances are even if they have one, you won't have privileged rights to create an API key, so your best bet might be scraping the site using python, then outputting it into XML, CSV, or whatever format you want.

#

Or you could do what I did where I work: constantly hound the company to support a scheduling system that provides an iCal link so it can integrate directly into Google Calendar, Outlook, or Apple Calendar by way of leaving passive comments on every page of internal documentation for the scheduling system.

cloud knot
#

@brazen sluice well, i would look at the source code of the table. most likely it is just a HTML table etc. but without seeing the source code we can't really help you

brazen sluice
#

Thanks, I’m afraid the passive comments thing won’t work but I’ll have a look at the API again @limpid reef

tired bane
#

I don't really know python, why does eval('%s > 1' % 0.5) return false

#

like mathematically what does it mean

tepid ice
#

@tired bane %s is just a placeholder and it inserts in your example 0.5.

#

so it says 0.5 > 1 which is false ofc

#

if you write '%s is a %s' % 'this', 'placeholder'

#

it would output this is a placeholder

shadow hawk
graceful silo
proper saddle
tepid ice
#

i use visual studio code and the theme outrun ended my search - its gorgeous imho

raven kernel
#

atom's one dark theme is very nice imo

willow silo
#

@tepid ice Is it alright if i DM you?

proper gale
#

i just use JB's default dark theme, Darcula

wraith fossil
#

Can someone help me understand how to read hex of a drive in a hex editor in MBR

deep scarab
#

gl

wraith fossil
#

Lol. Thank you. I am in a computer forensics class and I’m trying to understand it.

wraith fossil
#

does anyone perhaps how to read the size of the partition in the hex editor?

#

nvm figured it out

worthy dirge
#

why is priority_queue so much faster than std::make_heap with vector

#

seems exponentially faster

tired bane
#

is there a way to generate random SHA256 hashes and save them to a file on a GPU instead of a CPU?

#

not cracking, just generating new ones from random stuff

next flax
#

random sha hashes are just random numbers, no?

#

like there is no point in doing sha256(rand256()), just use the rand

tired bane
#

thats cpu tho

next flax
#

right, but im just saying you're just looking for a rng

tired bane
#

and not all hex is sha256

next flax
#

sha is irrelevant

#

im pretty sure it is

#

otherwise sha is not a very good algorithm

tired bane
#

yes but it would be way faster to just generate sha256 vs generate hex and then check to see if it is a valid sha256 hash

next flax
#

you're missing the point

#

every 256 bit pattern is a valid sha hash

#

there is no validity check

#

something will hash to that

#

that is a property of SHA being a good algorithm, it uses the entire available key space

tired bane
#

ik, but I want it to just hash out to something alphanumeric

next flax
#

gpu is probably not worth the trouble if you just need an RNG, the bandwidth going back and forth is probably gonna be more than just using a fast rng on the cpu

#

especially if you just need "pretty good", not necessarily "100% cryptographically secure RNG"

tired bane
#

what is the fastest way to hash strings from a wordlist

next flax
#

if you just need random hashes why start with words?

#

just generate random numbers

#

and then convert them to hex

#
C:\Users\Shane>perl -e "printf( qq~%X\n~, rand()*(2**32) ) for 1..10
9A6F726E
9F3960AB
7E1E6F7
65C5995C
4A9E6053
12C159AF
A32105D5
A9466B37
E8B3DD47
E37715D2
#

you'll probably need hex values a little longer, but same idea

tired bane
#

I shouldn't have said random sha256 hashes, more like sha256 hashes that are alphanumeric

deep scarab
#

aren't all sha256 hashes alphanumeric?

#

🤔

next flax
#

if you convert them to hex

tired bane
#

like the encoded string is alphanumeric

next flax
#

SHA is just integers, the alphanumeric appearance is just a side effect of converting to hex

obsidian sundial
#

Hi guys! I'm looking for a feedback on a little project I'm working on (a free NodeJS hosting)

turbid yoke
#

Any details?

obsidian sundial
#

@turbid yoke

vernal marsh
#

actually both vs and vs code of mine are pretty heavily dark themed ... and yes I have the thingy on right in vs code, I know that triggers some people 😛

#

In vs code I use horizon and in vs I made my own theme derived from the usual dark theme ... so put a good effort into that

nocturne galleon
#

I found the earliest site that I had ever made earlier

#

or well, had record of

#

There was 1 site before this one

#

This was back in early 2010?

#

boy was I bad back then

wary sigil
#

Any reason why floatplane hasnt been updated yet?

brave jungle
#

hello fellow devs

cursive umbra
#

Anyone around here by chance familiar with C# Dictionaries?

wheat dock
#

fuck apple

#

fuck xcode

jaunty hawk
#

I really hate having to configure docker and kubernetes clusters

thin flax
limpid reef
#

You can learn python using that online editor, reading programming books, or installing python on your pc locally.

thin flax
#

Thanks

brave jungle
#

@wheat dock ayy fellow ios dev

cursive prawn
#

I would recommend installing it

#

Web compilers can be stripped down and old

worthy gulch
#

quick C++ question: why some APIs refer to its objects (for example, GtkWidget) as pointers?

#

when initializing, you have to do something like GtkWidget *my_button; instead of GtkWidget my_button; like standard objects such as ints and strings, anybody knows why?

proper gale
#

@worthy gulch because if they used stack objects the API wouldn't be able to comunicate correctly.

#

unless it uses a heap pointer internally.

#

in which case, its just hiding it from you, probably with a smart pointer.

#

C APIs that use ints such as OpenGL are doing basically the same thing, just in a slightly different way, and you must deallocate the object yourself.

worthy gulch
#

@proper gale thank you very much sensei!

proper gale
#

miss me with that weeb shit

cursive prawn
#

You already do c++ there’s no missing that weeb shit

naive terrace
#

does anyone here use certbot / letsencrypt?

I have a few subdomains / certs on boxes behind firewalls, and it's a pain to open them up to renew every few months, and I can't automate w/ cron easily. Is there a better way to do this? I've heard letsencrypt now supports wildcards, but I don't know how to migrate a bunch of machines to all use the same wildcard cert, and if I do, can I renew the certs from a dedicated box open to the internet?

raven kernel
#

I use certbot on my production server and it works great. I'm not sure how you would go about having multiple machines as you would somehow need to distribute the certificate from the dedicated renewal box. It would definately be possible though.

vernal marsh
#

offcourse I don't know anything till now 😅

deep scarab
#

iostream and using namespace std

#

uses printf anyway

#

¯_(ツ)_/¯

visual storm
#

😄

#

@vernal marsh congratulations

vernal marsh
#

@deep scarab well there isn't even a return statement 😄 I just overwrote a code so iostream was still hanging up there when I took the screenshot

#

@visual storm thanks

proper gale
#

@vernal marsh avx isn't hard, its just cryptic and different from normal code.

#

you also get to use intrinsics that map to a single instruction, which is wonderful.

vernal marsh
#

yeah I get that now.. its actually very simple atm.. I haven't jumped to assembly and stuff but that seems bit over too much right now

proper saddle
#

Doesn't have a plus license, but it has learn premium. 🤔

light gorge
#

Hello I have a pretty dumb question but I'm learning java and we have to do these programming projects and I'm stuck on this one part

#

String moneygained = startingbal*interest; this is my code, I'm trying to multiply two numbers that are in those two strings but im getting this error

#

hmm it wont let me post it, I guess ill send a screenshot

#

I'm not sure what this means or what I'm doing wrong, any help is appreciated

deep scarab
#

you can't multiply strings

#

you need to convert them to ints/doubles

light gorge
#

Gotcha, once I did that it just worked. Thank you!

naive terrace
#

@raven kernel the issue is that the certs are on boxes that are behind FW's w/o outside internet access

#

so LetsEncrypt can't verify the page

#

I figured if they all had the same cert

#

if I renew one on an external box

#

all the internal ones also should be updated?

#

or does it actually update the cert value itself when renewing?

raven kernel
#

yes it does up date the cert value

#

I think...

naive terrace
#

makes sense

raven kernel
#

actually... 🤔

#

never checked soz

#

I would think so though

#

but yeah proving to letsencrypt that you own the domains will be the hardest part

#

you could use the DNS method of proving

#

then letsencrypt wouldn't have to try and find the server

naive terrace
#

for now I just take the service offline, throw up default nginx server, renew, then fix FW rules and bring service back online

#

I'd still have to update the cert w/ dns method

raven kernel
#

it's hacky but that's what I also do

naive terrace
#

Ideally I want this fully automated

#

I guess I could do this fully automated too but uhhh

raven kernel
#

certbot has the option to run commands before and after it renews the certs

naive terrace
#

automating FW changes w/ opening to world is dangerous

#

and having the same box able to adjust the fw is not a great idea either

raven kernel
#

no not really unless your using a reverse proxy

naive terrace
#

uhhh? 😛

#

meaning yes

#

nginx -> another service w/o tls

#

nginx being the proxy to provide tls

raven kernel
#

hang on what's your set up?

#

you have multiple servers connecting to a reverse proxy?

naive terrace
#

nah, if so I'd use a load balancer or something, since it's on aws. This is a java spring application, where the dev didn't do any sort of TLS implementation

raven kernel
#

so you want to put a reverse proxy in front of it to enable TLS?

naive terrace
#

that's what I use nginx for, yes

raven kernel
#

ohh ok

naive terrace
#

maybe reverse proxy is the incorrect term

raven kernel
#

no it's right

naive terrace
#

but nginx sits in front and adds tls essentially

#

ah okay

raven kernel
#

yeah certbot can do that

naive terrace
#

can certbot validate on a specific port?

#

then I can have nginx provide a specific certbot listener port

raven kernel
#

I believe it'll only work over 80/443

naive terrace
#

since it redirects all 80 traffic to the 443 proxy.... hmm

#

not sure I want to open it up that much still

raven kernel
#

you could have something like

server {
    listen 80;
    server_name sub.domain.com www.sub.domain.com;
    […]
    location /.well-known {
            alias /var/www/sub.domain.com/.well-known;
    }

    location / {
        # proxy commands go here
        […]
    }
}

Source: https://serverfault.com/questions/768509/lets-encrypt-with-an-nginx-reverse-proxy

naive terrace
#

yeah, was thinking that

#

but still requires making the box visible to the internet

#

right now, nothing sees the outside internet

raven kernel
#

yeah it's hard to prove something exists when it can't be seen 😝

naive terrace
#

btw does ltt have a channel where we can lurk for people to hire?

raven kernel
#

idk, I'm not the best person to ask.

naive terrace
#

ok. We need a Microsoft guy for azure etc.. xD (or girl)

#

but yeah, thanks for the help. Not sure there's many options for my use case

#

I'll look into the DNS verification

raven kernel
#

np, happy to help.

naive terrace
#

and/or an open box w/ a tunnel or something to the other boxes

raven kernel
#

if you have any other questions feel free to dm or @ me

#

I'll try to help 😄

naive terrace
#

@raven kernel I need help breaking the root certificate for microsoft kthx

raven kernel
#

😝

#

yeah easy, who's microsoft's ca? 😆

naive terrace
#

uhhh MS actually I think xD

raven kernel
#

wow your right.

#

they provide there own certs

naive terrace
#

google issues their own too

#

apple surprisingly doesn't actually

#

I figured if they ship their own browsers (safari) they could afford to pay google to ship a cert w/ chrome and be their own CA lol

raven kernel
#

I wonder why they go to the effort to create their own CA?

naive terrace
#

I think it goes back to the IE days

#

IE was the biggest baddest browser

#

90% of market

#

so they made their own CA

#

shipped it with IE

#

so everyone had it and was trusted

#

so any new browsers basically HAD to follow suite

raven kernel
#

fair enough I guess.

naive terrace
#

and has been a thing ever since

#

don't quote me on that, but that's my guess

raven kernel
#

it seems reasonable

#

when you have that much market share you can do what you want

naive terrace
#

yep

#

being big is one thing, but being first is another

#

hence why I think apple doesn't have their own public CA

sacred shuttle
#

async_native is the package async. Ignore some of the inconsistencies, I'm still working on it.

naive terrace
#

you can go overkill on console.logs and track what's happening

#

do one for each line

#

see where it stops

#

possibly an exception is thrown? (I do java dev, javascript probably has the same or similar?)

sacred shuttle
#

Yeah, the thing is, there are no errors

#

It just generates a timeout

#

And I know where it stops. It's line 47 as I already said

naive terrace
#

Hmm an issue w/ the DB?

#

maybe missing write perms? except I think that would produce an error, not a timeout

sacred shuttle
#

Yeah

#

And using google(an alternative register method) it writes to it fine

cursive umbra
#

In C# is there another way to store a single Key that has multiple Values specific to that key?

Currently I have a Dictionary with Key as Key and Value as a Class that stores all the real needed values as properties

muted vale
#

Anyone here got a Website Index / Landing Page that I could look at

#

Need to sort out my website as its hella buggy

cursive umbra
#

Anyone around able to help me out with an issue with HTML/Javascript ?

finite flame
#

probably, whats the issue?

grand sigil
#

yo

#

Sup guys

#

So I'm an IT helpdesk level 2 and I sit all day in my office doing nothing

#

And I really want to learn something new in the world of development, from absolute scrach

#

What would you recommand

#

I've seen Golang and Rust are new , but are they worth it ?

raven kernel
#

+1 for Rust. I'm still learning it and have been loving how simple (compared to other compiled languages that is) and efficient it is. Although I have also only heard good things about Go so either would be a good choice. I think it would more come down to what you want to do. Go is mostly used for web based applications where as Rust is attempting to be more like a C replacement.

grand sigil
#

@raven kernel thanks! what would you recommand for website creation?what's new in this department ? I keep hearing lots of hate towards php

raven kernel
#

yeah from what I have seen php is dying due to security vulnerabilities. It seems like it's being replaced by web frameworks such as flask, django, etc. which makes sense as it allows the backend code to be easily programmed in almost any language.

gilded moon
#

+1 for learning a framework for websites, whether it's Flask, Django, or even something like Ruby on Rails

raven kernel
proper saddle
#

Ooo, nice

#

No physical events in my area
closest event is in the middle of nowhere

nocturne galleon
#

Does ffmpeg have a tendency to bork? I ran multiple conversions at the same time, then it just refused to convert, made a blank file and that's bout it,

vast echo
#

its been rock solid when I've set it up correctly

final sun
#

How do i hide a driver object?

proper gale
#

@final sun gonna need more context

final sun
#

I have a program that uses a driver

#

but i need to hide its signature or whatever its called

#

so that other programs don't detect it

#

@proper gale

#

if thats even possible

proper gale
#

i have absolutely no idea.

potent oxide
#

Just curious, what language are you using?

#

@final sun

worthy gulch
#

been through the pain of working and making my own libraries in C++, done several GTK programs with Lua integration already and even worked with this terrible win32 native GUI stuff, gotta ask

#

how easy will it be to code for android and iOS?

#

got no experience in those two platforms

rough bridge
#

How is LUA different in like say a object based Language like java, I have attempted to learn lua but java has a ton of documentation and LUA doesnt have as much

proper gale
#

@potent oxide C, you dont use anything else.

worthy gulch
#

@rough bridge imma try my best to answer: those two are different, Lua is simply a scripting language and its pretty easy, because its syntax is similar to that of your everyday english, but that means less efficiency and, because it runs on C++, itd be tricky to convert to each platform. If you mean Javascript, well yes, Javascript is widely supported and well documented already, thus much more capable, there are entire frameworks built around it.

#

if you meant literally Java well that's a programming language, which is essentially a different concept

rough bridge
#

I see, so scriping is way different from programming

proper gale
#

not really

#

lua and java are both turing complete languages

#

they are used different, but you can write games in lua and scripts in java

#

and cloudflare runs on lua

#

also, because luajit its not slow either.

worthy gulch
#

but id say there are more layers between Lua and actual assembly, than in java

rough bridge
#

Ok did a quick lookup, basically when you script,it doesnt need compiler

proper gale
#

there are less though

#

lua -> interpreter/jit -> asm
java -> compiler -> interpreter/jit -> asm

#

scripting is a run-time environment.

#

so, translated from source at runtime.

#

language is irrelivant.

worthy gulch
#

wouldnt you still be interpreting Lua at runtime through C++?

#

interpreter itself is written in C, and generally speaking basic arithmethic is performed at a lower CPU task on lower-level languages such as C rather than in Lua

proper gale
#

C is high level assembly, so thats not a fair comparison.

worthy gulch
#

but my knowledge regarding this matter is too limited to get a valid perspective about it

proper gale
#

and with luajit, its basically the same as java.

#

C++ that takes source and compiles it then runs it immediately.

worthy gulch
#

well java itself is a middle ground

proper gale
#

if there is a lua llvm front end, you could compile it.

worthy gulch
#

i see

proper gale
#

old af, but it exists

worthy gulch
#

well glad to see my old boy gets some stuff done really well, it got me into programming

#

support for JITS i saw it kinda sucks

final sun
#

@potent oxide its not my program lol

astral radish
#

If this is the àppropriate channel. Can we have 2 #tech-support channels? Lots of people talking over each other

vast echo
#

this is for talking about programming projects

#

I dont think there is a #meta channel on this server

forest sphinx
#

so I'm trying to set up MongoDB and I keep failing

proper gale
#

@forest sphinx what part of mongo?

forest sphinx
#

Hooking it up to integromat and Heroku

proper gale
#

so, what are you trying to do, and what isn't working?

forest sphinx
#

just hooking it up

#

I have to hook it up to my Discord bot for Data and stuff but no matter what I try it doesn't work

proper gale
#

there are thousands of ways to "hook it up" to a discord bot

forest sphinx
#

I'm talking Heroku

proper gale
#

so, you have a discord bot on heroku, and it needs to connect to a mongo server?

forest sphinx
#

yes

proper gale
#

so, what part of that isn't working?

#

because heroku seems to basically just be hosting.

forest sphinx
#

it is

#

It just won't link

proper gale
#

where is the mongo server hosted?

forest sphinx
#

West Coast

#

same as me

proper gale
#

via?

#

how is it hosted

forest sphinx
#

Azure

proper gale
#

how is on it on azure?

#

because by default mongo only accepts connections from local applications.

forest sphinx
#

thats the Cluster

#

Hosting it is another issue

proper gale
#

i need to know exactly how this whole thing is setup, and exactly what error you are getting, otherwise i cant really help

forest sphinx
#

You want to see how fucked up it's set up

proper gale
#

i mean, if i dont know then there are thousands of issues you could be having, of varying posibilities.

forest sphinx
#

I can add you to the group

proper gale
#

id rather you dont

forest sphinx
#

TeamViewer/Anydesk?

#

so you can see the issue

#

@proper gale

proper gale
#

words, use them.

forest sphinx
#

Thats the issue

#

I can't see the issue

narrow furnace
#

Check if you have open ports - so the mongo is accessible by outside world

#

on AWS - default is that your machines are not accessible

forest sphinx
#

It would help if I knew HOW to even do that

#

but so far nothing I do works

narrow furnace
#

ok - download some kind of MongoDB GUI app

#

Robo3T e.g.

#

and in azure - under details you should see IP of your machine

#

default port for mongo is 27017 if i remember it correctly

forest sphinx
#

port foward

#

right

#

@narrow furnace

narrow furnace
#

@forest sphinx yep ?

forest sphinx
#

ok just checking

#

error: ```Connection failed.

SERVER [discordbotcreatorsstorage-shard-00-00-njwdx.azure.mongodb.net:27017] (Type: UNKNOWN)
|_/ Connection error (MongoSocketReadException): Prematurely reached end of stream

Details:
Timed out after 5000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address:27017=discordbotcreatorsstorage-shard-00-00-njwdx.azure.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]```

#

i gtg for a bit

proper gale
#

remember when i mentioned that mongo only accepts connections from local, thats probably what thats gonna be.

forest sphinx
#

how do i allow from any

proper gale
#

there is documentation on that.

forest sphinx
#

o

narrow furnace
#

this can be either bad port (better case) or blocked outside connections

proper gale
#

and i point you to that, bceause i dont know.

narrow furnace
#

you have dev subscription on azure ?

#

there is some support hours included - i would contact their support (Azure) to help you with this case. They usually response within minutes

forest sphinx
#

no

#

wait

#

I have to use Linux

#

FUCK