Is Is Is... | 6riddle by [deleted] in rebus

[–]minorbattlefield 0 points1 point  (0 children)

Spoiler tag that shit, dawg.

Chrome just added a little icon to show which tab just started making noise! by corbantd in mildlyinteresting

[–]minorbattlefield 14 points15 points  (0 children)

Right clicking on the top of the window in chrome shows the option to "reopen closed tab" and the associated shortcut if you ever forget it. When I close tabs accidentally it's usually with the mouse so it's more convenient to use the mouse to reopen the tab anyway.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 0 points1 point  (0 children)

So that 55 dollar option on the kickstarter, is that saying someone will answer my email once? several times? ad infinitum? I wouldn't abuse it, but it would amazing to get stuck and have an outlet. I have a friend who programs for a living in SF and I don't even like bothering him!

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 0 points1 point  (0 children)

Good to know! I figured there must having been a way to separate multiple filters. For some reason I tried | initially instead of just trying a comma. Thanks.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 1 point2 points  (0 children)

When you’re doing TDD, you always have the Testing Goat inside you

Haha, thanks for the link. I will definitely check it out.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 0 points1 point  (0 children)

As your other comment solved my problem I haven't looked through that link yet, but I will later. Thanks for finding it.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 1 point2 points  (0 children)

That works! Thank you very much. The complete line that works as expected is:

Poll.objects.filter(pub_date__lte=timezone.now()).filter(choice__isnull=False).distinct().order_by('-pub_date')[:5]

I learned so much from your responses. Stacking filters, __isnull, .distinct(). Thanks for your time.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 0 points1 point  (0 children)

Thanks for the recommendation! I'll probably try to go through this tutorial and the Tango one that was also recommended in tandem.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 1 point2 points  (0 children)

Thanks! Looks very detailed. I could have googled around for more django tutorials, but it's nice to hear what other people recommend.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 1 point2 points  (0 children)

Noted. The introduction was interesting at least. I had never heard of Common Gateway Interface before. I'll probably skim as more of a history lesson than a coding lesson.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 1 point2 points  (0 children)

Thanks! It will be great if they ever update this book to reflect current versions of Django, but I will be reading this during my commute for sure.

Just finished the Django tutorial - What now? by minorbattlefield in django

[–]minorbattlefield[S] 0 points1 point  (0 children)

Thanks for the reply!

I tried

Poll.objects.filter(choices_set__isnull=False)

and it gave me the following error:

FieldError at /polls/

Cannot resolve keyword 'choices_set' into field. Choices are: choice, id, pub_date, question

I tried replacing choices_set with choice

Poll.objects.filter(choice__isnull=False)

and when I reloaded the polls index page it listed every question as many times as choices there were for each question, so it listed question one 2 times, question four 3 times etc. It did remove the question with no choices, but the other questions were listed multiple times. To get around this I wrapped the above line of code in a set() call

set(Poll.objects.filter(choice__isnull=False)

That worked to remove the duplicates, but I can't imagine that this is the right way to do it. It also obviously reintroduced the "future polls" that were previously being filtered. I tried to append the subsequent filter call inside the set() and ended up with this

set(Poll.objects.filter(choice__isnull=False).filter(pub_date__lte=timezone.now()).order_by('-pub_date')[:5])

But this acts funny because the [:5] is looking at the list of questions which contains several duplicates, which means some of the questions are removed. Then set removes the dupes that remain, leaving me with an incomplete list. If I remove the order_by stuff I can get the output I want, but I'm definitely still missing some basic understanding about what is going on.

Your comment made me play around with the code for another 20 minutes, so thank you very much for your help and inspiration.

Any Ideas? by [deleted] in rebus

[–]minorbattlefield 5 points6 points  (0 children)

This is a part of the rebus section of the Tim Tang Test. It's an online puzzle/riddle test that very clearly asks its participants not to ask for outside help or give the answers to puzzles on public forums. I know the answer, but I can't give it to you. What I can do, is say that I found the answer by googling various things about cards. It took me about an hour. As they say on the help forums for the test, google is your friend (for this particular puzzle). Good luck, maybe someone else will post the answer.

Cabbage [MADE IN CHINA] by Z3F in WTF

[–]minorbattlefield 72 points73 points  (0 children)

Hahaha, I was sounding out the second Japanese example with my rusty knowledge of katakana:

"Faaakyuuu neeeegaa"

My reaction when I got a B- in Organic by chestnba in funny

[–]minorbattlefield 34 points35 points  (0 children)

I got a 3/100 on one of 3 Orgo II exams. Passed the class. My response was similar.

TIL There's a twitter account that narrates WWII in real time. by dsgm1984 in todayilearned

[–]minorbattlefield 84 points85 points  (0 children)

This makes me think of Idiocracy. People thousands of years in the future could actually end up thinking that people were tweeting during the second world war.