As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

PA Programming Thread :: PAdev.net - Need hosting for a service of yours? Check it out.

15657596162100

Posts

  • Options
    InfidelInfidel Heretic Registered User regular
    templewulf wrote:
    Ah, gotcha. I'm just intermediate at Linux admin, so I'm not sure how that all works with multiple users.

    Are you running multiple apache daemons? Would I create a www root in my user folder and have you put a symlink somewhere else? Are you handling the site config files, or do we have access to a2ensite and the like?

    This is why I'm offering the service! :D

    As for Apache, it is one daemon that serves requests under your user context. You get username.padev.net setup for you automatically at /var/www/username.padev.net/ and you can get me to setup more complicated vhosts for you.
    Phyphor wrote:
    Can we get a svn client installed? I could probably get it for myself but it's probably simpler to grab a package

    Definitely, this is the kind of thing people should request, as opposed to just silently building and installing a client in your home directory.

    Because then everyone will do that and that's just dumb.

    Will install some more stuff when I get home.

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    I'm trying to get mercurial to work over ssh from aptana.

    I hate you certificates :)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    @Infidel

    Do you have certificate authentication on for ssh?

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    Weretaco wrote:
    @Infidel

    Do you have certificate authentication on for ssh?

    Yes of course, your private key is generated automatically and already setup to be used for identification. See ~/.ssh it is the usual deal.

    OrokosPA.png
  • Options
    InfidelInfidel Heretic Registered User regular
    svn installed, going to get userspace gems working properly next.

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Infidel wrote:
    Weretaco wrote:
    @Infidel

    Do you have certificate authentication on for ssh?

    Yes of course, your private key is generated automatically and already setup to be used for identification. See ~/.ssh it is the usual deal.

    For some reason putty is hating that key.
    Unable to use key file "C:\Users..." (SSH-1 private key)


    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Weretaco wrote:
    Infidel wrote:
    Weretaco wrote:
    @Infidel

    Do you have certificate authentication on for ssh?

    Yes of course, your private key is generated automatically and already setup to be used for identification. See ~/.ssh it is the usual deal.

    For some reason putty is hating that key.
    Unable to use key file "C:\Users..." (SSH-1 private key)


    I also tried adding a id_rsa generated one with cygwin to my authorized_keys but no go...

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Weretaco wrote:
    Weretaco wrote:
    Infidel wrote:
    Weretaco wrote:
    @Infidel

    Do you have certificate authentication on for ssh?

    Yes of course, your private key is generated automatically and already setup to be used for identification. See ~/.ssh it is the usual deal.

    For some reason putty is hating that key.
    Unable to use key file "C:\Users..." (SSH-1 private key)


    I also tried adding a id_rsa generated one with cygwin to my authorized_keys but no go...

    Did some converting an got it up now.

    I hate key formats ;)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Weretaco wrote:
    Infidel wrote:
    Weretaco wrote:
    @Infidel

    Do you have certificate authentication on for ssh?

    Yes of course, your private key is generated automatically and already setup to be used for identification. See ~/.ssh it is the usual deal.

    For some reason putty is hating that key.
    Unable to use key file "C:\Users..." (SSH-1 private key)


    You need to use puttygen to put it in a format it can use. I tried to do it but the server is refusing the key, not sure why

  • Options
    DekabalDekabal Registered User regular
    Admanb, I just wanted to thank you for your help. Because of you, the basic elements of my first game are almost done. I plan on adding other things and possible a graphical interface (nothing fancy, just pictures). Again, thank you so much :).

  • Options
    NightslyrNightslyr Registered User regular
    Infidel wrote:
    I'm used to Wordpress mainly.

    You poor man....

  • Options
    InfidelInfidel Heretic Registered User regular
    edited January 2012
    @weretaco

    Try this:
    cd ~
    rails new MyApp --skip-bundle
    cd MyApp
    bundle install --path vendor/bundle
    rails server
    

    What this does is allow you to specify where to install your gems for the application. Useful since version differences can screw others over, and you don't need any root access since you're not sharing.

    I'll update the howto if this gets you up and running finally. It's working for my dummy user.

    edit: Also just fyi, once you specify the --path on the initial setup there, you just use the bundle commands exactly as before. It caches the path, if you want to remove the path and go back to system default (you don't here but hey) you use bundle install --system.

    Infidel on
    OrokosPA.png
  • Options
    InfidelInfidel Heretic Registered User regular
    Just added this, give it a whirl as well:
    [2036][infidel@carbon:~]$ padev-newrails Apptastic
    Will create new Rails application in /home/infidel/rails/Apptastic
    and link to /var/www/infidel.padev.net/Apptastic
    URL: http://infidel.padev.net/Apptastic
    
    Continue?
    

    Pretty much does everything that was in the guide and my previous post. :P

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Ugh.. trying to setup git or mercurial from aptana is giving me a headache and a half.

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    Did you give the setup or script a try yet? Wanna know if that works for someone trying to run an actual app.

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    I'll do that now if you can also setup mercurial for me :)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    Weretaco wrote:
    I'll do that now if you can also setup mercurial for me :)

    A one-liner?

    Done. :)

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Infidel wrote:
    Weretaco wrote:
    I'll do that now if you can also setup mercurial for me :)

    A one-liner?

    Done. :)

    Awesome.. now to figure out why this guided rails app wont' work and I'll let you know how the script works.

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    So far mostly ok.. any chance you can update from ruby 1.8 to 1.9.3?

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    Weretaco wrote:
    So far mostly ok.. any chance you can update from ruby 1.8 to 1.9.3?

    Multi-user makes everything more exciting!

    I am in the process of getting RVM working so that people/projects can pick and choose ruby versions and such. Wish me luck!

    (by the end of this I'm going to be a Rails Hostmaster)

    OrokosPA.png
  • Options
    bowenbowen How you doin'? Registered User regular
    Seems you guys have been busy.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    bowen wrote:
    Seems you guys have been busy.

    I can't wait until @Infidel has a wife and kids and 60 hours a week so that I don't have to feel so lazy by comparison!

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    InfidelInfidel Heretic Registered User regular
    templewulf wrote:
    bowen wrote:
    Seems you guys have been busy.

    I can't wait until @Infidel has a wife and kids and 60 hours a week so that I don't have to feel so lazy by comparison!

    I release at another hospital next week and I'll be on-site, I am handling a few side projects, and I am in the middle of incorporation!

    Also, I'm trying to fit in some SWTOR.

    It is a very good thing I don't have a family right now.

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Think it's time to setup a ubuntu VM for this coding mess.

    Aptana gets a little crashy when things go a little wrong and leaves behind a whack of processes to close myself.

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    bowen wrote:
    Seems you guys have been busy.

    Totally not my fault >.> <.<

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    Weretaco wrote:
    bowen wrote:
    Seems you guys have been busy.

    Totally not my fault >.> <.<

    I have RVM installed now (no system Ruby, cleared it all out and started over) and the default is 1.9.3.

    If anyone needs to know how it works, please see the RVM docs. :rotate:

    But the main part is it allows switching of your ruby environment and creation of personal rubies (ruby interpreters, diff versions or diff vendors even) and gemsets etc.

    You shouldn't need to do anything if you want to use 1.9.3 and the shared default gemset. 'gem list' should show what is installed, 'bundle install' works without specifying your own path (although you still can if you want to ensure/specify your own versions of gems, you can also do this with RVM itself so read up on it) etc.

    So 'rails new Blah' should work 100% out of the box now.

    Important note: Passenger runs as one Ruby system, so it is running as 1.9.3. It is configured Apache side so you cannot change it using RVM, so don't pull your hair out trying to do so. If you need a Rails running on 1.8.7 then we'll have to setup a domain specifically for you and reverse-proxy it. I'd heavily recommend going with 1.9.3 if at all possible.

    padev-newrails is still there but pretty simple now, all it will do extra is create the symlink and .htaccess directive in your user.padev.net web root for you. It works if you want to use it.

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    Infidel wrote:
    Weretaco wrote:
    bowen wrote:
    Seems you guys have been busy.

    Totally not my fault >.> <.<

    I have RVM installed now (no system Ruby, cleared it all out and started over) and the default is 1.9.3.

    If anyone needs to know how it works, please see the RVM docs. :rotate:

    But the main part is it allows switching of your ruby environment and creation of personal rubies (ruby interpreters, diff versions or diff vendors even) and gemsets etc.

    You shouldn't need to do anything if you want to use 1.9.3 and the shared default gemset. 'gem list' should show what is installed, 'bundle install' works without specifying your own path (although you still can if you want to ensure/specify your own versions of gems, you can also do this with RVM itself so read up on it) etc.

    So 'rails new Blah' should work 100% out of the box now.

    Important note: Passenger runs as one Ruby system, so it is running as 1.9.3. It is configured Apache side so you cannot change it using RVM, so don't pull your hair out trying to do so. If you need a Rails running on 1.8.7 then we'll have to setup a domain specifically for you and reverse-proxy it. I'd heavily recommend going with 1.9.3 if at all possible.

    padev-newrails is still there but pretty simple now, all it will do extra is create the symlink and .htaccess directive in your user.padev.net web root for you. It works if you want to use it.

    rails new (and padev-rails) still have an issue (i assume becuase it's trying to do the run bundle install)

    create vendor/plugins/.gitkeep
    run bundle install
    Enter your password to install the bundled RubyGems to your system:
    weretaco is not in the sudoers file. This incident will be reported.

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    edited January 2012
    Can you PM me the output of "gem env"?

    Also "which bundle"

    Infidel on
    OrokosPA.png
  • Options
    zeenyzeeny Registered User regular
    Hey, smart people. Design pattern for dealing with errors in asynchronous code - no throw/catch allowed.
    It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?

  • Options
    DrunkMcDrunkMc Registered User regular
    zeeny wrote:
    Hey, smart people. Design pattern for dealing with errors in asynchronous code - no throw/catch allowed.
    It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?

    I know in GWT all callBacks have to implement two functions
    public void onFailure(Throwable caught)
    
    public void onSuccess(<> result)
    

    Works well.

  • Options
    bowenbowen How you doin'? Registered User regular
    That's about it I think.

    You could imitate try catch with queues but that's probably a lot more work, and you'd probably run into concurrency issues in rare circumstances?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    zeenyzeeny Registered User regular
    edited January 2012
    DrunkMc wrote:
    zeeny wrote:
    Hey, smart people. Design pattern for dealing with errors in asynchronous code - no throw/catch allowed.
    It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?

    I know in GWT all callBacks have to implement two functions
    public void onFailure(Throwable caught)
    
    public void onSuccess(<> result)
    

    Works well.

    What I was considering doing was implementing a success/failure object, but I was unable to see the actual benefit. It doesn't save me the ugly test.
    It's probably an accepted way to work, I'm just not used to it, so for some reason find it revolting.

    zeeny on
  • Options
    jothkijothki Registered User regular
    I just spent a days worth of work debugging a single error in a relatively simply piece of code that I wrote. It was just a class to store a two-dimensional array of values and interpolate those values for arbitrary coordinates, so that they could be used to simulate sensor readings off of a continuous field.

    It mostly worked, but for large fields some of the stored values were reading as very large, very tiny, or nan. I checked pretty much everything related to how the values were initially generated, how they were passed into the class, how they were stored within the class itself, and how they were read, but came up with nothing.

    And then I noticed that my constructor was doing a shallow copy of the passed in array. That was an embarrassingly pathetic waste of my time.

  • Options
    InfidelInfidel Heretic Registered User regular
    VICTORY IS MINE!

    I hacked up RVM a bit and now have a way to install Ruby versions and gem as root (for Passenger to execute under) and keep user installs separate. Everything except the Ruby binaries are stored in ~/.rvm now. You don't need to really worry about the guts of that, just pointing out what is going on.

    A user who hasn't run RVM will have no ruby command. You won't have ruby and the related binaries until you execute 'rvm use 1.9.3' or 'rvm use 1.8.7' which sets up your shell for using that version. I recommend you use 1.9.3, especially if you're hosting Rails, because that is what Passenger is running your Rails applications as and it can't be overridden there with RVM.

    The shell will reset and forget about Ruby unless you make a version default like so: rvm use 1.9.3 --default

    Now you have your own private Ruby. 'gem list' will show no local gems, etc. You can break shit as you please and no one can mess with your install.

    Start off installing Rails with: gem install rails

    Easy enough. Now while you could use 'rails new App' you don't want to if you want to host through Passenger. The problem is that if you let it do the default, it will run 'bundle install' which puts the gems for your application in your user's local gems. Passenger won't find them and you'll get errors about "bundler can't find rake" and so on.

    So use the script I made, 'padev-newrails App' and it will link everything up for you. As mentioned before, it does --skip-bundle and then calls bundle to install to a path within your application. Passenger will pick this up automatically so you don't need to do anything special.

    That means that if you want to install a gem for your local Ruby, use 'gem install' but for the Rails applications make sure to install them to the application itself.

    I hope this explains the setup and works for you, @weretaco and whoever else wants to play with Rails. :^:

    OrokosPA.png
  • Options
    WeretacoWeretaco Cubicle Gangster Registered User regular
    I feel so bad for you doing this hassle for me :)

    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • Options
    InfidelInfidel Heretic Registered User regular
    If it was only for you I had it working single user long ago! :P

    Gotta figure out something that will work longterm too.

    OrokosPA.png
  • Options
    Gilbert0Gilbert0 North of SeattleRegistered User regular
    do it right the first time, even if it takes longer.

  • Options
    InfidelInfidel Heretic Registered User regular
    Gilbert0 wrote:
    do it right the first time, even if it takes longer.

    The only thing I really am able to get out of this is the experience and knowledge, so it makes little sense to not do it right, yeah.

    That said, I learned more about Rails/RVM than I want, no more for now. D: This takes a bit more space since users have their own copies of many things, but at least it's secure (let me know if there's a flaw?) and user-managed.

    Installed Boost, have most of the common source control tools on there, if anything found lacking keep asking for it.

    OrokosPA.png
  • Options
    bowenbowen How you doin'? Registered User regular
    Yeah boost is working correctly afaik, I'm going to test the modules that you need to compile separately like Thread today or tomorrow.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    Jimmy KingJimmy King Registered User regular
    Hey, help me translate my math class into programming so that I can understand it. I understand the math itself fine, I'm just not 100% clear on what math I'm being asked to do.

    If I've got f(x) = 3x-2 and f(x-h) then that translates to this in code:
    def f(x):
        3x-2
    
    x = 3
    h = 1
    f(x-h)
    

    So f(x) = 3x-2 defines the actual function and that is the base of the function. Anything else is saying to use that same function but just modifying the parameter being passed in, right? The f(x) and passing a value into that is not an issue because that's exactly what I do all day, I just didn't immediately grasp what f(x-h) actually meant with the way my trig book explained it.

This discussion has been closed.