« first day (1152 days earlier)      last day (4022 days later) » 

20:05
nothing like a happy user
He might become grumpy when he discovers that he can't draw lines and things on top of that entry
If I recall correctly, widgets are always drawn over primitive canvas elements
user559633
yeah, don't really care about happy users, but i do enjoy "oh tkinter seems to do most of what i want" posts because they quickly descend into madness
yep, keyword most
Hi K DawG!
Thanks for your answer by the way !
user559633
last 10% is 90%
20:08
the remainder is where the hair-pulling occurs
I think I am doing basic level math wrong
@tristan no offence man but Tkinter is awesome ::::::: than PYQT or others....
@Basj no sweat :)
there was one bug though
Run it by me, @Crowz, basic math is my specialty
which one ?
Do you mean the "maximize" bug ? (when I maximize, it's buggy)
@Basj yup
20:10
Do you know the solution? I can't find (yet ;) )
user559633
really? tkinter over pyqt?
I go through a list and look at basically 1 or 0. I want to find out what percent of the total 1 is. So I just do int(float(total_ones) / float(total) * 100)
tristan and K DawG are you good in Python GUI (tkinter and pyqt) ?
;)
That sounds good to me @Crowz
for one, I have 1019 ones and 1757 0s, but it says the percent is 36% of the total
20:11
If so, I may have a challenging question :)
(less newbie-question than the previous one ;) )
@tristan ok I seriouly didn't mean that PyQT5 was sorta good.... BTW don't let Tkinter down Its the most beginner friendly Gui I ever met and you should've seen some of @PeterVaro's work.....
@Basj It would be better if you ask it on SO and then post a link here....
Sounds about right @Crowz
Well I realize it's not really a quesiton, but rather a "project" :)
user559633
I've written a good amount of Tkinter. It's the most beginner friendly, but oh jeez how steep the fall-off is.
@KDawG I would like to display a big screen with ability to create new textboxes like we did, and ability to move them (like in Photoshop), ability to have multiple lines with CTRL+ENTER (is it possible with Entry to have multiple lines with CTRL+ENTER?)
20:15
Hey can you guys help me out with this ?
http://stackoverflow.com/questions/20528993/what-would-be-the-big-o-notation-for-the-function
@kiasy, it's O(1). No matter what number you give to the function, it always runs in the same amount of time.
@Basj you better try something first by learning something first and then if you get any errors come over SO and drop-by
Do you have an idea for that @KDawG (I can post a SO question, but won't this considered as flooding ?"
It performs exactly 85 loops, regardless of whether you call method(0) or method(999999999)
@Basj try something reasonable first or your likely to be flagged
20:17
Kevin can you shorty explain why ? I want to understand it... :)
for CTRL ENTER, do you have an idea ?
@Kevin
@kiasy : complexity is a measure of "runtine" approximatively or memory usage (am I wrong)
There's not much else I can say, besides the things I already said
t=0
for i in range(n):
t = t+i ** 2

