« first day (2496 days earlier)      last day (2456 days later) » 
00:00 - 15:0015:00 - 00:00

12:00 AM
test
Out[31]: 'https://plus.google.com/117150671992820587865'
re.sub(r"https?://www.", "http://", test)
Out[32]: 'https://plus.google.com/117150671992820587865'
How come isn't it matching the 's' in https?
 
There's no www.
 
-_-
Can I delete this?
 
DSM
@AbhishekBhatia: if one model is equivalent to a broader model under a certain set of assumptions, you can often describe the one model as having made an implicit assumption. The fundamental difference between Bayesian and frequentist analyses isn't priors vs. no priors (whatever that would mean), it's that Bayesians work in the hypothesis space and frequentists work in the sample space. If you don't know what I'm talking about, that just means you get to do more reading. :-)
 
12:11 AM
@DSM I don't what you are talking about. :) Can you explain what you mean by "Bayesians work in the hypothesis space and frequentists work in the sample space". I generally found Probability and Statistics by DeGroot helpful. But I didn't come across this statement/explanation anywhere in it.
 
DSM
Googling "Bayesian hypothesis space" would probably be fruitful (he said, having just confirmed that indeed it brings up lots of tutorials.)
 
thanks. Though if you could have explained more it be have been helpful. :)
 
the saga continues
 
It would be funny, if I come across a paper, where reference instead of citing a book or paper, just mention "Google XYZ, you will find it".
 
what is the point you are trying to get at exactly?
 
12:26 AM
player I enters the game :D
 
that when you show up here people have to write essays for you explaining the thing that was actually searchable with almost the exact words you used to ask about here?
 
12:37 AM
errr....it is not much productive continuing discussion :). I am graduate going ML stuff. I always found this bayesian vs frequentist question cool, and I asked around it about with my profs. But I didn't hear this explanation, so I was just curious. :)
Like what does this even mean frequentist work in sample space? Can frequentist not have a hypothesis? There is no less information to figure it out!
 
so is it true that windows is absolute trash for anything envolving python ssl?
because so far, I believe it is a fault of windows
all the fixes I see are for mac/linux
 
12:56 AM
devil's advocate: the fixes might be missing for windows because it Just Works
 
def isnt working for me so far lol but possible. I heard it doesnt work with windows credential manager well though
 
 
2 hours later…
Cro
2:44 AM
how could i crop image in the center of a image using opencv with specified size sz?
 
I used to use PIL for that kind of stuff, was pretty easy. PIL has been replaced by Pillow.
 
wim
3:11 AM
on the long tail of crap here
 
 
2 hours later…
4:53 AM
how to run a docker container with ports enabled? I've already created the container now I can't access it via jupyter-notebook. I really new for docker
 
o/
what : symbol means in python ?
> train_house_size = np.asarray(house_size[:num_train_samples])
> train_price = np.asanyarray(house_price[:num_train_samples:])
 
: used for slicing arrays
 
ok
 
>>l=[1,2,3,4,5]
>>l[1:3]
[2,3]
 
":num_train_samples" and ":num_train_samples:" does both line mean items from the beginning to end ?
 
 
2 hours later…
6:38 AM
cbg
 
Cro
cbg
is there any high-level python networking api?
an api that let me do real time data transferring using tcp
i used socket and i got this:
450
Traceback (most recent call last):
File "tflearn_cap_testing.py", line 100, in <module>
data = cv2.resize(pickle.loads(data).astype('float'), (64, 64))
_pickle.UnpicklingError: invalid load key, ' '.
 
7:07 AM
cbg-ning
 
@Cro That's not a networking issue
dpaste the code
 
Cro
7:42 AM
import tflearn
from tflearn.data_utils import shuffle, to_categorical
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
#neg = cv2.imread('neg.png').astype('float')
img_prep = ImagePreprocessing()
img_prep.add_featurewise_zero_center()
        for i in range(k + min_sz):
            print('i: ' + str(i))
            if(i % 100 == 0):
                for j in range(k + min_sz):
                    #print('j: ' + str(j))
                    try:
                        frame1 = cv2.resize(frame[j:j+k+min_sz, i:i+k+min_sz], (64, 64)).astype('float')
                        pred = model.predict([frame1])
                        if(pred[0][1] > pred[0][0]):
                            print('detected #{:d}!'.format(count))
                            count += 1
 
