workspace
stringclasses 1
value | channel
stringclasses 1
value | sentences
stringlengths 1
3.93k
| ts
stringlengths 26
26
| user
stringlengths 2
11
| sentence_id
stringlengths 44
53
| timestamp
float64 1.5B
1.56B
| __index_level_0__
int64 0
106k
|
---|---|---|---|---|---|---|---|
pythondev | help | my mistake | 2019-03-14T13:35:54.710100 | Otelia | pythondev_help_Otelia_2019-03-14T13:35:54.710100 | 1,552,570,554.7101 | 13,621 |
pythondev | help | :thumbsup: | 2019-03-14T13:36:19.710300 | Carina | pythondev_help_Carina_2019-03-14T13:36:19.710300 | 1,552,570,579.7103 | 13,622 |
pythondev | help | Thoughts? I'm starting to think the activity isn't legit idk | 2019-03-14T13:43:14.710500 | Otelia | pythondev_help_Otelia_2019-03-14T13:43:14.710500 | 1,552,570,994.7105 | 13,623 |
pythondev | help | So now I think you’ve got too many tabs :wink: Your `except AssertionError` is one tab too far | 2019-03-14T13:46:50.710900 | Carina | pythondev_help_Carina_2019-03-14T13:46:50.710900 | 1,552,571,210.7109 | 13,624 |
pythondev | help | The `try` and `except` keywords should line up | 2019-03-14T13:46:57.711100 | Carina | pythondev_help_Carina_2019-03-14T13:46:57.711100 | 1,552,571,217.7111 | 13,625 |
pythondev | help | right so eliminate it? | 2019-03-14T13:48:17.711300 | Otelia | pythondev_help_Otelia_2019-03-14T13:48:17.711300 | 1,552,571,297.7113 | 13,626 |
pythondev | help | Do you want the `try/except`? | 2019-03-14T13:48:27.711500 | Carina | pythondev_help_Carina_2019-03-14T13:48:27.711500 | 1,552,571,307.7115 | 13,627 |
pythondev | help | You’ll also need to define the `number_to_choice` function (similar to how the `choice_to_number` function is defined, but only you will know what it needs to look like) | 2019-03-14T13:48:57.711700 | Carina | pythondev_help_Carina_2019-03-14T13:48:57.711700 | 1,552,571,337.7117 | 13,628 |
pythondev | help | None | 2019-03-14T13:53:46.712000 | Otelia | pythondev_help_Otelia_2019-03-14T13:53:46.712000 | 1,552,571,626.712 | 13,629 |
pythondev | help | I don't think I'll sleep without getting this to run | 2019-03-14T13:54:50.712400 | Otelia | pythondev_help_Otelia_2019-03-14T13:54:50.712400 | 1,552,571,690.7124 | 13,630 |
pythondev | help | ahhahahah | 2019-03-14T13:54:52.712600 | Otelia | pythondev_help_Otelia_2019-03-14T13:54:52.712600 | 1,552,571,692.7126 | 13,631 |
pythondev | help | Just try `test_all()` now | 2019-03-14T13:57:37.712800 | Carina | pythondev_help_Carina_2019-03-14T13:57:37.712800 | 1,552,571,857.7128 | 13,632 |
pythondev | help | Also, I’d suggest putting this in a file somewhere (instead of just in a python shell), then run it using the python command line program | 2019-03-14T13:58:36.713000 | Carina | pythondev_help_Carina_2019-03-14T13:58:36.713000 | 1,552,571,916.713 | 13,633 |
pythondev | help | None | 2019-03-14T14:00:19.713200 | Otelia | pythondev_help_Otelia_2019-03-14T14:00:19.713200 | 1,552,572,019.7132 | 13,634 |
pythondev | help | Try putting this in a file called “my_tests.py”: | 2019-03-14T14:02:32.713600 | Carina | pythondev_help_Carina_2019-03-14T14:02:32.713600 | 1,552,572,152.7136 | 13,635 |
pythondev | help | ```def choice_to_number(choice):
if choice == "Usain":
return 1
elif choice == "me":
return 2
elif choice == "mason":
return 3
return 4
def number_to_choice(number):
if number == 1:
return "Usain"
elif number == 2:
return "me"
elif number == 3:
return "mason"
return None
def test_choice_to_number():
assert choice_to_number("Usain") == 1
assert choice_to_number("me") == 2
assert choice_to_number("mason") == 3
def test_number_to_choice():
assert number_to_choice(1) == "Usain"
assert number_to_choice(2) == "me"
assert number_to_choice(3) == "mason"
def test_all():
try:
test_choice_to_number()
test_number_to_choice()
except AssertionError:
print("Tests failed!")
raise
if __name__ == '__main__':
test_all()``` | 2019-03-14T14:02:33.713800 | Carina | pythondev_help_Carina_2019-03-14T14:02:33.713800 | 1,552,572,153.7138 | 13,636 |
pythondev | help | Then just run: `python my_tests.py` | 2019-03-14T14:02:48.714000 | Carina | pythondev_help_Carina_2019-03-14T14:02:48.714000 | 1,552,572,168.714 | 13,637 |
pythondev | help | Then you can edit `my_tests.py` to play around with different test cases, add more print output, etc. etc. | 2019-03-14T14:04:53.714200 | Carina | pythondev_help_Carina_2019-03-14T14:04:53.714200 | 1,552,572,293.7142 | 13,638 |
pythondev | help | Then test it, using `python my_tests.py` | 2019-03-14T14:04:59.714400 | Carina | pythondev_help_Carina_2019-03-14T14:04:59.714400 | 1,552,572,299.7144 | 13,639 |
pythondev | help | I just tested your code | 2019-03-14T14:06:40.714600 | Otelia | pythondev_help_Otelia_2019-03-14T14:06:40.714600 | 1,552,572,400.7146 | 13,640 |
pythondev | help | thanks heaps | 2019-03-14T14:06:46.714800 | Otelia | pythondev_help_Otelia_2019-03-14T14:06:46.714800 | 1,552,572,406.7148 | 13,641 |
pythondev | help | Totally! | 2019-03-14T14:06:49.715000 | Carina | pythondev_help_Carina_2019-03-14T14:06:49.715000 | 1,552,572,409.715 | 13,642 |
pythondev | help | could you simply explain why the other code wasn't working? | 2019-03-14T14:07:02.715200 | Otelia | pythondev_help_Otelia_2019-03-14T14:07:02.715200 | 1,552,572,422.7152 | 13,643 |
pythondev | help | if that's possible to articulate | 2019-03-14T14:07:09.715400 | Otelia | pythondev_help_Otelia_2019-03-14T14:07:09.715400 | 1,552,572,429.7154 | 13,644 |
pythondev | help | I’ll try my best! All of the issues you were running into were syntax errors. It would likely be a good idea to check out the tutorial on the official docs site: <https://docs.python.org/3/tutorial/index.html> — The specific syntax errors you had were: 1. Invalid/inconsistent tabs; Python uses tabs to denote blocks of code (effectively “scope”), whereas other languages use things like curly braces (`{` and `}`) to denote blocks of code. 2. The `assert` keyword has a specific invocation pattern. You need an expression to assert, and more generally `assert`ing an object will _evaluate_ your expression in an attempt to confirm that it is “Truthy” (i.e. using `bool(expression)` will return `True`), otherwise it will raise an `AssertionError`. | 2019-03-14T14:11:13.715800 | Carina | pythondev_help_Carina_2019-03-14T14:11:13.715800 | 1,552,572,673.7158 | 13,645 |
pythondev | help | In your case specifically, you’re using the python shell, which is an interactive program where you type code directly into the interpreter. It’s still a python interpreter and still requires valid python syntax, so tabs are still a requirement. The tricky thing about the python shell is that it’s not really practical to build any significant/major behavior through the interactive interpreter, which is why I suggested putting your code in a file instead and running it using the `python my_tests.py` command. | 2019-03-14T14:12:51.716000 | Carina | pythondev_help_Carina_2019-03-14T14:12:51.716000 | 1,552,572,771.716 | 13,646 |
pythondev | help | Further, the `if __name__ == '__main__': test_all()` line is what tells python what code to run. This is more or less standard boiler plate for python applications/code, it’s somewhat analogous to other language “main” functions. For example, in java you’d use `public static void main(String[] args)`, in C it’s `int main()`, etc. etc. | 2019-03-14T14:15:52.716200 | Carina | pythondev_help_Carina_2019-03-14T14:15:52.716200 | 1,552,572,952.7162 | 13,647 |
pythondev | help | I hope that’s clear, but definitely let me know if I can clarify this further. | 2019-03-14T14:19:01.716400 | Carina | pythondev_help_Carina_2019-03-14T14:19:01.716400 | 1,552,573,141.7164 | 13,648 |
pythondev | help | I'm having a issue where my urls.py is not detecting the URL it's being redirected to... I'm probably overthinking this, but would somebody be able to have a look? | 2019-03-14T20:06:46.719700 | Robbi | pythondev_help_Robbi_2019-03-14T20:06:46.719700 | 1,552,594,006.7197 | 13,649 |
pythondev | help | Anyone happen to know how I can pass a list in a cli arg(argparse)
`python foo.py --data [{'key':'value'}, {'key': 'value'}]` | 2019-03-15T01:03:57.721500 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:03:57.721500 | 1,552,611,837.7215 | 13,650 |
pythondev | help | Does it make sense to have like a JSON config file that you read in instead? | 2019-03-15T01:07:39.722000 | Sasha | pythondev_help_Sasha_2019-03-15T01:07:39.722000 | 1,552,612,059.722 | 13,651 |
pythondev | help | yea that would make a lot more sense. | 2019-03-15T01:09:33.722400 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:09:33.722400 | 1,552,612,173.7224 | 13,652 |
pythondev | help | my outout that Id like to read in is `[{'key':'value'}, {'key': 'value'}]` do you suggest, i save that as a temp json file? and pass in that json | 2019-03-15T01:10:13.723200 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:10:13.723200 | 1,552,612,213.7232 | 13,653 |
pythondev | help | I'd tend to suggest that, since you're going to have a hell of a time with getting the escaping right with braces, brackets, and quotes on the command line. | 2019-03-15T01:11:16.723900 | Sasha | pythondev_help_Sasha_2019-03-15T01:11:16.723900 | 1,552,612,276.7239 | 13,654 |
pythondev | help | i will change the data to `{"data": [{'key':'value'}, {'key': 'value'}]` | 2019-03-15T01:13:48.724800 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:13:48.724800 | 1,552,612,428.7248 | 13,655 |
pythondev | help | <@Sasha> check ou this hack | 2019-03-15T01:28:03.725100 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:28:03.725100 | 1,552,613,283.7251 | 13,656 |
pythondev | help | ```
In [21]: data = "[{'key':'value'}, {'key': 'value'}]"
In [22]: import ast
In [23]: x = ast.literal_eval(data)
In [24]: x
Out[24]: [{'key': 'value'}, {'key': 'value'}]
In [25]: x.__class__
Out[25]: list
In [26]:``` | 2019-03-15T01:29:27.725300 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:29:27.725300 | 1,552,613,367.7253 | 13,657 |
pythondev | help | Handy, that gets around some of the normal concerns with `eval()`. | 2019-03-15T01:31:36.725800 | Sasha | pythondev_help_Sasha_2019-03-15T01:31:36.725800 | 1,552,613,496.7258 | 13,658 |
pythondev | help | thats my only concern. I have never used this package before | 2019-03-15T01:32:21.726100 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:32:21.726100 | 1,552,613,541.7261 | 13,659 |
pythondev | help | actually | 2019-03-15T01:33:07.726300 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:33:07.726300 | 1,552,613,587.7263 | 13,660 |
pythondev | help | json.loads might work too if i return the data in double quoted strings | 2019-03-15T01:33:23.726700 | Adolfo | pythondev_help_Adolfo_2019-03-15T01:33:23.726700 | 1,552,613,603.7267 | 13,661 |
pythondev | help | <@Joette> this looks useful thanks :taco: | 2019-03-15T04:35:39.728100 | Jamey | pythondev_help_Jamey_2019-03-15T04:35:39.728100 | 1,552,624,539.7281 | 13,662 |
pythondev | help | Anyone could help me with reading .off files python tutorials.. I'm only finding .obj, and the format differs.. I'm trying to deal with such type of files in order to construct graph from this 3d model | 2019-03-15T05:11:04.728800 | Tanja | pythondev_help_Tanja_2019-03-15T05:11:04.728800 | 1,552,626,664.7288 | 13,663 |
pythondev | help | Didn't get the question,
The problem?
Your proposed solution?
Eventual output?
May it will be easy for me to get and offer assistance. Enjoy! | 2019-03-15T06:26:38.729700 | Yoko | pythondev_help_Yoko_2019-03-15T06:26:38.729700 | 1,552,631,198.7297 | 13,664 |
pythondev | help | you might want to check out <#C22DMH61M|devops> :slightly_smiling_face: | 2019-03-15T07:49:56.735600 | Hiroko | pythondev_help_Hiroko_2019-03-15T07:49:56.735600 | 1,552,636,196.7356 | 13,665 |
pythondev | help | Hey guys! I am Business analytics student of Indian Institute of Technology Kharagpur. For a project I need to setup an AWS instance which I have done successfully but I am having a little trouble connecting to the network restrictions here. Anybody who has a good grasp on Computer Networks particularly SSH, packages such as corkscrew or even anybody who uses AWS EC2 and is familiar with the environment please reply to this thread. Hopefully we’ll be both get to learn something new. Thanks :slightly_smiling_face:.
Sharing a screenshot if it helps. | 2019-03-15T07:52:14.735900 | Elmo | pythondev_help_Elmo_2019-03-15T07:52:14.735900 | 1,552,636,334.7359 | 13,666 |
pythondev | help | I don’t think ssh works on port 443 | 2019-03-15T07:54:32.736400 | Hiroko | pythondev_help_Hiroko_2019-03-15T07:54:32.736400 | 1,552,636,472.7364 | 13,667 |
pythondev | help | works on 22 by default, unless you specifically change that configuration | 2019-03-15T07:54:42.736700 | Hiroko | pythondev_help_Hiroko_2019-03-15T07:54:42.736700 | 1,552,636,482.7367 | 13,668 |
pythondev | help | <@Hiroko> You are absolutely right! It doesnt work on Port 443, it works on 22 only. But HTTPS uses 443. In campus the Port 22 is blocked so as an alternative we use a package called corkscrew that tunnels all ssh commands through 443. Its a workaround that enables us to use SSH in campus. | 2019-03-15T08:03:37.739700 | Elmo | pythondev_help_Elmo_2019-03-15T08:03:37.739700 | 1,552,637,017.7397 | 13,669 |
pythondev | help | you can also reset ssh to use a different port | 2019-03-15T08:06:03.740000 | Hiroko | pythondev_help_Hiroko_2019-03-15T08:06:03.740000 | 1,552,637,163.74 | 13,670 |
pythondev | help | <https://askubuntu.com/questions/264046/how-to-ssh-on-a-port-other-than-22> | 2019-03-15T08:06:24.740200 | Hiroko | pythondev_help_Hiroko_2019-03-15T08:06:24.740200 | 1,552,637,184.7402 | 13,671 |
pythondev | help | so that would remove your corkscrew dependency | 2019-03-15T08:06:40.740600 | Hiroko | pythondev_help_Hiroko_2019-03-15T08:06:40.740600 | 1,552,637,200.7406 | 13,672 |
pythondev | help | for this to work AWS instance should allow ssh connection through port 26 or any other port right? I dont think they do. For ssh 22 is a static Port. | 2019-03-15T08:41:52.742000 | Elmo | pythondev_help_Elmo_2019-03-15T08:41:52.742000 | 1,552,639,312.742 | 13,673 |
pythondev | help | <@Elmo> do they specify that you must set up an AWS box and use SSH to get to it… and also block access out via SSH? Because if so, that's utterly stupid. | 2019-03-15T08:58:43.743100 | Melynda | pythondev_help_Melynda_2019-03-15T08:58:43.743100 | 1,552,640,323.7431 | 13,674 |
pythondev | help | might be a campus policy that’s entirely different from the department | 2019-03-15T08:59:27.743400 | Hiroko | pythondev_help_Hiroko_2019-03-15T08:59:27.743400 | 1,552,640,367.7434 | 13,675 |
pythondev | help | Ok sorry,
The case is that i have 3d models objects represented by .OFF FILES and I want to construct graphs from these files, where it contains list of vertices and faces. Hopefully my idea get closer and clearer. I appreciate your efforts for helping me. | 2019-03-15T09:07:02.746300 | Tanja | pythondev_help_Tanja_2019-03-15T09:07:02.746300 | 1,552,640,822.7463 | 13,676 |
pythondev | help | Then the department needs to not set impossible requirements ¯\_(ツ)_/¯ | 2019-03-15T09:08:01.746700 | Melynda | pythondev_help_Melynda_2019-03-15T09:08:01.746700 | 1,552,640,881.7467 | 13,677 |
pythondev | help | This regarding the OFF files
<https://en.m.wikipedia.org/wiki/OFF_(file_format)> | 2019-03-15T09:08:25.747200 | Tanja | pythondev_help_Tanja_2019-03-15T09:08:25.747200 | 1,552,640,905.7472 | 13,678 |
pythondev | help | <@Melynda>, I’m aware of the wont-it-be-much-easier-scenarios but unfortunately I can’t do anything about that. I’m sure they must have their reasons. Right now I was hoping if we could find a solution despite the constraints. | 2019-03-15T09:47:50.750000 | Elmo | pythondev_help_Elmo_2019-03-15T09:47:50.750000 | 1,552,643,270.75 | 13,679 |
pythondev | help | This firewall config doesn't look like you've opened SSH, unless specifying nothing means "open to all"/ | 2019-03-15T09:51:56.750300 | Melynda | pythondev_help_Melynda_2019-03-15T09:51:56.750300 | 1,552,643,516.7503 | 13,680 |
pythondev | help | Oh, the content _behind_ the modal looks correct, with `0.0.0.0/0` | 2019-03-15T09:52:31.750500 | Melynda | pythondev_help_Melynda_2019-03-15T09:52:31.750500 | 1,552,643,551.7505 | 13,681 |
pythondev | help | Your AWS looks sensible: ```$ ssh <mailto:[email protected]|[email protected]>
The authenticity of host '<http://ec2-35-154-179-149.ap-south-1.compute.amazonaws.com|ec2-35-154-179-149.ap-south-1.compute.amazonaws.com> (35.154.179.149)' can't be established.
ECDSA key fingerprint is SHA256:Z5T5YwE0UZSYIirqn6OFvD69TjJcrilQ8oXxZry6Ifs.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '<http://ec2-35-154-179-149.ap-south-1.compute.amazonaws.com|ec2-35-154-179-149.ap-south-1.compute.amazonaws.com>,35.154.179.149' (ECDSA) to the list of known hosts.
<mailto:[email protected]|[email protected]>: Permission denied (publickey).``` | 2019-03-15T09:54:00.750700 | Melynda | pythondev_help_Melynda_2019-03-15T09:54:00.750700 | 1,552,643,640.7507 | 13,682 |
pythondev | help | Perhaps your SSH key isn't the right format? It's unusual for it to be in a `.pem` file. | 2019-03-15T09:54:21.750900 | Melynda | pythondev_help_Melynda_2019-03-15T09:54:21.750900 | 1,552,643,661.7509 | 13,683 |
pythondev | help | Do the contents of that file look like `ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC94WHvGPR/RTAgLHZbcMdHXSGVs… name@host` :question: | 2019-03-15T09:55:09.751100 | Melynda | pythondev_help_Melynda_2019-03-15T09:55:09.751100 | 1,552,643,709.7511 | 13,684 |
pythondev | help | * How To Open .whl Extension In Python * | 2019-03-15T11:12:46.752400 | Claud | pythondev_help_Claud_2019-03-15T11:12:46.752400 | 1,552,648,366.7524 | 13,685 |
pythondev | help | Knowing how to ask a good question is a highly invaluable skill that will benefit you greatly in any career. Two good resources for suggestions and strategies to help you structure and phrase your question to make it easier for those here to understand your problem and help you work to a solution are:
• <https://www.mikeash.com/getting_answers.html>
• <https://stackoverflow.com/help/how-to-ask>
| 2019-03-15T11:15:24.752500 | Leana | pythondev_help_Leana_2019-03-15T11:15:24.752500 | 1,552,648,524.7525 | 13,686 |
pythondev | help | <@Claud> what have you tried? What didn't work? Did you get an error? | 2019-03-15T11:15:41.753000 | Melynda | pythondev_help_Melynda_2019-03-15T11:15:41.753000 | 1,552,648,541.753 | 13,687 |
pythondev | help | Guys, what is wrong in my code? I cannot acess the method rota_builder for some reason | 2019-03-15T12:56:55.753700 | Jolanda | pythondev_help_Jolanda_2019-03-15T12:56:55.753700 | 1,552,654,615.7537 | 13,688 |
pythondev | help | It looks like you have a circular import... Utils imports Config, and Config imports Utils. | 2019-03-15T13:05:53.755100 | Sasha | pythondev_help_Sasha_2019-03-15T13:05:53.755100 | 1,552,655,153.7551 | 13,689 |
pythondev | help | Better here, anyone? :thinking_face: | 2019-03-15T14:33:52.756700 | Dennise | pythondev_help_Dennise_2019-03-15T14:33:52.756700 | 1,552,660,432.7567 | 13,690 |
pythondev | help | I’m writing a simple example of a HashTable. I want my HashTable to accept any key which is `Hashable`, instead of having to limit myself to lets say an `int`.
Instead of using the built in `__hash__` function, I want to roll my own simple one, for illustrative purposes. Can someone help me with taking some `Hashable` object and overriding its `__hash__` function?
```
from typing import Hashable, Any
class HashTable:
"""A horribly simple HashTable implementation.
"""
# Where we store our HashTable's keys -> value mapping
storage = [] # type: [int, List[(Hashable, Any)]]
def hash(self):
return self.__attrs % 42
def __getitem__(self, key_to_look_up: Hashable) -> Any:
"""Some text about the function
"""
def __setitem__(self, key_to_store: Hashable, value: Any):
"""Some text about the function
"""
key_to_store.__hash__ = self.hash.__get__(key_to_store, key_to_store.__class__) # this is failing
```
This is my attempt so far | 2019-03-15T14:34:11.757200 | Cammie | pythondev_help_Cammie_2019-03-15T14:34:11.757200 | 1,552,660,451.7572 | 13,691 |
pythondev | help | None | 2019-03-15T14:39:42.758100 | Richelle | pythondev_help_Richelle_2019-03-15T14:39:42.758100 | 1,552,660,782.7581 | 13,692 |
pythondev | help | Hi all, fairly new to Python, created the above file and ran gameOfLife with an argument, but it can't seem to access the create_board function. Any one know why? | 2019-03-15T14:41:12.760300 | Richelle | pythondev_help_Richelle_2019-03-15T14:41:12.760300 | 1,552,660,872.7603 | 13,693 |
pythondev | help | firstly, `self` is always the first parameter in instance methods - none of you methods will run correctly | 2019-03-15T14:42:04.761200 | Clemmie | pythondev_help_Clemmie_2019-03-15T14:42:04.761200 | 1,552,660,924.7612 | 13,694 |
pythondev | help | that is probably your issue, but to be sure please show how you are trying to instantiate/call `Game` | 2019-03-15T14:42:42.761900 | Clemmie | pythondev_help_Clemmie_2019-03-15T14:42:42.761900 | 1,552,660,962.7619 | 13,695 |
pythondev | help | sure -- give me a sec. Thanks! | 2019-03-15T14:43:23.762300 | Richelle | pythondev_help_Richelle_2019-03-15T14:43:23.762300 | 1,552,661,003.7623 | 13,696 |
pythondev | help | Hmm, moving self to the first param didn't fix my issue. The error is `NameError: global name create_board is not defined` I'm testing the gameOfLife function by simply calling `gameOfLife([[0,1,1,1],[0,0,1,1],[1,1,0,1],[0,0,0,0]])` | 2019-03-15T14:51:11.765200 | Richelle | pythondev_help_Richelle_2019-03-15T14:51:11.765200 | 1,552,661,471.7652 | 13,697 |
pythondev | help | The `gameOfLife` is a method of your `Game` object, so it needs to be called in association with one of those objects, like:
```my_game = Game()
my_game.gameOfLife(...)``` | 2019-03-15T14:54:02.766300 | Sasha | pythondev_help_Sasha_2019-03-15T14:54:02.766300 | 1,552,661,642.7663 | 13,698 |
pythondev | help | <@Jonas> Hey, been running into an issue with using `Hashable`. Do you have any way I can override the `__hash__` function? | 2019-03-15T14:54:14.766400 | Cammie | pythondev_help_Cammie_2019-03-15T14:54:14.766400 | 1,552,661,654.7664 | 13,699 |
pythondev | help | Asking you specifically, because of the context of the thread here. and I think using `Hashable` is a good idea | 2019-03-15T14:54:21.766600 | Cammie | pythondev_help_Cammie_2019-03-15T14:54:21.766600 | 1,552,661,661.7666 | 13,700 |
pythondev | help | That solves it, thanks! | 2019-03-15T14:54:39.767200 | Richelle | pythondev_help_Richelle_2019-03-15T14:54:39.767200 | 1,552,661,679.7672 | 13,701 |
pythondev | help | You may have already fixed it, but in calling your methods internally, you should be doing like `self.create_board(board)` instead of using `self` as a calling parameter, since again, they're associated with a particular object. | 2019-03-15T14:57:33.768500 | Sasha | pythondev_help_Sasha_2019-03-15T14:57:33.768500 | 1,552,661,853.7685 | 13,702 |
pythondev | help | Yes, fixed, but thanks for pointing it out! | 2019-03-15T15:06:10.768900 | Richelle | pythondev_help_Richelle_2019-03-15T15:06:10.768900 | 1,552,662,370.7689 | 13,703 |
pythondev | help | adding a vertex to an adjacency matrix is quoted at O(v^2) - if python uses a list of lists - wouldn't it be just O(v) ? | 2019-03-15T15:14:10.769800 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:14:10.769800 | 1,552,662,850.7698 | 13,704 |
pythondev | help | For a list of list you need a nested loop - assuming an n x n size a nested loop is O(n^2) | 2019-03-15T15:16:06.772200 | Clemmie | pythondev_help_Clemmie_2019-03-15T15:16:06.772200 | 1,552,662,966.7722 | 13,705 |
pythondev | help | what is the structure used for the adjacency matrix? Sparse matrix format like CSR style? | 2019-03-15T15:20:02.774700 | Bethany | pythondev_help_Bethany_2019-03-15T15:20:02.774700 | 1,552,663,202.7747 | 13,706 |
pythondev | help | 2D array? | 2019-03-15T15:20:14.774900 | Bethany | pythondev_help_Bethany_2019-03-15T15:20:14.774900 | 1,552,663,214.7749 | 13,707 |
pythondev | help | None | 2019-03-15T15:20:15.775000 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:20:15.775000 | 1,552,663,215.775 | 13,708 |
pythondev | help | 2d array | 2019-03-15T15:20:19.775400 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:20:19.775400 | 1,552,663,219.7754 | 13,709 |
pythondev | help | I think it's still O(v) - you don't need a nested loop | 2019-03-15T15:20:28.775700 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:20:28.775700 | 1,552,663,228.7757 | 13,710 |
pythondev | help | How are you iterating through the rows? | 2019-03-15T15:20:39.776100 | Clemmie | pythondev_help_Clemmie_2019-03-15T15:20:39.776100 | 1,552,663,239.7761 | 13,711 |
pythondev | help | that is the first loop | 2019-03-15T15:20:44.776400 | Clemmie | pythondev_help_Clemmie_2019-03-15T15:20:44.776400 | 1,552,663,244.7764 | 13,712 |
pythondev | help | well if you're adding a connection to an existing node, it should be constant time | 2019-03-15T15:20:45.776600 | Bethany | pythondev_help_Bethany_2019-03-15T15:20:45.776600 | 1,552,663,245.7766 | 13,713 |
pythondev | help | then each row is a loop | 2019-03-15T15:20:50.776800 | Clemmie | pythondev_help_Clemmie_2019-03-15T15:20:50.776800 | 1,552,663,250.7768 | 13,714 |
pythondev | help | adding a new node would require reallocating the whole thing more than likely | 2019-03-15T15:21:08.777300 | Bethany | pythondev_help_Bethany_2019-03-15T15:21:08.777300 | 1,552,663,268.7773 | 13,715 |
pythondev | help | yes, adding/removing an edge is O(1) | 2019-03-15T15:21:10.777400 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:21:10.777400 | 1,552,663,270.7774 | 13,716 |
pythondev | help | generally adjacency matrix if it's large would be represented in sparse form, which is usually more of a dict of 1d arrays | 2019-03-15T15:21:49.778300 | Bethany | pythondev_help_Bethany_2019-03-15T15:21:49.778300 | 1,552,663,309.7783 | 13,717 |
pythondev | help | or rather, two 1d arrays i think | 2019-03-15T15:22:15.778800 | Bethany | pythondev_help_Bethany_2019-03-15T15:22:15.778800 | 1,552,663,335.7788 | 13,718 |
pythondev | help | pseudocode would be like | 2019-03-15T15:22:53.779100 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:22:53.779100 | 1,552,663,373.7791 | 13,719 |
pythondev | help | `for r in rows: r.append(0)` | 2019-03-15T15:23:12.779600 | Lynelle | pythondev_help_Lynelle_2019-03-15T15:23:12.779600 | 1,552,663,392.7796 | 13,720 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.