this is O(n) because there are "n" passes in the loop
20:18
so O(n) or O(1) ?
@Basj unfortunately Entry widgets can have only one line therefore go on with the Text widget
the above code is O(n). The code in your question is O(1).
Its possible to have multiple lines with Enter in them
In your example there are a CONSTANT number of passes in the loop, that's why O(85), or better as we don't mind the constants in O(...), we say "O(1)"
@KDawG: I tested with Text, and you're right, it works... But... ;) unfortunately, all the space below the Text is used by the Text, so it's possible to create a new text below an existing Text
Is this normal ?
@Kevin what about :
def method(a)
sum = 0
for i in range (len(a))
sum+= int(a[i])*2
return sum
20:22
@Basj I don't get what you mean BTW I fixed the resizing Bug :)
wanna see it
Oh yes !
@kiasy : O(len(a))
user559633
O(n) because of len(a)
@KDawG : yes I wanna see it ;) Where ? ;)
it is 0(n) because we don't know the range right ? if the range was for example 60 it would be O(1). Am I right ?
@Basj I'll edit my answer in a minute or two...
20:24
Here is the solution with "Text" instead of Entry : pastebin.com/WUZx8g7W . When a Text is created, it's impossible to create a new Text below ;)
I wouldn't say it's O(n), since there's no N anywhere in that function
O(a) then ?
lol
i's so confused
i'm
@kiasy If you know that all your numbers are <= a fixed limit , example len(a) <= 60, etc. your complexity time is finite O(1)
If the length of a can go to infinity (theoritically)
Nah, since a is a list and not a numerical value, it doesn't make much sense to put it in the O()
user559633
but len(a) is the number of steps
20:26
then O(len(a)) means : "The running time will be PROPORTIONNAL to the length of a"
^^^ yes, O(len(a)) is probably the way to go here
user559633
where n is the number of steps, O(len(a)) is O(n)
if len(a) = 10, then running time will be for example 10 micro seconds
if len(a) = 1000000, then running time will be for example 1 second
O(len(a)) means : running time is proportional to len(a)
so for this one it is O(len(a)) right ? Because it realy depends on what len(a) is ?
20:29
You got it.
Awesome, thanks.
I have another example that i'd like to share but I first want to see if I can get it right myself
Yes !
also implemented
22 mins ago, by Kevin
If I recall correctly, widgets are always drawn over primitive canvas elements
Thanks @KDawG.
@Basj Your Welcome :) , and always remember to drop by here if you have some free time
20:31
@KDawG : I found the problem when I replace Entry by Text
OK assume b is a list of ints.
def main(b)
sum = 0
for i in b:
if i % 5 == 0:
sum += method1(i)
else:
sum += method2(b)
return sum
The new Text takes very huge space.
(try to just replace Entry by Text in your code)
Then it's impossible to create a new text below, can you see this problem ?
@Basj I did BTW I gotta go, need some sleep :D
just tag me if you ask another Q on SO....
so i can see it 2mrw ...
Ok great!
Last thing : maybe there is something in Text, in order that its size auto-adapts to the content ?
rhuarb all!
20:34
Any idea for my question dudes ?
ie the "Text" widget is very small at the beginning, and then it grows if extry lines
@kiasy : try to imagine "What is the RUNTINE proportionnal to ?"
Is it O(len(b)) ?
@kiasy : If I use a b which is 1 million times bigger, will the running time be 1 million times bigger ?
yes...
So running time is proportionnal to len(b)
So... O(len(b))
20:36
yey I got it right then :)
If you do this :
for i in range(n):
for j in range (n):
# do something
what will be the complexity @kiasy ?
O(n)
No :)
O(len(n)) ?
As there is a double loop
O(n^2) here
20:37
oo wait
i see i see
ie, if n is two times bigger
the running time will be 2^2 = 4 times longer
if u have 3 ranges of n then O(n^3) etc.. ?
if you have 3 loops one in each other, yes O(n^3)
what if for example u have somehting like thse:
this*:
Exercise : compute the complexity of a matrix multiplication (A * B)
20:38
ummm
do you know (n,n) matrix algebra ? (addition , multiplication, etc.) ?
O(ab) ?
No idea what matrix alg is
is O(ab) correct ?
so forget about my question!
OK :)
So a quick questions, what if u have something like:
not important in your context, it was just an example
20:41
If they're asking you to find the complexity of matrix multiplication, and you don't know what matrix multiplication is, then the school probably screwed up the prerequisites list for this class.
Same thing happened to me. My spring partial differential equations class was heavy into linear algebra, but I didn't take linear algebra until fall.
def main(a)
for b in a:
if a % 3 ==0:
sum = sum+1
else:
sum= sum-1
for c in a:
if a % 5 ==0:
sum = sum+1
else:
sum= sum-1
all through the second course I was nodding along, thinking, "this really would have been useful three months ago"
So pretty much 2 for x in y statements that are not inside each other
It's hard to say whether those loops are inside one another, because there's no indentation in your posts
would the Big O notation be O(2a) ?
20:43
You can preserve indentation with ctrl-k, or hit the "fixed font" button next to "send"
@kiasy what's supposed to happen if it's divisible by both?
Are you doing the first euler challenge ?
@JonClements, looks more like a homework lesson on time complexity
we're not so much interested in what the code does, as how long it takes.
Umm forget about this example, I'm trying to ask what would be the time complexity if there are 2 for x in y conditions that are not inside each other....
would it be O(2a) ?
Is there someone specialist in Tkinter out there ? :)
Still linear time. O(len(a)).
20:46
Now KDawG is away ;)
coefficients get simplified away when it comes to time complexity. There's no such thing as O(2N), only O(N)
Kevin maybe ? :)
Think it's O(N + N ) isn't it ?
If not - I don't see why not, as some algorithms are O(N + 1) or something
Yeah, @Basj, but I consider implementing an MSPaint-style text tool to be a moderately hard task.
There's no easy built-in way to do it
You could laboriously draw the dotted lines, and draw the resize handles, and change the mouse cursor at the appropriate times, and draw the mouse cursor every other frame to simulate blinking, but it's all manual
ok!
And something like CTRL+click (and hold and drag and drop) => move the text ?
it would avoid the dotted lines, resize handles, etc.
20:51
cabbage
I dunno, last time I tried to do drag and drop I struggled for a few days and gave up
Kevin : I'd like to do a some sort of infinite blackboard where you can write ideas/notes in textboxes
Would you be interested to help me ? ;)
@Basj and you want to implement it with tkinter?
Sorry, I haven't got the time
@PeterVaro : it's the only GUI thing that I know (a little!)
20:53
have you ever used the Canvas widget?
I'd be okay to switch to something else than tkinter if someone helps me ;)
my first implementation pastebin.com/WUZx8g7W uses Canvas
I think if you are just starting begin with GUI then tkinter is a pretty good tool to start with
ok!
Peter Varo, my goal is to do an infinite blackboard where we can write down notes , interested to help me ? (opensource!)
Some sort of sticky notes tool, but with lots of more interesting features
well, it's not an easy task
With one big new feature that I haven't seen anywhere else (yet)
20:56
and I guess you want to add some zooming?
oh yes!
haven't seen this one anywhere yet
ooo rep cap - haven't hit that in a while
Peter Varo, do you think it's a bad idea ? ;)
user559633
what's that website that has basically a shared drawing board?
I think implementing this full thing just because you want to add one feature to it is a bad idea -- it would be better to extend and existing one
actually zooming is really starightforward
but
20:59
@Basj just saw my TA and asked him about:

OK assume b is a list of ints.
def main(b)
sum = 0
for i in b:
if i % 5 == 0:
sum += method1(i)
else:
sum += method2(b)
return sum
if you are doing this, because you want to learn something new
he said the answer for this would be :
O(len(b)^2)
then I guess it is a really good project -- but not the easiest one I can think of
Peter Varo, may I send a screenshot ?
user559633
@kiasy yeah, what about it
21:01
sure use the upload... button:)
I tought we concluded it was 0(len(b))
user559633
len(b) is the for i in b, because you're looking for every instance of i in 'b', then you either calculate %5 or you don't.
user559633
no, because there's two actions that can be taken
@Basj all righty, this is a.. umm.. very early sketch..
user559633
21:01
it's either mod 5 or it's not, which is more complex
Here I did a test with Photoshop. The ideas are :
* ability to zoom in/out easily
* easily add some text with appropriate font size (according to zoom level)
the blackboard is infinte on the right, left, top bottom
@tristan what if there are 4 actions that could be taken, would it be O(len(b)^4) ?
user559633
if it was
for i in b:
print b
then you'd have your O(len(b))
the zooming would be like "Google Maps"
well, the truth is, you can do this in about a 100 lines of code
21:03
This idea (probably lots of others had the same idea) is the fruit of years of thiking about "How can I organize my everyday-(not so good)-thoughts in sketches?"
but most of these blackboards have drawing capabilities as well
Remember to consider the complexity of method1 and method2, as well.
user559633
oh whoops, right Kevin
I tried with text editords, but always, always : lack of a "3rd dimension"
If method2 is O(N), and it's called inside a loop that is O(N), then it compounds and becomes O(N^2)
user559633
21:04
@kiasy depends on the "actions"
@PeterVaro then I imagined this GoogleMaps-ish solution
100 lines of code really @PeterVaro ?
I'd be happy to pay 1€ per line of code if this dream is true !
so for the example above it is indeed O(len(b)^2) right ?
user559633
@kiasy depends on what the methods are
It's impossible to say without seeing the definition of method2
@PeterVaro i don't need drawing in fact, only text
21:05
@Basj do you really want to pay me €100 just to implement this? that's a lot of money -- and I think you should really learn how to do this, it is not that hard..
@PeterVaro, if zooming works (with CTRL + / CTRL - like in Photoshop for example) , and ability to create textboxes is possible, yes I would be happy to pay this amount... and then spend time on things for which I'm better than core-programming in order to make live the opensource project!
Ooh, a dollar per line? I'll switch to java and begin with a public static abstract infiniteCanvasFactoryBeanAssemblerManagementSingletonInterface...
:):):):)
:))
Well haven't you experienced in your life "Oh this 2D text editor is not adapted to what I have in my head where things are more directionnal than just 2D textediting with lines"
well @Basj let's make a deal: you create the first half of the code (i will define it in one sec) and I will review it.. for FREE
how about this?
:)
21:09
Perfect!
Github ?
And also, I will extend it, correct it, if somethign is wrong..
I was going to offer a discount and do it for £180/hr but okay :p
:D
it's you project, use whatever tools you need, if it is guthub, then github it is
21:10
Are you interested to do it opensource? If so, where's the simplest place to share things ?
we could use dropbox as well as a beginning?
I think first create the project, write some code
design your project
and later after a lot of prototypes
user559633
I have spent all the evening with something I don't do usually (but I should do!) : write some design things on ... paper with a pen...
Now my ideas are clearer thanks to these notes :)
decide if this project worth it to be a "public" one or not
Ok you're right. I have all these things in mind, I just to write all down
What is the first half you would like me to do ? ;)
21:15
umm.. create a canvas, on hitting the space-bar add a text-field at the position of the mouse (if it is inside the window, if not, use the closest point to the mouse-cursor in the window). on hitting the enter key save the text (of course display it while typing)
this is already done
font and size doesn't matter
really?
Font has to be gothic, bold, bright pink... and size has to be 72pt
lol ;)
on a bright orange backgound ofc
so @Basj where is it?
21:18
yes this is done. Now this harder part is zooming
....
umm.. I think this won't be enough..
Sorry I haven't implemented the bright orange background ;)
not sure if I should do this work that is assigned to me, because I have all day tomorrow to do it
yeah, that's the one that is missing
héhé ;)
@PeterVaro maybe you have a wider view of which things has to be done in which order (I don't have this view as I don't program so often)
21:20
where do you storing the texts?
My goal is to store in a XML file
<id> for a text item identifier <x>, <y> for position <text> for text etc
that is the serialisation -- we don't care about that right now
anyway, I recommend you to use JSON -- it's lighter and easier to understand, follow, read, implement
but
if you want to zoom in and out
you want to "grab" the texts, right?
what do you mean by grab ?
so first you have to store them somewhere
to use them later
ok.
maybe I should use objects and instances of this object ?
21:22
I mean "grabbing" as "using them, to change some of their properties later eg. size"
then each object (class) would have a self.text, self.position
that is a design decision
Do you think it is possible without objects ?
you can store them in a dictionary, in a list it is your decision
Ok
What is easier in your opinion here ?
21:23
my opinion is: the best way is "learning by doing" -- don't ask that much
create some prototype and test it
Yes I know this
if it is working, then it is working -- we can talk about it later if it is an overhead or not
I learnt (basic) Python 2 months ago by designing an audio Noise reduction tool
good for you ;)
and doing some intensive Fourier transforms things (my main job is math)
that's why I totally agree with you : learn by doing !
My question about paying is really serious, if someone can create a working basis for say 100€, I would really pay it right now and then spend the lot of time on designing the project, add some features,
Or even the double of this price (I have another job, so this is not a problem for me)
21:28
then what will you learn from all of this?
user559633
Uhh stackoverflow isn't a place to hire cheap programming labor
About DSP, Noise reduction, I learnt all by reading math articles, and very tiny code versions written by another people... Then after weeks, I understood very well how it worked, and I have completely rebuilt it for my needs
@tristan If someone needs hard math tools which I can do in 1 hour , and he would need 10 hours to do it, if I do it for 100€ in one hour, i don't consider this as cheap labour
maybe I'm too cheap...
@tristan why did you tell this ?
user559633
Because this isn't a site for hiring consultants.
user559633
And unless you really will just take a block of code and never ask about it, it's not an hour's worth of work.
One hour is one hour. If I ask more ("how does it work here?") then of course it would be no more one hour, and of course it would be different for pricing (Of course I don't ask anymore, because I understand this is not the right place here).
By the way, @tristan, do you know a place for that (hiring consultatns?)
@PeterVaro do you have an idea about the big "steps" (I have now implemented data storage in a list) ?
21:38
It's not something you'd ask on the main site - but as a casual mention - and not even a direct question of "Would someone here like to do some paid work for me?" - it's fine... Check out stuff like elancer and freelancer etc... You can place ads for a project and people can bid on it etc...
Good to know! As I don't know these sites, are there some that you would avoid, and some others you would prefer ?
(Python programming)
in tkinter the only way you can do the zooming and panning, is to change the properties of the texts, their sizes and their positions -- that's why we store them in somewhere
I think this is enough help, to implement the whole zoom/pan part ^
That's perfect. I stored them in a list now : L.append(Entry(root,bd=0,font=("Purisa",15)))
Now I'm trying to L[-1].bind (the newly created Entry) "CTRL+click" with "moving the entry", But I don't know how to intercept the CTRL click , and above all by doing L[-1].bind("<ButtonPress->", function)..... how will "function" know which element of L is concerned ?
@PeterVaro : by the way, when I first spoke about infinite blackboard, you immediately thought about Zooming , why? Maybe there is already some existings project like this ? If so there is no need for me to recode it if it exists ! Do you know some ?
@Basj a hungarian company, called LogMeIn is doing on this: conceptboard.com
it has way more features than you wished for
:D
I tried just a couple of seconds, but even during the first seconds I see how things that I would like to do totally differently
So it's still something that I would wish to be able to code
21:53
then start coding :)
I do!
PeterVaro: when I attach CTRL-click on a Entry to a function named "test" with L[-1].bind("<Control-1>", test), then, when "test" is called, I have no reference of which Entry it is!
then read the documentation of tkinter, on how and where to bind functions
do some tests, try to understand how it is working
I'm doing it while we are speaking : pastebin.com/bDmDfYK3
then you should know that your code won't do what you want
Yes! I'm currently reading effbot.org/tkinterbook/tkinter-events-and-bindings.htm, but I see that the callback functions here only get "event" as parameter. So impossible to know which Entry it is, right ?
21:58
anyway, I gtg now -- don't give up, do your research and tests and if NOTHING works after 24 hours of hard trying, then come back and I will help;)
@Basj it is more than possible
rbrb
~
I know, I know
a hint for the last problem ?
then I'll do alone until next week!
@Basj event's have a widget attribute - if you scroll down that page :)
Thanks so much !
Haven't seen it , I was rereading from top !
I know realize that each of this little step will require 1 hour for someone like me
Hello everyone
So my project is not possible time-wise. I should probably do my main job only : math and nothing else.
22:03
wb @sam - how's things?
How about you?
That's sad but so true : we only have one life, and it's not possible to learn all things from 0
Wtf??
I said good, just getting started on algebra hw using the program I wrote :D
@samrap okay... had to look at the revision there to make sense of what you were doing :)
Then I said, how about you?
22:04
Cool...
Yea haha idk what happened there
Well let's give up about this project :)
@basj maybe you can contact this guy and see if he's interested: samrapdev.com :)
Hahaha what's the project?
Well first I don't want to make you loose your time !
22:06
@samrap easier if you scroll up instead of having it repeated :)
My project is not that interesting ... it is for me, but ...
I'll scroll up and check it out. Anything to help me procrastinate on homework :)
In one word @samrap, my project is doing a Python infinite blackboard, on which you can 1/ add textboxes and nothing else 2/ Zoom in or out like in Google Maps
And then, if there is some interest... discuss it in a less public forum :)
Some sort of "Text editor" with some "Google Maps" zooming feature !
22:08
Sounds nice but I have no GUI experience
I learned HTML as my first computer language and I can't visualize GUIs in a non-markup environment
Here's what I do with phosothop (ugly now ;) ) : dl.dropboxusercontent.com/u/83031018/Capture.JPG
I tried wxPython and it's so hard for me haha I end up getting really pissed
:)
My project would be like a "fractal" text editor : you can always zoom in, zoom in
and discover new texts ;)
like a mandelbrot ;)
Sounds interesting, so the farther you zoom in the more things there are, or the more details there are about a few things?
Yes !
It's the fruit of years of thiking about "How can i organize ideas in a better way than 2D classic text editor" LOL
22:10
I like that idea
But I'm stuck on every detail like "Implement a textbox", "Implement a mouse click callback", so I have to be realistic :
user559633
hack the gibson 3d text editor
I see it more as a type of web broswer, social media, or news outlet type of app
1/ I have a main job that needs all my time 2/ I have a baby 3/ I cannot begin a new project with learning 2hours for each "Create an Entry box".
22:11
Imagine Facebook, Instagram, Twitter, and Google news all combined inside of it
So result : I'll give up, and begin this again when I'm 64 y old.
Hahahahaha
I have never seen a GoogleMaps zooming feature in text editing yet, that's why I found it a good idea, and was about to start something in python.
but it seems that it is more that what I can learn (time-wise)
So if someone is interested, I be happy to keep it opensource and pay at the same time to encourage developing (this is NO cheap developer hire)
But I don't think it is interesting for someone else than me, and I can fully understand that ;)
I'd like to hear what Peter or Jon would say, but if your app is very GUI focused, you would probably want to use a language like C,C# for the UI
And Python for the backend scripting
Hum... I enjoyed Python since a few weeks because it's fast
that's why I didn't want to go back to C
or even C# (I did some 10 years ago : C)
22:15
Yea like I said, haven't worked with GUIs so I don't know what the best languages are for GUI programming
ok
If you know someone interested, you can let me know! );
22:26
I'm starting coding again, the last things I tried worked :)
Some news later in the week maybe !
Thanks everybody for your help (especially @PeterVaro) !
Definitely let us know how it goes!
I will!
Bye!

« first day (1152 days earlier)      last day (4022 days later) »