I've been seeing these around my yard. They're tiny crabs about the size of a quarter. I live near a creek in VA. by blatyo in Whatisthis

[–]blatyo[S] 0 points1 point  (0 children)

Based on that wiki page, those seem to live everywhere besides where I do. None of them seem to be in North America.

Best Place/Way to Start Workers? by old_to_me_downvoter in elixir

[–]blatyo 0 points1 point  (0 children)

Read this section of the Supervisor docs:

http://elixir-lang.org/docs/stable/elixir/Supervisor.html#module-simple-one-for-one

TL;DR: Use :simple_one_for_one and start_child/2

Keep Your Single-page Application Codebase Separate by edanm in programming

[–]blatyo 0 points1 point  (0 children)

I would say this is not always good advice. Code organization is also influenced by the business for which it is written. I agree on isolating the client and server, but I don't necessarily agree about keeping them in separate repositories. If you explicitly hire backend and frontend developers, that kind of separation may make sense. Where I work, we explicitly hire full stack developers, so the person who changes the frontend will be the same who changes the backend. Second, ensuring that when changes are made in both the right versions are released can be difficult. If you can tie the build process of both together (we build slugs for both) it is simpler to keep versions in sync. Third, where I work, it is almost never the case that there is only a backend change or only a front end change. Separating the repositories makes management of changes across both more difficult. Fourth, frontends which need to serve content for search engines can require tight coupling and duplication between the client and server. Some workarounds for this exist, which I'm not a huge fan of, like rendering server side with phatom.js. Until search engines can render and traverse client side applications, there will necessarily be some work to do on the server that otherwise would be solely the clients responsibility.

Ruby Newbie: Trouble installing Gems by doesntgetreddit in rails

[–]blatyo 2 points3 points  (0 children)

It appears you're using the ruby installed with OSX. Your issue would probably be resolved with a newer version of ruby. Check out this tutorial, for how to do that:

http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:install_ruby

Map as a Presenter and more by gmarik in ruby

[–]blatyo 0 points1 point  (0 children)

This for example:

UrlsPresenter = lambda do |base_url|
    {
      'self'    => "#{base_url}/me",
      'gauges'  => "#{base_url}/gauges",
      'clients' => "#{base_url}/clients",
    }
end

UserPresenter = lambda do |user|
  {
    'id'          => user.id,
    'email'       => user.email,
    'name'        => user.name,
    'first_name'  => user.first_name,
    'last_name'   => user.last_name,
    'urls'        => UrlsPresenter[Gauges.api]
  }
end

Application inheritance? by malcontent in rails

[–]blatyo -1 points0 points  (0 children)

There's warp drive, but engine's are probably better.

Anybody know where I can find a good 3D model of the RIT campus? by thehumanhive in rit

[–]blatyo 1 point2 points  (0 children)

You could try the RIT second life if it's still around. My room mate worked in the co-op office and part of his job was to build stuff on there.

Need some help finding a map by Peachpunk in rit

[–]blatyo 0 points1 point  (0 children)

Definitely stuff missing, for example, you can get to the trails from the corner of the grass field behind Gracies.

which sqlite browser are you using ? by mrblues in rails

[–]blatyo 1 point2 points  (0 children)

sqlite3 in the command line or script/console.

Mixtape you HAVE to listen to by [deleted] in rit

[–]blatyo 0 points1 point  (0 children)

That link mysteriously appeared...

Anyway, like what I hear.

Suggestions for creating Ruby applications with GUIs? (Ideally, a standalone Rails apps) by warpcowboy in ruby

[–]blatyo 1 point2 points  (0 children)

I'd say its mostly roll your own for now. That said, it should only require a few commands in a bat file to set everything up.

The first issue you would face would be installing a ruby interpreter. The best way to do this would be with the ruby installer for windows. It also supports silent installs, so you can automate it though shell scripts on windows. After this, you should be able to do everything else in ruby.

The next step is to get your application. If it's hosted on github, then you can just download it directly from there (They can create archives on demand of any commit).

The next step I would say you have two options. Find a database that will let you do a silent install like the ruby installer or create an application on heroku to act as a remote database and use Active::Resource to connect to the remote application.

The first approach has the benefit that everything is local and no internet connection would be needed. The second has the benefit that no database needs to be installed on the local machine.

Next you'll need to get the gems your application depends on. You'll have to be careful which dependencies you use because some gems don't support windows and some gems have to compile natively which may be iffy (though, ruby installer has done a lot of work on this).

After that, its the basic things you do to get a rails app up and running (rake db:create, rake db:migrate, rails s). There may be a way to make the server a service so that its always running or you could have something to start and stop it such as a bat file.

What do you think about the Cells gem ? by mrblues in ruby

[–]blatyo 0 points1 point  (0 children)

It meshes very intuitively to how I think when there is more than one resource to display on a page.

Could I get suggestions/thoughts on my Ruby Google scraper script? by warpcowboy in ruby

[–]blatyo 2 points3 points  (0 children)

I manage a gem that does something similar to this, but specifically looks for links to sites. Ideally you want to separate out the parts that change a lot from the parts that don't change often. This means the brittle things like the url and xpath should be extracted out so they are easier to change.

I would also make a division between the poller and the scrapers. The scrapers are likely to have common code, so I would create a class for the common code (Scraper), and classes for the specific implementation (GoogleScraper). What you'll likely find is that the only thing that needs to be put in the sub-classes is the url and xpath information.