« first day (3191 days earlier)      last day (1979 days later) » 
01:00 - 19:0019:00 - 00:00

01:03
Hi
from PyQt5 import QtWidgets

app = QtWidgets.QApplication([])
window = QtWidgets.QWidget()
window.setGeometry(50, 50, 500, 300)
menu_bar = QtWidgets.QMenuBar(window)
menu_bar.addMenu("File")
menu_bar.addMenu("Edit")
menu_bar.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
window.show()
app.exec()
I have written this code but the menu bar is not showing as expected.
it is showing like this:
notice the menu bar. It is not not covering the top portion of the whole width of the window.
And moreover size policy is not working at all.
@smci Thank you so much for rewriting my question I really appreciate your time. However, there is a small change that I will make on the question. I had a chat with my senior he has just given me the right steps I should follow for a correct answer. If you could please assist me in following those steps. I really appreciate your help.
> (Size Policy) If there is a QLayout that manages this widget's children, the size policy specified by that layout is used. If there is no such QLayout, the result of this function is used.
01:15
@smci the steps my senior asked to follow are
1) Find difference between date columns.
2) Set the threshold as its row target value. So the threshold changes for every row since target is different for every row.
3) Find the percentage difference between the difference values (step 1) and the target.
4) Percentage difference, should now be compared with new universal threshold that we will set now. However, we have to ensure that the threshold isn't too high or too low. Otherwise spikes in the data will not be observed. It should be in a range where some spikes should be seen.
@krijan This is confusing to keep restating the question so many times, and you already accepted an answer, but by the way no answers used Target because you didn't tell us how to use it. Ok so you're trying to heuristically find your 'threshold' (different value for each row), with this iterative process. I don't know what you mean by "2) Set the threshold as its row target value." but I think you mean "Initialize threshold to Target value for that row"
@smci Im so sorry, my senior is bugging me every now and then he himself is confusing me.
Correct thats what i mean, Set threshold to target value for that row.
However for very last step 4. This time We have to ensure that the new threshold we set is same for the whole table.
In terms of accepting the answer. That was the correct answer. However, my senior technically asked me to do it again, however using his steps (the steps i just gave) this time.
@krijan But stop saying "Set" when you mean "Initialize". "Set" means once and for all. "Initialize" tells us "here's an initial value, but we're going to change it later, possibly iteratively". Honestly I'm trying hard to follow, but it's hard. "4) Percentage difference, should now be compared with new universal threshold that we will set now.". Again, don't say "set", say "determine" or something...
Im sorry for my grammatical mistake i make. Yes I agree, its initialize and determine.
Your definition of "threshold" and "spike" keeps going in circles: "spike" is any difference-in-values where deviation is >= (/<=) "threshold", and "threshold" is whatever value detects a lot of "spikes", but not too many. Please post us your updated data after doing [your above revised process]chat.stackoverflow.com/transcript/message/46743690#46743690, then let's figure out how to unwind your circular definition.
01:33
Do you want me to visually show you in table about how it should look?
because the data frame is the same.
when i say "spikes", i am trying to say that it is going above the threshold. (Thats why we take absolute of the difference column).
When I say "Threshold", I am trying to say that its a value that detects if the comparison result is going above the value we set (Threshold). If the value is going above the threshold then its considered as a spike.
Ze python is eating the world! techrepublic.com/article/…
01:49
@smci Updated (Removed grammatical errors)
1) Find difference between date columns. (Absolute difference)
2) Initialize the threshold to Target value for that row
3) Find the percentage difference between the difference values (step 1) and the threshold.
4) Percentage difference, should now be compared with new universal threshold that we will determine now. However, we have to ensure that the threshold we initialize is not too high or too low. Otherwise spikes in the data will not be observed. It should be in a range where some spikes in data should be seen.
02:11
@ParitoshSingh @anky_91
1) Find difference between date columns. (Absolute difference)
2) Initialize the threshold to Target value for that row
3) Find the percentage difference between the difference values (step 1) and the threshold.
4) Percentage difference, should now be compared with new universal threshold that we will determine now. However, we have to ensure that the threshold we initialize is not too high or too low, also its same value for every row. Otherwise spikes in the data will not be observed. It should be in a range where some spikes in data should be seen.
@krijan Ok so you need to expand Step 4) "However, we have to ensure that the threshold we initialize is not too high or too low." into an iteration. Like 4a) Count FCount for given threshold. 4b) If FCount > ?, Threshold = Threshold * .9? 4c) If FCount < ?, Threshold = Threshold * 1.1?
@smci when i say not too high or too low. I mean, that suppose if we get percentage difference is 10%, 10%, 20%, 40%. If we determine our universal threshold to be example 2%. Then all the values are above it, hence all the values will be considered as spike. However if we set it as 12%. Then we will have 20%, and 40% as spike value. So, my point is, that 12% is a good value to be determine as threshold
does it sort of made sense on what i mean?
02:53
I have a rest api exposed from flask. Now i want to use kerberos authentication for this rest api. I got a Flask-Kerberos library but not getting how it works,I got a service keytab file from the AD server(Is this kerberos env) also how to set up kerberos environment.
03:48
recabbage
 
2 hours later…
06:04
@roganjosh I want dict and set and friends to work normally - via a random salt. I want my own data structure to work deterministically - via a known salt.
06:15
@Kevin I would also love to have something like that. The other wish I had for python, assignment expressions, were granted. So the outlook isn't too bad :p
My birthplace was only like 50 km from the dutch border, after all.
 
1 hour later…
07:24
Anyone worked with non max suppression with opencv?
@krijan So, here's the thing. you've gotten a lot of groundwork done for you, can you,by yourself,try and add the additional functionality? If we do all the work for you, what would you gain out of it? I highly encourage you to first 1: understand the current code and 2: see if you can add the additional logic required on your own. I'll give you a hint too. numpy arrays are really powerful, and allow comparisons between arrays as long as either the shapes match
For example:
import numpy as np
a = np.array([10, 20, 30, 20, 10])

a > 15 #works, as you know
array([False,  True,  True,  True, False])

a > [5, 15, 25, 0, 0] #works too, as long as the shapes align!
array([ True,  True,  True,  True,  True])
Just try it first, if you get stuck then feel free to show what you tried and went wrong
07:46
does anyone use azure notebooks for jupyter? im having trouble that after successfully installing a package and trying to execute a command it comes back as NameError: name 'mypackage' is not defined
that is the online azure notebooks
08:28
Maybe it's not in the sys path
An issue I had a while back. followed this thread
08:50
thank you!
will check it out
cbg
what method do you people like to use to exit a python script if an IF condition is triggered? There seem to be a lot of options.

I want an orderly close down, and was thinking on using exit()
sys.exit? sure, sounds fine. though make sure you really need it. If you can refactor code to allow normal code flow without losing out on readibility, opt for that instead.
@ParitoshSingh Yes I probably can do that, was trying to keep as readable as possible, but if normal code flow is better than I'll go for that
@ParitoshSingh thanks!
09:05
no worries
normal code flow is always preferrable?
I think your problem is completely analogous to the discussion "should a function have multiple returns?", where function -> script and returns -> exits. I personally like this answer on the matter: stackoverflow.com/a/733858/962190
@arne awesome thanks
cbg
@Andy you're welcome =)
09:13
@Andy if the condition is fatal, you probably want to throw an actual exception. If the condition is not fatal, there really isn't much reason to abort the program at that point. All callers should be aware if a call can un-exceptionally end a program.
note that "orderly close down" is ill-defined for threaded and multi-process applications. sys.exit can fail to stop your application promptly in these cases.
problem? regex! -> you now have two problems
problem? multiprocessing! -> you now have n_cores problems
hi, does anyone of you have experience with tensorflow-gpu in python? im currently training an object detection but it looks for me like the cpu is way more utilized then my gpu.
09:33
@Arne problem? async! -> you now have no problems until it
ha
what's a good oops source for a beginner? I have 0 knowledge of oops, and looking to learn some of it
this one is great
haha
you guys don't find use of oops in your work?
mostly as data containers with a couple of very simple methods, when I feel that dictionaries won't cut it
or if a framework forces me
09:44
Cabbage all, bugrit.
okay
But still to get the gist of it, where should I begin? not digging deep but just want to get a working knowledge, that's it
i do a lot of oop but not with python.
Can somebody please vote to open this one again? stackoverflow.com/q/57002951/562769 - it is not a duplicate
@MartinThoma punkt isn't a python package?
@MisterMiyagi So create a separately-seeded random.Random object, and use that for "your own" functions?
09:51
Okay, I’m apparently very rusty… My original timing (using a custom type) didn’t make sense here: stackoverflow.com/posts/57004399/revisions – Can anyone see what I am missing?
@holdenweb hash doesn't allow setting the salt per call. There is only the interpreter-global $PYTHONHASHSEED
@JackDaniels a lot, but rarely for anything a beginner would want to do
@MisterMiyagi I understood you can separately seed random.Random and it should have no effect on the sequence generated by $PYTHONHASHSEED and hence dict and set lookups.
but I cannot use random.Random as the salt for a call to hash. Because hash does not take a salt.
But you said you wanted the system stuff to work normally. Why would you want to seed its random generator?
import random
rr = random.Random(1)
print(rr.random(), random.random())
The above code always prints the same first value and a different second value. Why isn't that what you need? (I'll believe you that it isn't).
-1
Q: how to run sync function as async - non-blocking

