« first day (280 days earlier)      last day (4699 days later) » 

3:00 PM
Esp: "Use new when you need to control the creation of a new instance. Use init when you need to control initialization of a new instance."
 
@Lekensteyn yeah that's the Borg pattern I was talking about
sorry, the Factory pattern I mean
 
Borg from Star Trek?
 
BORG?!?
WHERE??? brings out a phaser rifle
 
a borg object assimilates all other objects by replacing their state with a shared object
but it can leave some of the individual state in place
crazy computer science nerds...
 
Oli
@TheEvilPhoenix Haven't you learnt anything? They adapt too fast to phaser frequencies!
 
3:04 PM
:P
@Oli except this isnt a normal phaser rifle ;P
its a phased plasma beam :P
imagine extremely superheated warp plasma leaking everywhere :P
except in a directed beam
 
Oli
Oh suddenly everybody thinks they're better than Geordi La Forge.
 
Seven of Nine from Voyager could build a better anti-borg weapon than Geordi!
</NERD DISPUTE!>
 
I just deployed wordpress in amazon in like 2 minutes
 
Oli
Urgh. Voyager.
 
@Oli lol
@Oli lets remember i've watched most of TNG, seen all the TNG era movies, seen most of DS9, and about 85% of Voyager :P
 
3:06 PM
@StefanoPalazzo hmm, I can't decide. I've read that using decorators has effects like the docstrings becoming invisible. Is that @cache method still the best (cleanest) way to accomplish my task?
 
<--- Star Trek nerd
 
@Lekensteyn decorate your wrapped function with functools.wraps(original_function) to preserve all of this
def decorator(function):
    @functools.wraps(function)
    def wrapped(*args, **kwargs):
        ...
 
Oli
@TheEvilPhoenix You're saying that in a Linux chat room. No, I'm sure you're the only one :)
 
@Oli :P
@Oli go over to the Windows chatrooms, they're all Star Wars nerds
 
now the docstring and everything is still there, and the original function is stowed away in decorated_function.__wrapped__
 
3:11 PM
@RolandTaylor Rock that skype question, the other answers are :(
 
Is it considered better practise to create a generic decorator (@cache), or am I allowed to create a decorator, specifically designed for a single case (@GetBackend)?
 
@Lekensteyn that's much better. If you name your decorator "cache", it should be totally universal and work for all functions with hashable arguments
if it doesn't, name it something specific
 
@JorgeCastro roger that
@StefanoPalazzo to your earlier question that might be wordpress tracking because of jetpack
 
I didn't specifically enable anything else
 
3:14 PM
@RolandTaylor ohai
I meant to tell you @roland, 2buntu is being very cpu intensive on my system
just like omg! and engadget, somehow it manages to stall the browser for a few tenths
 
@StefanoPalazzo oh? is it the javascript overkill?
 
Probably because it's wordpress
 
Btw which browser are you using?
 
chrome 12+𝛆
 
hmm, I don't get any problems with chrome 13
@TheEvilPhoenix I see what you did there :P
 
3:17 PM
I'll check chrome 14
 
@RolandTaylor :P
 
these silly version numbers
 
wait, I have 14 too my bad
 
nope, in 14 it's just as bad
I always suspected it's because I only have one core
that would explain why the people at [big wordpress powered site] are oblivious to the problem
 
ohhhhhhhhhhh
I have 2 cores :P
I don't feel a thing
 
3:20 PM
I'm not worthy
3
 
burn the heathen
 
@Stefano desktop?
 
laptop/netbook/other-inferior-device?
 
my desktop computer is the thing that happens when I plug the vga cable into my laptop
if it ever dies, you'll be the first to notice :O
 
3:21 PM
:P
if you had said desktop i'd have sent you the motherboard and processor and ram for this old system i have
dual core athlon x64
i'm replacing it with a six-core processor (or an i7, havent decided yet)
 
I've got an old Athlon with 1800 megahertz and a broken power supply :P
 
lol
i'll send you the old psu too :p
 
but it's a weird case, so I can't buy one off the shelf :\
 
@JorgeCastro check it out :D:
 
an old 250w psu xD
 
3:23 PM
(not that I would do, come to think about it)
 
1
A: How to use Skype?

Roland TaylorIf you enable (this link tells you how) the partner repository within your software sources (and reload the list). Now you should be able to install Skype in 11.04 from the Software Centre. Screenshot, it happened.

 
@RolandTaylor I thought you didn't need to do that
but I can't test it now
 
@StefanoPalazzo your @cache and @functools.wraps examples were using functions, does it also apply to class instances? If not, should i use @staticmethod for gathering instances?
 
you can also have class decorators :)
they are a-weird
this is a very nice practical example:
12
A: Decorators applied to class definition with Python

Alex MartelliIt replaces the vast majority of classic good uses for custom metaclasses in a much simpler way. Think about it this way: nothing that's directly in the class body can refer to the class object, because the class object doesn't exist until well after the body's done running (it's the metaclass's...

 
yeah!
 
3:27 PM
\o/
 
@Lekensteyn you'd use @staticmethodand @classmethod a bit like you do in java
like this:
    class Thing (object):

        def __init__(self):
            print "I initialised, but I still need bacon!"

        def do_something(self, bacon):
            self.bacon = bacon

        @classmethod
        def new_from_bacon(self, bacon):
            self = Thing()
            self.bacon = self.frobnicate(bacon)
            return self

        @staticmethod
        def frobnicate(bacon):
            return bacon[::-1]

    a = Thing.new_from_bacon("bacon")
    print(a.bacon)
you can use classmethods to provide alternative initialisation functions
or you can use a smart __new__ method instead
 
How do I get started with Ensemble? http://bit.ly/rnCTIu #cloud
2
 
notice staticmethods have no self, they are just functions belonging to a class, with no instance
is that even remotely what you're after?
 
Hi @StefanoPalazzo :)
 
@karthick87 hello
 
3:33 PM
Hello @TheEvilPhoenix :)
 
@karthick87 'ello \o
 
@StefanoPalazzo yeah, I've read that already. Thing.frobnicate is the same as Thing().frobnicate; without using decorators, I'd use Backend.get_backend_by_filename(filename); the downside of that is that multiple Backend instantiations cannot be prevented.
 
anyone want to see the status of the chess game of me vs. alvar?
 
@Lekensteyn yeah, that's where you'd use a factory object as a sort of parent
to keep track of the instances you've already created
 
3:36 PM
HOW TO VIEW:
1. Go here: http://www.apronus.com/chess/wbeditor.php
2. Put this text in the "Absorb FEN/PGN" box, then click the "Absorb" button:
1. e4 e5 2. Nf3 d6 3. Nc3 Bg4 4. Bb5 c6 5. Bc4 Bxf3 6. Qxf3 Qf6 7. Bxf7 Kxf7
8. Qd3 Nd7 9. O-O Nh6 10. Qc4 Ke8 11. d3 Ng4 12. h3 Qh4 13. Qe6 Be7 14. hxg4
THERE we go
 
@Lekensteyn I think i have a good idea, give me a second
 
EvilPhoenix is the white player, and Alvar is the black player
 
Many thanks for your help Stefano, I really appreciate it.
 
@RolandTaylor did my many edits explode your mind?
 
3:41 PM
@Lekensteyn check this out
class UniqueThingFactory (object):

    class UniqueThing (object):

        def __init__(self, _id, factory):
            self.factory = factory
            self.factory.ids[_id] = self
            self._id = _id

        def __del__(self):
            del self.factory.ids[self._id]

    ids = {}

    def get_new_unique_thing(self, _id):
        if _id in self.ids:
            raise ValueError("thing already exists")
        return self.UniqueThing(_id, self)


unique_thing_factory = UniqueThingFactory()
 
@TheEvilPhoenix lol no, the state of that game is messsssssed up :D
 
the UniqueThing objects there are aware of their factory and can talk to it
 
your queen is dead btw
 
@RolandTaylor :P
 
only they know when they're deleted, so they can let the factory know they don't exist anymore
 
3:42 PM
@Roland here's the diagram image when i import the PGN from my system: apronus.com/chess/…
yes, long link
 
it's a bit weird, because you're messing with the objects own reference in __del__, which you should normally avoid, but it's pretty nice in this case. You probably don't need to worry about __del__ at all I suppose?
 
@TheEvilPhoenix why is the top pink?
 
nfc
it doesnt show up as pink on here
perhaps your screen needs to be beaten with a hammer
 
@TheEvilPhoenix come let us play :) I am national level player :)
 
@karthick87 i only play email chess :P give me an email i'll send you the first move (2 match game, alternating white/black, EP starts as white)
granted i'm not a national level player :P
yawn
ohey, my lunch break is in 10 minutes...
oh good
 
3:47 PM
oh and by the way @Lekensteyn, you can name the member "self._factory" if you want to hide it from the help()
best not to expose implementation details to users of your library or module
 
Whoa, why have I never heard of Ensemble before?
 
ohi @MarcoCeppi didnt realize you were here :P
hows things
 
I know right
I just got assigned to it
it's basically the awesomest thing ever
@MarcoCeppi and the formulas are easy to write
 
Yes, yes it is. Gotta setup a server to try this out on
 
it's basically the same as whatever deployment scripts you've had lying around
you don't even need a server
 
3:48 PM
This is going to make my life mega easy
 
just your laptop and an amazon AWS account
 
@MarcoCeppi there are some posts on the Ubuntu Planet about it - you want links? (I have liferea open).
 
Sure
 
I thought downvotes were free now...
 
cloud.ubuntu.com
 
3:50 PM
It's getting pretty crowed in here \o/
 
@MarcoCeppi ^
 
must be the weather
 
...and now I'm losing rep. for them.
 
@GeorgeEdison For questions
 
oh that's better :D @JorgeCastro
 
3:50 PM
Ooooooh yeah :)
 
@MarcoCeppi lmk if you want to write some formulas for whatever you want to deploy
 
slaps forehead...
 
@GeorgeEdison awww
 
@JorgeCastro Thanks, going to try this out in a few hous
 
we've got a bunch
you know, for when you're like "oh I think I'll try hadoop for fun", heh
@MarcoCeppi and like , I've got people standing by answering on ensemble, so let em rip if you have questions
I just started messing with it today
 
Yesss this is going to rule
 
@Marco or @StefanoPalazzo can either of you take a look at this? Flagged as should be in meta: askubuntu.com/questions/52032/delete-my-account
 
@MarcoCeppi I just need to figure out persistance
like, if you do ensemble shutdown it all goes away
 
and with that, i'm headed off to lunch. will return later
 
@TheEvilPhoenix cya dude
 
3:55 PM
Cya I'm off too. And @StefanoPalazzo thanks a lot!
 
@Lekensteyn adios
 
cya guys!
@MarcoCeppi look at the video with the mediawiki example
basically, you can just mega scale with one command after you have it up
each subsequent add-unit basically just adds a horizontal node
it's brilliant
 
@Lekensteyn bye, you're quite welcome
 
:O I'm lovin' this
 
it's pretty impressive!
 
3:57 PM
who wants to write some formulas!
we've got some of the basics
 
@Jorge can I use this in the private cloud, or just AWS?
 
AWS for now, openstack and bare metal soon
 
awesome
 
it'll be something fierce when it'll just fire up openstack nodes
if you're doing bare metal it's just fire up orchestra and start provisioning hardware via cobbler
 
So glad I shifted from CentOS machines
 
3:59 PM
what kind of things do you deploy?
@MarcoCeppi this will be nice for prototyping
"Go find out if we would care about $some_new_thing"
spend like 5 bucks, deploy it, bang on it
 
Rails applications and shared servers for the most part
 
it painssss
 
but we're moving to decentralize services like mail and db so we'll be deploying those as well
 
the video on cloud.ubuntu.com is very impressive
 
question is , was the video made of FOSS software :D
 
4:03 PM
@MarcoCeppi right so check this out
right now the wordpress formula is basically "apt-get install wordpress", and then an install script
but formulas can do anything
 
