« first day (2113 days earlier)      last day (2841 days later) » 

9:02 PM
large number of enums?
are the options enums?
 
@Mikhail Modularize all that? Move it into a text config file and document it there? The batteries-included configparser module can read/write .ini files in a standardish format.
 
Then you end up with a text file that has entries like:
[LOGGING]
; Options are:
; Critical only    50
; Error and up     40
; Warning and up   30
; Info and up      20
; All logs         10
loglevel = 20
 
I guess @Mikhail was crushed under the weight of his overly large dictionary
 
An ignoble end.
 
9:09 PM
@AdamSmith even better - use the built-in logging config from ini/dict
so good
though you do end out with like... 50 lines of config just to setup a couple of loggers :P
 
@WayneWerner sure, unless you want to put things in your config textfile that have to do with things other than logging ;). I tend to build a ConfigParser object and just pull out what I need from it.
 
I do not knwo what rootkit or what is here, but it crashes trying to load avast antivirus drivers...
 
my_log_formatter.setLevel(configobject["logging"]["loglevel"])
 
antivirus programs are the biggest viruses ever
 
@AdamSmith You can still put other things in your config file. It only looks at the relevant [logging] sections
 
9:12 PM
oh really? I didn't know that
Reading the documentation is for chumps. :)
 
IKR? :P
[loggers]
keys=root,log02,log03,log04,log05,log06,log07

[handlers]
keys=hand01,hand02,hand03,hand04,hand05,hand06,hand07,hand08,hand09

[formatters]
keys=form01,form02,form03,form04,form05,form06,form07,form08,form09
And then it'll expect [logger_root], [logger_log02], etc.
So, unless you want to use sections named like that in your config file for other purposes
you're totally fine
 
@AdamSmith Yeah, so I have the parsing done correctly with defaults, but I might need to look at the options in three or so files... IDK in C++ world we have static typing...
@AnttiHaapala antivirals are like herpes, you're taking a minor hit all the time...
 
What's the problem with looking for options in 3 or so files?
 
spelling errors, I get the enums mixed up. Hard to tell what they are...
 
Without more detail, the only answers I can give you is "Don't do that."
 
9:24 PM
The complexity of python program is soul crushing
 
@Mikhail I'm not sure that's the fault of the language:)
 
I blame dynamic typing
 
or do you mean your specific program?
 
yes, my specific program
 
dynamic typing makes things easier, not harder :P
 
9:24 PM
too many lines, man
 
just zip it up
 
How many lines are in your program?
 
or cut it into 15 files:P
then it's easier to take in at once;)
 
idk, like 10k lines
some of them are in CUDA
 
9:25 PM
that indeed sounds like a lot
 
10k is a huge python program.
 
I have no clue what I'm doing
 
Wait, there's CUDA in there. And you dare make any negative remarks about python?:P
 
just keep typing
 
^
There's your problem right there
 
9:26 PM
yeah would be better if that were static typing
 
Are you writing C code with python?
 
the mission critical parts are in PyCUDA
 
ah, pycuda (didn't even know that was a thing)
 
lol. I love how you think static typing will help you figure out what you're doing
 
9:27 PM
Not me silly, the compiler
 
@WayneWerner Forcing you to think for five minutes about your types might indeed help...
 
Its bad if both of us don't know whats going on
 
I think the compiler is pretty clear on the matter.
 
like static typing would prevent function add(int a, int b){ return a-b; } problems
Which I'd classify as "I have no idea what I'm doing" ;)
 
well it would help with "x=3; result=is_it_giraffe(x)"
in case giraffe is not an int;)
 
9:29 PM
but also like structure mismatches and spelling errors
fuk
 
@AndrasDeak That's not an emergent result of static typing. That's just your compiler forcing you to slow down.
@Mikhail does your editor not have autocomplete? I use vim, vim has autocomplete.
 
I'm using PyCharm, it gets some things but not all
 
it's not catching your typos?
 
@WayneWerner vim has autocomplete if you configure it that way
 
yeah or when structures have their elements changed
 
9:32 PM
@AndrasDeak Right.
 
@WayneWerner I'm not sure what you mean
Good code can be written in both static and dynamic languages. But if you're hit on the head at compile-time, that surely catches some of the errors that might go under the radar in a dynamic setup
unless I'm completely missing the point of static vs dynamic:)
which is not at all unlikely
(considering the gaping holes of ignorance in my knowledge base when it comes to CS)
 
another point was that static produces faster code
 
well, python and fast don't mix well, usually
 
its causative
also pickle sucks
 
"static" doesn't produce faster code, compiled does
 
9:35 PM
why are you using python again?:D
 
I made a poor choice, and don't have time to switch languages
but also python has some nice packages
maybe
 
should've went with Mathematica
 
For the slow?
 
for the goodness of choices:P
 
Idk, python has for loops, but I doubt Mathematica could muster even three.
 
9:41 PM
Three whats?
 
These "complaints" aren't interesting.
 
":-|" -- davidism
4
 
:-|
 
@AndrasDeak loops
 
@Mikhail Ha, wordplay!
 
