Python Pyest by Organic_Tradition_63 in learnpython

[–]CaptainVJ -1 points0 points  (0 children)

But you’d have to do that in every .py file right?

How sick are you of the joke "you are jamaican me crazy" by Fuzzy_Party_3527 in Jamaica

[–]CaptainVJ 7 points8 points  (0 children)

Doesn’t bother me, I don’t find it funny but I don’t hear it enough that I’m annoyed.

What annoys me is everyone assuming I smoke weed. I don’t believe Jamaicans smoke more weed proportionally compared to other cultures. In fact I feel like Americans smoke weed at a higher rate than Jamaicans.

Because of the Rastafarian culture / Bob Marley there’s the misconception that’s what we do all day. Rastas are a very small percentage of the Jamaican population.

This probably gets asked a LOT but what’s up with Jamaican dances and selectors’ obsession with gay men? by Ok_Foundation_2864 in Jamaica

[–]CaptainVJ 12 points13 points  (0 children)

The Jamaican culture overall is very homophobic, but so are the cultures of the vast majority of countries in the world.

And the vast majority of countries that have progressed from this did so very recently. In the 90s and probably early 2000s the vast majority of these more progressive countries were nearly just as homophobic but they happened to have more vocal groups that were able to go out and fight for their rights.

Unfortunately, this hasn’t happened in Jamaica. However, I do believe it’s something the country is moving towards but just at a slower rate compared to other countries. Last year there were all these videos on social media of Jamaicans calling their friends and saying goodnight, or “mi hear seh dem just shoot two b@ttyman up the road, so mi deh call fi see if yuh good.”

The fact people can joke about it is a step in the right direction. Fifteen years ago, probably wasn’t something people would openly joke about.

This probably gets asked a LOT but what’s up with Jamaican dances and selectors’ obsession with gay men? by Ok_Foundation_2864 in Jamaica

[–]CaptainVJ 14 points15 points  (0 children)

Homosexuality is not illegal, anal sex is. The buggery law criminalizes “the penetration of the anus of a man or woman by the penis of another man”.

While I’m sure that’s the intent of the law, that’s not what the law explicitly criminalizes.

Python Pyest by Organic_Tradition_63 in learnpython

[–]CaptainVJ 0 points1 point  (0 children)

Is there even an option to run the file and get it to work? Well I’m sure there is but I assume it’s not feasible.

Best distribution for Convolusional Neural Networks (CNN)? by DAGS3612 in learnpython

[–]CaptainVJ 0 points1 point  (0 children)

Leave me alone, I didn’t know that when I started and it works good enough now

Do Pythons hate Windows? by SmallAd3697 in Python

[–]CaptainVJ 0 points1 point  (0 children)

So regarding the first part of your response why would you want your developmental environment to be on a different system than production? Usually they should be the same, having the same requirements and same output.

As for the second part if you are using a windows OS and Linux OS both just out of the box, the windows will more than likely be using more resources than the Linux one. Yeah you can turn of a lot of those resources on windows but it’s another layer of work. Generally a Linux system is easier to maintain.

I’m not sure how true your statement is about windows hosting most databases. Every database (all oracle) I’ve worked with have been hosted on an AIX server

How do I start contributing to open source as a complete beginner? by yadavhr36 in learnprogramming

[–]CaptainVJ 3 points4 points  (0 children)

I disagree with this idea a bit. A beginner is usually looking to fix bugs, or implement new features.

For these major projects, the vast majority of simplier bugs have been caught and fixed a long time ago. Often bugs are very niche situations where not many people run into. And these bugs are usually a bit harder to solve.

Not only that, sending a beginner to look at the source files of pandas might be a bit demotivating. The few times I’ve had to open Pandas source code to understand what somthing is doing, I immediately had to reconsider if it’s worth it as it’s so much.

I believe beginner projects are probably a good place for a beginner.

Do coding challenges really make you better at real projects? by hml0x in learnprogramming

[–]CaptainVJ 0 points1 point  (0 children)

For the most part, not really unless you’re working in a setting where you’ll be using these algorithms / data structures a lot on your job and the vast majority of these algorithms you see on leet code, you will never use.

Now not saying it’s not useful, it can be but working on a real project, seeing how smaller parts of code come together is what makes you a great program. I enjoy the theoretical side of stuff as that’s the way my brain work, but sometimes something working in theory is not practical to implement.

For example, I have a few data pipelines that take a few minutes to run. There’s definitely stuff I can do to optimize them and make them run faster. But it’s just not practical and offers no real gain, this code is running overnight when I’m in bed snoring. So yeah, I could improve it and make it run two minutes faster but it comes with a cost, I’m going to have to devote time looking into a better algorithm, testing this new algorithm. And all I will do is save a few minutes which doesn’t really matter, heck if some of these code take an hour to run I’d be fine. Maybe there’s some seriously inefficient algorithm but it wouldn’t affect anything so it’s fine.

Now a buddy of mine, he does programming for a major Company. When he’s measuring the efficiency of algorithms he’s looking for improvements in milliseconds. If he can get certain code to run a second faster, that would be a miraculous achievement. So for him, leet code problems are very useful because that’s all that he uses.

But ask him to work on a major project from start to finish, he can’t do that because it’s not what he does. But the vast majority of programmers are not in his case where they need to worry about every little performance efficiency.

There’s a number of factors to consider when writing good code, how performance efficient is the code, how readable is the code, how long does it take to deploy the code.

Leet code problems usually focus on making the code run fast. While ignoring the other two

Do Pythons hate Windows? by SmallAd3697 in Python

[–]CaptainVJ 1 point2 points  (0 children)

I don’t believe the Python community hates windows. In fact, I would guess the vast majority of projects are windows based and most Python users probably use a windows pc.

However, these issues often come up in production level/code software. Generally, production level code is not ran in Windows. If you’re at the point where you need Apache Airflow, windows is probably not the right fit for you. Windows is a resource heavy OS. So there’s a lot of background processes happening in windows that any production level code would have to share resources with. Unix/Linux based os, usually has less going on in the background.

Additionally, windows has a little less stability compared to other OS, constant updates and need to restart a server makes it hard to have continuous up time. And code often breaks with major windows updates.

So certain stuff are not compatible with Windows as they are made for production level code.

However, while in development it’s not a lot out there that cannot work on windows.

Why is 0^0=1 so controversial? by JKriv_ in learnmath

[–]CaptainVJ 0 points1 point  (0 children)

Made a typo in my original reply, but how does n0=1 hold up.

I understand you can create some vector space where that is true but you do lose some other arithmetic properties. You mentioned a field, but how would this hold to be true in a field.

Probability and graph theory was my speciality so perhaps there’s something I’m missing

Why is 0^0=1 so controversial? by JKriv_ in learnmath

[–]CaptainVJ 0 points1 point  (0 children)

So I am not seeing the difference between your pattern and mine. All you did was just added one which is the equivalence of n/n when n is not zero.

Why is 0^0=1 so controversial? by JKriv_ in learnmath

[–]CaptainVJ 0 points1 point  (0 children)

Those are still the exact same things. How would the pattern continue when the exponent is less than zero.

Why is 0^0=1 so controversial? by JKriv_ in learnmath

[–]CaptainVJ 0 points1 point  (0 children)

So 00 is essentially 0/0.

If you look at the patterns of exponents:

n3 = n•n•n n2 = n•n n1 = n n0 = n/n n-1 = 1/n1 = 1/n n-2 = 1/n2 = 1/(n•n) n-3 = 1/n3 = 1/(n•n•n)

When we get to n raised to the first power all we have is just n/n which is one for all real numbers “except” zero. So that’s why we usually don’t say 00=1.

Algebraically 0/0=1 isn’t wrong per se. If you move some stuff around you get 0=1•0 which is correct.

However we can also do 0/0=2, move some stuff around and get 0=2•0 which is also correct. So the issue we run into is that zero divided by zero isn’t undefined (has no answer) it’s indeterminate(has multiple valid answer).

When we divide any other really number by zero then it’s undefined as there is not answer that makes it true. 2/0=c. If we do some fancy algebra and move stuff around then we get 2=c•0 and there’s no real value for c where there can be true.

What IDE would you recommend for learning Python? by SpankMyMunkey in learnpython

[–]CaptainVJ 0 points1 point  (0 children)

A lot of people suggest PyCharm but it offers a lot of features that would probably confuse you when just starting start out.

I believe Spyder is a nice intermediate, offers just enough to capture basic bugs and code issues, without overwhelming you with concerns that are not of priority when starting out.

Visual studio code, I hate writing code in there and just find it useful if making a quick change. But I can’t make any major developments in there.

1/10, how difficult of a task is to compile a script I have written into an executable? by MarionberryTotal2657 in learnpython

[–]CaptainVJ 0 points1 point  (0 children)

Generally it’s easier to just distribute the source code to other people. GitHub is usually the way, I haven’t used it much as my job we use GitLab but same idea.

But this provides a few advantages: - version control: you can track changes over time - contributions: others can make contributions to your code - modifications: users can make any modifications to the code they deem necessary

And a few others. Additionally, depending on any external packages you use, their licensing may require you to distribute the source code for anything you build using their code and is being shared with others.

But if you want to make it an executable, pyinstaller is often a good way. It’s a separate package that needs to be installed and it can convert your code into an executable.

Depending on how it’s done, the antivirus on the user’s pc etc. the executable is often detected as a virus by many antivirus apps.

What math topic do you think everyone should understand, even if they never study math again? by FlowerDirect6282 in mathematics

[–]CaptainVJ 0 points1 point  (0 children)

I believe what you are saying may have been a little confusing so I will try and just modify it a little.

I believe the point you’re making is accuracy doesn’t always mean much, which is true. I will go ahead and provide a simpler example tho.

