Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Dec 7, 2018 06:50
no truer words ever spoken
Dec 7, 2018 06:50
well that song makes me want to sing or drink or both
Dec 7, 2018 06:36
should this be httpresponse because it's over the web now? or any other thing obviously wrong here?
Dec 7, 2018 06:35
is generating TypeError wallet not iterable
Dec 7, 2018 06:34
` created_mangopay_wallet, response = client.wallets.Create(mangopay_wallet)
Dec 7, 2018 06:34
An app works locally and is being deployed, however this line...
Dec 7, 2018 06:34
ok thanks!
Dec 7, 2018 06:33
hey is it ok to ask a question about django here?
Nov 7, 2018 18:37
ah i figured it out
Nov 7, 2018 18:30
I have pycharm installed, and I have a file which has functions in it that I want to experiment with at the command line, I've added the packages to the project, and I can run the file and it exits (because it just has functions in it) - how can I access the functions in this file from the terminal in pycharm? what do I need to do to make the functions in the file accessible from the pycharm terminal, thanks
Nov 7, 2018 17:18
which talks about consistency with isinstance , but this blog article, mentions it's not a very good reason also: xion.io/post/code/python-startswith-tuple.html
Nov 7, 2018 17:16
Yeah, there's a feature request here: bugs.python.org/issue1491485
Nov 7, 2018 17:10
if a script has this, because print is a statement, this means it's a Python 2 script right? Is that correct
Nov 7, 2018 17:10
 if verbose:
        if abs(player_adjustment - 1) > 1e-6:
            print 'Adjusted result:', res * player_adjustment
Nov 7, 2018 17:06
just had a look very useful thanks @idjaw
Nov 7, 2018 16:50
*ide
Nov 7, 2018 16:50
(or any idea, that isn't overly bloated)
Nov 7, 2018 16:49
I know this is quite an open ended question. But can someone recommend the lightest weight IDE that will allow me to open a python script (that doesn't do anything by itself) , and then use a python prompt to use functions from that script? I am just testing the script functionality
Nov 7, 2018 16:38
sound's interesting though, "It's impossible for a beta coefficient to be greater than one, and if you think about this long enough, that is a good thing. If the outcome variable increased by two standard deviations every time the independent variable increased by a single standard deviation, that would eventually lead to the explosion of the universe." ha
Nov 7, 2018 16:37
Thanks Code-Apprentice yes, you're right. Once I knew it wasn't special to Python, I did a bit more research on the maths point of view: it's a statistical term - pmean.com/06/BetaCoefficient.html ; so the fact they used same term in the unrelated answer on SO, was just down to logical naming of the dictionary!
Nov 7, 2018 16:24
ah ok thankyou
Nov 7, 2018 16:24
the first answer also uses the term beta_dict, so I'm thinking, maybe it has some special meaning in python, or you think this is just not the case
Nov 7, 2018 16:24
because i saw in this answer: stackoverflow.com/questions/43161307/…
Nov 7, 2018 16:23
but what is beta coefficient , is what i'm wondering
Nov 7, 2018 16:23
it says this below it. :param beta_dict: dict with beta coefficients
Nov 7, 2018 16:22
i googled beta_dict and saw it elsewhere, what is beta_dict what is special about this dictionary?
Nov 7, 2018 16:21
'def log_reg_dot(beta_dict, shot_params, verbose=False):
Nov 7, 2018 16:21
hey I am looking into some code and saw this:
Nov 6, 2018 20:46
Thanks Kevin, the readme was practially non existent, it linked to a mostly theoretical article that explained what the model was based on. -- the docstrings, I will check them out thank you!
Nov 6, 2018 20:37
yes true, I thought was not the best way to get my idea across as soon as I said it! I just wanted to see some of what the xg_calculator.py can do but I'm a novice with Python, so am not even sure where to start, I just e-mailed the author of it,in case he can share some tips of what a script should do to experiment with the functions in xg_calculator.py
Nov 6, 2018 20:24
hmm ok thanks
Nov 6, 2018 20:23
oh thanks Aran-Fey, so they're rather useless then I guess. I would need to write another script, that uses the functions in them to get anything out of them
Nov 6, 2018 20:21
hey there, i'm interested in experimenting with this, github.com/krivonogov/xg/blob/master/xg_calculator.py and just wondered if it looks like it should run as is, if I set it up on a python box, or if it looks like it's just one file from a bigger project
Jul 13, 2018 19:18
haha about flashbacks of darker times, yes that sounds like just as good a reason as any !
Jul 13, 2018 18:57
yes I guess when a group of experts have differing opinions on the right course of action, and the numbers are fairly equal on both sides, either action is likely to be just fine.
Jul 13, 2018 18:51
yes true!
Jul 13, 2018 18:49
I just read the Guido is retiring from BDFL message, his tone sounds quite low in that message, like he's not in a very happy place at the moment
Jul 13, 2018 18:39
useful to know also thanks wim
Jul 13, 2018 18:34
that's useful to know, also of course i just realised .format(x,y) ; (x,y) isn't a tuple is it, it's passing two variables into a method ; unlike the modulo string syntax
Jul 13, 2018 18:32
*indexes
Jul 13, 2018 18:32
ah i see, great, i guess if you have more than perhaps 2, it makes sense to include the indices just for readability if you need to cross reference a variable from the tuple to the string while reading the code
Jul 13, 2018 18:27
that makes sense and useful to be able to know how to test it in the language, i just discovered also if you omit the index's from { } , when using the format method, with more than one variable you get an error "tuple index out of range". But if you are only using a single variable, and using it once in a string with the format method, you can omit the index like so print("Hello {}".format(name))
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Jul 24, 2018 16:03
is anyone familiar with cakephp, i have some routing issues and can't solve them at the moment (or at least what i think are routing issues)
Jul 21, 2018 17:49
break worked great thanks
Jul 21, 2018 17:39
thanks very much for the reference to break i'll investigate it
Jul 21, 2018 17:39
well, yes when i say work as well, i mean from a correct programming paradigm as well not just achieve the desired result :)
Jul 21, 2018 17:37
thanks Danack I'm just reading that ; I also found mention of this array_slice ; e.g. "$output = array_slice($input, 0, 3); " ; and then passing $output in as the variable in the foreach loop instead; do you think that would work just as well?
Jul 21, 2018 17:29
but i only want to run it for the first 4 items returned not every single $foo ; how can i adapt this?
Jul 21, 2018 17:28
<?php foreach ($foo as $foo) {
}
?>
Jul 21, 2018 17:28
Hey i have some php code which works fine which is: