« first day (1565 days earlier)      last day (3383 days later) » 

8:06 PM
I reduced the example and still get errors, can anyone reproduce?
 
No can do, sorry. ImportError: No module named 'pymongo'
 
-.-
 
user2555451
@Kevin - Yea, that makes more sense to have the words change. But you might want to have cycle call itself so that it cycles through the list indefinitely.
 
xbg
cbg, even
(xbg is even more X-TREEM)
 
user2555451
We can save xbg for Xmas.
 
8:09 PM
re-cbg
 
@iCodez yeah, that might be the OP's intended behavior... I'll write something up
@vaultah Ok, I installed it. pymongo.errors.ConnectionFailure: [WinError 10061] No connection could be made because the target machine actively refused it
(on line 4)
 
@Kevin which question is this? I am using MongoDB right now
 
@Kevin Thanks for the help anyway, writing a question for SO now
 
8:15 PM
Code dump with no clear question. I can see the errors, but the OP should just state what the errors are.
 
zip(*[iter(my_list)]*3) man I love that formula
 
Ah, the old list... grouper... thing.
Oh, the wacky behavior of multiple references to the same iterator.
("It's not wacky, it's perfectly logical". Yeah, yeah)
 
I just used grouper as an answer yesterday!
 
I'm surprised that the docs condone this kind of thing. It feels like you're getting away with something when you use it.
 
@davidism <300 rep! Push it to the limit! 80s montage time!
 
8:23 PM
Yep, almost there. Don't start the montage just yet though.
@MartijnPieters is there a dupe target for "serving html5 video with Flask dev server"? stackoverflow.com/questions/28201423/…
I'm sure I've seen similar questions before, and the answer is "don't use the dev server in single-threaded mode".
 
Can I be Rocky to your Apollo Creed? I'm at 9.1k -- the natural underdog. We'll battle for 10k, you'll win, but the important lesson we learned was friendship.
 
Confession: I've never watched Rocky
 
What does this make me? The guy who raced ahead? The Russian dude on steroids?
 
good luck with that .... then you have to explain about apache and mod-wsgi and .httpconf
 
I only watched one of the Rocky films. It had a birthday robot.
 
8:28 PM
speaking of 80's robots
looks amazing
 
@vaultah did you do show dbs on your mongo command line?
 
I've never seen Rocky either, but I've watched the 80s montage video enough times for it to count.
 
DSM
@AdamSmith: one of my all-time favourite sopython quotes is from davidism: "We have all eaten from the cabbage of friendship."
 
@JoranBeasley Love that 80's shiny metal font
 
Hello room, finally have enough rep to say that:)
 
8:32 PM
cabbage @Death_Dealer
 
cbg
 
:P
i havnt been able to figure out how to change that photoXD
 
@corvid No, why? I just did and it outputs "admin (empty) local 0.078GB", but I thought it's okay as long as databases are lazily created
 
hm, I'm never done it that way myself. I usually create a db then connect to it. Though it is a pretty tedious task with Node.js at least
 
@davidism Sorry, no idea.
 
8:36 PM
@Death_Dealer There is a "change picture" button under one's avatar in the "edit" tab of your profile.
 
Haven't done any such questions, certainly
 
thanks^_^ @Kevin
 
Hmm, oh well
 
@davidism why would you call me a cabbage?
 
8:41 PM
We're all cabbages here
 
Such is the way of our people.
 
Ah i see:)Melon for telling me^_^
 
on docky for linux, is it possible to pin an arbitrary program from the command line or something? I can't seem to pin Synapse
 
Funny, we usually get a lot of questions like "why doesn't x = x.sort() do what I want?", but this one is the opposite.
 
8:47 PM
x = x.sort() or x
 
Is there any community consensus on whether you should answer a question if someone else already gave the answer in a comment?
 
I usually comment on their comment they should post this as the answer
 
This came up yesterday, when I was browsing questions that were ~6 hours old. I found one with a comment-answer, and clearly the commenter had time to write up a full post, but he never did. Would it be wrong of me to snatch that opportunity?
 
@Kevin yes I think it's fine, especially if someone just gives a generic "Use X" and you then give working codes.
 
user2555451
stackoverflow.com/q/28202097/2555451 - Funny how the OP had the answer in the title.
 
8:49 PM
@Kevin I don't think I've read anything on meta, but in the past I've answered. If I didn't add ANYTHING then I'll mark it as a community wiki
 