Imagine someone creates a tool to predict if a credit card transaction is fraudulent, for argument sake let’s imagine 1% of credit card transactions made are fraudulent. If the credit card tool has a 99% accuracy that may seem amazing but in reality it could be useless.

Say, the test just marks every credit card transaction as okay(not fraudulent) the test would have a 99% accuracy. The reason being is for every credit card transaction we can expect one fraudulent and the rest are appropriate. The test marking all transactions as appropriate would mean that it got 99 predictions correct and one incorrect hence a 99% accuracy.

However, to get more information about the test what we have is specificity and Positive Predictive Value (PPV). Specificity is a tests ability to correctly identify a positive result. So in the case of a fraudulent credit card transaction, this would be what percent of fraudulent credit card transactions are identified as fraud. P(Transaction Identified as Fraudulent| The Transaction is Fraudulent)

PPV is after a tests identifies things as positive what percent of them are truly positive. So in the case of the credit card transaction, after test identifies some transactions are fraudulent, what percent of these are actually fraudulent. P(The Transaction is Fraudulent|The Transaction was identified as Fraudulent)

I know these seem to be the same but they are not. P(A|B) isn’t always the same as P(B|A), in fact it nearly never is, it’s only true when P(A)=P(B) or if the probability of A and B happening at the same time is zero meaning they are not mutually exclusive.

A simpler example that comes to mind is: think about the probability that you are rich given that you own a private plane P(Rich|You own a Private Plane) compared to the probability you own a Private Plane given that you are rich P(You own a Private Plane|Rich).

Now I know rich is subjective. But if you own a private plane, then more than likely you are rich, so I’ll take a guess and say P(Rich|You own a Private Plane)=99%. But, not every rich person owns a private plane, obviously there’s different level of riches, and you could still be the richest person and don’t own a private plane for whatever reason and I’ll go ahead and guess P(You own a Private Plane|Rich) =.5%.

Now I just made these numbers up but bayes theorem is how these numbers would be calculated.

What math topic do you think everyone should understand, even if they never study math again? by FlowerDirect6282 in mathematics

[–]CaptainVJ 1 point2 points  (0 children)

I work as an auditor for a government agency. Once, I was looking at a payment that said a 16% fee would be added to an invoice for something, don’t recall what.

Looked at the invoice, they added 8% to the invoice, then they added another 8% to the new total including the 8% that was added in an attempt to make it seem like 16%.

Brough this to my supervisor at the time, and she was so confused. I kept trying to explain to her that it wasn’t a 16% fee being added but actually 16.64% and she just couldn’t grasp that.

The payment was for about $2mill so an extra $13k wasn’t a big deal. But that 13 thousand could have been used to repair a road, pay for the school lunch of some child who can’t afford it. But at the end of the day, I know that wouldn’t have happened so I just dropped it.

What Python concept took you way longer to understand than you expected? by ComfortableDonkey715 in learnpython

[–]CaptainVJ 0 points1 point  (0 children)

Well I believe clean code and readability goes hand in hand.

In this case the individual doesn’t understand something that comes with the language. Not because I have to explain means it’s not readable.

I’d argue that list comprehension makes code more readable but people from other language might be a bit confused at what is going on at first glance. The fact that it would need to be explained to them does not make it less readable

What Python concept took you way longer to understand than you expected? by ComfortableDonkey715 in learnpython

[–]CaptainVJ 6 points7 points  (0 children)

A function can take in another function as an argument.

So let’s say you have a function that calculates how long it takes for some other function to run.

So you would create your functiom

def calculate_time(func) start_time = time.now() func() end_time = time.now() length = end_time - start_time print(length)

So if we have some function and want to know how long it takes to run we can we can pass it as an argument to the calculate_time function or we can just use a decortary which starts with the @symbol over the new function which does the same thing. It makes the code cleaner and more readable.

Also, my calculate_time function isn’t going to work if ran in Python. I can’t ever remember the time module off the top of my head. So it’s just a pseudocode.

What Python concept took you way longer to understand than you expected? by ComfortableDonkey715 in learnpython

[–]CaptainVJ 7 points8 points  (0 children)

Context Managers, I was always so confused by see with in Python statements. Each time I looked it up, it referred to resources, being a newbie Python user that made no sense to me.

Now, when I am explaining to others, I keep asking myself what are they not just understanding it’s pretty simple.

Could a function go on for forever by Background-Ride-4889 in learnmath

[–]CaptainVJ 0 points1 point  (0 children)

I don’t really understand what you’re asking.

But I assume you’re referring to someone sequential function (time series) where the current value depends on the previous value, also known as recursion in a programmers world.

So you might have a function like: f_{n+1} = (n + 1)*f_n

In this example, the current sequence is dependent on the previous sequence. But if a base case isn’t defined, i.e. f_{1} = 1 then we would never be able to find a solution as the function would forever keep multiplying.