« first day (1132 days earlier)      last day (4039 days later) » 
00:00 - 11:0011:00 - 00:00

11:07
I don't get it. The law of "silly questions get ton of answers and up votes" is not working for me: stackoverflow.com/q/20119023/1561176
Ooo... pythonchallenge - haven't seen that one in a while :)
im still trying to find my original error
its bugging me
pastebin.com/w95mcQ2s in case you want to look for it
Um... don't fancy wrapping my brain about that strange indexing just yet, thanks :)
Besides, if you wanted to do it like that... can't you just slice chunks of 9 from it to make it conceptually more obvious, and then slice into that
yes i suppose
its just that, i dont see whats wrong with they way it is currently and its bothering me
its something dumb of course
@aIKid Are you stalking me? You seem to comment on many of my answers :)
11:18
It's not obvious because it's difficult to grasp how what your'e doing is supposed to work :)
the whole loopving ove ra range from -4 to 4 is strange, and then remember that you're adding -4 to the total numbers of chars seen to get what would be the start of a block...
It's not fun
Here's one I whipped up that's not great or complete... but at least a bit more understandable:
for idx in range(len(text)):
	block = text[idx:idx+ 9]
	if not (block[0].islower() and block[-1].islower()): continue # not exactly 3
	if not (block[1:4]).isupper() and block[-3:].isupper(): continue # not 3 uppercase surrounding
@InbarRose Hahahah, no way :p You're a bit too sensitive XD
yea I was trying to go 4 each way from n, and test -4 and 4 to make sure they are lowercase then test -3,-3 to make sure they are upper case
I'm just wandering around the python tag, and you're everywhere, and i usually comment on nice answers :)
@bh3244 it's just easier for humans if you have a block where the indices start on something that's related... not relative blocks within a huge chunk of text :)
i know, but i have to solve this
ive spent probably 4 hours on this
11:24
Well, I'm not running/debugging the code, but you're missing a function call here: j==4 and text[n+j].isupper
Which means you'll never get results appended.... try calling isupper... who knows - it might fix your problem
yes i see that, thought that would give an error, but i fixed it, still no luck
ill find it eventually
hello stranger @haidro ;)
So are you receiving an error when you run your code @bh3244?
well not an error the result is just wrong
11:27
Okay, firstly, let's see if you know what each thing does
Are you firstly aware that continue starts the loop again with the next value>
yes
@bh3244 text is the bunch of letters from the source code of the page, yea?
yes
Hum.. why don't you use slicing?
Cabbage dude @Haidro
@bh3244 Did you remember to get rid of the <!-- --> that appears at the start and the end?
11:31
well this code isnt going to win any prized thats for sure
i didnt
does it matter?
text[n-3:n].isupper() and text[n:n-3].isupper()
Try removing it
Although you're right, it probably won't matter
yea didnt make a difference
when i debug it the -4 side from n are all capital
so something is wrong thre
the +4 side seems ok though
I think your best bet is to re-look at how to solve this questino
Umm... shouldn't there be 1 lower case followed by 3 uppercase - ie, they shouldn't all be capital at the start
11:34
it should be lUUUlUUUl
yes the first should be uppercase
i mean lowercase
@bh3244 part of learning to program is to throw away code, if you've spent 4 hours working with that and still don't get it... you've got it wrong in both design and implementation... you agree that using more obvious chunks will make it easier - throw your code away and do so
I suppose youre right
No supposing about it... throw it away, use an approach that you know's better.. and in 10 minutes this is all behind you... put it down to a learning experience that looping over indices and breaking/continuing was not a good idea for this problem
haha ok, i will do that
i tried it like this because ive used this before in C and it worked for me
but i guess i should do things more pythoneque
with slice or learn regex
Regex is your best solution here
I think the challenge actually gives you the hint of using regex
11:48
yes it does, i didnt realize what "re" meant though
Sorry guys
It's what you use for regular expressions
I just found that pythonchallenge from @bh3244 :D
What is the hint for the ocr one?
Check the source
11:51
the hint is in a comment in the source
I found the data already XD But what am i suppose to do?
what would you do iif you hated workiing for other ppl?
BTW, i hope this doesn't count as cheating :D
Find unique characters
is what it's trying to say
@haidro no... "rare" :)
11:54
hi all , how to save images in db using django models
You can't literally save images in db
But you can store their paths.
@aIKid put the answer in the url in place of ocr
@aIKid using blobstorage??
@PaoloCasciello dbg
11:56
Night all
@aIKid how we can store the path
@Haidro Night bro
@AvinashGarg Like you store anything? As a string?
12:39
@Lattyware you're still alive then :) Everything going okay mate?
13:21
cbg all!
14:13
Good Morning All or Good Evening, depending on the lat-long you're on.
Could someone help me write a resume?
I want to work in Python, but all my experience is limited to c#, plsql and t-sql.
@abhi And?
14:30
@abhi wasn't aware this is the careers advice and support room ;)
cabbage!
@shannon cbg!
@JonClements that workplace exchange is pretty sweet
@shannon yeah... I've seen it referenced a few times on meta
14:46
I am heading over to workplace exchange right now.
Wow... browsers don't have tabs or can't be run multi times it would appear :)
anyone uses arduino or rasberry pi here? or mindstorms?
cbg4all
:)
yesterday I finally flashed some LEDs on my arduino with Python!!! but I was wondered, what else could I do? I saw that there are tons of shields and kits and extra parts for these systems.. but which one is good?
Think there's some kind of robot wars competition using arduino I saw the other day
15:00
i have an arduino, not much use for it at the moment
yeah, well.. I bought mine back in 2010 -- I ran the standard blink demo, and.. and put it on my shelf ;)
Cabbage again
now I realised that maybe I could use it with Python -- and I found the pySerial library, then I wrote a small receiver function on the Arduino, and BAMM! it is working.. although I did the same.. blinked some leds:)
well, not the same, I created a Tkinter interface for it, and it is a Morse translator.. but still
@PeterVaro I actually have both arduino and rpi..
really?
and what are you using for?
15:04
Only i've no idea what to do with the pi, and i forgot how to setup my little robot.
:D:D:D:D
Hahahaha XD
Has to be played loud though!
the only good thing I could think of is the BrickPi
and probably buy some servos and sensors on eBay
and it is way cheaper and more Python-orinted than the original mindstorms
but still LEGO centric
@aIKid so do you know BrickPi ?
15:08
@PeterVaro Umm.. No.
What's that?
I just linked that above^^^^
@peter umm.... interesting... Look for: "Murray Gold - The Long Song"
@JonClements it's not interesting.. this is a fuckedup country.. nothing special;)
oh I like that song ;)
#yolo ?! ^
@PeterVaro sorry, I wasn't looking. Yea, i've used arduino and RPi like crazy
@ShannonStrutz and what did you used it for?
and what do you think about that BrickPi thingy?
15:14
Arduino, pretty much everything it has to offer. RPi, just RTos stuff
Ummm its okay I guess. I don't have many legos
well electronic legos
so you did soldered everything for Arduino?
or you used a PrototypeBoard?
I either use a solderless breadboard or I design my own circuit board
wow -- that is advanced ;)
its mainly big-boy connect the dots
I use nanobots to build my circuit boards :)
15:17
I mean I also have bread board (I thought it's name is protype board) but creating your own circuits..
in fact... I could use them to build my own arduino
Oh wait... why do I need to bother building an arduino if I've already got nanobots... ummm
nanobots?
:):):)
because nanobots can not be programmed with Python.. this is the only downside they have..
@Peter yeah... gotta be at the forefront of technology when one plans on taking over the planet
anyway @aIKid and @ShannonStrutz this is some pretty awesome keyboard for rasberry pi: kickstarter.com/projects/alexklein/…
The thesis with project of Arduino is fashionable in my university La Sapienza of Rome
15:24
Arduino in a university?
yes I have a professor that it has more robot in the office room and also those is of LEgo
@PeterVaro How did you get the strikethrough text in chat?
@abhi --- your text ---
Test this
but ofc without the spaces after and before
15:33
Gotcha! Thanks @PeterVaro
np at all
How do you design a deck() class that holds 4 suits and 13 cards per suit & 2 jokers?
I was thinking 4 lists in a dictionary.
deck = {"Hearts":range(0,13), "Spades":range(0,13), "jokers":range(0,2)}
is that something that'll work?
Why a dictionary... it's just a list of 54 items, surely?
Clearly I haven't thought this through
but how do you mark the H / S / C / D suits in the list?
What is that
?
15:38
You have tuples or other lists.... eg ('H', 1) for the 1 of hearts
this is the reason I was thinking of 4 separate lists.
Sorry 5, including the jokers.
Then combining them.
or use simple strings: '♣︎1', '♥︎Q', '♦︎A', '♠︎J' :)
create a class called deck with a method called shuffle.
You could try that...
@PeterVaro Do I need to create add each card to the deck individually?
15:42
no, you can create these strings programatically
@abhi you can loop - this is what computers are for... you know there's 4 suits and 13 in each... that's a nested loop to add them.... just add the 2 jokers to the end
import itertools

deck = []
for symbol in ('♣︎', '♥︎', '♦︎', '♠︎'):
    for i in itertools.chain(range(1, 10), ('A', 'J', 'Q', 'K')):
        deck.append(symbol + str(i))

print(deck)
@abhi how about this ? ^
I am not sure itertools is available to me.
Let me try your code out.
it is part of the standard library
@abhi it is... do you mean that you're not allowed to use it?
15:47
guys. Assembly language is frying my brain
@Crowz then use C ;)
@Jon correct.
I changed the symbols with regular H / C / D / S
that's okay
how do I chain using range?
@PeterVaro can't, assembly language course
15:49
@abhi python 2.x ?
list.extend should do the same job.
just looked up documentation.
After this course is done luckily I will never have to do assembly language again... it makes C look like super high level programming
I am on python 2.6
@Crowz Real Programers love the pain of assembly
I once heard that some crazy programmer made a first person shooter (with playable albeit horrible graphics) in assembly that can fit on a floppy disk.
@Peter - my take
from itertools import product
print list(product('♣♥♦♠︎', range(10) + list('JQKA')))
15:51
@InbarRose do you know what demo scene is?
@PeterVaro I changed your code to this:

import random

deck = []

my_card = range(1,13)
for symbol in ('C', 'H', 'D', 'S'):
for i in my_card:
deck.append(symbol + str(i))
random.shuffle(deck)
print(deck)
@JonClements that is the ultimate solution, yes
@JonClements This is why you're at 40K rep points. :)
I'm so ashamed that I did ('♣︎', '♥︎', '♦︎', '♠︎') instead of '♣♥♦♠︎'
15:54
@abhi why would they? Even the C compiler is optimized enough that there's no significant difference
sorry wrong link
:)
umm.. actually good link @InbarRose youtube.com/watch?v=AWcbj7ksqwE
4kb full HD
including music
I know a few demo scener guys.. they are crazy, really
they are using amiga, and they've written all their programs -- mail apps and webbrowser..
and C64 ofc
they created their own music creator apps... crazy stuffs
@JonClements one tiny mistake: range(1, 10) since there is no 0 :)
anyway, I gtg, rhubarb folks!
~
@peter there is that... :) see ya
@PeterVaro you might be interested in youtube.com/watch?v=4KFCA750JdM - I remember being amazed when it came out
16:10
Can someone answer a quick question for me?
Not without knowing what that question is.... - so don't ask to ask... just ask your question and if someone wants/can answer they will
while calculateHandlen(hand) > 0:
print 'Current Hand:', displayHand(hand)
key = compChooseWord(hand, wordList, n)
if key == None:
break
else:
score += getWordScore(key, n)
print '"%s" earned %d points. Total: %d points' % (key, getWordScore(key, n), score)
hand = updateHand(hand, key)
Damnit, stupid formatting....
Trying to figure out why it is printing "None" after displaying the current hand, before printing the points earned.
There is some indentation in there I swear ;)
that 4kb demo is impressive
@Ernesto I'm guessing because your displayHand doesn't return anything... in which case it implicitly returns None which print then faithfully prints...
Any of you using lynx? Here's column 80 for you http://www.column80.com/
16:15
Your output:
Current Hand: a a c b t
None
"acta" earned 24 points. Total: 24 points
Current Hand: b
None
Total score: 24 points.
None

