Open Side Menu Go to the Top

02-01-2013 , 01:51 AM
Quote:
Originally Posted by tyler_cracker
i realize you're trying to simplify to make the example digestible, but i don't understand why you would ever want to do this. a traditional getter/setter layout would be much easier to understand.
I don't quite understand what you mean, but I'll give a bit more context.

The "external API" is really a bunch of shell scripts maintained by someone else. I have another dict with the name of each shell script and the args that the shell script requires. It looks something like this:

Code:
OPS = { 'api_operation1': {'script_name': 'script1.sh',
                           'args': ('url','param1') }
     }
I fill in the exact script call by calling the "value function" for each arg in the 'args' list.

Basically I just wanted to keep all the info about the script calls in one place. We are pretty frequently requesting new scripts / changes to the existing scripts from the other team, so I wanted it to be easy to change the script calls quickly.

Quote:
don't do this. use functools.partial.
Do you have a reason? I think there is better introspection with functools.partial but I don't see a problem with using lambda for simple cases.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
02-01-2013 , 03:50 AM
i don't see why the thing in your example needs to be anything other than a static dict, but i doubt it matters. i'm going to understand what you're doing a lot faster with an @property than with a lambda tossed into a dict or whatever. strictly speaking i guess it's more typing to do it my way.

http://stackoverflow.com/questions/3...tial-necessary
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 05:09 AM
Quote:
Originally Posted by tyler_cracker
i don't see why the thing in your example needs to be anything other than a static dict, but i doubt it matters. i'm going to understand what you're doing a lot faster with an @property than with a lambda tossed into a dict or whatever. strictly speaking i guess it's more typing to do it my way.
So I think you're saying to do something like this:

Code:
class ApiObj(object):
  @property
  def url(self):
    # get_url code here
    return blah.url

  @property
  def arg1(self):
    return 55

  def operation1(self):
    return ['script1.sh', self.url, self.arg1]
is that correct? I guess I just don't usually think to write classes.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 05:13 AM
yes.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 07:09 AM
SmartOS has entered the list of candidates I concider. KVM for SmartOS is only supported on Intel but has some experimental AMD code that supposedly runs well. I always liked Solaris conceptually but got to use it maybe 1h in total so that's a plus.

As far as what I want to do with it...it's just a desktop system basically all I want to do is run a Linux and a Windows which VirtualBox could handle fine. But I also want to experiment with new stuff when I have a chance to do so that's why I'd prefer a KVM (or SmartOS) setup. It's just more interesting. I know my setup of Linux+VirtualBox for Windows and other OS if needed will work just fine.

Well I guess it can't hurt to ask, anyone here on a setup that uses a Linux as a mere shell and does all the work in a VirtualBox guest? I can certainly see a benefit of having your main desktop be a VM instead of a standard on the box installed Linux but at the same time the setup of install Linux+install Linux VM and only work in the VM seems a bit much.

I'd certainly like to build some general knowledge in virtualization. I'd kind of like to know how you'd set up a fully virtualized inhouse environment for a small or medium business. Kind of hard to practice that stuff unless you want to buy the infrastructure for kicks. If anyone knows a way to learn more about this lmk

Last edited by clowntable; 02-01-2013 at 07:15 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 02:18 PM
your plan is reasonable for those goals. those goals just weren't evident in your original question.

for learning how to set up v12n in a SMB, i'd start with at least two physical machines. learn how to automate image creation, use that automation to create a few classes of VMs (frontend tier, persistence tier, middleware tier), deploy those VMs amongst your physical cluster, play with replication and failover, learn how to snapshot and recover from backups, all while keeping the site up.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 05:27 PM
Been away for a bit. Did I miss anything big?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 05:44 PM
I do all of my development inside of a linux guest, full screen. I like it because I have all of the windows (or mac) software at my disposal without any issues. Also booting into a different VM is super easy and doesn't screw too much with your flow.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 06:05 PM
Quote:
Originally Posted by Shoe Lace
I do all of my development inside of a linux guest, full screen. I like it because I have all of the windows (or mac) software at my disposal without any issues. Also booting into a different VM is super easy and doesn't screw too much with your flow.
And you can install/mess with anything you want inside a VM without danger to your host operating system.

Sent from my Galaxy Nexus using 2+2 Forums
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 06:07 PM
Yeah, I really like that aspect. Honestly even if I had linux as my host OS I would still use a linux VM inside of it. The only problem they need to solve is better multi-monitor support because being limited to 1 monitor in a VM is kind of crippled.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 06:18 PM
So I want to set up a Linux VM to set up a webserver and do some python/django dev. Is there an advantage to using Ubuntu Server instead of Ubuntu desktop? With desktop, I can do what Shoe Lace is saying and just work completely within the VM. Server is command line only.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 06:38 PM
I did the headless linux VM too and just used putty to ssh into it. That's fine until you want to use an editor that's not vim, emacs or c9 ide. There's no real benefit other than learning how to setup putty and get used to using only a terminal. You might want to ssh into your real web server at some point.

I think that's not a real argument for using server only though. Once you know the linux basics and get a little comfy with it you'll be using the desktop terminal in linux all the time. The only time I ever use a graphical window is for my editor and also I have a few linux browsers installed just to test sites on.

