« first day (982 days earlier)      last day (4191 days later) » 

04:15
I take that back that was the dumbest question ever asked on stack overflow
04:31
I'll be asleep when this room picks up participants again, so if anyone has any idea how to help with this one it would be really appreciated: stackoverflow.com/questions/17267682/…
 
1 hour later…
05:33
good morning all... :)
cabbage
Simple question in Django!
Never mind :)
 
1 hour later…
06:45
hello
any body there
Hi Good morning friends...............
I don't understand why he thinks you are trying to correct him on how SO works?
07:01
He's complaining how I'm telling him that the answer should not have been downvoted because it's correct
yeah but this part: "go on correcting people who has been members for ten times as long as you on how Stackoverflow works"
what does that have to do with anything
He is wrong.
.count('dog') would also return a 1 for dogs.
Whereas your method does not.
I also find this disgusting (he posted this on his answer):
"Haha, now this got downvoted for no reason. I suspect childishness. ;-) But I already have over 20k, so I don't mind, downvote on. "
lol what a douche
best to just walk away from people like this.
But anyway - show him that .count() is not the same as what you did.
07:04
>>> ['the', 'dogs', 'barked'].count('dog')
0
Dunno what you're saying @InbarRose
why did you use a list?
Because that's what he did
use the count on the string.
But then it would do what you just described
exactly
07:05
"show him that .count() is not the same as what you did."
So... explain pls
/me confused
str.count()
He doesn't do str.count
I didn't look at what he did.
Only one who does is OP
Oh
I looked only at your answer, and his comment says "your method is exactly the same as builtin count(word)
Which is wrong.
07:10
Oh, that's what you were referring to. I thought you meant his answer :p
does the OP expects the count of dog to be 1 since he has "dog(s)" in the sentence?
3
A: Counting words in a text file

Inbar RoseI have changed my answer to better reflect your wishes: from nltk import word_tokenize with open('file_path') as f: content = f.read() # we will use your text example instead: content = "A professional is a person who is engaged in a certain activity, or occupation, for gain or compensation...

An answer of mine
dealing with this exact situation.
oh i see
Yea well it's over now I guess :(
In other news, stackoverflow.com/questions/17269648/… It's always beneficial to start a new language even if you quit after learning how to make strings
How do i reference a variable in a function from another class exactly? I kinda forgot
class A():
    def __init__(self, x):
        self.x = x

class B():
    def do_something(self):
        print A.x
something like that
how do i acces "x"
07:18
Create an instance of the class first
foo = A('test')
foo.x
oh
right
thanks :P
:) mp
np*
if i instantiate the class inside an if condition, will it be in the scope of the function?
if conditions are no place for instantiating classes.
if the conditions are met
oh ok
07:22
A common problem among beginners, is that they want to do X, and so to do X, they think they figure out they must do Y, so then they try to do Y, and Y does not work, so they come and ask help on how to do Y, where in fact, they should ask help for how to do X, and then they will get proper responses from those who know, the answer is usually Z, and not Y... and that is where most of the confusion comes from... So please.. tell us what your X is.
oh no it's not like that in this case i think
I just wanted to know in general... because i already have done a similar thing in my code but i wanted to make sure that it was done right
hello
i am getting import error when i run my file
i have installed all the modules
What's the error?
even then i m getting this error
@InbarRose also, telling you what x is would be long and tedious :P
07:24
"I have done everything right, but something is still wrong" = You have not done everything right.
Import error: no module named requests
i never said something is wrong though
Not you :)
i have installed the modules usuing pip install
and easy_install
oh generally speaking
07:25
Do you have multiple Python versions installed?
even then i am getting this error
What version of requests did you install ?
oh, Cavallo
That is your problem exactly
07:25
pythn27
I have to go. good luck.
what would i do?
should i uninstall the rest except 27
see ya
yeah @cavallo i would copy the files you worked on to a different folder
uninstall everything
and reinstall
keep just one python version on your pc
07:27
k
let me try
07:40
hello! Question: I have a list of integers: [65,66,67] for example, all less than 256. How do i cast that to a string? result: "ABC". The only thing I can think of is to use a for loop and convert each element to a char and concatenate. Is there a better way?
list is approx ~600 integers long.
What do you mean to cast to a string
@Haidro each int in the list is an ascii character code, so I want [65,66,67] to become "ABC"
@MaxPower uninstalled and reinstalled
still get the same error
@StaceyAnne map(chr, mylist)
no named module ?
07:45
@StaceyAnne ''.join(map(chr, mylist))
@cavallo what is the module you are trying to import?
@Haidro, awesome, that's magic. Thanks so much
You're welcome :)
map(chr, mylist) is the same as [chr(i) for i in mylist)]`
Oh my god
My worst... nightmare
no no no no no no
"You have failed too many recent review audits – looks like you might need a break. Come back in 2 days to continue reviewing."
I only failed ONCE today, none yesterday
NOOOOOOOO
requests? @MaxPower
07:52
what do you mean? What are you trying to import that gives you this error i don't understand
i am trying to run a file which makes request to get files from a url
i get this error when i run the file
copy and paste the error here
stop saying "this error"
importerror: no mdule names requests
Anyone know how I can link an audit
what kind of audit
personal i suppose?
07:58
'easy_install' is not recognized as an internal or external command,
operable program or batch file.
@cavallo try installing the module in a different way...
import requests
ImportError: No module named requests
when you run python in windows command line
yes tell me
i forgot how exactly but it's something like python setup.py
so instead of python you give it the full path
as in c:\python27\ etc
08:01
ok
Is anyone familiar with using python + socket + linux to transmit packets over UDP?
no module names git ?
I'm attempting to transmit data over udp from python, and monitoring the interface via wireshark to see if anything is actually going out, but I'm not seeing much on wireshark
sorry can't help you here
@cavallo c:\\python27\\python setup.py install
08:17
Cabbage.
welcome back
@InbarRose Guess what
(You can probably figure out by scrolling up)
No energy for scrolling. Just tell me.
Well, I failed an audit (which seemed legitimate) and now I can't review for two days
I wasgoing to get my gold badge tomorrow!
Bummer.
Just live with it. :)
08:21
But... two days! Long time
Yeah.....
You must have failed a few audits already
This is the proverbial "straw" that broke the camels back.
I wish I could check
I really don't remember failing any
what is an audit? and how do you fail one?
An audit is a little test they sneak in your reviewing. It's a test to see if you are paying attention
08:39
cabbage
cabbage
08:55
Potato?
potato
88
Q: What are review tests (audits) and how do they work?

AsheeshRI recently received this rather amusing message while reviewing a user's first post: Congratulations! This was only a test, designed to make sure you were paying attention. This post has already been removed, but thanks for taking time to leave feedback for the author. What is t...

09:16
what do you guys think about Game of thrones audio books narrated by this guy? en.wikipedia.org/wiki/Roy_Dotrice
Might be fun to listen to while I'm working out
Cabbage folks
@ThiefMaster Can you do anything about my current situation?
0
Q: I can't review for two days after failing one audit

HaidroI was reviewing Low Quality Answers and I failed an audit (I kind of think the audit was wrong, but this isn't what this is about. Then again, I may have just made a mistake). I was a bit shocked to see that since that one failed audit, I can no longer review anything for two days. When clicking...

I'm not asking you to lift the ban or anything, just wondering if you can do anythin
09:33
cabbage
Possibly your failed audits in the reopen queue were taken into account, too
cabbage @limelights
@ThiefMaster How can I see these?
I can post you the links in here if you don't mind
:s I dunno, I may be laughed at
Go ahead I guess
09:41
http://stackoverflow.com/review/first-posts/2371869
http://stackoverflow.com/review/reopen/2319894
http://stackoverflow.com/review/reopen/2283692
First link is the one which gave me the 2 day ban
I kind of disagree with these audits, but eh
yeah I think that first-post audit you failed is one of the harder cases, especially when not looking closely at the context
but since the audits are based on flagged posts sometimes stuff ends up there that is not completely obvious crap/no-crap
@ThiefMaster I love you <3
yay I can get my gold badge tomorrow :D
 
1 hour later…
11:17
Cabbage all or none
everyone seemed idle
cabbage @InbarRose how have you been?
@InbarRose is it bad that I still find classes to complicated to work with
nothing bad with finding classes hard to grasp
Well.. let me ask you a question
Do you know about animals, and their kingdom/species etc?
I feel as though I should be able to work with classes by now though, I mean Inbar, kevin, and a few others have tried explaining it to me. I read a tutorial on it(which is rare because I don't read tutorials), But when I write code I find it easier to work with functions. My code when using classes is all clustered and ugly, and half the time it doesn't run or work the way I want it to.
@InbarRose kind of why?
11:27
That is how the class hierarchy works.
a lion is a type of cat, which is a type of mammal... etc etc...
And when you specify a specific lion, you give it a name.. and it has slightly different properties to the default "lion"
just like humans
you have your own height and name and hobbies... but you still function like a human
A class in python works in the same way
You create a class to do something for you
lets say - to manage connections between 2 computers.
so they all must work the same way - only each time you make a connection, you will specify different endpoints, and maybe some flow parameters.
A function does 1 thing
a class is a way to group things together, and create objects that will act for you.
a list is a class
each time you do l = [1,2,3]
you are creating a new list, and giving it 3 (in this case) values.
then you can perform actions on this list
list.sort() list.index() list[:] etc etc
these are all the same actions any list can do - but this one has specific values.
I wanna create a game called Bulls and Cows:
Bulls and Cows (also known as Cows and Bulls or Pigs and Bulls or Bulls and Cleots) is an old code-breaking paper and pencil game for two players, predating the similar commercially marketed board game Mastermind. It is a game with numbers that may date back a century or more. It is played by two opponents. The game can also be played with 3 digits instead of 4. On a sheet of paper, the players each write a 4-digit secret number. The digits must be all different. Then, in turn, the players try to guess their opponent's number who gives the number of matches. If the matching digits are on...
Well that clears it up a little
When you create a custom class for a connection lets say - then you would instantiate it something like: b = connection(me, other_guy)
11:32
And I am not worried about the bulls, because I can do that....
and then b.connect()
and b.disconnect()
but my problem is actually applying it
But I am worried about the cows part.. I have been thinking about it a lot.. but i can't crack it..
Peter convinced me to refactor the code I am working on to use classes(after I finish adding all the features to the program) and I'm almost scared to attempt it because I don't want to fail. =(
cabbage @JonClements
11:33
@Inhale.Py cabbage
I have tried the following code:

let User and Comp be the lists with the three digits that entered by the user and randomly selected by the computer:

for x in User:

if x in Comp:
if x in Comp:
stop
@IcyFlame use pastebin.com
Yes sir...
It is very hard to read and understand code in this chat room
@InbarRose it's hammer time? :)
11:35
does a little jig Can't touch this!
tkinter excepts number in the form of hex(or whatever the color codes or called)
right?
can anyone help me, pls?
can you post the entire code?
11:41
you mean the complete app??
this is the main part... the other parts of the app consist of code that includes Tkinter formatting.. Buttons etc...
well no
but your problem is that if comp.index(x) == User.index(x)
comp.index != user.index which is why you are getting a cow instead of a bull
I don't get you....
lets see the two lists
comp = [2,7,7]
and the user
if comp.index(x) == User.index(x):

bulls += 1

else:

cows += 1
user = [4,4,7]
oh...
you are saying that i should increment cows only if the indices are not equal?
well in order for bulls to increment the indices have to be equal, thats the way your code is written
11:43
yes...
so if the indices are not equal it increments cows by default
yes....
thats how it works....
so if cows is being incremented then the indices arent equal and since your problem is that it increments cows instead of bulls, when you want it to increment bulls, somewhere in your code is causing the indices to not be set to equal
user2483250
If anyone is experienced with Tkinter, I must appeal for assistance. stackoverflow.com/questions/17197759/…
does that make sense to you @IcyFlame also I should inform you that I am the least experienced programmer on here.
so I could be wrong
its just how it seemed to me
11:54
well.... can you explain it to me in easier terms....
there are no problems with anything else...
and it works completely fine when there are no repeated digits in the number guess by the computer...
@IcyFlame what is your problem exactly ?
@IcyFlame that's my point, somewhere in your code it isn't acting as you want it to when you enter repeated digits, I couldn't tell you where without seeing your code
@IcyFlame have you tried using list.count(number) instead of list.index(number) ? index only returns the position of the first item matched
>>> a = [1, 2, 3]
>>> b = [1, 2, 2]
>>> a.index(1)
0
>>> a.index(2)
1
>>> b.index(2)
1
>>> b.count(2)
2
>>>
if you need the index for every element matched, you need to use list.index(number, start_position). see this post stackoverflow.com/questions/5419204/…
12:20
is index a built in module in python?
@GeorgeLonngren have you tried just playing experimenting with it and see if you can get it to work by luck?
@GeorgeLonngren I don't know enough to be able to help you =(
user2483250
Well I have, and the issue stems from which objects do I call during instantiation, or if I should be calling an integer? I have no idea what objects to call, after I completely guess on what class to instantiate.
oh.. yeah thats a problem then. Like I said I don't know enough to help you(still new to programming) but I'm sure someone will pop up that will be able to help you.
12:40
can someone explain to me why python 2.x imports Tkinter with a capital T and why 3.x uses lower case t, because other than this my code works in both python2.x and 3.x
ahh, explains why I couldn't figure that out
try:
    import Tkinter
except ImportError:
    import tkinter as Tkinter
well yeah, theres a work around
but still
doesn't explain why they changed it
Note Tkinter has been renamed to tkinter in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
probably because most standard library modules are lowercase named
os, socket, ssl, io, subprocess
etc
12:47
ahh, fair enough
so Tkinter was going against the norm so they put it in with the "hip" crowd in 3.x
rbrb
I need some more input into Cabbage
You know how I was talking about a "strict" mode and a "rebel" mode for the language?
Should I give the coder the power to change factions mid-code, or force them to decide at the beginning and stay in that mode?
ooo, allow rebellious rebels ?
basically ;)
12:59
Ummm, if they change their mind - they're obviously not pure of heart and their hard-drive should be deleted...
This is getting interesting.
Ok, I was also thinking about giving each mode it's own set of advantages and disadvantages - what do you think about that?
Wow - is this going to end up that followers of the cabbage diverge into two factions, and continuously end up killing each other, as they can't decide on the one true way of the cabbage?
I'm not sure my conscience could deal with that...
There can only be one Cucumber!
(see what I did there?)
Yes, but that Cucumber's name is Bob!
13:05
Cucumber Bob, yep - that's what we always call him.
Oh phew - as long as we agree - that's fine... thought we might have had to go to war if you thought its name was something like Jim or something else stupid...
Jim is the Zucchini.
They are Cousins.
And there is Jimbob - the Pickle.. no one likes him... he smells funny...
Is that the one that's constantly drunk ?
He is just SWIMMING in it.
So, if we got someone that's pickled... do we have someone that's marshalled ?
bbias
13:09
I... don't understand the reference.
pickle and marshal modules?
(anyways...)
CABBAGE!
ARRRRGH! CRABBAGE!
does Python recognize ± as a math function
@Inhale.Py no
What would you expect it to do?
13:20
@Inhale.Py Think about it... how would a computer understand that concept?
so if I wanted something to be displayed as ±0.005 I would have to add it to "±"
huh ?
You can always print whatever you want.
well if a number was 2.400 ±.005
the number would be 2.395 and 2.405
you would have to make your own function that did the plus/minus thing
But if you want to deal with numbers that have a '±' then you could make your own number class :)
13:21
its a ranged tolerance
basically
Here is a perfect opportunity for a class.
I'm wrapping the whole code in a class
class RangedNumber():
you don't just wrap code into a class
but I actually need it to output the ±
you can wrap the code in the module into a class of the module
13:22
well I know that
but you also have classes inside the class
like int and float - these are classes
so make your own class called RangedNumber
int and float are classes inside the math module which is a class
Which gets a float and a range.
your right
no
int is a class.
the math module is not a class.
13:24
its a module =D
exactly :)
so you can make your own class
called RangedNumber
    class RangedNumber():
        def __init__(self, number, num_range=0):
            self.number = number
            self.range = num_range

        def __str__(self):
            return '%s±%s' % (self.number, self.range)

        def __repr__(self):
            return '%s±%s' % (self.number, self.range)
Just a sample
you need to implement the add, subtract, multiply...etc etc...
i was way more lazy :)
Also equality, fuzzy equality.... blah blah
whats the %s do?
formats a string
or interpolates a string, rather
the same can be achieved with the sexier .format()
13:29
so its kind of like
{%.3f}.format
"myString is {0}".format(self.best)
@Inhale.Py it is basically me being old school.
yeah, he didnt even use new style classes! :D
13:31
    def __repr__(self):
        return '{}±{}'.format(self.number, self.range)
Is how you would write it.
or '{number}±{range}'.format(self) :P
or was it self=self
mk
I get you
anyone good with tkinter?
def copy_to_clipboard(event):
    """Function for copying the correct output to the clipboard"""
    # clears the clipboard of whatever was stored in it
    root.clipboard_clear()
    # appends the string to the clipboard
    root.clipboard_append(event)
    # ToDo: Function for toggling features
I want to be able to disable this function in the menubar
basically theres a drop down menu labeled "Options" and I want to add a feature that when you click on the menu there will be another label that says auto copy and if theres a check mark next to it it will run this function, otherwise it wont.
if that makes sense
I want the user to be able to chose whether or not the program copys results to the clipboard
wb @ShannonStrutz
Morning @JonClements
33 more rep and I have 6k ! :)
13:48
nice
13:59
Cabbage folks!

« first day (982 days earlier)      last day (4191 days later) »