*** ERROR: Expected to find two numbers in the line 'None'.
Check to be sure your lines match up with the expected output!!! ***
Correct output:
Current Hand: a a c b t
"acta" earned 24 points. Total: 24 points

Current Hand: b
Total score: 24 points.
None
It's returning the correct word and the correct points.
@Ernesto have your function return the value that should be printed (and don't have it print it, itself), or call it outside of a `print` statement like:

print 'Current Hand:',
displayHand()
def compChooseWord(hand, wordList, n):
"""
Given a hand and a wordList, find the word that gives
the maximum value score, and return it.

This word should be calculated by considering all the words
in the wordList.

If no words in the wordList can be made from the hand, return None.

hand: dictionary (string -> int)
wordList: list (string)
n: integer (HAND_SIZE; i.e., hand size required for additional points)

returns: string or None
"""
# BEGIN PSEUDOCODE <-- Remove this comment when you code this function; do your coding within the pseudocode (leaving those comments in-place!)
Please consider using a gist/pastebin if we're going to be posting large blocks of code that take up most of the room window :)
Copied the wrong thing, sorry
i'm a supporter of the KTWOTIC group (Kill The Wall Of Text In Chat)
16:28
It doesn't quite roll off the tongue though... sounds more like someone is coughing up a hairball or something
@thefourtheye stop answering questions - you're supposed to be at a wedding! :p
wow @jon... the second reality demo... reminds me when i was a kid learning assembly...
Here is my code to create the deck class in python. Please **critique**

class deck:
def __init__(self, numberofdecks):
if numberofdecks == 0:
numberofdecks = 1
self.decksize = numberofdecks
self.decks = []
for i in range(0,numberofdecks):
for symbol in ('C','H','S','D'):
for i in range(1,13):
self.decks.append(symbol + str(i))

def getdeck(self):
return self.decks

def shuffle(self):
random.shuffle(self.decks)
critique
That and crystal dreams were cool as far as I recall
@abhi could you put that in a gist/similar please
So we get some nice highlighting and indentation instead of directly in the room please?
there were a lot of amazing demos in the scene back there _
I think that SR demo is still impressive 20 years later
16:39
I seriously just want to scream and/or punch someone right now.
@ernesto you seem to have that feeling quite a bit
oh god... writing decimal machine assembly language
17:09
@JonClements do you want me to use pastebin?
Hello, Python!
Hello Code-Guru
does the pastebin link work?
Or is this better?

http://pastebin.com/YpVmYPxq
@abhi those work... thank you
So... what kind of critique were you after?
Thanks @JonClements
You're using Python 2.x ?
17:13
Yes. 2.6 I believe.
Okay... classes typically have a CapitalLetter notation to describe them... and should inherit from object, so the first change should be class Deck(object): instead of class deck:
Read up on PEP8 re: naming conventions... for inheriting from object, you just need to know it makes it a new style class... not an old style one... the difference isn't important right now so don't worry about it....
Python doesn't really use getters/setters... so getdeck() is a bit ugh... but we'll ignore that for the second
You don't need to loop to create multiple decks...
Once you've created a deck... you can just copy it
I'm not sure about if someone passes 0, it assumes they meant one...
And time to eat.... bbl
Thanks @JonClements
17:45
with zero decks, the game wouldn't start.
also should deal be a method in the Deck class?
18:27
rhubarb guys
@PaoloCasciello rhubarb!
19:06
python 3 sucks
19:32
I like python 3
 
1 hour later…
Dan
Dan
20:36
cabbage
20:55
like input() always returns a string now rather than numbers if I need it to
disregard that im dumb
 
1 hour later…
22:23
Cabbage!
Today is my four year anniversary on StackOverflow!
Congrats! Also, cabbage :)
Thanks ^^ Although, it’s somewhat depressing when I think about how much time I spent on it already ^^ I tend to do that a lot with some things…
22:40
I’m bored :(
Go pet some bunnies?
I don’t have one anymore :(
22:59
cbg all
Awww! bad mood bunnies :)
Hey Jon :)
Congrats on 4 years.... @poke
now get a life!? :p
How ya doing this evening anyway?
hi @badgergirl that's a cat... :)
I’m considering becoming a professional bunny adorer…
I was at the cinema, watching the new Hunger Games movie
Ahh... still haven't got around to the first one yet
Did you read the books?
23:08
Nope - can't say I have
@JonClements pancakeception.
Well both the books and the movies are really good
I started re-reading some David Gemmel recently... don't read anywhere near as much as I use to
(Of course you can’t compare them, and I learned to not do that ever and just tell anybody complaining about a movie not being as good as the book to shut up and just see the movie as a separate thing)
cookies.
So, what is everyone doing?
23:14
I'm looking at some page designs for sopython.com
hmm
Well, keep the wiki for a bit... but migrate into a custom site... I've got the data gathering and classification stuff going, and want to make something that's easier to add questions/answers to (just by number or importing) instead of editing markdown so....
Was looking at: html5up.net/prologue - but categories and stuff would go on the left...
Umm... mind you - that's all one page layout - I'm starting to suspect that most of them on that page are
Yeah, seems to be some portfolio-like thing, not meant for much content.
Maybe more a twitter style thing
Maybe just build a simple thing from scratch
23:22
Yup... I just don't do design... hence trying to find a template
Well, no need to do much design.. just something functional and not-ugly
Peter did us a nice design... SO colours, with Python esque logo:
Jun 6 at 15:07, by Peter Varo
user image
So that was the colour scheme I was going to try to work with
Did he do other stuff too? Or just the logo?
Just the logo... at the time we wasn't busy, I kept getting distracted, and now he's busy so...
I thought that with some of the icons from that template
I might quickly come up with some basic thing
23:26
was thinking of nicking the "no sidebar" for the categories of Q&As
The the one from "dropdown" for stats
@JonClements Doesn’t show up for me
Hmm, works in Chrome. So it fails the browser compatibility test. Next.
LOL
Just the icons
But I think it’s more the thing around, responsible for loading the design, that’s messed up..
I’m not a fan of icons because you will need to make icons.
And I’m bad at making icons.
Not if I can find 3/4 and nick 'em :)
Nicking from Gnome/KDE icon sets would probably work
Just need 'em for chat, categories, home, stats and info
and a notepady kinda thing for wiki
Tell me about the layout you have in mind.
23:32
Errr..... well... I'd only got so far as the logo at the top with 5/6 icons and text next to win as a 100% width whatever height at the top
then probably 90% of the page as actual content
Hang on scrap that - one sec
There needs to be a much nicer way of presenting this: sopython.com/CommonQuestions
So essentially, “type of question” - “list of related questions on SO”?
And all that possibly grouped into categories
Yeah....
That's basically meant to be a much more usable version of stackoverflow.com/questions/tagged/…
00:00 - 11:0011:00 - 00:00

« first day (1132 days earlier)      last day (4039 days later) »