dpaste != paste
 
Cro
import tflearn
from tflearn.data_utils import shuffle, to_categorical
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
import cv2
import numpy as np
import pickle
import socket

# Data loading and preprocessing

# from tflearn.datasets import cifar10
# (X, Y), (X_test, Y_test) = cifar10.load_data()
wat
dpaste?
 
Cro
i want to send frame1 up
and download pred
 
zomg... can anyone link that indentation error canonical we were talking about the other day to this post stackoverflow.com/q/45707846/2336654
Found it
26
A: I'm getting an IndentationError. How do I fix it?

Christian DeanWhy does indentation matter? In Python, indentation is used to delimit blocks of code. This is different from many other languages that use curly braces {} to delimit blocks such as Java, Javascript, and C. Because of this, Python users must pay close attention to when and how they indent their ...

 
8:15 AM
Cabbage!
 
\o
 
Hi there!
I've got a binary-tree-like structure like in https://upload.wikimedia.org/wikipedia/commons/f/f7/Binary_tree.svg
Now there is a flow dflow flowing into that structure at node 2 and is split up by the factors n7 and n5 with n7+n5=1. So in node 5 the flow is dflow5=dflow*n5 and for node 6 it is dflow6=dflow*n7*n6.
It determine these factors for each node before my calculation with a few million iterations starts. But while looping, dflow and the n-values change constantly, but I don't want to waste time on looping through the tree again.
Any idea? and thanks for help!
 
8:35 AM
cbg
 
9:03 AM
Lazy OP is lazy.
 
anyone able to help me? Current workaround is to call a method which loops over the tree-like-structure at each iteration, but that is extremely slow...
 
I don’t really understand that flow/dflow stuff you’re talking about
 
The true solution is to stop running any code at all in Python 2Antti Haapala 9 secs ago
 
wtf is with that question even?
 
well, let s say water is flowing into the tree at node 2 with dflow=1 kg/s. the connection between nodes are pipes. and after node 2 it is split up with dflow5 = dflow*n5 going to node 5 and dflow7 = dflow*n7 with n5+n7=1
 
9:09 AM
That’s like saying “I get a syntax error when I try to compile my Java code in C#.”
 
and I want to reference to the variables n5,n7... and dflow to dynamically update my dflow5, dflow7... values without having to run the loop over the tree at each iteration
 
Uhm, can’t you have those variables in a dictionary where you update the values, and then just pass the dictionary?
So every node will always lookup the stuff from the dictionary and automatically get the newest value?
 
well, unluckily it is a little bit more complicated, as each node does not really know which node is before or after it and one of the nodes determines the dflow-value. this could be node 2, node 5 or any other node. or there could be another tree upside down on top of node 2, etc... so that would make constructing and updating a dict really complicated
 
In today's saga of "pythonic code": Two people upvoted this answer that simply didn't work, probably because it looked fancy and they couldn't read it.
 
@Scotty1- Is the tree fixed though?
 
9:17 AM
yeah
it doesn't change its topology after it is created
 
@Rawing And why the hell is everybody using a file function?! What is that supposed to be?!
 
He actually opens the file with open first, but then just ignores it and opens it a 2nd time lol
 
@Scotty1- So you could parse the tree once and build up a set of dynamic calculation expressions for each node that automatically reference the correct dependent nodes?
 
@poke I am currently trying to adapt this way of referencing to variables to my need, but still can't work it out properly:
class PassByReference:
    def __init__(self):
        self.variable = ['Original']
        self.change(self.variable)
        print(self.variable)

    def change(self, var):
        var[0] = 'Changed'
 
@Rawing But there is no file function :(
 
9:21 AM
Oh snap, you're right. TIL.
So I can name my variables file now without being frowned upon? :o
 
@poke yeah, that s the way I tried to do it, but I can't come up with a solution. I tried passing the n-values and dflow-value to a list by appending them, but it only appends their value and not their reference
 
@Rawing Yes…? xD
 
I'm not sure if you're joking anymore :/
 
@Scotty1- Can you show an example for these calculations? Also, when you process the tree, do you want to do the calculations for all nodes in the tree at once; and do you want to do it with a fixed set of flow values? Or is this actually real-time or a delayed execution?
 
file is the same as open in py2
 
9:23 AM
wut
wtf
didn’t know that
 
@Rawing Not exactly, though the end result is the same. file is the type / constructor.
 
Python 2 is really weird.
 
@poke well, the calculations for the flow would be just dflow5 = dflow * n5 for node 5 and for node 6 for example dflow6 = dflow * n7 * n6. the calculations should be done at once as I change one of the values for all nodes in the tree. and the flow values change after each iteration my main calculation.
 
So a calculated flow does not depend on the flow of a node before? Where does the tree structure matter in the calculations then?
 
it does. for example dflow6 = dflow * n7 * n6 = dflow7 * n6 with dflow7 = dflow * n7
 
9:35 AM
Why isn’t dflow7 = dflow2 * n7?
 
well in this case the flow at node 2 determines the "basic flow" of the tree, so dflow = dflow2
 
(not helping that the wikimedia picture has two 2s; I meant the parent 2)
Okay, so that’s a special case because 2 is the root.
So dflow11 = dflow6 * n11?
 
yea, sorry. should have pointed that out
yep
 
Or in general dflowN = dflowParent * nN?
 
yes
 
9:37 AM
So ideally, you would want a function you pass in the basic flow dflow and the nI for all nodes I and get back the dflowI for all nodes I?
 
yeah. currently I am looping over the tree at each iteration, but I thought just giving the nodes some kind of a calculation expression which uses references would be great. something like an expression where dflow and the n-values are pointers which point to the memory adress where the current value is saved
 
Let me think about this for a bit.
 
but since each node is saved in an instance of a class it seems like I can't pass the references to the dflow and n-values to the nodes' instance attributes. only passing values seems to work
ok, thanks alot!
 
@Scotty1- you can wrap the dflow and n-val in a class to simulate pointers?
 
@Metaphox you mean to create an instance of a class to which I pass my node class instances?
 
9:54 AM
@Scotty1- i didn't read the whole context but i think if you just want the values to be pointers, you can do something like this
class ptr:
    def __init__(self, val): self.val = val
so say a = ptr(42), b = a, b.val = 0, now a.val is 0
and you just make the instance variable of nodes all ptr(value)?
 
Hi can anyone experienced in flask help me with this stackoverflow.com/questions/45706218/…?
 
@Metaphox thanks, that looks like a really nice and easy way to use something like pointers! now the remaining problem is, that I would like to also update the result c in the equation c = a.val * b.val once either a.val or b.val change. any idea on how to do that?
 
10:16 AM
@Scotty1- i think you'll need to either use a messaging system or make a simple event handling mechanism by your own, like handlers = []; def a(): <update c = a.val * b.val>; handlers.append(a). Then, in your node class, whenever the value changes, call def notify_all(): for h in handlers: h()
 
@Metaphox ok thanks! I m currently trying to make a class which has an update all method which is called after all n-vals have changed and then changes dict-values. but I'm running into the problem that my dict is not ordered and I need to maintain the order (ordererd_dict is no option, because I need to compile the class in Cython later on...). something like notify_all sounds like a great idea for that! I ll try to implement it. thanks!
 
@Scotty1- :D glad i could help
 
11:11 AM
def getDflows(baseDflow, ns):
    dflows = {}
    for node in nodes_in_breadth_first_order:
        if node.parent is None:
            dflows[node] = baseDflow
        else:
            dflows[node] = dflows[node.parent] * ns[node]
    return dflows
@Scotty1- Would this work?
 
@poke thanks! I didn't include a parent attribute so far, but that looks like a good idea! I ll take a look at it and try to implement it!
 
Alternative to the parent lookup on the node itself, you could also prepare nodes_in_breadth_first_order and some parents dictionary in a first phase when you interpret the tree.
 
@Cro I'm absolutely sure that 5 minutes of googling will give you an answer.
 
@poke has anyone pointed out networkx yet?
 
11:22 AM
@poke yeah, I am looping over the tree with a recursive function in which I currently try to implement a dict lookup. but I m having trouble with the order in which the dict is looked up, so a parent attribute could be really helpful.
or I guess better would be a children attribute
 
@Jon I don’t know Python libraries
 
I thought networkx is a graph thing
Oh this is for a graph thing
Sherlock strikes again
 
cbg @JonClements long time no see, what's up ol' friend?
cbg for all as well
 
@Peter how goes it!? Still in the UK?
 
@JonClements still here, yeah, a month from now will be my first anniversary :) things are happening very fast, I work my bottom off (as everyone else)
so I don't really have that much time being around on SO anymore
 