The guest tools let you share files locally in real time so you could use your editor in windows but then you lose out on key features because your editor is not installed in the same OS as your libs.

That is when I just said whatever and installed a linux desktop in a VM.

Even with 2gb of ram it's fine to run the desktop version, but I use lubuntu which is just a more light weight version of ubuntu.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 07:02 PM
I'm running Arch Linux x86 on 1g Ram w/ 75g of hard drive and Virtual Box. If you never used Linux before, I would definitely suggest installing a desktop. The file systems are actually very simple, but I didn't know that until I saw the graphical representation of it. At some point, you'll probably have to build from a tarball, and it is helpful to understand what's going on before you do that. The graphics on my desktop are sort of meh, but I'm running LXDE. I've been thinking of running Enlightenment, which apparently is a robust desktop that is still lightweight. Just figured it's not that important, really.

Oh, and make sure you have guest additions as well, so you can share files between your home OS and the VM OS.

Shoe, weren't you able to install vim / emacs / whatever via the package manager in the command line and use it like nano?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 07:30 PM
I only give the vm 512mb, my entire system only has 2gb total. You could get by with less too, I ran 256mb for a while until I had some adventures with Scala. The JVM laughed in my face with 256mb.

What do you mean by using it like nano, just being able to run it from any directory? Sure. You just need to make sure where ever you installed it to is on your system path. lubuntu and unbuntu both use the same package manager AFAIK. I don't use it much tbh, most of the packages I deal with are out of date with the package manager.

Arch's stuff is usually really up to date so I guess you don't run into that problem much? I would say 99% of the time I install stuff from source or maybe download the binary in some cases on my development machine.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 07:36 PM
Yeah, Arch is extremely picky about keeping their stuff up to date and they frown on things that have multiple choices. I had to install leiningen and heroku via tarball because it isn't in the standard packaging system. I use the AUR, but it's not the same.

I've never had to "path" my programs though, which is nice.

How you liking Scala?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 08:31 PM
I haven't touched it in a few months. I didn't see a benefit of using it and it seemed to be really noisy.

I've been using Go recently to get my fix for a statically typed language that is well geared for web development. I seem to always fall back into using Node though, I guess it's mainly because the library support is just so much better than Go at the moment.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-01-2013 , 10:48 PM
splashpot,

there is no reason to run the server flavor for your use case.

wooster,

you missed that we are tarring and feathering people who haven't figured out how to turn this off yet:

Quote:
Sent from my Galaxy Nexus using 2+2 Forums
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 12:31 AM
As part of converting our monster site to responsive design, in our web layer we're looking at swapping out JSP's for node.js/dust.je/stylus. Anyone have any experience with this on large-scale sites?

To me one of the biggest advantages, theoretically, would be that we can run dust.js templates on the server side or the client side. So for search engine crawlers we could run on the server side and return straight HTML. For most other devices, we could send JSON back to the browser and run the template there. I have yet to prove that this would work though.

Also we're looking at using Zepto instead of jQuery for the framework. Anyone have any thoughts on this?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 01:17 AM
Quote:

wooster,

you missed that we are tarring and feathering people who haven't figured out how to turn this off yet:
Hanging my head in shame
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 01:51 AM
suzzer,

JSPs! that takes me back to 2004.

fortunately, the industry has come to its senses since then and gotten rid of crazy template-based solutions that invite co-mingling of buisness logic with the presentation laye-- what's that? wait, are you sure? oh.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 01:52 AM
wooster,

in your defense, it was a terrible default and the author of it should be run out of town on ruby-on-rails.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 01:53 AM
lastly, has this already been posted here?

http://www.coboloncogs.org/INDEX.HTM
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 03:09 AM
Quote:
Originally Posted by tyler_cracker
wooster,

in your defense, it was a terrible default and the author of it should be run out of town on ruby-on-rails.
Ye. Just moved from iOS to Android so still getting used to a few things. Android 2p2 app is tons better than the iOS one.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 06:26 AM
Quote:
Originally Posted by splashpot
So I want to set up a Linux VM to set up a webserver and do some python/django dev. Is there an advantage to using Ubuntu Server instead of Ubuntu desktop? With desktop, I can do what Shoe Lace is saying and just work completely within the VM. Server is command line only.
Dunno what you want to do exactly but it might be easiest to use this:
http://gettingstartedwithdjango.com/...on-and-launch/

And just work off it

He explains a fairly typical process of setting up the environment in the video (virtualbox,vagrant,chef,virtualenv). Well I guess the typical way is just hacking away on your desktop :P

In my research about virtualization I stumbled about buzzwordmania. DevOps seems to be the thing to namedrop. I'll try it on our admin on Monday

Last edited by clowntable; 02-02-2013 at 06:33 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-02-2013 , 03:03 PM
Quote:
Originally Posted by tyler_cracker
suzzer,

JSPs! that takes me back to 2004.

fortunately, the industry has come to its senses since then and gotten rid of crazy template-based solutions that invite co-mingling of buisness logic with the presentation laye-- what's that? wait, are you sure? oh.
Nobody's co-mingling business logic with the presentation layer. Node.js is pretty new. I'm just curious if people have experience with it in a large-scale setting.

Also pretty much every presentation layer technology that I've ever seen is a template that acts on some kind of value object. What exactly are you talking about?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m