@JorgeCastro When it says "connecting to environment" is that just straight AWS calls or is it contacting an ensamble server on AWS and proxying the commands through that?
 
so you could have "rails-nightly-snapshot"
ensemble on your machine is calling AWS
 
Gotchya
 
it's you and amazon, we don't have like anything inbetween
so like, what sucks about deploying rails on ubuntu is you have packages
 
For our rails stuff we use Capistrano but I hate it
 
4:05 PM
and gems
and all this crap
yeah, capistrano is more like a crappy puppet. :p
but when dealing with EC2 we do services and relationships
# of machines, not so much
so it's a higher level above configuration management
 
finds himself in a ununderstandable -cloud-related-disscussion
 
Right
 
no DSL for formulas either
so like the mediawiki one is in php, because mediawiki is
so basically whatever you want to write it in it will execute
 
That makes me so happy
 
@StefanoPalazzo can you use python to display chat on the terminal form this feed? chat.stackexchange.com/feeds/rooms/starred/201
 
4:09 PM
@Amithkk yes of course
 
if you are free can you show me how
is there something that python cannot do
 
Okay, got to run for now @JorgeCastro I'll be checking this out further this afternoon and asking a lot of questions on the site :)
 
for sure
it's new for me too
so we can learn together
 
Marco's phone : ringtone plays New Call from sara
 
3
Q: How to hide hard disk size in volume name?

karthick87How to hide hard disk size in volume name?I just want to show volume name alone.

 
4:15 PM
@Amithkk here you are:
import feedparser


d = feedparser.parse("http://chat.stackexchange.com/feeds/rooms/starred/201")

for i in d.entries:
    print i.author_detail.name
    print i.summary_detail.value
    print
 
thanks alot
 
I think you have to sudo apt-get install python-feedparser
yeah you're welcome. You know, next time have a look at Stack Overflow, there's tons of examples
and feedparser is very popular too
 
amith@amith-desktop:~$ sudo apt-get install python-feedparser
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-feedparser is already the newest version.
The following package was automatically installed and is no longer required:
libhal1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
^ no install required
 
Anyone know if OS X Server can run XCode and be used as a development environment?
 
@StefanoPalazzo any way to avoid &quot;
 
4:20 PM
hey guys, quick question. How do I save my alias that I create so they are present the next time I boot up?
 
19
Q: How to create a permanent "alias"?

ZangoIf you create an alias for example: alias cls="clear" It exists untill you kill terminall session. When you start a new terminal window the alias doesn't exist any more. How to create "permanent" alias, one that exists in every terminal session?

@Amithkk yeah there's htmlentitydefs - but notice there's more html in there
like <pre> and such
It's a frequently asked question ;)
 
interesting...I don't have a ~/.bash_aliases file....
 
@sadmicrowave that's right, just create it
(note: no sudo)
 
oh ok
and then tell my bashrc to use it? or will it do that automatically?
oh wait, nevermind, thats the 'uncommenting' part
 
right :)
You could also just put your aliases at the end of your .bashrc, but that's not recommended
 
4:25 PM
right, so what is the syntax to use in the .bash_aliases file when defining the alias?
the same as outputted from $ aliases
?
 
stefano@lenovo:~$ cat .bash_aliases
alias nano="nano -ET4"
this is what it looks like here, there's no special syntax - it's just a shell script
 
nice thanks
 
no problem :)
 
cool its already uncommented in 10.10
@StefanoPalazzo do I need to restart a service for the bashrc file to start reading from bash_aliases?
 
just the bash instance
they should be there when you open a new terminal window
 
4:30 PM
beautiful
much appreciated
 
you're quite welcome - awesome when stuff works :-)
 
i know
 
4:46 PM
0
Q: How secure is Ubuntu in Virtualbox on Windows host?

GTylerI have the most recent version of Ubuntu in Virtualbox on Windows 7 host. How secure will that be? I mean if I get malware on windows how will that affect the Ubuntu system I am working on? Thank you.

 
ewww WINDOWS BLASPHEMY!
2
by a BOT nonetheless
 

« first day (280 days earlier)      last day (4699 days later) »