11:32 AM
Wow - coming up a year... just wow...
You doing tech or design stuff?
 
tech, working as a fullstack, mostly backend dev, working with Python, JS, etc. the usual stuff :)
sometimes a bit of C if I'm lucky :)
how 'bout you? still freelancing/doing project based works?
@JonClements what do you think about the upcoming changes in DW?
 
@Peter I'm holding off thinking about it until I see it :)
 
you were always the wiser between the two of us, I already gave up on it :/
(it was a hard decision, because I used to love it so much..)
 
12:02 PM
The writing let it down for me... Capaldi could have been so much more :(
 
12:15 PM
(didn't have before :( )
Ah but I can re-edit :D
hmm now I canät cancel my reopen
 
12:33 PM
Oh... it doesn't let you retract it?
 
12:49 PM
cabbage :-)
 
82
Q: Documentation is read-only. What’s next?

Jon Ericson As previously announced, Stack Overflow Documentation is now in read-only mode in preparation for its sunset permanent removal from the site. Before we move on, I want to update you all on some responses to your feedback. I’m enormously encouraged by the thoughtful comments and answers to the...

 
I was told not to write query like this due to SQL hacking problem.
sql = text('INSERT INTO custom_user_test_data(taskid,test_data) VALUES ("test1" ,"test2")')
    exe = db.engine.execute(sql)
This code is working presently , no issues whatsoever
 
possible issues arise when someone gives you input that manipulates the query
 
How can they do it?
 
@Anarach it depends on the code. If you're just throwing string-valued variables into a query and the strings come from outside, you're vulnerable
it's the SQL equivalent of eval(input())
 
12:52 PM
The 'test2' is a dict
 
code words are "sql injection", "input sanitization", etc.
 
and 'test1' is generated by me
but the dict is coming from the web so you are right
 
yup
I don't know SQL but the philosophy is what I told you: be very very very careful with untrusted inputs
and it's better to get into the habit of using safe code even if your inputs are trusted
there are idiomatic ways to do this safely, so learn it and use it
 
Woah, that is a pretty huge data on SQL injection
 
yes.
so don't be that guy
 
1:04 PM
@AndrasDeak I tired to replace the hard inputs with '%s' and in the following execute statement i passed the variables but it throws and error
 
as I said I don't know SQL but replacing one kind of string substitution with another kind wil probably not make it safer
 
i have upgraded django 1.6 to 1.8. and used followed instruction docs.djangoproject.com/en/1.8/topics/migrations/… but when use makemigration it keep give me "no changes detected", any idea?
 
sql = text('INSERT INTO custom_user_test_data(taskid,test_data) VALUES (%s,%s)')
    exe = db.engine.execute(sql,"test1","test2")
 
you have to search and learn how to do these queries safely
@Anarach oooh, I see!
that's different
but my statements hold ---------------------^
 
Need to dig deep i guess
Thank you for the headsup
 
1:06 PM
no worries, stay safe :P
 
@SaravananN it will detect a change only if your models have changed
 
others here will probably be able to help you
 
Yeah
 
@Anarach but i upgraded from 1.6 to 1.8 ...so it should basically detect my changes right??
 
Did you flushthe migrations folder?
Not asking you do do it now
BTW
just enquiring
 
1:09 PM
Yes...deleted migration files and .pyc files. then try to run makemigartions command
 
have your models changed since you updated the versions?
 
No...
 
Hmmm...
 
@Anarach How can i successfully run makemigrations command without errors?
any suggestions??
 
I am not an expert by any means but why not try to link the engine to a brand new DB like sqlite or something and run the make migrations command, that way, neither the migration files will be there nor the tables.
if it successfully creates the tables in the sqlite db then you will have to probably drop the tables in your current db and recreate them all over again. Again, I am not an expert and just giving suggestions.
 
1:18 PM
cbg \o
 
whaddup
let's party
 
Hey guys I have a generell question about data management (keeping data up to date) within an app. Yesterday I created a new question but nobody answered. So hopefully somebody can help me: I'd like to check within my app if some data is up-to-date, maybe every time the user opens the app. So my idea is to download a file (.txt) and compare its contents with the contents in the app.
Is this the right way - to download a file for checking if the data is still up-to-date? Or are there any better solutions? I also thought about making a new update for the app if something changes but it's not guaranteed that every user will update it. :D
 
@idjaw in 2 days sure... gotta wrap up my project before friday night :\ And now I hit a random error with the system, oh joy.
 
just wrap it up in an exception and hush it
force it to be quiet
 
system error isn't running my functions so i cant just wrap it :D
 
1:30 PM
ugh you're so difficult to please
 
It's cause I can't eat cheese
 
you're an abomination
that goes for anyone else that doesn't like cheese
 
@CedricMichael where is this file that you will download to get the lastest information, there's so many gaps in your question to kind help you with :\
@idjaw i love cheese just can't eat it :\ life is cruel that way. you want something you can't have :(
 
you poor thing
 
@MooingRawr thanks for your answer! :) Until yet I havent such a file on a website. My idea is to do it like this. What I ask myself is: is this the right approach?
 
1:38 PM
@MooingRawr \o
 
@CedricMichael I'm actually confused on what your goal is, you have an app that has some url that you want to keep updated correct? what's the correlation to your "site" and your app? do you have a database? when will the url get updated (not your app's url outside of your app). whos updating the url that is causing your app to have to be updated.
@AndyK \o how goes it
 
@MooingRawr not too bad. back from holidays also known as "time to do chores like fixing the bathtub or putting that extra paint the room, you don't have time to do during the years"
 
eh... that's what weekends are for :D
 
lol
 
idjaw would know too well about that :D
with his army of lildjaws running around
 
1:43 PM
they're called zergs Moo
zergs
 
zerglings? :D
 
yes
 
@MooingRawr lol I wish!
 
@MooingRawr hmm okay, sorry for the confusion. Its a iOS app, I have local database. There are product objects inside it who have an url attribute redirecting the user to the url (by interaction). My plan is to check these urls one time a week if there are still working/ correct. So if there are incorrect I update them (with my plan within a .txt/csv file which will be downloaded by the app automatically from a website/ cloud - something like that). Sooo hopefully this is more understandable.
@MooingRawr I could also publish an update for the app but so then I dont need all of that. But I think thats not the right way - publishing updates for such small data changes. (hopefully my english is understandable :S)
 
My Facebook feed is currently filled with spoilers from the leaked episode 6 of GoT. Kindly keep yourself safe.
 
1:54 PM
ugh
is there nothing sacred anymore
 
Well, after seeing alt-right vs "alt-left", I believe anything can happen these days.
The times are dark and full of terror...
 
Yeah. Just a heads up. We really try to avoid any politics in here. Especially with the current landscape.
I hear you. Trust me. But, let's not do it here, please.
 
Ah, my bad. Politics in a sacred place should be avoided at all costs.
 
we can talk about the politics of Python though and all those pesky python 2 lovers
looks around the room
 
I wouldn't call them lovers... more like they don't know what they are doing...
Been there, talking for self.
 
2:17 PM
@idjaw s/lovers/heretics
 
guys
i need help please
im using opencv on python and im trying to use the cv2.fitLine() however it keeps giving me an error
cv2.fitLine(np,array(circleCenter_coords), cv.CV_DIST_L2,0,0.01,0.01)
the error im getting is...
OpenCV Error: Assertion failed ((is2d || is3d) && (points.depth() == CV_32F || points.depth() == CV_32S)) in fitLine, file /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/contours.cpp, line 2033
ERROR:
Traceback (most recent call last):
File "rotate.py", line 37, in <module>
[vx,vy,x,y] = cv2.fitLine(np.array(circle_cords), cv.CV_DIST_L2,0,0.01,0.01)
error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/contours.cpp:2033: error: (-215) (is2d || is3d) && (points.depth() == CV_32F || points.depth() == CV_32S) in function fitLine
circleCenter_coords = [(336, 290), (358, 276), (316, 312), (354, 300), (318, 282)]
I've tried googling however I havent found anything helpful for me, and I don't understand c++
 
Have a quick look at chat.stackoverflow.com/transcript/message/37997172#37997172 to see how to format code in chat
 
before, i was straight up using `cv2.fitLine(circles[0] ....`
where `circles = cv2.HoughCircles(imgray,cv.CV_HOUGH_GRADIENT,1,20,minRadius=20`
however i realised that, that contained a few more extra data so i thought that was causing the error
 
Also sopython.com/chatroom from the top right for a few rules of the road around here.
 
Cabbage
 
2:30 PM
Looks like you've got a problem there in the C++ code (so maybe Python room ain't the best place to come for help). However, it looks like an assertion has failed
The syntax in that line of C++ looks similar to the Python, so you can work out what's wrong.
((is2d || is3d) && (points.depth() == CV_32F || points.depth() == CV_32S)) has evaluated false for some reason.
 