Community wiki? But... But... points :-(
 
Hello guys I am trying to increase the precision of text classification with a BernoulliRBM and logistic regression this is the code: pastebin.com/SBXrz0Y3 and this is the traceback: pastebin.com/d82LiT7P could anybody help me with this task?.
 
I guess in this case, it's @vaultah that has first dibs on writing an answer.
OP has even confirmed that it fixed his problem, so there's no better opportunity :-)
 
In fact I am not sure if this is possible.
 
Hmm, I don't have any experience with sklearn, I'm afraid
 
user2555451
8:53 PM
@MartijnPieters - 80 points for saying to call a method?! Conspiracy I say! :P
 
@room-owners anyone want to write a crazy userscript? trello.com/c/ZcKflPlu/34-room-owner-tools-userscript
 
DSM
This is why it's hard to take points too seriously; the upvotes aren't a function of the effort required. (My highest-voted answer is nothing more than numpoints=1.)
 
@davidism "Card not Found"
 
@corvid anyway, were you able to reproduce it?
 
@corvid yeah, you're not a room owner
 
8:57 PM
@vaultah nah. not quite
awh :( I want to laugh at me
 
Pretty sure it's just healthy to laugh at yourself every now and then.
 
23 views, no votes, no comments, no answers. Getting ready for mean comments and a storm of downvotes ;(
 
user2555451
Hey, this might be good. You could get Tumbleweed!
 
user2555451
(that is actually hard to do these days)
 
@davidism I feel like one of us already wrote a message templates script. I remember them saying it was handy for making tricky emoticons, ex. the look of disapproval.
Can't remember who it was. Tristan maybe?
 
9:01 PM
well, we at least need a list of what already exists then
 
Ah, I think it was rlemon.
Apr 24 '14 at 14:55, by rlemon
https://gist.github.com/rlemon/11198858 this is a userscript to add tab complete 'snippets' to the chat input.
 
DSM
@vaultah: no tumbleweed for you, more's the pity..
 
Additionally, I myself wrote a script that disables the avatars of users with less than 20 rep. This was back when he-who-must-not-be-named was signing up a new account every fifteen minutes, uploading an offensive avatar, and idling in the room.
 
hey rlemon, that guy is awesome at JavaScript
 
Although that just subs in the "anonymous" avatar, rather than drawing an X on top of the existing one.
 
9:15 PM
If anyone is interested, the problem I've faced was a bug in PyMongo which will be fixed in PyMongo 3.0
@DSM :-)
 
why is a tag :-|
 
DSM
Blek.
 
re-re-cbg
 
DSM
Even more cabbage for you.
It's pretty, in a way.
 
I spent entirely more time than I ought to on my lunch turning my answer for a bad question into a one-liner for no good reason than "Just how ugly would this be?" The answer is: very
"\n".join(["\n".join([", ".join(["{}:{}".format(k,v) for k,v in value.items()])]+[str(v) for v in value.values()]) if isinstance(value, dict) else value for tup in example_dict for dct in tup for value in dct.values()])
 
DSM
9:28 PM
What's that monstrosity supposed to do?
 
turn this:
example_dict = [({'Progrm':'Python'},
                 {'Rohit':{'age':24,'pincode':400000}},
                 {'Rahul':{'age':22,'pincode':500000}})]
to this:
Python
age:24, pincode : 400000
24
400000
age:22, pincode : 500000
22
500000
 
buh... I think I am doing something wrong. should git fetch origin get all remote branches and clone them locally so you can do git checkout myBranch?
 
DSM
Isn't it weird to not show the names?
 
@DSM isn't it weird that he has a tuple of one-element dicts inside a one-element list? There's no accounting for the specifications of strangers.
 
DSM
Touché.
 
9:40 PM
is it possible to get a files bytes size with a relative path? it keeps writing the paths length instead of the file im trying to direct it to.
 
9:51 PM
@Death_Dealer how are you trying to do it?
@Death_dealer this should work:
os.stat('relative/path.txt').st_size
 
DSM
I like os.path.getsize, but that should work too.
 
I had no idea that was a thing -- thanks DSM :)
Oh yeah in fact it's just an alias
def getsize(filename):
    """Return the size of a file, reported by os.stat()."""
    return os.stat(filename).st_size
 
DSM
I think most of the path.get* stuff is just to avoid having to type .st_. :-)
 
infoPack = (r'\Pack.pack\info.pack-\Info.pack')

infoPack_write = infoPack.encode('utf-8')
infoPack_len = len(infoPack_write)

struct.pack( 'i', infoPack_len)
infoPack_len_bytes = (struct.pack( '>i', infoPack_len))

with open(pack, 'ab') as header_2_:
header_2_.write(infoPack_len_bytes)
this is a snippet of code im using.
 
@Death_Dealer infoPack is just a bytes object. It's not referring to the file at all
 
9:57 PM
ah def getsize, thank you sorry i didnt see that before i posted code.
sorry that not all the code: / my bad
 
Has anyone here used OpenShift?
 
@AdamSmith oh it is just a byte object..XD i thought the relative path was directing it to the file.
 
DSM
What do you mean by "relative path"?
 
I'd just like to say that sqlite has completely ruined what would have otherwise been a wonderful day of Python.
 
infoPack = ( r<--'\Pack.pack\info.pack-\Info.pack') this
 
DSM
10:02 PM
If it makes you feel any better, my last evening was ruined by postgresql..
 
im a noob so ya^_^
 
DSM
@Death_Dealer: that's what I thought you might mean. :-) That r doesn't mean "relative", it means "raw". In other words, interpret r"\t" as two characters, \ and t, not as the tab character.
 
@Jefe why? sqlite is about as easy of a database to work with as any
 
Ooh nice catch @DSM
 
ooh, i didnt know that.
 
10:03 PM
and by far the easiest to setup and configure (basically do nothing)
 
@JoranBeasley I know, the problem is me. I
 
then how would i deffine a file as a variable? with no r?
 
@Death_Dealer open("path/to/file") is a file handler
but remember to close the file handler afterwards
 
DSM
But note that many functions accept a filename (which is a string) and not a file object itself.
 
what do you mean define a file as a variable .... forget the r ...
 
10:06 PM
ah ok thanks for answering such a simple question. one more noobish question why is it good to close the file afterwards? ive noticed the file will still write and is usable.
 
thats clearly just confusing the issue
 
@JoranBeasley I've written a lot of code that uses table names as the target of parameter substitution, which is apparently not something that can actually be done.
 
@Death_Dealer closing the file will flush the buffer, among other things.
run this, then check the file
f = open(r"C:\foo.txt", 'w')
f.write("Here's some text")
then call f.close() and check the file again
 
@Jefe oh yeah... ive done that before too ... not sure why you cannot do that
fieldnames have the same problem afaik are the
 
The canonical way to handle files (whenever possible) is to use a context manager. Something like:
with open("path/to/file", 'w') as f:
    f.write("Here's some text")
# when you exit the block, the file object will close
 
10:10 PM
@Adam Smith oh ok good to know, thanks for the info and the help guys:)
 
@JoranBeasley Any thoughts on a workaround for dynamic table name calls? I'm writing methods in a superclass and each subclass will have a differently named table, so this seems like the most reasonable approach.
 
"SELECT * FROM %s where A=?,B=?"%(self.__tablename__),a1,b1)" is how I would do it ... or better yet use an ORM (sometimes its overkill... but ORM's make life much easier once you get used to them)
I think i actually quote the table name with square brackets "... FROM [%s] ..."%(...)
 
Hello guys I am trying to increase the precision of text classification with a BernoulliRBM and logistic regression this is the code: pastebin.com/SBXrz0Y3 and this is the traceback: pastebin.com/d82LiT7P could anybody help me with this task?.
 
those pastes show up as removed to me ...
 
10:27 PM
Oww
Sorrry... hold on joran
 
@JoranBeasley Thanks! The string formatting works, but unfortunately it doesn't seem to play nice with "SELECT EXISTS(SELECT..." Instead of returning 0 if the table doesn't exist it throws an error from the inner reference to the table, and errors can always be handled.
 
Hello guys I am trying to increase the precision of text classification with a BernoulliRBM and logistic regression this is the code: pastebin.com/jyrj82gC and this is the traceback: pastebin.com/mULr2yCX could anybody help me with this task?.@JoranBeasley
 
@ml_guy please don't spam the room, and don't ping someone who hasn't been tlaking to you directly.
 
sorry
 
@ml_guy Write a question and someone will take a look. If you haven't gotten any attention on your question in the first 3 days or so, feel free to post it again here for further attention
 
10:37 PM
sorry guys.. delete my comment here please.
 
@ml_guy no worries from me ... sorry I would help if I could ... but im pretty rusty on my learning algorithms ... your code looks short enough you could probably get an answer in a normal SO question though
 
Thanks guys ;) no problem joran
 
oops yeah you did, and I just robovoted. Some Rocky/Apollo we turned out to be!
 
no there's another one
 
hmmm I could have sworn there was a different canonical
 
11:00 PM
if you find it, add it to the list! I added you to the editor group
 
11:16 PM
@davidism thanks!
 
11:26 PM
open('TexturePack.pack-/info.pck-/Info.pck', 'rb') as f:
print len(f)
am i doing something wrong here?
 
@Death_Dealer other than indentation? :) Yes, a file handler doesn't have a length
also you need to use the context manager, e.g. with open('path', 'rb') as f:
not just open
 
dam, im so bad at this. sorryXD
 
If you just need the size in bytes, use os.path.getsize('path/to/file')
if you need to operate on the bytes, you could do f.read() to pull them from the file, then get the length of that object
 
well i need to get the byte size then write it to the file.
 
I think that works
 
11:29 PM
i will try it out.
 
but strings vs. bytes are still really fuzzy to me
I just decode every bytes object I see and pretend there's no difference :)
 
lol niceXD
 
If you write the size of the file to the file, the file size will increase.
 
no im writing the size of the file to another file, and then writting the file inside of the other.
 
so a.contents -> b; a.size -> c?
 
11:35 PM
no, b.size-> a; b.content -> a
 
ah ok
 
yes im decrypting an unknown file type^_^
 
In the star list on the right: what's the difference between the filled stars and the outlined stars?
 
is os.path.getsize supposed to automatically print the size?
 
@AdamSmith WRT context managers, need is perhaps stronger language than you should use :P
 
11:47 PM
i used it,got no error. but it also didnt do anything else. am i supposed to call print on something?
 
@AdamSmith disregard that earlier comment ... I didnt see that he already was sort of doing the context manager ... but didnt have the with
@De
@Death_Dealer data = f.read(); print len(data),"\n"+data
 
what is the "\n"?
 
bah... stupid OAuth flow...
 
adam recommended i use os.path.getsize(). i used it but it did not print anything.
 

« first day (1565 days earlier)      last day (3383 days later) »