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 | I should probably take the time to delete them for good | 2018-02-21T14:49:21.000785 | Micki | pythondev_help_Micki_2018-02-21T14:49:21.000785 | 1,519,224,561.000785 | 35,324 |
pythondev | help | <@Micki> :taco: <@Monroe> :taco: thanks! | 2018-02-21T14:49:24.000091 | Tobias | pythondev_help_Tobias_2018-02-21T14:49:24.000091 | 1,519,224,564.000091 | 35,325 |
pythondev | help | you should remove them, I almost messaged them like 5 times :wink: | 2018-02-21T14:49:32.000446 | Hayden | pythondev_help_Hayden_2018-02-21T14:49:32.000446 | 1,519,224,572.000446 | 35,326 |
pythondev | help | well it goes to `/dev/null` | 2018-02-21T14:49:52.000541 | Micki | pythondev_help_Micki_2018-02-21T14:49:52.000541 | 1,519,224,592.000541 | 35,327 |
pythondev | help | or write a delete user function | 2018-02-21T14:49:54.000665 | Hayden | pythondev_help_Hayden_2018-02-21T14:49:54.000665 | 1,519,224,594.000665 | 35,328 |
pythondev | help | Sorry, I didn't have the magical answer | 2018-02-21T14:49:56.000690 | Monroe | pythondev_help_Monroe_2018-02-21T14:49:56.000690 | 1,519,224,596.00069 | 35,329 |
pythondev | help | haha | 2018-02-21T14:49:56.000806 | Hayden | pythondev_help_Hayden_2018-02-21T14:49:56.000806 | 1,519,224,596.000806 | 35,330 |
pythondev | help | thanks for your help <@Micki> | 2018-02-21T14:50:02.000400 | Hayden | pythondev_help_Hayden_2018-02-21T14:50:02.000400 | 1,519,224,602.0004 | 35,331 |
pythondev | help | So I’ve been trying to go through Cracking the Coding Interview. I don’t understand their solution for 1.1: “Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?” which is <https://github.com/careercup/ctci/blob/master/java/Chapter%201/Question1_1... | 2018-02-21T15:05:41.000357 | Winifred | pythondev_help_Winifred_2018-02-21T15:05:41.000357 | 1,519,225,541.000357 | 35,332 |
pythondev | help | what are you having trouble with? | 2018-02-21T15:06:41.000393 | Floy | pythondev_help_Floy_2018-02-21T15:06:41.000393 | 1,519,225,601.000393 | 35,333 |
pythondev | help | understanding the whole thing I don’t know what’s the logic behind it
```
public static boolean isUniqueChars(String str) {
if (str.length() > 128) {
return false;
}
int checker = 0;
for (int i = 0; i < str.length(); i++) {
int val = str.charAt(i) - 'a';
if ((checker & (1 << val)) >... | 2018-02-21T15:29:43.000108 | Winifred | pythondev_help_Winifred_2018-02-21T15:29:43.000108 | 1,519,226,983.000108 | 35,334 |
pythondev | help | <@Winifred> are you familiar with bitwise operations? | 2018-02-21T15:32:21.000267 | Brande | pythondev_help_Brande_2018-02-21T15:32:21.000267 | 1,519,227,141.000267 | 35,335 |
pythondev | help | Yes and no. I can see what it may do, but can't understand the why. Like I know 1<<Val is a bitshift left to Val' th slot, correct? | 2018-02-21T15:41:25.000613 | Winifred | pythondev_help_Winifred_2018-02-21T15:41:25.000613 | 1,519,227,685.000613 | 35,336 |
pythondev | help | Can see the individual parts but not the big picture. | 2018-02-21T15:41:56.000329 | Winifred | pythondev_help_Winifred_2018-02-21T15:41:56.000329 | 1,519,227,716.000329 | 35,337 |
pythondev | help | alright | 2018-02-21T15:45:47.000229 | Floy | pythondev_help_Floy_2018-02-21T15:45:47.000229 | 1,519,227,947.000229 | 35,338 |
pythondev | help | so, you’re given an input string `abcde` | 2018-02-21T15:46:13.000528 | Floy | pythondev_help_Floy_2018-02-21T15:46:13.000528 | 1,519,227,973.000528 | 35,339 |
pythondev | help | at line 11 `int val = str.charAt(i) - 'a';` | 2018-02-21T15:46:37.000163 | Floy | pythondev_help_Floy_2018-02-21T15:46:37.000163 | 1,519,227,997.000163 | 35,340 |
pythondev | help | what that does is execute the following operations
```
'a' - 'a' => 0
'b' - 'a' => 1
'c' - 'a' => 2
// and so on
``` | 2018-02-21T15:47:01.000456 | Floy | pythondev_help_Floy_2018-02-21T15:47:01.000456 | 1,519,228,021.000456 | 35,341 |
pythondev | help | in Java, a char can be represented by its unicode point value, or its ascii value | 2018-02-21T15:49:03.000055 | Floy | pythondev_help_Floy_2018-02-21T15:49:03.000055 | 1,519,228,143.000055 | 35,342 |
pythondev | help | so when you do implicit subtraction like that, it converts the char to its integer representation and does the math | 2018-02-21T15:49:33.000255 | Floy | pythondev_help_Floy_2018-02-21T15:49:33.000255 | 1,519,228,173.000255 | 35,343 |
pythondev | help | then the bitshift happens | 2018-02-21T15:50:39.000415 | Floy | pythondev_help_Floy_2018-02-21T15:50:39.000415 | 1,519,228,239.000415 | 35,344 |
pythondev | help | I don’t write java and should shush about it :stuck_out_tongue: | 2018-02-21T15:52:10.000160 | Brande | pythondev_help_Brande_2018-02-21T15:52:10.000160 | 1,519,228,330.00016 | 35,345 |
pythondev | help | actually, that’s an or equals operation. where the value of checker is OR’d with the bitshift and the result saved in `checker` | 2018-02-21T15:53:41.000455 | Floy | pythondev_help_Floy_2018-02-21T15:53:41.000455 | 1,519,228,421.000455 | 35,346 |
pythondev | help | its not really a conditional assignment | 2018-02-21T15:53:56.000601 | Floy | pythondev_help_Floy_2018-02-21T15:53:56.000601 | 1,519,228,436.000601 | 35,347 |
pythondev | help | similar to `checker (+=, -=, *= /=) 2;` | 2018-02-21T15:54:08.000285 | Floy | pythondev_help_Floy_2018-02-21T15:54:08.000285 | 1,519,228,448.000285 | 35,348 |
pythondev | help | well, it’s still going to OR it, then assign based on whichever value is truthy | 2018-02-21T15:58:57.000325 | Brande | pythondev_help_Brande_2018-02-21T15:58:57.000325 | 1,519,228,737.000325 | 35,349 |
pythondev | help | IIRC, out of Java for way too long, so I defer to you | 2018-02-21T15:59:10.000221 | Brande | pythondev_help_Brande_2018-02-21T15:59:10.000221 | 1,519,228,750.000221 | 35,350 |
pythondev | help | ha ok. been a _long_ time since I’ve twiddled bits at this level though | 2018-02-21T15:59:34.000019 | Floy | pythondev_help_Floy_2018-02-21T15:59:34.000019 | 1,519,228,774.000019 | 35,351 |
pythondev | help | <@Winifred> this might help you.
```
public static boolean isUniqueChars(String str) {
if (str.length() > 128) {
return false;
}
int checker = 0;
for (int i = 0; i < str.length(); i++) {
int val = str.charAt(i) - 'a';
System.out.println( In... | 2018-02-21T16:05:12.000486 | Floy | pythondev_help_Floy_2018-02-21T16:05:12.000486 | 1,519,229,112.000486 | 35,352 |
pythondev | help | puts out the output
```
0 1
1 // checker value
1 10
11 // checker value
11 100
111 // checker value
111 1000
1111 // checker value
1111 10000
11111 // checker value
abcde: true``` | 2018-02-21T16:05:38.000125 | Floy | pythondev_help_Floy_2018-02-21T16:05:38.000125 | 1,519,229,138.000125 | 35,353 |
pythondev | help | to be honest, unless it was for a C job or something in hardware, I’d be surprised if I was doing bitwise ops in an interview | 2018-02-21T16:06:14.000581 | Brande | pythondev_help_Brande_2018-02-21T16:06:14.000581 | 1,519,229,174.000581 | 35,354 |
pythondev | help | yeah. got asked to do an encoding problem once at an interview | 2018-02-21T16:06:40.000140 | Floy | pythondev_help_Floy_2018-02-21T16:06:40.000140 | 1,519,229,200.00014 | 35,355 |
pythondev | help | and this was a java webapp position | 2018-02-21T16:06:57.000693 | Floy | pythondev_help_Floy_2018-02-21T16:06:57.000693 | 1,519,229,217.000693 | 35,356 |
pythondev | help | ¯\_(ツ)_/¯ | 2018-02-21T16:06:59.000217 | Floy | pythondev_help_Floy_2018-02-21T16:06:59.000217 | 1,519,229,219.000217 | 35,357 |
pythondev | help | a coworker was once asked for something similar, but was expected to know ascii table values | 2018-02-21T16:07:10.000104 | Brande | pythondev_help_Brande_2018-02-21T16:07:10.000104 | 1,519,229,230.000104 | 35,358 |
pythondev | help | why use a library when you can code your own bloom filter ¯\_(ツ)_/¯ | 2018-02-21T16:07:24.000563 | Leanora | pythondev_help_Leanora_2018-02-21T16:07:24.000563 | 1,519,229,244.000563 | 35,359 |
pythondev | help | I know ASCII reps from 65-122 with a few exceptions | 2018-02-21T16:08:02.000120 | Floy | pythondev_help_Floy_2018-02-21T16:08:02.000120 | 1,519,229,282.00012 | 35,360 |
pythondev | help | but other than that, sorry | 2018-02-21T16:08:08.000319 | Floy | pythondev_help_Floy_2018-02-21T16:08:08.000319 | 1,519,229,288.000319 | 35,361 |
pythondev | help | I feel like if someone is expecting you to know ascii values off the top of your head you can just start berating them about how they should not be using ascii anymore | 2018-02-21T16:09:28.000619 | Leanora | pythondev_help_Leanora_2018-02-21T16:09:28.000619 | 1,519,229,368.000619 | 35,362 |
pythondev | help | ahh probabalistic computing and data structures | 2018-02-21T16:09:31.000237 | Brande | pythondev_help_Brande_2018-02-21T16:09:31.000237 | 1,519,229,371.000237 | 35,363 |
pythondev | help | I might reach back out again for the second time later on this. Thank you for the output <@Floy>. Maybe I can rephrase my question into a better one. What's the real role of checker? What's the real role of (1<<val)? What's the real role of checker = checker | (1<<val)? The numbers make sense, but the ratio... | 2018-02-21T16:55:56.000153 | Winifred | pythondev_help_Winifred_2018-02-21T16:55:56.000153 | 1,519,232,156.000153 | 35,364 |
pythondev | help | I think where I'm at is "ok, so when I do 1 << val where val is 0 I get 1, but why is it needed and what does it represent in this solution for finding unique numbers?" | 2018-02-21T16:57:35.000207 | Winifred | pythondev_help_Winifred_2018-02-21T16:57:35.000207 | 1,519,232,255.000207 | 35,365 |
pythondev | help | <@Winifred> You can think of the checker as an array of bits. To keep it simply let's assume we're only working with character's a-z. We can start with an array of length 27 filled with 0's. Then you go through the string character by character. The character is converted to an index (in this case a = 0, b = 1, etc) a... | 2018-02-21T17:09:36.000555 | Leanora | pythondev_help_Leanora_2018-02-21T17:09:36.000555 | 1,519,232,976.000555 | 35,366 |
pythondev | help | Or it may make more sense seeing these operations applied to binary numbers, then you’ll see how it carries over in decimals | 2018-02-21T17:11:47.000163 | Brande | pythondev_help_Brande_2018-02-21T17:11:47.000163 | 1,519,233,107.000163 | 35,367 |
pythondev | help | <@Brande> you may be right... still reading john's answer | 2018-02-21T17:12:24.000267 | Winifred | pythondev_help_Winifred_2018-02-21T17:12:24.000267 | 1,519,233,144.000267 | 35,368 |
pythondev | help | Here;s a video from the author of cracking the coding interview going over bit manipulation and the basic operations: <https://www.youtube.com/watch?v=NLKQEOgBAnw> | 2018-02-21T17:14:35.000377 | Brande | pythondev_help_Brande_2018-02-21T17:14:35.000377 | 1,519,233,275.000377 | 35,369 |
pythondev | help | <@Leanora> yeah, I'm pretty sure that makes a lot of sense to me. I'm going to diagram it out and submit it here once I get the chance to. | 2018-02-21T17:25:37.000402 | Winifred | pythondev_help_Winifred_2018-02-21T17:25:37.000402 | 1,519,233,937.000402 | 35,370 |
pythondev | help | Sounds good! To relate it back to specific parts of the above code the `(checker & (1 << val)) > 0` part is what does the check itself for a specific bit and then `checker |= (1 << val);` updates the checker value with the new bit | 2018-02-21T17:30:25.000334 | Leanora | pythondev_help_Leanora_2018-02-21T17:30:25.000334 | 1,519,234,225.000334 | 35,371 |
pythondev | help | <http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/> | 2018-02-21T17:57:59.000266 | Monroe | pythondev_help_Monroe_2018-02-21T17:57:59.000266 | 1,519,235,879.000266 | 35,372 |
pythondev | help | <@Leanora> fun little response to a common interview question | 2018-02-21T17:58:32.000596 | Monroe | pythondev_help_Monroe_2018-02-21T17:58:32.000596 | 1,519,235,912.000596 | 35,373 |
pythondev | help | anyone have any experience with customizing the auto-generated models in `sandman2`? | 2018-02-21T18:06:33.000252 | Cassandra | pythondev_help_Cassandra_2018-02-21T18:06:33.000252 | 1,519,236,393.000252 | 35,374 |
pythondev | help | <@Leanora> I drew it out based on your explanation (and seeing dd82's prints), I finally get it: It's just a condensed way of writing out which characters have been seen already (checker) and which characters are we currently looking at (1 << val). Based on the way the code has been written, the characters suppor... | 2018-02-21T19:42:52.000114 | Winifred | pythondev_help_Winifred_2018-02-21T19:42:52.000114 | 1,519,242,172.000114 | 35,375 |
pythondev | help | Hey all! My Scrapy is telling me it can't connect to the site server. I am trying to scrape Walmart and I'm thinking they blacklisted my scrape. Would it be best to use a proxy? Would you recommend setting one up on a Raspberry Pi? Or is there any other way to bypass the site? | 2018-02-21T21:29:26.000118 | Chi | pythondev_help_Chi_2018-02-21T21:29:26.000118 | 1,519,248,566.000118 | 35,376 |
pythondev | help | hi <@Chi> - We unfortunately can't help with anything designed to avoid blacklisting or anti-scraping systems in this community. | 2018-02-21T21:44:44.000036 | Noel | pythondev_help_Noel_2018-02-21T21:44:44.000036 | 1,519,249,484.000036 | 35,377 |
pythondev | help | Ahh, I completely understand. I think I'll switch to BeautifulSoup anyways. | 2018-02-21T21:45:11.000087 | Chi | pythondev_help_Chi_2018-02-21T21:45:11.000087 | 1,519,249,511.000087 | 35,378 |
pythondev | help | Hey All, We are planning to start automating some of the instruments using VR, please can you suggest good tutorials and tools for learning VR with python. | 2018-02-21T22:53:10.000231 | Alison | pythondev_help_Alison_2018-02-21T22:53:10.000231 | 1,519,253,590.000231 | 35,379 |
pythondev | help | Hello, which is better?
A:
```
spam = None
if condition:
spam = something
# later
if spam:
cook(spam)
```
B:
```
if condition:
spam = something
# later
if 'spam' in locals():
cook(spam)
``` | 2018-02-22T02:17:32.000012 | Carly | pythondev_help_Carly_2018-02-22T02:17:32.000012 | 1,519,265,852.000012 | 35,380 |
pythondev | help | I just run into this choice too many times that there must be a consensus out there | 2018-02-22T02:18:17.000221 | Carly | pythondev_help_Carly_2018-02-22T02:18:17.000221 | 1,519,265,897.000221 | 35,381 |
pythondev | help | or maybe `else: spam = None`? | 2018-02-22T02:21:24.000186 | Carly | pythondev_help_Carly_2018-02-22T02:21:24.000186 | 1,519,266,084.000186 | 35,382 |
pythondev | help | I never saw `B:` in the wild tbh | 2018-02-22T02:22:03.000120 | Sadye | pythondev_help_Sadye_2018-02-22T02:22:03.000120 | 1,519,266,123.00012 | 35,383 |
pythondev | help | I once seen something like:
```
try:
cook(spam)
except NameError:
pass
``` | 2018-02-22T02:22:46.000110 | Sadye | pythondev_help_Sadye_2018-02-22T02:22:46.000110 | 1,519,266,166.00011 | 35,384 |
pythondev | help | But my feelings about it somewhat controversal | 2018-02-22T02:23:00.000290 | Sadye | pythondev_help_Sadye_2018-02-22T02:23:00.000290 | 1,519,266,180.00029 | 35,385 |
pythondev | help | That looks like the EAFP way, except whether `spam` exists or not depends on something in the same function | 2018-02-22T02:25:34.000141 | Carly | pythondev_help_Carly_2018-02-22T02:25:34.000141 | 1,519,266,334.000141 | 35,386 |
pythondev | help | <@Carly> can you show your real use-case? | 2018-02-22T02:29:42.000266 | Aleida | pythondev_help_Aleida_2018-02-22T02:29:42.000266 | 1,519,266,582.000266 | 35,387 |
pythondev | help | B should not be used, ever. It is a horrible programming style. Forget it exists.
try/except is horrible too, because it's used for a regular (non-exceptional) control flow | 2018-02-22T02:33:20.000271 | Aleida | pythondev_help_Aleida_2018-02-22T02:33:20.000271 | 1,519,266,800.000271 | 35,388 |
pythondev | help | I have since read that `wraps` updates the attributes, so this code has changed in a way that my question is not relevant anymore | 2018-02-22T02:35:15.000087 | Carly | pythondev_help_Carly_2018-02-22T02:35:15.000087 | 1,519,266,915.000087 | 35,389 |
pythondev | help | You don't need the wrapper function here | 2018-02-22T02:35:34.000031 | Aleida | pythondev_help_Aleida_2018-02-22T02:35:34.000031 | 1,519,266,934.000031 | 35,390 |
pythondev | help | yup. | 2018-02-22T02:35:41.000210 | Carly | pythondev_help_Carly_2018-02-22T02:35:41.000210 | 1,519,266,941.00021 | 35,391 |
pythondev | help | wait | 2018-02-22T02:35:47.000237 | Carly | pythondev_help_Carly_2018-02-22T02:35:47.000237 | 1,519,266,947.000237 | 35,392 |
pythondev | help | Ah.. | 2018-02-22T02:36:14.000126 | Carly | pythondev_help_Carly_2018-02-22T02:36:14.000126 | 1,519,266,974.000126 | 35,393 |
pythondev | help | ```
def sample(input=None, output=None):
def decorator(method):
document = getattr(method, 'document', {})
if 'sample' not in document:
document['sample'] = []
document['sample'].append({'input': input, 'output': output})
method.document = document
return method
... | 2018-02-22T02:36:32.000128 | Aleida | pythondev_help_Aleida_2018-02-22T02:36:32.000128 | 1,519,266,992.000128 | 35,394 |
pythondev | help | I can just return the same method, right? | 2018-02-22T02:36:34.000207 | Carly | pythondev_help_Carly_2018-02-22T02:36:34.000207 | 1,519,266,994.000207 | 35,395 |
pythondev | help | Right. | 2018-02-22T02:36:50.000007 | Carly | pythondev_help_Carly_2018-02-22T02:36:50.000007 | 1,519,267,010.000007 | 35,396 |
pythondev | help | Although I would reconsider this design | 2018-02-22T02:37:14.000041 | Aleida | pythondev_help_Aleida_2018-02-22T02:37:14.000041 | 1,519,267,034.000041 | 35,397 |
pythondev | help | <@Aleida> Do you mean the design of using decorator for documentation? | 2018-02-22T02:55:07.000199 | Carly | pythondev_help_Carly_2018-02-22T02:55:07.000199 | 1,519,268,107.000199 | 35,398 |
pythondev | help | That doesn't look like documentation at all | 2018-02-22T02:55:24.000341 | Aleida | pythondev_help_Aleida_2018-02-22T02:55:24.000341 | 1,519,268,124.000341 | 35,399 |
pythondev | help | What is another way to document a function? | 2018-02-22T02:56:14.000038 | Carly | pythondev_help_Carly_2018-02-22T02:56:14.000038 | 1,519,268,174.000038 | 35,400 |
pythondev | help | The docstring is already used by the framework | 2018-02-22T02:56:38.000302 | Carly | pythondev_help_Carly_2018-02-22T02:56:38.000302 | 1,519,268,198.000302 | 35,401 |
pythondev | help | I have to ask you again to show your _real_ use-case | 2018-02-22T02:58:14.000048 | Aleida | pythondev_help_Aleida_2018-02-22T02:58:14.000048 | 1,519,268,294.000048 | 35,402 |
pythondev | help | Oh right, I haven't showed you the other half of the puzzle (since I was focusing on the local var thing) | 2018-02-22T02:59:42.000286 | Carly | pythondev_help_Carly_2018-02-22T02:59:42.000286 | 1,519,268,382.000286 | 35,403 |
pythondev | help | The other side of the attr assignment:
```
if hasattr(func, 'document'):
# circumvent itypes
obj[doc_method].__dict__['document'] = func.document
```
This obj is then passed into the template (also overwritten) so that I can eventually do stuff with `{{link.document}}`. | 2018-02-22T03:01:27.000155 | Carly | pythondev_help_Carly_2018-02-22T03:01:27.000155 | 1,519,268,487.000155 | 35,404 |
pythondev | help | I am reusing the work done by core-api and django-rest-framework on the schema, but I need to change some of the stuff that is not provided by the libraries. I feel that modifying dependency's dependency would be harder to maintain than this kind of monkey patching. | 2018-02-22T03:02:44.000160 | Carly | pythondev_help_Carly_2018-02-22T03:02:44.000160 | 1,519,268,564.00016 | 35,405 |
pythondev | help | Have you tried to read the docs and maybe the source code and see if it's possible to do what you need using standard features of the libraries? | 2018-02-22T03:05:22.000257 | Aleida | pythondev_help_Aleida_2018-02-22T03:05:22.000257 | 1,519,268,722.000257 | 35,406 |
pythondev | help | Yes, the core-api schema doesn't have a place for sample input/output | 2018-02-22T03:05:54.000051 | Carly | pythondev_help_Carly_2018-02-22T03:05:54.000051 | 1,519,268,754.000051 | 35,407 |
pythondev | help | It's simply defined that way | 2018-02-22T03:06:18.000352 | Carly | pythondev_help_Carly_2018-02-22T03:06:18.000352 | 1,519,268,778.000352 | 35,408 |
pythondev | help | <https://github.com/core-api/python-client/blob/master/coreapi/document.py#L186>
Here's the source for `Link` | 2018-02-22T03:08:06.000076 | Carly | pythondev_help_Carly_2018-02-22T03:08:06.000076 | 1,519,268,886.000076 | 35,409 |
pythondev | help | When you previously said that the docstrings are used by the framework, did you mean this <http://www.django-rest-framework.org/api-guide/schemas/#schemas-as-documentation>? | 2018-02-22T03:09:48.000325 | Aleida | pythondev_help_Aleida_2018-02-22T03:09:48.000325 | 1,519,268,988.000325 | 35,410 |
pythondev | help | Yes | 2018-02-22T03:11:42.000426 | Carly | pythondev_help_Carly_2018-02-22T03:11:42.000426 | 1,519,269,102.000426 | 35,411 |
pythondev | help | Have you actually tried to put an example in there? | 2018-02-22T03:13:09.000166 | Aleida | pythondev_help_Aleida_2018-02-22T03:13:09.000166 | 1,519,269,189.000166 | 35,412 |
pythondev | help | Yes, it goes under the subheading | 2018-02-22T03:14:12.000244 | Carly | pythondev_help_Carly_2018-02-22T03:14:12.000244 | 1,519,269,252.000244 | 35,413 |
pythondev | help | rendered as markdown | 2018-02-22T03:14:17.000018 | Carly | pythondev_help_Carly_2018-02-22T03:14:17.000018 | 1,519,269,257.000018 | 35,414 |
pythondev | help | I have no idea what's wrong with it. I suppose you'd better ask in <#C0LMFRMB5|django> | 2018-02-22T03:16:29.000421 | Aleida | pythondev_help_Aleida_2018-02-22T03:16:29.000421 | 1,519,269,389.000421 | 35,415 |
pythondev | help | Hi. I'm trying to make sure that `request.json['description']` is a unicode value. I've tried the code below and it is returning the error `E: 47, 0: invalid syntax (<string>, line 47) (syntax-error)`
```
if 'name' in request.json and isinstance((request.json['description']), str):
``` | 2018-02-22T03:17:18.000120 | Hans | pythondev_help_Hans_2018-02-22T03:17:18.000120 | 1,519,269,438.00012 | 35,416 |
pythondev | help | request.json? | 2018-02-22T03:19:02.000140 | Tenesha | pythondev_help_Tenesha_2018-02-22T03:19:02.000140 | 1,519,269,542.00014 | 35,417 |
pythondev | help | Are you loading the request data to json? | 2018-02-22T03:19:27.000182 | Tenesha | pythondev_help_Tenesha_2018-02-22T03:19:27.000182 | 1,519,269,567.000182 | 35,418 |
pythondev | help | Yes. | 2018-02-22T03:19:46.000259 | Hans | pythondev_help_Hans_2018-02-22T03:19:46.000259 | 1,519,269,586.000259 | 35,419 |
pythondev | help | Do you need to see the full context of the code? | 2018-02-22T03:20:01.000259 | Hans | pythondev_help_Hans_2018-02-22T03:20:01.000259 | 1,519,269,601.000259 | 35,420 |
pythondev | help | <@Tenesha> | 2018-02-22T03:20:13.000243 | Hans | pythondev_help_Hans_2018-02-22T03:20:13.000243 | 1,519,269,613.000243 | 35,421 |
pythondev | help | ```
json_data = json.loads(request.body)
json_data['description']
``` | 2018-02-22T03:20:22.000264 | Tenesha | pythondev_help_Tenesha_2018-02-22T03:20:22.000264 | 1,519,269,622.000264 | 35,422 |
pythondev | help | would help | 2018-02-22T03:20:25.000319 | Tenesha | pythondev_help_Tenesha_2018-02-22T03:20:25.000319 | 1,519,269,625.000319 | 35,423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.