cant do the `` ...?
@JRichardSnape ah right okay
@JRichardSnape i dont understand why though?
 
Well. First work from the assumption that it is what you are passing in that's wrong. Of course it's possible that there's a bug in the Python wrapper for the C++ code, but that's the least likely option.
We may get to that
I guess points is the data you're passing in somehow
 
Yes, I think its the first argument..?
Thinking that i was passing my data wrong, I used this a guideline
1
Q: Weird error thrown by cv2.fitLine() method

zeoI'm using the cv2.fitLine method to find a line segment among many points. I have the following error: error: /Users/jenkins/miniconda/1/x64/conda-bld/work/opencv-3.1.0/modules/imgproc/src/linefit.cpp:603: error: (-215) npoints2 >= 0 || npoints3 >= 0 in function fitLine Here's the section of m...

Im using the same format as him however its working for him?
 
So - did you read and understand the answer to that question?
Because I think you're making the same mistake as him.
 
the tuples instead of np array?
 
2:36 PM
yerp
 
doesn't np.array(circleCenter... take care of that?
 
It might (not sure)
BTW - it might be a typo in your cut/paste, but I see you have np,array rather than np.array
is it possible that you're passing in the entire numpy package as your first argument?
That would possibly give that error
 
@JRichardSnape typo in my cut/paste, sorry
 
So i printed the `np.array(circleCenter_coords)`
`[[336 290]
[358 276]
[316 312]
[354 300]
[318 282]]`
thats the output i get
 
2:39 PM
Here's an idea. Try doing coord_arr = np.array(circle_cords) before the call to fitLine() and then check that coord_arr is actually in the shape you want
Ah, kinda similar to what you've done there.
 
my `` isn't formatting for me, idk why, sorry!
 
@enderland we should shame them as much as we can
 
@CedricMichael sounds like you are depending on a third party site. If you are planing on checking once a week, you could make your app point to your database for the url, and when you do your weekly check up, just update the database value, no need to actually write update codes in your app since it would assume the database has the newest info. You will write a separate update 'job' that runs (you said once a week) once every x days, and update the database values. It's how I would do it if I
understand your question and situation correctly.
 
@SylentNyte take note of what @poke said - I put it here too chat.stackoverflow.com/transcript/message/38690116#38690116. Room mods might get bored of the formatting...
 
2:42 PM
yes but
nvm, i know
 
@SylentNyte You could try transposing your array (maybe it should be Nx2 rather than 2xN)
 
Please use the sandbox to test stuff
 
@wim so great
 

Sandbox