9:47 PM
oh, that ^
Humour caught me off guard:P
 
Evening all
 
@JRichardSnape evening:)
 
10:12 PM
@AndrasDeak You said that "forcing you to think for five minutes about your types might indeed help". Just because your language has static types doesn't mean that you have to think about them that much. And because you're programming in Python doesn't mean that you can't think about types.
 
I fully agree with the latter; I've been wondering about the former
you definitely should think about your types in python, but I'd think you're less forced to do so
 
True
 
consenting adults and whatnot:)
 
It becomes a lot more important when you're dealing with enterprise-level software
 
lollerskates
 
10:15 PM
Maybe python is easier to write but it also requires more test cases...
 
... it took 3 hours of debugging but I found out why my windows was crashing in boot without any explanation...
 
... wrong partition type.... my ntfs partition had type 83... not 07
 
@AnttiHaapala shoot
 
Oops
 
10:16 PM
what is that?
is it important?:P
 
so, that for good diagnostics
 
@Mikhail I'd argue that static types require the same number of test cases.
 
I just knew that it crashes when loading "avast antivirus drivers"
 
nice...
 
then I removed them, it turns out "ah no, it is with PNP device detection"
ah no...
... then ...
it is because the partition is marked 83 not 07 <3
GOOD WINDOWS GOOD. GOOD THAT YOU EXPLAIN THE ERRORS EXPLICITLY NO?
 
10:17 PM
@Mikhail Or at least not significantly more
 
You subconsciously wanted to install Linux on that partition.
 
@AnttiHaapala You're just spoiled because Python
 
@davidism i am pretty sure i've cleared the partition table once or somethign :D
 
@AnttiHaapala You should've just installed python youtube.com/watch?v=bYQ_lq5dcvM
 
windows update at 93 %
asymptotically approaching 99
 
10:19 PM
@WayneWerner Interesting post
 
@JRichardSnape I've noticed the 20k line number seems pretty accurate
at least in projects that I've worked on
 
wowo 94 %
(btw again this problem couldn't have been fixed without linux. Though, this problem also couldn't have been done without linux :D)
 
You have to spend an hour at 98, it's a right of passage. It's called Windows 98 persistence.
 
stackoverflow.com/q/38664088 typo, user didn't define a variable as the return from a function
 
@davidism deja vu...for the 6e23th time
wait there's a new error:P
there's some indentation foobar too
 
10:26 PM
The same user's been posting one low quality question after another as they struggle through this problem without paying attention to what they're doing.
 
don't we have a question ban for that?
 
Eventually.
 
at least they're actually posting their code, so there's that
 
also, chameleon question
not that I'd want 15 iterations of version control of this single question...
@DanielMargosian Well, I do have other analogies for what Documentation is, but I'm afraid SO dev team won't really appreciate them. — TerraPass 2 hours ago
 
11:00 PM
Any well-versed wxpythoners here?
I am trying to figure out how to make it so with a function I can reset the checkmarks of a widget...
 
The sooner you switch to Qt, the sooner you will be free. Like with Scientology.
 
but that has cooties
 
cuties
 
I knows but Im in too deep
Get me an oxygen tank
Or a wx function to reset a widget
 
just run the program again
 
11:07 PM
but
noes
I need to make it so when I choose a different client, the checkboxes reset
 
When titans clash...
 
@Dominico909 isn't there some kind of bind variable? Or do you just set some kind of checked property to True or False?
 
Can you access instance variables outside of the class?
 
sure
 
Well I basically need to make it so that each client has their own checkbox values
 
11:14 PM
@Dominico909 seems like you want a dict/namedtuple/whatever containing the settings for each client, no?
 
such as each client having the checkboxes: IsEmployed(), BillingPending()
 
Wait who can you access instance variables outside of their class @Wayne
 
I have all the client values stored on a sql database
 
Wait how*
 
Try being more vague descriptive about your problem. What about "make it so each client has their own values" are you having trouble with?
 
Each client has their own values in an sql database e.g. firstname, lastname, tel, email... I have a multi-checkbox widget that is applicable to all the clients on whether they are due for billing, whether they are employed, etc. I need to make it so that whenever I choose a different client with a button in my wxpython gui, the chosen clients checkboxes are saved in the way they were checked.
 
do you already have some container to hold them?
 
Yes, thanks for the example @Wa
@Wayne*
 
@WayneWerner put it in a .jar
 
11:24 PM
fyi, jarjarlinks
Alos, how the heck do you deploy the SQL connection settings in Python
 
use a config file
Cause that's way better than other options
 
rhubarb
 
You could use configparser or the json module for it
rbrb andras
 
Yeah, but then it becomes public, etc...
 
What do you mean? Where would it not be "public"?
 
11:39 PM
@Mikhail config in your files is less public than config in your code
unless you make it a habit of not letting any developers actually look at the code they're writing
 
11:51 PM
I am trying to use an existing libraries. And they are written this way. So just want to understand why the issue is happening and how do I solve it. — SB26 39 secs ago
I should reply, "You can do it using for loops" ;)
 

« first day (2113 days earlier)      last day (2841 days later) »