underscoreI'm consuming data from rabbitmq and message push rate is nearly 50/s so i want to do two asyc tasks inside on_message callback. 1) send acknowledgement to rabbitmq 2) do a calculation and save in database ( non async ) How could I achieve this ? def on_message(channel, body, envelope, prope...

10:02
@poke you mean why the custom class has a slower BINARY_ADD than string?
@holdenweb because I need a stable hash for arbitrary Python objects. Not a randomly-salted hash for arbitrary Python objects, nor a stable hash of only bytes objects.
@Arne No, why + is slower than a call to __add__ for the custom type
technically, + does more than call __add__
it only safes time for the slot lookup
The BINARY_ADD should be able to call the __add__ implementation a lot faster than a method lookup and method call though.
@poke Oh true, I misread the revision. Can you paste your custom class real quick?
10:09
I could imagine that the context switch back to the Python implementation of __add__ be the reason.
class SType:
    def __add__(self, other):
        return 'spamNI!'
(yes, very complex :P)
the rules for BINARY_ADD require checking the presence of RHS.__radd__, possibly the sub typing relation of RHS and LHS, and a pointer comparison of the return value against NotImplement
@underscore 50/s is pretty tame, Threads are probably a lot more appropriate for your use case
can i run thread inside on_message for check_hour_satisfaction without block it
?
@MisterMiyagi Hmm, you’re probably right there. The add does a lot more and eventually invoking __add__ is just one thing..
@MisterMiyagi ` check_hour_satisfaction(body, properties, envelope)`
10:24
Alright, I played around a little and I have no clue whatsoever I'd agree with Miyagi there.
interestingly enough, my timing had even more extreme differences:
$ python3 --version
Python 3.6.8
$ python3 -m timeit -s 'S = type("S", (), {"__add__": lambda x, y: "spamNI!"})()' 'S + "NI!"'
10000000 loops, best of 3: 0.105 usec per loop
$ python3 -m timeit -s 'S = type("S", (), {"__add__": lambda x, y: "spamNI!"})()' 'S.__add__("NI!")'
10000000 loops, best of 3: 0.0676 usec per loop
11:06
@underscore I don't see why you want to use an async event loop in the first place
11:23
@krijan you keep coming back with this problem. Now you've posted at least three iterations of the same large message containing steps of what you have to do. Don't use this room as a short-cut to learning to do your job or as a short-cut to asking questions on main. If your problem needs half an hour to explain and people have to write your code for you: you're doing it wrong.
12:06
So I'm saving an image using cv2.imwrite and it's not appearing in the folder, the operation outputs True, but there's no image to be found
then look harder
you're probably looking in the wrong directory
crosschecked it many times
It wrote other files, so certainly not a directory issue
well either 1. the call to write failed, or 2. the file is somewhere and you just can't find it
that's literally all the help we can give you
12:36
@piRSquared Nice work. Apparently the conventional solution is to generate a point inside a quadrilateral formed from two triangles. Then you only have two cases to deal with.
"left half of the quad" or "right half of the quad"
The article is frustratingly vague about how to transform one into the other
@Kevin you already have to have the outliers identified, at which point you can rotate each point 180 degrees around the midpoint of the common edge
I was trying to come up with a function that flips or rotates points over the line y=-x, but only if they're on the left side of the line to begin with... (new_x, new_y) = (abs(x+y)-x, abs(x+y)-y) is the closest I got. (1,1) becomes (1,1) as desired, and (-1,-1) becomes (3,3) which is wrong but at least it's in the right quadrant
if the origin is the bottom right corner then you have to shift by (v1+v2)/2, then act with the matrix [[-1,0],[0,-1]] (i.e. just flip each x and y component) then shift back by -(v1+v2)/2
@AndrasDeak Yes, or you can reflect over the common edge (but only if the non-shared edges of the triangle are the same length)
12:43
yeah, but rotations usually seem easier to me in terms of linear transforms
My holy grail is an approach that doesn't require me to identify outliers first. That's why I'm hung up on functions that don't do anything to points already inside the desired region
I suspect having a piecewise function that contains an explicit or implicit conditional doesn't count
Oops, the equation I wrote above is backwards, I meant (new_x, new_y) = (abs(x+y)-y, abs(x+y)-x). Not that it matters for the two examples I gave.
I also have (new_x, new_y) = (x * abs(x+y) / (x+y), y * abs(x+y) / (x+y))???) written down on this cocktail napkin but I haven't investigated it very thoroughly yet
Too bad it divides by zero when x == -y
abs(x+y)/(x+y) is sign(x+y) which can indeed be problematic at x==-y
if the formula is correct it should not matter if it's +0 or -0
Yeah for my purposes it doesn't really matter whether sign(0) returns -1 or 1, as long as it doesn't crash
12:53
I mean new_x, new_y should be correct both for -1 and 1. If those work you can hack a sign function that is defined to be either in 0
13:52
new_x = (abs(x+y) + x - y) / 2
new_y = (abs(x+y) + y - x) / 2
I have a good feeling about this one. No chance of dividing by zero.
fingers crossed :)
I derived it symbolically by putting an abs between two rotation matrices, so it's only wrong if I missed a sign somewhere in fifty lines of arithmetic
For x+y >=0 it's idempotent which is good
for x+y<0 it switches (x,y) to (-y,-x)
That's, uh, 180 degree rotation plus reflection to x=y line?
14:08
@AndrasDeak you mean a reflection on x=-y?
Currently squinting my brain to determine whether reflection on x=-y is isomorphic to reflection on x=y plus some kind of rotation
I think you need a 90 degree rotation.
@MisterMiyagi I don't think so. x <-> y replacement should be on x=y
if you mean the two together, then maybe :P
I'm not good with point groups. A few weeks ago I had to look at the character table of a group in order to be convinced that S_6 is the same as C_3·i. Rookie mistake, right?
@Kevin (x, y) => (-x, -y) is a 180° rotation around the center. (x, y) => (y, x) is a reflection on x=y. (x, y) => (-y, -x) is a reflection around x=-y == y=-x.
then it's working as he intended
Does anyone use Pycharm IDE here?
14:15
yep
I have created some environment variables on my host bash profile, which show up in python when I do os.environ.get(VAR_NAME) but they don't show when I put os.environ.get(VAR_NAME) statement in a script and run it via pycharm
PyCharm ignores most of your environment
So I need to add my variables explicitly in run/debug configuration
it's also running as a non-login shell, so bash_profile, bash_login and profile are ignored
@DeveshKumarSingh yes, if you want to use PyCharm for testing that's better for reproducibility anyways
okay, that's what the config page tells me, but do you know a way to automatically export these variables
14:21
Only took me two days B-)
\o/
well-spent, no doubt
I'm working on the new method.... I wanna see code
@Muze I think I could ask this on the Space SE meta
@Muze But it would be a little bit risky, mods hate this. On the PSE, I would get a year long ban if I would do, but the Space Meta is not so vehement yet. The obvious cause of your suspension was a cross-site mod conspiracy.
that's an oddly specific reply :P
gist.github.com/kms70847/69f5cb1f61efbdb93d66cfc5e69deaa1 for the morbidly curious. Scroll down past geometry.py. All you need to know about that file is that Point supports typical vector operations
14:23
> The obvious cause of your suspension was a cross-site mod conspiracy
1. that's quite an allegation, 2. why is this being discussed here?
@AndrasDeak Yeah. I know more about this case as it is usual, I know Muze since years.
@AndrasDeak That is the obvious truth. He did not make any bad.
OK, but there's literally no context here, nothing about space SE, nothing about conspiracies.
and frankly it's none of our business unless it concerns question bans due to things posted in the python tag
@AndrasDeak He often posts LQ posts. These are downvoted, closed and deleted. He is often accessed by automatic Q/A bans. But there is no reason to punish him over these, his attitude clearly shows curiosity, a wish to learn, and a strong urge to keep the rules.
@peterh Wait, so...he gets question-banned due to a consistent stream of low-quality posts? So where's the cross-site mod conspiracy?
@AndrasDeak That is right, I will try to contact him on better channels.
14:26
Exercise: turn rand_point_in_unit_triangle() into a single equation that uses no functions other than random()
@peterh English, please. Mods can't moderate things they can't read (there's precendent) thanks
@peterh you can open a separate chatroom with him, and ping him on main
I take it he has several posts on main, so pinging him should not be difficult
if he doesn't see pings on main, he won't see pings from chat either
otherwise, good luck
@AndrasDeak On mysterious reasons, he does not answer. It has probably some to do that he has an ongoing suspension on 7 sites now.
He's not suspended on chat.SO nor on SO main, so this should not be the reason. He might be discouraged of course.
@peterh Why does this bother you? 7 sites is enough for someone to have got the message by now
let's not go into that, this is off-topic enough as it is
14:39
@Kevin does a unit triangle have a unit distance from the origin to the edges or corners?
corners.
14:56
Or rather, one of its corners is on the origin and the other two corners are one unit away from the origin.
If all three corners were one unit away from the origin, that would be messy
re-cbg
mornin
I have a weirdly specific indexing pandas question, if anyone feels like helping
Just ask and if someone can and will help, they'll reply
@Kevin so the length of edge is 1?
i have a sorted dataframe, and i'm trying to filter by condition and grab some specific indices: df[df['categorical']=='val'].index.values
but when I use one of those indices in .iloc, it returns rows where df['categorical'] != 'val'
15:06
@MisterMiyagi Yeah.
so it's basically sampling a 1x1 square and projecting that onto a triangle?
wait, that's what you did there...
@Dylan please create a mcve
@anky_91
@anky_91 is there a way to do it in chat or should I just do a whole post?
If it's a few lines post it here, see sopython.com/wiki/…
I think it has to be a 1x(sin(60°)) rectangle actually
15:09
For more use a code paste service like pastebin
@Kevin shouldn't matter, since you can skew a triangle without changing its area
i'm at work on a vpn, all the images and code pasting sites get blocked. full post it is I guess. thanks though
You really don't need to post the full code. You can boil this kind of issue down into a few lines
I believe you, although I'm not sure how skewing is useful. If you skew my unit rhombus into a rectangle, it will have width 1 and height sqrt(3)/2. So I don't think sampling the unit rhombus is the same as sampling the unit square.
most pandas MCVEs should fit here though
15:13
I guess if you incorporate scaling along one axis, it's the same...
You have a df, you sort it, and then you .iloc on it. I suspect it's just that you don't reset the index after sorting but we'll soon see. In any case, the example needs to only be representative
Which of the two approaches are better in my case 1 or 2: pastebin.com/3kD9Kfxg
Anyway. I'm trying to decide whether it's possible to generate random points inside any simple polygon, if all you've got is an algorithm to generate random points inside an isosceles triangle. It seems simple in principle - decompose the polygon into triangles, then decompose each triangle into two isosceles triangles. My only concern is whether there will be a slight bias along the edges where two triangles meet.
Or is there a 3rd approach which is better, perhaps have an attribute in the __init__ instead of a function
15:19
@roganjosh it was a reset_index() issue, thanks
If I understand my own code correctly, a generated point can lie on the edge of the equilateral triangle that's opposite the origin; but a generated point will never lie on either of the other two edges. So depending on how you divide the polygon, you might get internal edges that a point can never lie on, or edges that a point is twice as likely to lie on.
with my code... different triangle
tri = make_tri(1, [.25, .5 * 3 ** .5])  #
lin = get_line(tri[1], tri[2])         # right side of triangle
con = get_converter(tri, lin)

plot_triangles(tri, con)
Or, no, I changed my mind. My code can put points on any edge.
So every internal edge in the simple polygon is twice as likely. Dang.
@Kevin If you are picking a random point in the 1 x sin(60°) rectangle, the right and top edges will be exclusive of your random function. The right edge would have mapped to the vertical centerline of the triangle, but that is okay because the left rectangle edge already maps to it. The top edge would have mapped to the bottom, but that too is already covered. The non-X-axis edges of your triangle will fall in the range returned by random, so your random picker will be inclusive of them.
So I think your random picker is inclusive of all the triangle edges (if I have guessed your approach is to pick a random in 1,sin(60°) and then map to itself if inside the triangle, or to its twin if outside)
my randoms are open on the right. Left edge only possible from first random. Cannot be reached from a converted point. ... in fact no edge can be reached from a converted point. Therefore it seems internal points are more likely
@Kevin checking your code now
15:27
@PaulMcG Yes, I think you're right.
I think I got McG'd but in a not so obvious way (-:
@Kevin if anyone asks tell them that zero Lebesgue-measure domains are irrelevant
^ that.... unless we're picking rational points from a machine... but don't mention that
I'm guessing that you're saying "for a random number generator with unlimited precision, the odds of random() returning 0 is almost exactly 0%. So it doesn't really matter if the odds of that are doubled"
15:31
indeed
Writing a random number generator that can return any real in [0,1) left as an exercise to the reader
you have a 2d uniform distribution that has doubled value on the edge of the triangle, which is irrelevant in the continuous limit
Lines don't have volume, and probability on the 2d plane depends on volumes, so the probability of a point being exactly on an edge is 0.
analysis is very forgiving <3
My company is starting to develop private packages that we will use internally. We are looking at ways to distribute these packages so that we can pip install them into projects. We've considered two options: installing directly from the libaries' git repos and setting up a PyPI-like repo.
We have a client that wants to do some of their own development on their project, so we need to allow 3rd parties to be able to install these packages without exposing any other code (such as that of other client projects). Any suggestions about where to look for information on either of these or other alternatives?
Neat! This method works easily for goofy triangles
tri = make_tri(1, [-.5, .5 * 3 ** .5])  #
lin = get_line(tri[1], tri[2])         # right side of triangle
con = get_converter(tri, lin)

plot_triangles(tri, con)
15:51
In the meantime, I'm googling. I'm just wondering if anyone here has experience with this type of thing.
You can always host your own pypi server, my company has one with necessary access restrictions, we also have CI/CD which pushes whl files to this server whenever a build is made of said libraries
twine does the said pushing
yah, that's one option we are considering. How difficult is it to set up? I mean how much time?
I like that rotation about the midpoint strategy, since reflection over the shared line only works for isosceles triangles
I initially chose reflection because I didn't want to have to calculate the midpoint, but in the end I need to calculate it anyway in order to get the right translations. So maybe I shouldn't have bothered.
@Code-Apprentice The server was already there before I came, but making your own whl files using setup.py and pushing those to pypi using twine via jenkins is pretty easy
@DeveshKumarSingh we will also need to set up the private pypi server, so I'm looking into what that takes
we don't have CI/CD set up for any of these projects yet, but that will likely be part of this.
16:04
a google search came up with this
perhaps you can play around with how you plan to authenticate? A unique token, or a username password combo etc
yes CI/CD is a good idea for automating the pushing of whl files, and pulling of these whl files by some other library
we'll get there eventually. This is a completely new thing we are setting up to help mitigate legal issues with IP ownership.
our original thing was a complete SNAFU
haha. even my company has big IP issues with almost everyone, they are much more strict in terms of access
the next step is figuring out how to distribute these internal packages
well you cannot reverse engineer a whl file I think, so just hand those off?
we are a consulting firm. We build custom software for whomever pays us. Which typically means that they own it. At the same time, many of the systems we build are quite similar. Someone had the most brilliant idea of creating a base git repo that we fork. But now we are cleaning up the mess that caused because we want to maintain ownership of that base project but now its code is in a client project's repo.
16:12
But why is your proprietary build software on git rather on a private repo via bitbucket etc
Maybe you already know this, but just to be sure: git and github are different things
sorry I should have said github repo lol
@Kevin I'm not calculating a mid point. Let the left edge be A, The bottom edge B, and the right edge be C. The coords for the first vertex is (0, 0) so I can treat the point of the top vertex as a vector, in fact it's A. and the right vertex is the same as B. So if a point chosen is P then it is either P or A + B - P
Code-Apprentice's base git repo might very well be on a private server that has no affiliation with github
@piRSquared Oh, makes sense.
@DeveshKumarSingh a wheel is just a zip file of Python code and metadata
only extension files are built
16:16
I use a function for the line that C lies on and test whether the point P is above C or below.
@Kevin yes a git repo can be hosted on github or bitbucket etc, I get your point
@MisterMiyagi pyc files?
I would gladly use an approach with vertex arithmetic like that if only I could do it without having to test whether P is above or below C
@DeveshKumarSingh by default, regular .py
Shalom! Cbg!
Happy Friday! :D
I suspect this is possible by briefly converting each vertex to polar coordinates, then doing some trickery on the angular component, probably involving modulus, and then converting back to (x,y)
16:20
hey not exactly python related but oculd anyone help me witha git issue?
What's the git issue?
i cant find the repository
from my bash or visual studio
Like you can't find the repository via command line or actually on GitHub itself?
I have asked three git questions in here in the last week so I'd feel pretty hypocritical if I forbade it now
via command line
i copied and pasted the url from a new repository and it says repository not found
16:22
I don't know much about visual studio. Via command line... my best guess would be to start by maybe recloning the repository. But that would mean you'd lose all your local work.
@SamuelWakeman That sounds like the right solution to me.
@SamuelWakeman As in, you did git clone http:///www.the-repository.com and it didn't work? Strange.
i don't need visual studio as much as i just need the git bash to people to push
@Kevin that is really strange.
i did git push after commiting the project
and it cant find it
So the code is actually on GitHub yet you can't clone it? This is bizarre indeed.
16:24
Or are you saying you successfully created a local clone of the project, but when you make a change and commit it and push it, it doesn't affect the remote repository?
no the code I have i need to push up to github
i created an empty repository on git hub that i want to populate
@Kevin this should do:
def rand_point_in_unit_triangle():
    height = 0.8660254038
    x = random.random()
    y = random.random()
    return (x + (1 - y) / 2, (1 - y) * height) if y > x else (x - y / 2, y * height)
Ok. What did you do after creating an empty repository?
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Lokesh-Eisen/manufacturingNetworkMVC.git
git push -u origin master
you cant go to that link its private repos
are you authenticated with your git client?
16:28
git config user and email seem right
i tried the command to make it reenter my credentials and nothing happened when i tried to push just still said I cant find
Interesting. What is the exact wording of the error message?
$ git push --set-upstream origin master

remote: Repository not found.
fatal: repository 'https://github.com/Lokesh-Eisen/manufacturingNetworkMVC.git/' not found
gonna try making it public briefly
$ git push --set-upstream origin master
remote: Permission to Lokesh-Eisen/manufacturingNetworkMVC.git denied to
Samuel-Wakeman.
fatal: unable to access 'https://github.com/Lokesh-Eisen/manufacturingNetworkMVC.git/': The requested URL returned error: 403
ok
are you sure you are using the correct account? The repo belongs to Lokesh-Eisen, but you authenticate as Samuel-Wakeman
right
wtf
but git config.user
says .user-name
=lokesh.eisen
how
am i 2 people at once
?
Hmm, can't help you there. It was only by a stroke of luck that user authentication works correctly on my machine.
16:37
well if i cant do this i have to manually click drag large groups of files
last day at ccurrent jop need to push so other people might carry on what i was doing
Worst case scenario, put it on a flash drive and let them figure it out
@SamuelWakeman that should be username, not user-name
but I recommend using ssh+key to authenticate to github
much less of a hassle
reglardles of i typed it in here
its correct
on github
gonna list samuel as acolloaborator
two spidermen pointing accusingly at one another dot png
@SamuelWakeman git config user and email are only used for adding meta data to commits. They have nothing to do with authentication.
16:45
@Code-Apprentice how do i fix this?
is there a git logout or something
Or should that be pluralized as "spidersman", in the style of "attorneys general"
afaik, git doesn't do any authentication at all. This is handle by other apps or the OS.
@SamuelWakeman 'https://github.com/Lokesh-Eisen/manufacturingNetworkMVC.git/' What's up with that trailing slash?
I suspect that is the problem
remove it and it will work
@Kevin Spidersman conjures up an image of a creepy guy that throws tubs of spiders on people in the street. I don't think it's what you're after.
    i-sam.wakeman@Workroom6 MINGW64 ~/source/repos/website final (master)
$ git remote set-url origin github.com/Lokesh-Eisen/manufacturingNetworkMVC.git

i-sam.wakeman@Workroom6 MINGW64 ~/source/repos/website final (master)
$ git push --set-upstream origin master
remote: Permission to Lokesh-Eisen/manufacturingNetworkMVC.git denied to Samuel-Wakeman.
fatal: unable to access 'https://github.com/Lokesh-Eisen/manufacturingNetworkMVC.git/': The requested URL returned error: 403
@roganjosh wow. You know, in this day and age, I wouldn't be surprised if someone actually did that.
16:49
did it ask for a user name and password when you did the git push?
There's a spiderman villain who was bitten by a radioactive spider and then his body melted into a million spiders that all host his consciousness in a telepathic hivemind. That guy is certainly a spidersman.
@Kevin ooo creepy - but very cool.
@Code-Apprentice it did not
@SamuelWakeman windows or linux?
or mac?
windows its pushed now
i added samuel as a collaborator
16:51
what did you do?
oh lol
I'm just gonna say; you said it's your last day at the job, but I can access that repository and see all of the code. Are you aware that this is public?
im just about to make it private again
is this a project for work?
that's a pretty large window for anyone to steal your company's code
especially that you have publicly posted the URL for the repo
Which I quite easily could have done. I don't actually know what the code does, but I could always have just grabbed it as soon as I realised you posted the URL here
well i hope not.
its private now
16:55
hope isn't a security feature...
the code doesn't do all that much and its not that hard to reccreate. not a security feature thank God.
I didn't, but you shouldn't trust me. The lesson here is that you really need to avoid doing that in future
I misremember, it was only a couple thousand spiders. (content warning: cartoon people melting into thousands of spiders)
noted
ftr its just a website outline right now with fake data is what that thing has and i didn't post any of the database data
youre right i should be careful
@Kevin fwiw, millions still qualifies as thousands
16:57
Technically correct: the best kind of correct
but im just trying to get out of this job tbh. I'm a 21 year old intern still in college who got kind of manipulated when i took the job, and the boss is like go build amazon b2b2c by yourself, and I'm like ok ill try
this was doomed operation from the start
I had three internships during college and they all involved doomed operations. Oh well, I still got paid.
Cool, it would be good for you to be able to move on without prosecution for leaking company trade.
@roganjosh right I'm saying I agree I should be more careful, but also anyone who knows how to code vaguely in asp.net could do what I did with that repo in under 3 hours
well maybe not vaguely
but if theyve been coding with it for a least 1-4 months 1 day
1 year
State of the art computer vision, digital newsletter distribution scalable into the tens of thousands, sentiment analysis of articles about publicly traded stocks... My bosses sure loved giving me pie in the sky objectives
17:01
a few hours or less
17:19
Hi all, I'm looking for a resource that can help me understand how to create a Python package (something pip installable) that users will be able to evoke from the command line after installation. So pip install blargs && blargs would run __main__ inside of the blargs package
I know there's python -m but I don't want users to have to type the python command at all. I know this can be done but can't seem to figure out just how to set it up. Can one augment a user's path as a post install hook or something like that?
you want an entry_point, specifically a console_script
it will automatically create the platform-dependent executable on installation
awesome, is that part of the setup() function?
Solid, thanks very much!
17:25
Perfecto, thanks again!
 
1 hour later…
18:53
What a frustrating day. Trying to revisit my old code, it seems my old stack is basically alien after a couple of years; so many changes in the libraries. For some reason it reminds me of the old Jaffa cake advert where I've just watched everything disappear.
A recent now-deleted post on the main site asks how to print a triangle of numbers. Pretty standard stuff for a beginner exercise, except it took me five minutes to determine the pattern by which the numbers appear.
And before that, a minute to determine that there might be a pattern, rather than a keymash by the OP to produce approximately triangle-looking sample output
I don't think this is a very productive way to teach someone how to do for loops
I'm guessing that's the one I commented on. I also didn't see a pattern but I lose interest fast when there's no input from the poster, even just to say they don't see the pattern, so I moved on and didn't think too much about it
You did indeed comment on it.
It's easier to see the pattern if you use something other than zero as the separator
01:00 - 19:0019:00 - 00:00

« first day (3191 days earlier)      last day (1979 days later) »