Where you can play with regular chat features (except flagging...
 
wim
how much rep is needed to cast delete votes?
 
2:45 PM
@CedricMichael I've never written a Web app, but I agree that forcing an update of the app just because the data on your site has changed is overkill, and annoying for the user, as well as wasting their internet data usage. Your app could just blindly download the data files it needs every week, but that's wasteful too.
It would be much better if the app can access a list of the names & timestamps of the files it needs, and if the version of a file on the site has a newer datestamp than the local version, then it needs to be downloaded. You may also like to include a cryptographic checksum, eg SHA-256, with that data.
 
why would transposing work?
 
@wim 10k on questions, 20k on answers
 
+ it would mess up my data :/
 
wim
another 5 bad answers worth deleting to clean up this canonical stackoverflow.com/a/25856144/674039
 
@SylentNyte Just an idea, if the underlying C++ cares which dimension is 2 long. This chat is a bit extended now. Maybe if you do a question with an MCVE on the main site, it will get answered. It won't mess up your underlying data, because you can just transpose it for that particular call (if needed).
I have used cv.fitLine() before with no issues, but it is years ago.
 
2:48 PM
what im trying to do is find a line of best fit from center points of a circle detected by hough circles
 
@MooingRawr thank you! That sounds good. But @PM2Ring your approach also sounds really well! I think this is the best way how to solve my issue. Never thought about checking it by datestamp/ cryptographic checksum - this is how i'll do it! Really well! Thank you very much guys =)
 
@SylentNyte OK - just tried what I think is a minimal example from your data and it works for me. Which makes me think that you are not copy-pasting exactly what you are doing.
 
ill copy that whole section
(and try to format it correctly)
 
Lemme try it clean and give you a transcript.
 
there's a formatting guide in the second pinned post -->
 
2:51 PM
@SylentNyte make a small example that shows your error, it's far easier to help someone who does this
 
No - don't dump everything here - use dpaste (see the rules of the road I posted you to)
 
ah okay
 
@wim Oh, goodie. I have a valid excuse to post this:
Even alleged experts can get this wrong: see Excel incorrectly assumes that the year 1900 is a leap year. — PM 2Ring 33 secs ago
 
@PM2Ring wouldn't that just be the solution to update the database of my solution :D ? oh well at least OP got his answer lol
 
@MooingRawr If so, then I havent understand it 100% correctly :D Sry mate!
 
2:55 PM
eh no worries just go with what your gut tells you lol
 
>>> import numpy as np
>>> import cv2
>>> circleCenter_coords = [(336, 290), (358, 276), (316, 312), (354, 300), (318, 282)]
>>> coord_arr=np.array(circleCenter_coords)
>>> [vx,vy,x,y] = cv2.fitLine(coord_arr, cv2.DIST_L2,0,0.01,0.01)
>>> vx
array([ 0.9046874], dtype=float32)
>>> vy
array([-0.42607591], dtype=float32)
>>> x
array([ 336.3999939], dtype=float32)
>>> y
array([ 292.], dtype=float32)
>>>
That looks like what you said you want @sylent
Tested in Python 3
 
@MooingRawr Sorry, I haven't read all of the relevant posts yet, so I don't know the details of how Cedric Michael is handling the data. Sure, that info can be on a database, but it could be an independent JSON or plain text file. And I assume that any sane file delivery system already incorporates datestamps & checksums. ;)
 
my point was that im not a fan of writing update data code into my apps, i rather have them point to something like a database, and have my separate update codes that update the database, the only downside to my method is you will be using data to ping the database for urls, unless u manage it with sessions and or cookies....
 
Don't know where your dpaste link went, but maybe in pasting it you have spotted the error?
 
@PM2Ring dont be sorry :D I'm just pointing out what I think and just wondering no worries :D your idea of checking hash values and timestamp is the correct way of updating files and data. I'm just saying where to put that update code.
 
@MooingRawr Rightio. I defer to your expertise in this matter. Being an amateur programmer, I haven't had much experience doing database programming stuff.
 
00:00 - 15:0015:00 - 00:00

« first day (2496 days earlier)      last day (2456 days later) »