DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON http://guides.rubyonrails.org.
Layouts and Rendering in Rails
This guide covers the basic layout features of Action Controller and Action View.
After reading this guide, you will know:
- How to use the various rendering methods built into
Rails
. - How to create layouts with multiple content sections.
- How to use partials to DRY up your views.
- How to use nested layouts (sub-templates).
Overview: How the Pieces Fit Together
This guide focuses on the interaction between Controller and View in the Model-View-Controller triangle. As you know, the Controller is responsible for orchestrating the whole process of handling a request in Rails
, though it normally hands off any heavy code to the Model. But then, when it's time to send a response back to the user, the Controller hands things off to the View. It's that handoff that is the subject of this guide.
In broad strokes, this involves deciding what should be sent as the response and calling an appropriate method to create that response. If the response is a full-blown view, Rails
also does some extra work to wrap the view in a layout and possibly to pull in partial views. You'll see all of those paths later in this guide.
Creating Responses
From the controller's point of view, there are three ways to create an HTTP response:
- Call
render
to create a full response to send back to the browser - Call
redirect_to
to send an HTTP redirect status code to the browser - Call
head
to create a response consisting solely of HTTP headers to send back to the browser
Rendering by Default: Convention Over Configuration in Action
You've heard that Rails
promotes "convention over configuration". Default rendering is an excellent example of this. By default, controllers in Rails
automatically render views with names that correspond to valid routes. For example, if you have this code in your BooksController
class:
class BooksController < ApplicationController
end
And the following in your routes file:
resources :books
And you have a view file app/views/books/index.html.erb
:

Books are coming soon!

Rails will automatically render app/views/books/index.html.erb
when you navigate to /books
and you will see "Books are coming soon!" on your screen.
However a coming soon screen is only minimally useful, so you will soon create your Book
model and add the index action to BooksController
:
class BooksController < ApplicationController
def index
@books = Book.all
end
end
Note that we don't have explicit render at the end of the index action in accordance with "convention over configuration" principle. The rule is that if you do not explicitly render something at the end of a controller action, Rails will automatically look for the action_name.html.erb
template in the controller's view path and render it. So in this case, Rails will render the app/views/books/index.html.erb
file.
If we want to display the properties of all the books in our view, we can do so with an ERB template like this:

Listing Books

Title
Content

<% @books.each do |book| %>

<%= book.title %>
<%= book.content %>
<%= link_to "Show", book %>
<%= link_to "Edit", edit_book_path(book) %>
<%= link_to "Destroy", book, method: :delete, data: { confirm: "Are you sure?" } %>

<% end %>

<%= link_to "New book", new_book_path %>
NOTE: The actual rendering is done by nested classes of the module ActionView::Template::Handlers. This guide does not dig into that process, but it's important to know that the file extension on your view controls the choice of template handler.
Using render
In most cases, the ActionController::Base#render
method does the heavy lifting of rendering your application's content for use by a browser. There are a variety of ways to customize the behavior of render
. You can render the default view for a Rails template, or a specific template, or a file, or inline code, or nothing at all. You can render text, JSON, or XML. You can specify the content type or HTTP status of the rendered response as well.
TIP: If you want to see the exact results of a call to render
without needing to inspect it in a browser, you can call render_to_string
. This method takes exactly the same options as render
, but it returns a string instead of sending a response back to the browser.
Rendering an Action's View
If you want to render the view that corresponds to a different template within the same controller, you can use render
with the name of the view:
def update
@book = Book.find(params[:id])
if @book.update(book_params)
redirect_to(@book)
else
render "edit"
end
end
If the call to update
fails, calling the update
action in this controller will render the edit.html.erb
template belonging to the same controller.
If you prefer, you can use a symbol instead of a string to specify the action to render:
def update
@book = Book.find(params[:id])
if @book.update(book_params)
redirect_to(@book)
else
render :edit
end
end
Rendering an Action's Template from Another Controller
What if you want to render a template from an entirely different controller from the one that contains the action code? You can also do that with render
, which accepts the full path (relative to app/views
) of the template to render. For example, if you're running code in an AdminProductsController
that lives in app/controllers/admin
, you can render the results of an action to a template in app/views/products
this way:
render "products/show"
Rails knows that this view belongs to a different controller because of the embedded slash character in the string. If you want to be explicit, you can use the :template
option (which was required on Rails 2.2 and earlier):
render template: "products/show"
Rendering an Arbitrary File
The render
method can also use a view that's entirely outside of your application:
render file: "/u/apps/warehouse_app/current/app/views/products/show"
The :file
option takes an absolute file-system path. Of course, you need to have rights
to the view that you're using to render the content.
NOTE: Using the :file
option in combination with users input can lead to security problems
since an attacker could use this action to access security sensitive files in your file system.
NOTE: By default, the file is rendered using the current layout.
TIP: If you're running Rails on Microsoft Windows, you should use the :file
option to
render a file, because Windows filenames do not have the same format as Unix filenames.
Wrapping it up
The above three ways of rendering (rendering another template within the controller, rendering a template within another controller and rendering an arbitrary file on the file system) are actually variants of the same action.
In fact, in the BooksController class, inside of the update action where we want to render the edit template if the book does not update successfully, all of the following render calls would all render the edit.html.erb
template in the views/books
directory:
render :edit
render action: :edit
render "edit"
render "edit.html.erb"
render action: "edit"
render action: "edit.html.erb"
render "books/edit"
render "books/edit.html.erb"
render template: "books/edit"
render template: "books/edit.html.erb"
render "/path/to/rails/app/views/books/edit"
render "/path/to/rails/app/views/books/edit.html.erb"
render file: "/path/to/rails/app/views/books/edit"
render file: "/path/to/rails/app/views/books/edit.html.erb"
Which one you use is really a matter of style and convention, but the rule of thumb is to use the simplest one that makes sense for the code you are writing.
Using render
with :inline
The render
method can do without a view completely, if you're willing to use the :inline
option to supply ERB as part of the method call. This is perfectly valid:
render inline: "<% products.each do |p| %>
<%= p.name %>
<% end %>"
WARNING: There is seldom any good reason to use this option. Mixing ERB into your controllers defeats the MVC orientation of Rails and will make it harder for other developers to follow the logic of your project. Use a separate erb view instead.
By default, inline rendering uses ERB. You can force it to use Builder instead with the :type
option:
render inline: "xml.p {'Horrid coding practice!'}", type: :builder
Rendering Text
You can send plain text - with no markup at all - back to the browser by using
the :plain
option to render
:
render plain: "OK"
TIP: Rendering pure text is most useful when you're responding to Ajax or web service requests that are expecting something other than proper HTML.
NOTE: By default, if you use the :plain
option, the text is rendered without
using the current layout. If you want Rails to put the text into the current
layout, you need to add the layout: true
option and use the .text.erb
extension for the layout file.
Rendering HTML
You can send an HTML string back to the browser by using the :html
option to
render
:
render html: helpers.tag.strong('Not Found')
TIP: This is useful when you're rendering a small snippet of HTML code. However, you might want to consider moving it to a template file if the markup is complex.
NOTE: When using html:
option, HTML entities will be escaped if the string is not composed with html_safe
-aware APIs.
Rendering JSON
JSON is a JavaScript data format used by many Ajax libraries. Rails has built-in support for converting objects to JSON and rendering that JSON back to the browser:
render json: @product
TIP: You don't need to call to_json
on the object that you want to render. If you use the :json
option, render
will automatically call to_json
for you.
Rendering XML
Rails also has built-in support for converting objects to XML and rendering that XML back to the caller:
render xml: @product
TIP: You don't need to call to_xml
on the object that you want to render. If you use the :xml
option, render
will automatically call to_xml
for you.
Rendering Vanilla JavaScript
Rails can render vanilla JavaScript:
render js: "alert('Hello Rails');"
This will send the supplied string to the browser with a MIME type of text/javascript
.
Rendering raw body
You can send a raw content back to the browser, without setting any content
type, by using the :body
option to render
:
render body: "raw"
TIP: This option should be used only if you don't care about the content type of
the response. Using :plain
or :html
might be more appropriate most of the
time.
NOTE: Unless overridden, your response returned from this render option will be
text/plain
, as that is the default content type of Action Dispatch response.
Options for render
Calls to the render
method generally accept five options:
:content_type
:layout
:location
:status
:formats
The :content_type
Option
By default, Rails will serve the results of a rendering operation with the MIME content-type of text/html
(or application/json
if you use the :json
option, or application/xml
for the :xml
option.). There are times when you might like to change this, and you can do so by setting the :content_type
option:
render file: filename, content_type: "application/rss"
The :layout
Option
With most of the options to render
, the rendered content is displayed as part of the current layout. You'll learn more about layouts and how to use them later in this guide.
You can use the :layout
option to tell Rails to use a specific file as the layout for the current action:
render layout: "special_layout"
You can also tell Rails to render with no layout at all:
render layout: false
The :location
Option
You can use the :location
option to set the HTTP Location
header:
render xml: photo, location: photo_url(photo)
The :status
Option
Rails will automatically generate a response with the correct HTTP status code (in most cases, this is 200 OK
). You can use the :status
option to change this:
render status: 500
render status: :forbidden
Rails understands both numeric status codes and the corresponding symbols shown below.
| Response Class | HTTP Status Code | Symbol |
|---|---|---|
| Informational | 100 | :continue |
| 101 | :switching_protocols | |
| 102 | :processing | |
| Success | 200 | :ok |
| 201 | :created | |
| 202 | :accepted | |
| 203 | :non_authoritative_information | |
| 204 | :no_content | |
| 205 | :reset_content | |
| 206 | :partial_content | |
| 207 | :multi_status | |
| 208 | :already_reported | |
| 226 | :im_used | |
| Redirection | 300 | :multiple_choices |
| 301 | :moved_permanently | |
| 302 | :found | |
| 303 | :see_other | |
| 304 | :not_modified | |
| 305 | :use_proxy | |
| 307 | :temporary_redirect | |
| 308 | :permanent_redirect | |
| Client Error | 400 | :bad_request |
| 401 | :unauthorized | |
| 402 | :payment_required | |
| 403 | :forbidden | |
| 404 | :not_found | |
| 405 | :method_not_allowed | |
| 406 | :not_acceptable | |
| 407 | :proxy_authentication_required | |
| 408 | :request_timeout | |
| 409 | :conflict | |
| 410 | :gone | |
| 411 | :length_required | |
| 412 | :precondition_failed | |
| 413 | :payload_too_large | |
| 414 | :uri_too_long | |
| 415 | :unsupported_media_type | |
| 416 | :range_not_satisfiable | |
| 417 | :expectation_failed | |
| 421 | :misdirected_request | |
| 422 | :unprocessable_entity | |
| 423 | :locked | |
| 424 | :failed_dependency | |
| 426 | :upgrade_required | |
| 428 | :precondition_required | |
| 429 | :too_many_requests | |
| 431 | :request_header_fields_too_large | |
| 451 | :unavailable_for_legal_reasons | |
| Server Error | 500 | :internal_server_error |
| 501 | :not_implemented | |
| 502 | :bad_gateway | |
| 503 | :service_unavailable | |
| 504 | :gateway_timeout | |
| 505 | :http_version_not_supported | |
| 506 | :variant_also_negotiates | |
| 507 | :insufficient_storage | |
| 508 | :loop_detected | |
| 510 | :not_extended | |
| 511 | :network_authentication_required |
NOTE: If you try to render content along with a non-content status code (100-199, 204, 205 or 304), it will be dropped from the response.
The :formats
Option
Rails uses the format specified in the request (or :html
by default). You can
change this passing the :formats
option with a symbol or an array:
render formats: :xml
render formats: [:json, :xml]
If a template with the specified format does not exist an ::ActionView::MissingTemplate
error is raised.
Finding Layouts
To find the current layout, Rails first looks for a file in app/views/layouts
with the same base name as the controller. For example, rendering actions from the PhotosController
class will use app/views/layouts/photos.html.erb
(or app/views/layouts/photos.builder
). If there is no such controller-specific layout, Rails will use app/views/layouts/application.html.erb
or app/views/layouts/application.builder
. If there is no .erb
layout, Rails will use a .builder
layout if one exists. Rails also provides several ways to more precisely assign specific layouts to individual controllers and actions.
Specifying Layouts for Controllers
You can override the default layout conventions in your controllers by using the layout
declaration. For example:
class ProductsController < ApplicationController
layout "inventory"
#...
end
With this declaration, all of the views rendered by the ProductsController
will use app/views/layouts/inventory.html.erb
as their layout.
To assign a specific layout for the entire application, use a layout
declaration in your ApplicationController
class:
class ApplicationController < ActionController::Base
layout "main"
#...
end
With this declaration, all of the views in the entire application will use app/views/layouts/main.html.erb
for their layout.
Choosing Layouts at Runtime
You can use a symbol to defer the choice of layout until a request is processed:
class ProductsController < ApplicationController
layout :products_layout
def show
@product = Product.find(params[:id])
end
private
def products_layout
@current_user.special? ? "special" : "products"
end
end
Now, if the current user is a special user, they'll get a special layout when viewing a product.
You can even use an inline method, such as a Proc, to determine the layout. For example, if you pass a Proc object, the block you give the Proc will be given the controller
instance, so the layout can be determined based on the current request:
class ProductsController < ApplicationController
layout Proc.new { |controller| controller.request.xhr? ? "popup" : "application" }
end
Conditional Layouts
Layouts specified at the controller level support the :only
and :except
options. These options take either a method name, or an array of method names, corresponding to method names within the controller:
class ProductsController < ApplicationController
layout "product", except: [:index, :rss]
end
With this declaration, the product
layout would be used for everything but the rss
and index
methods.
Layout Inheritance
Layout declarations cascade downward in the hierarchy, and more specific layout declarations always override more general ones. For example:
-
application_controller.rb
class ApplicationController < ActionController::Base layout "main" end
-
articles_controller.rb
class ArticlesController < ApplicationController end
-
special_articles_controller.rb
class SpecialArticlesController < ArticlesController layout "special" end
-
old_articles_controller.rb
class OldArticlesController < SpecialArticlesController layout false def show @article = Article.find(params[:id]) end def index @old_articles = Article.older render layout: "old" end # ... end
In this application:
- In general, views will be rendered in the
main
layout ArticlesController#index
will use themain
layoutSpecialArticlesController#index
will use thespecial
layoutOldArticlesController#show
will use no layout at allOldArticlesController#index
will use theold
layout
Template Inheritance
Similar to the Layout Inheritance logic, if a template or partial is not found in the conventional path, the controller will look for a template or partial to render in its inheritance chain. For example:
# in app/controllers/application_controller
class ApplicationController < ActionController::Base
end
# in app/controllers/admin_controller
class AdminController < ApplicationController
end
# in app/controllers/admin/products_controller
class Admin::ProductsController < AdminController
def index
end
end
The lookup order for an admin/products#index
action will be:
app/views/admin/products/
app/views/admin/
app/views/application/
This makes app/views/application/
a great place for your shared partials, which can then be rendered in your ERB as such:
<%# app/views/admin/products/index.html.erb %>
<%= render @products || "empty_list" %>
<%# app/views/application/_empty_list.html.erb %>
There are no items in this list yet.
Avoiding Double Render Errors
Sooner or later, most Rails developers will see the error message "Can only render or redirect once per action". While this is annoying, it's relatively easy to fix. Usually it happens because of a fundamental misunderstanding of the way that render
works.
For example, here's some code that will trigger this error:
def show
@book = Book.find(params[:id])
if @book.special?
render action: "special_show"
end
render action: "regular_show"
end
If @book.special?
evaluates to true
, Rails will start the rendering process to dump the @book
variable into the special_show
view. But this will not stop the rest of the code in the show
action from running, and when Rails hits the end of the action, it will start to render the regular_show
view - and throw an error. The solution is simple: make sure that you have only one call to render
or redirect
in a single code path. One thing that can help is and return
. Here's a patched version of the method:
def show
@book = Book.find(params[:id])
if @book.special?
render action: "special_show" and return
end
render action: "regular_show"
end
Make sure to use and return
instead of && return
because && return
will not work due to the operator precedence in the Ruby Language.
Note that the implicit render done by ActionController detects if render
has been called, so the following will work without errors:
def show
@book = Book.find(params[:id])
if @book.special?
render action: "special_show"
end
end
This will render a book with special?
set with the special_show
template, while other books will render with the default show
template.
Using redirect_to
Another way to handle returning responses to an HTTP request is with redirect_to
. As you've seen, render
tells Rails which view (or other asset) to use in constructing a response. The redirect_to
method does something completely different: it tells the browser to send a new request for a different URL. For example, you could redirect from wherever you are in your code to the index of photos in your application with this call:
redirect_to photos_url
You can use redirect_back
to return the user to the page they just came from.
This location is pulled from the HTTP_REFERER
header which is not guaranteed
to be set by the browser, so you must provide the fallback_location
to use in this case.
redirect_back(fallback_location: root_path)
NOTE: redirect_to
and redirect_back
do not halt and return immediately from method execution, but simply set HTTP responses. Statements occurring after them in a method will be executed. You can halt by an explicit return
or some other halting mechanism, if needed.
Getting a Different Redirect Status Code
Rails uses HTTP status code 302, a temporary redirect, when you call redirect_to
. If you'd like to use a different status code, perhaps 301, a permanent redirect, you can use the :status
option:
redirect_to photos_path, status: 301
Just like the :status
option for render
, :status
for redirect_to
accepts both numeric and symbolic header designations.
The Difference Between render
and redirect_to
Sometimes inexperienced developers think of redirect_to
as a sort of goto
command, moving execution from one place to another in your Rails code. This is not correct. Your code stops running and waits for a new request for the browser. It just happens that you've told the browser what request it should make next, by sending back an HTTP 302 status code.
Consider these actions to see the difference:
def index
@books = Book.all
end
def show
@book = Book.find_by(id: params[:id])
if @book.nil?
render action: "index"
end
end
With the code in this form, there will likely be a problem if the @book
variable is nil
. Remember, a render :action
doesn't run any code in the target action, so nothing will set up the @books
variable that the index
view will probably require. One way to fix this is to redirect instead of rendering:
def index
@books = Book.all
end
def show
@book = Book.find_by(id: params[:id])
if @book.nil?
redirect_to action: :index
end
end
With this code, the browser will make a fresh request for the index page, the code in the index
method will run, and all will be well.
The only downside to this code is that it requires a round trip to the browser: the browser requested the show action with /books/1
and the controller finds that there are no books, so the controller sends out a 302 redirect response to the browser telling it to go to /books/
, the browser complies and sends a new request back to the controller asking now for the index
action, the controller then gets all the books in the database and renders the index template, sending it back down to the browser which then shows it on your screen.
While in a small application, this added latency might not be a problem, it is something to think about if response time is a concern. We can demonstrate one way to handle this with a contrived example:
def index
@books = Book.all
end
def show
@book = Book.find_by(id: params[:id])
if @book.nil?
@books = Book.all
flash.now[:alert] = "Your book was not found"
render "index"
end
end
This would detect that there are no books with the specified ID, populate the @books
instance variable with all the books in the model, and then directly render the index.html.erb
template, returning it to the browser with a flash alert message to tell the user what happened.
Using head
To Build Header-Only Responses
The head
method can be used to send responses with only headers to the browser. The head
method accepts a number or symbol (see reference table) representing an HTTP status code. The options argument is interpreted as a hash of header names and values. For example, you can return only an error header:
head :bad_request
This would produce the following header:
HTTP/1.1 400 Bad Request
Connection: close
Date: Sun, 24 Jan 2010 12:15:53 GMT
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
X-Runtime: 0.013483
Set-Cookie: _blog_session=...snip...; path=/; HttpOnly
Cache-Control: no-cache
Or you can use other HTTP headers to convey other information:
head :created, location: photo_path(@photo)
Which would produce:
HTTP/1.1 201 Created
Connection: close
Date: Sun, 24 Jan 2010 12:16:44 GMT
Transfer-Encoding: chunked
Location: /photos/1
Content-Type: text/html; charset=utf-8
X-Runtime: 0.083496
Set-Cookie: _blog_session=...snip...; path=/; HttpOnly
Cache-Control: no-cache
Structuring Layouts
When Rails renders a view as a response, it does so by combining the view with the current layout, using the rules for finding the current layout that were covered earlier in this guide. Within a layout, you have access to three tools for combining different bits of output to form the overall response:
- Asset tags
yield
andcontent_for
- Partials
Asset Tag Helpers
Asset tag helpers provide methods for generating HTML that link views to feeds, JavaScript, stylesheets, images, videos, and audios. There are six asset tag helpers available in Rails:
auto_discovery_link_tag
javascript_include_tag
stylesheet_link_tag
image_tag
video_tag
audio_tag
You can use these tags in layouts or other views, although the auto_discovery_link_tag
, javascript_include_tag
, and stylesheet_link_tag
, are most commonly used in the
section of a layout.
WARNING: The asset tag helpers do not verify the existence of the assets at the specified locations; they simply assume that you know what you're doing and generate the link.
Linking to Feeds with the auto_discovery_link_tag
The auto_discovery_link_tag
helper builds HTML that most browsers and feed readers can use to detect the presence of RSS, Atom, or JSON feeds. It takes the type of the link (:rss
, :atom
, or :json
), a hash of options that are passed through to url_for, and a hash of options for the tag:
<%= auto_discovery_link_tag(:rss, {action: "feed"},
{title: "RSS Feed"}) %>
There are three tag options available for the auto_discovery_link_tag
:
:rel
specifies therel
value in the link. The default value is "alternate".:type
specifies an explicit MIME type. Rails will generate an appropriate MIME type automatically.:title
specifies the title of the link. The default value is the uppercase:type
value, for example, "ATOM" or "RSS".
Linking to JavaScript Files with the javascript_include_tag
The javascript_include_tag
helper returns an HTML script
tag for each source provided.
If you are using Rails with the Asset Pipeline enabled, this helper will generate a link to /assets/javascripts/
rather than public/javascripts
which was used in earlier versions of Rails. This link is then served by the asset pipeline.
A JavaScript file within a Rails application or Rails engine goes in one of three locations: app/assets
, lib/assets
or vendor/assets
. These locations are explained in detail in the Asset Organization section in the Asset Pipeline Guide.
You can specify a full path relative to the document root, or a URL, if you prefer. For example, to link to a JavaScript file that is inside a directory called javascripts
inside of one of app/assets
, lib/assets
or vendor/assets
, you would do this:
<%= javascript_include_tag "main" %>
Rails will then output a script
tag such as this:

The request to this asset is then served by the Sprockets gem.
To include multiple files such as app/assets/javascripts/main.js
and app/assets/javascripts/columns.js
at the same time:
<%= javascript_include_tag "main", "columns" %>
To include app/assets/javascripts/main.js
and app/assets/javascripts/photos/columns.js
:
<%= javascript_include_tag "main", "/photos/columns" %>
To include http://example.com/main.js
:
<%= javascript_include_tag "http://example.com/main.js" %>
Linking to CSS Files with the stylesheet_link_tag
The stylesheet_link_tag
helper returns an HTML <link>
tag for each source provided.
If you are using Rails with the "Asset Pipeline" enabled, this helper will generate a link to /assets/stylesheets/
. This link is then processed by the Sprockets gem. A stylesheet file can be stored in one of three locations: app/assets
, lib/assets
or vendor/assets
.
You can specify a full path relative to the document root, or a URL. For example, to link to a stylesheet file that is inside a directory called stylesheets
inside of one of app/assets
, lib/assets
or vendor/assets
, you would do this:
<%= stylesheet_link_tag "main" %>
To include app/assets/stylesheets/main.css
and app/assets/stylesheets/columns.css
:
<%= stylesheet_link_tag "main", "columns" %>
To include app/assets/stylesheets/main.css
and app/assets/stylesheets/photos/columns.css
:
<%= stylesheet_link_tag "main", "photos/columns" %>
To include http://example.com/main.css
:
<%= stylesheet_link_tag "http://example.com/main.css" %>
By default, the stylesheet_link_tag
creates links with media="screen" rel="stylesheet"
. You can override any of these defaults by specifying an appropriate option (:media
, :rel
):
<%= stylesheet_link_tag "main_print", media: "print" %>
Linking to Images with the image_tag
The image_tag
helper builds an HTML
tag to the specified file. By default, files are loaded from public/images
.
WARNING: Note that you must specify the extension of the image.
<%= image_tag "header.png" %>
You can supply a path to the image if you like:
<%= image_tag "icons/delete.gif" %>
You can supply a hash of additional HTML options:
<%= image_tag "icons/delete.gif", {height: 45} %>
You can supply alternate text for the image which will be used if the user has images turned off in their browser. If you do not specify an alt text explicitly, it defaults to the file name of the file, capitalized and with no extension. For example, these two image tags would return the same code:
<%= image_tag "home.gif" %>
<%= image_tag "home.gif", alt: "Home" %>
You can also specify a special size tag, in the format "width
xheight
":
<%= image_tag "home.gif", size: "50x20" %>
In addition to the above special tags, you can supply a final hash of standard HTML options, such as :class
, :id
or :name
:
<%= image_tag "home.gif", alt: "Go Home",
id: "HomeImage",
class: "nav_bar" %>
Linking to Videos with the video_tag
The video_tag
helper builds an HTML 5 <video>
tag to the specified file. By default, files are loaded from public/videos
.
<%= video_tag "movie.ogg" %>
Produces
<video src="/videos/movie.ogg" />
Like an image_tag
you can supply a path, either absolute, or relative to the public/videos
directory. Additionally you can specify the size: "#{width}x#{height}"
option just like an image_tag
. Video tags can also have any of the HTML options specified at the end (id
, class
et al).
The video tag also supports all of the <video>
HTML options through the HTML options hash, including:
poster: "image_name.png"
, provides an image to put in place of the video before it starts playing.autoplay: true
, starts playing the video on page load.loop: true
, loops the video once it gets to the end.controls: true
, provides browser supplied controls for the user to interact with the video.autobuffer: true
, the video will pre load the file for the user on page load.
You can also specify multiple videos to play by passing an array of videos to the video_tag
:
<%= video_tag ["trailer.ogg", "movie.ogg"] %>
This will produce:
<video>
<source src="/videos/trailer.ogg">
<source src="/videos/movie.ogg">
</video>
Linking to Audio Files with the audio_tag
The audio_tag
helper builds an HTML 5 <audio>
tag to the specified file. By default, files are loaded from public/audios
.
<%= audio_tag "music.mp3" %>
You can supply a path to the audio file if you like:
<%= audio_tag "music/first_song.mp3" %>
You can also supply a hash of additional options, such as :id
, :class
etc.
Like the video_tag
, the audio_tag
has special options:
autoplay: true
, starts playing the audio on page loadcontrols: true
, provides browser supplied controls for the user to interact with the audio.autobuffer: true
, the audio will pre load the file for the user on page load.
Understanding yield
Within the context of a layout, yield
identifies a section where content from the view should be inserted. The simplest way to use this is to have a single yield
, into which the entire contents of the view currently being rendered is inserted:

<%= yield %>

You can also create a layout with multiple yielding regions:

<%= yield :head %>

<%= yield %>

The main body of the view will always render into the unnamed yield
. To render content into a named yield
, you use the content_for
method.
Using the content_for
Method
The content_for
method allows you to insert content into a named yield
block in your layout. For example, this view would work with the layout that you just saw:
<% content_for :head do %>
<title>A simple page</title>
<% end %>

Hello, Rails!

The result of rendering this page into the supplied layout would be this HTML:

<title>A simple page</title>

Hello, Rails!

The content_for
method is very helpful when your layout contains distinct regions such as sidebars and footers that should get their own blocks of content inserted. It's also useful for inserting tags that load page-specific JavaScript or css files into the header of an otherwise generic layout.
Using Partials
Partial templates - usually just called "partials" - are another device for breaking the rendering process into more manageable chunks. With a partial, you can move the code for rendering a particular piece of a response to its own file.
Naming Partials
To render a partial as part of a view, you use the render
method within the view:
<%= render "menu" %>
This will render a file named _menu.html.erb
at that point within the view being rendered. Note the leading underscore character: partials are named with a leading underscore to distinguish them from regular views, even though they are referred to without the underscore. This holds true even when you're pulling in a partial from another folder:
<%= render "shared/menu" %>
That code will pull in the partial from app/views/shared/_menu.html.erb
.
Using Partials to Simplify Views
One way to use partials is to treat them as the equivalent of subroutines: as a way to move details out of a view so that you can grasp what's going on more easily. For example, you might have a view that looked like this:
<%= render "shared/ad_banner" %>

Products

Here are a few of our fine products:

...
<%= render "shared/footer" %>
Here, the _ad_banner.html.erb
and _footer.html.erb
partials could contain
content that is shared by many pages in your application. You don't need to see
the details of these sections when you're concentrating on a particular page.
As seen in the previous sections of this guide, yield
is a very powerful tool
for cleaning up your layouts. Keep in mind that it's pure Ruby, so you can use
it almost everywhere. For example, we can use it to DRY up form layout
definitions for several similar resources:
-
users/index.html.erb
<%= render "shared/search_filters", search: @q do |f| %>
 Name contains: <%= f.text_field :name_contains %>
 <% end %>
-
roles/index.html.erb
<%= render "shared/search_filters", search: @q do |f| %>
 Title contains: <%= f.text_field :title_contains %>
 <% end %>
-
shared/_search_filters.html.erb
<%= form_for(search) do |f| %>
Search form:
 <fieldset> <%= yield f %> </fieldset>
 <%= f.submit "Search" %>
 <% end %>
TIP: For content that is shared among all pages in your application, you can use partials directly from layouts.
Partial Layouts
A partial can use its own layout file, just as a view can use a layout. For example, you might call a partial like this:
<%= render partial: "link_area", layout: "graybar" %>
This would look for a partial named _link_area.html.erb
and render it using the layout _graybar.html.erb
. Note that layouts for partials follow the same leading-underscore naming as regular partials, and are placed in the same folder with the partial that they belong to (not in the master layouts
folder).
Also note that explicitly specifying :partial
is required when passing additional options such as :layout
.
Passing Local Variables
You can also pass local variables into partials, making them even more powerful and flexible. For example, you can use this technique to reduce duplication between new and edit pages, while still keeping a bit of distinct content:
-
new.html.erb

New zone
 <%= render partial: "form", locals: {zone: @zone} %>
-
edit.html.erb

Editing zone
 <%= render partial: "form", locals: {zone: @zone} %>
-
_form.html.erb
<%= form_for(zone) do |f| %>
 Zone name
 <%= f.text_field :name %>

 <%= f.submit %>
 <% end %>
Although the same partial will be rendered into both views, Action View's submit helper will return "Create Zone" for the new action and "Update Zone" for the edit action.
To pass a local variable to a partial in only specific cases use the local_assigns
.
-
index.html.erb
<%= render user.articles %>
-
show.html.erb
<%= render article, full: true %>
-
_article.html.erb

<%= article.title %>
 <% if local_assigns[:full] %> <%= simple_format article.body %> <% else %> <%= truncate article.body %> <% end %>
This way it is possible to use the partial without the need to declare all local variables.
Every partial also has a local variable with the same name as the partial (minus the leading underscore). You can pass an object in to this local variable via the :object
option:
<%= render partial: "customer", object: @new_customer %>
Within the customer
partial, the customer
variable will refer to @new_customer
from the parent view.
If you have an instance of a model to render into a partial, you can use a shorthand syntax:
<%= render @customer %>
Assuming that the @customer
instance variable contains an instance of the Customer
model, this will use _customer.html.erb
to render it and will pass the local variable customer
into the partial which will refer to the @customer
instance variable in the parent view.
Rendering Collections
Partials are very useful in rendering collections. When you pass a collection to a partial via the :collection
option, the partial will be inserted once for each member in the collection:
-
index.html.erb

Products
 <%= render partial: "product", collection: @products %>
-
_product.html.erb

Product Name: <%= product.name %>

When a partial is called with a pluralized collection, then the individual instances of the partial have access to the member of the collection being rendered via a variable named after the partial. In this case, the partial is _product
, and within the _product
partial, you can refer to product
to get the instance that is being rendered.
There is also a shorthand for this. Assuming @products
is a collection of product
instances, you can simply write this in the index.html.erb
to produce the same result:

Products

<%= render @products %>
Rails determines the name of the partial to use by looking at the model name in the collection. In fact, you can even create a heterogeneous collection and render it this way, and Rails will choose the proper partial for each member of the collection:
-
index.html.erb

Contacts
 <%= render [customer1, employee1, customer2, employee2] %>
-
customers/_customer.html.erb

Customer: <%= customer.name %>

-
employees/_employee.html.erb

Employee: <%= employee.name %>

In this case, Rails will use the customer or employee partials as appropriate for each member of the collection.
In the event that the collection is empty, render
will return nil, so it should be fairly simple to provide alternative content.

Products

<%= render(@products) || "There are no products available." %>
Local Variables
To use a custom local variable name within the partial, specify the :as
option in the call to the partial:
<%= render partial: "product", collection: @products, as: :item %>
With this change, you can access an instance of the @products
collection as the item
local variable within the partial.
You can also pass in arbitrary local variables to any partial you are rendering with the locals: {}
option:
<%= render partial: "product", collection: @products,
as: :item, locals: {title: "Products Page"} %>
In this case, the partial will have access to a local variable title
with the value "Products Page".
TIP: Rails also makes a counter variable available within a partial called by the collection, named after the title of the partial followed by _counter
. For example, when rendering a collection @products
the partial _product.html.erb
can access the variable product_counter
which indexes the number of times it has been rendered within the enclosing view.
You can also specify a second partial to be rendered between instances of the main partial by using the :spacer_template
option:
Spacer Templates
<%= render partial: @products, spacer_template: "product_ruler" %>
Rails will render the _product_ruler
partial (with no data passed in to it) between each pair of _product
partials.
Collection Partial Layouts
When rendering collections it is also possible to use the :layout
option:
<%= render partial: "product", collection: @products, layout: "special_layout" %>
The layout will be rendered together with the partial for each item in the collection. The current object and object_counter variables will be available in the layout as well, the same way they are within the partial.
Using Nested Layouts
You may find that your application requires a layout that differs slightly from your regular application layout to support one particular controller. Rather than repeating the main layout and editing it, you can accomplish this by using nested layouts (sometimes called sub-templates). Here's an example:
Suppose you have the following ApplicationController
layout:
-
app/views/layouts/application.html.erb
  <title><%= @page_title or "Page Title" %></title> <%= stylesheet_link_tag "layout" %>
Top menu items here

Menu items here

<%= content_for?(:content) ? yield(:content) : yield %>

On pages generated by NewsController
, you want to hide the top menu and add a right menu:
-
app/views/layouts/news.html.erb
<% content_for :stylesheets do %> #top_menu {display: none} #right_menu {float: right; background-color: yellow; color: black} <% end %> <% content_for :content do %>
Right menu items here
 <%= content_for?(:news_content) ? yield(:news_content) : yield %> <% end %> <%= render template: "layouts/application" %>
That's it. The News views will use the new layout, hiding the top menu and adding a new right menu inside the "content" div.
There are several ways of getting similar results with different sub-templating schemes using this technique. Note that there is no limit in nesting levels. One can use the ActionView::render
method via render template: 'layouts/news'
to base a new layout on the News layout. If you are sure you will not subtemplate the News
layout, you can replace the content_for?(:news_content) ? yield(:news_content) : yield
with simply yield
.


---
layout: post
title: Tears of Joy and Expectation for the God Who Loves the Lame and Outcast
date: '2010-04-24T09:24:00.003-05:00'
author: Jabell
tags:
- Affections
- Bible
- Hope
modified_time: '2010-04-24T09:37:40.085-05:00'
blogger_id: tag:blogger.com,1999:blog-19739956.post-4312948530664869182
blogger_orig_url: http://theabellsix.blogspot.com/2010/04/tears-of-joy-and-expectation-for-god.html
---
19 Behold, at that time I will deal with all your oppressors.
And I will save the lame and gather the outcast,
and I will change their shame into praise and renown in all the earth.
20 At that time I will bring you in, at the time when I gather you together;
for I will make you renowned and praised among all the peoples of the earth,
when I restore your fortunes before your eyes,” says the Lord.
—Zephaniah 3:19–20


In the 1900s the concept of innovation did not become popular until after the Second World War. This is the point in time when people started to talk about technological product innovation and tie it to the idea of economic growth Now 2021, The technological product innovations and ideas are accelarating all over our world.
User interface (UI) design is the design of user interfaces for machines and software, such as computers, home appliances, mobile devices, and other electronic devices, with the focus on maximizing usabilityi and the user experience. (UX/UI Design Software)
The term data analytics refers to the process of examining datasets to draw conclusions about the information they contain. Data analytic techniques enable you to take raw data and uncover patterns to extract valuable insights from it.
Software testing is the process of evaluating and verifying that a software product or application does what it is supposed to do. The benefits of testing include preventing bugs, reducing development costs and improving performance.
A Technical Engineer is usually hired by businesses to maintain their computer hardware and software systems. A Technical Engineer will also support flawless computer software integration by diagnosing and troubleshooting common problems.
Optical character recognition or optical character reader is the electronic or mechanical conversion of images of typed, handwritten or printed text into machine-encoded text, whether from a scanned document, a photo of a document, a scene-photo or from subtitle text superimposed on an image.
This Project is related about agriculture field which we have help to farmer using uinique and innovative technology. We have developed IOT database modeule which we have interconnect with cloud and give to real time output on server and was designed responsive integrated web application to help firmer for notifying real time output on smartphone devices.
Tic-tac-toe, noughts and crosses, or Xs and Os is a software game for two players who take turns marking the spaces in a three-by-three grid with X or O. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.
In Snake Mania, take the role of a snake, and try to maneuver around the arena as you try to complete each level. Your tail is short, and your stomach is growling. So hit that play button, and grow your tiny snake into a great serpent! The forest is a dangerous place, even for a slithering predator!
Experienced Technical Engineer with a demonstrated history of working in the information technology and services industry. Skilled in JavaScript, CSS, React js, Node.js, React Native, MySql Server, UI Designer, Machine Learning.
LinkedIn


This should only be called once when the application starts
This should only be called once when the application shutsdown


{{vm.question.questionAsked}}
Unable to display the specified question either because it does not exist, or because you are not the owner.


Systems engineer:
Systems engineer:
¿Why?
I am one of the people who believe a lot in technology. Technology has allowed the photo of a black hole to be seen for the first time or to discover the cure for smallpox, which alone in the 20th century was responsible for the death of between 300 and 500 million beings. In short, technology is crucial for the development of humanity. However, when I started this path that was not my motivation. I believe a lot in privacy, in freedom of expression and in transparency.  This is why I decided to study Systems Engineering: to help change that.
¿What?
So, ¿what do I do? I dedicate myself to the development of applications and software. I have knowledge in different languages and in different types of technologies or tools such as: SQDeveloper, AWS, MongoDB, Django, Bootstrap and Angular. My main interests are Artificial Intelligence (AI), computer security and the use of technology focused on medicine through synthetic biology.


WITNESS LIST Appropriations-S/C on Article IX Committee March 3, 1999-12:00P Article IX On: Purcell, Carolyn (Dept. of Information Resources)


Juration.js is a natural language time range parser written in javascript. It can also convert durations (in seconds) into human readable strings.
Source and documentation on GitHub
Juration is copyright © 2011 Dom Christie and is released under the MIT licence.


Training with onnxruntime¶
onnxruntime offers the possibility to compute a gradient. Then with some extra lines, it is possible to implement a gradient descent.
Training capabilities are part of the same repository but released under a different package onnxruntime-training. It is not an extension, it replaces onnxruntime and has the same import name. It can be built with different compilation settings or downloaded from pypi. There are two versions to keep a low size for the version which only does inference.
Two training API are available. The first one assumes the loss is part of the graph to train. It can be trained as a whole. The second API assumes the graph is only a piece or a layer in a model trained by another framework or at least a logic which updates the weights. This mechanism is convenient when a model is trained with pytorch.
First API: TrainingSession¶
TrainingSession is used by class
OrtGradientOptimizer
in example
Train a linear regression with onnxruntime-training to show how it could be wrappped
to train a model. Example Train a linear regression with onnxruntime-training in details digs
into the details of the implementation. It goes through the following
steps:
express the loss with ONNX operators
select all initializers to train
fill an instance of TrainingParameters
create an instance of TrainingSession
That’s what method OrtGradientOptimizer._create_training_session
does. It does not implement a training algorithm, only an iteration
- forward + backward - with the expected label, the learning rate and the features
as inputs. The class updates its weights. When the training ends, the user
must collect the updated weights and create a new ONNX file with the
optimized weights.
onnxruntime-training does not implement loss functions.
That must be done independently. That’s what function
onnxcustom.utils.orttraining_helper.add_loss_output()
does.
It implements a couple of usual losses in ONNX.
Another function onnxcustom.utils.orttraining_helper.get_train_initializer()
guesses all the coefficients of an ONNX graph if the user does not specify any.
Another common use not implemented in onnxruntime-training.
GPU is no different. It changes the syntax because data has to be moved on this device first. Example Train a linear regression with onnxruntime-training on GPU in details adapts previous example to this configuration. Finally, a last example compares this approach against scikit-learn in the same conditions.
Second API: TrainingAgent¶
TrainingAgent is used by class
OrtGradientForwardBackwardOptimizer
to train the same model. The training is split into the
forward step, the backward step (gradient computation), the weight
updating step. TrainingAgent implement forward and backward.
Everything else must be explicitely implemented outside of this class
or be taken care of by an existing framework such as this one
or pytorch. First, forward, backward with TrainingAgent.
To build it, the following steps are needed:
fill an instance of OrtModuleGraphBuilderConfiguration
create the training graph with OrtModuleGraphBuilder
retrieve the training graph
create an instance of InferenceSession with this graph
create an instance of TrainingAgent
That’s what method OrtGradientForwardBackward._create_onnx_graphs
does. Forward and backward steps must be called separately.
It is not trivial to guess how to call them (a forward step can be
called to predict or to train if followed by a backward step).
Class OrtGradientForwardBackwardFunction
implements those two steps with the proper API. Next lines gives an
idea on how it can be done. First the forward step.
def forward(self, inputs, training=False):
forward_inputs = cls.input_to_ort(
inputs, cls._devices, cls._debug)
if training:
forward_outputs = OrtValueVector()
state = PartialGraphExecutionState()
self.states_.append(state)
cls._training_agent.run_forward(
forward_inputs, forward_outputs, state, cls._cache)
return forward_outputs
else:
iobinding = SessionIOBinding(cls._sess_eval._sess)
for name, inp in zip(
cls._grad_input_names, forward_inputs):
iobinding.bind_ortvalue_input(name, inp)
for name, dev in zip(
cls._output_names, cls._fw_no_grad_output_device_info):
iobinding.bind_output(name, dev)
cls._sess_eval._sess.run_with_iobinding(
iobinding, cls._run_options)
return iobinding.get_outputs()
Then the backward step.
def backward(self, grad_outputs):
cls = self.__class__
inputs = self.saved_tensors
state = self.states_.pop()
backward_inputs = cls.input_to_ort(
grad_outputs, cls._bw_outputs_device_info, cls._debug)
backward_outputs = OrtValueVector()
cls._training_agent.run_backward(
backward_inputs, backward_outputs, state)
return backward_outputs
The API implemented by class TrainingAgent does not use named inputs, only a list of inputs, the features followed by the current weights. Initializers must be be given names in alphabetical order to avoid any confusion with that API.
Train a linear regression with forward backward changes the previous example
to use class OrtGradientForwardBackwardOptimizer
explains the details of the implementation. This example is the best
place to continue if using the raw API of onnxruntime-training
is the goal. Then the same
example is changed to use GPU: Forward backward on a neural network on GPU.
And finally a benchmark to compare this approach with
scikit-learn: Benchmark, comparison scikit-learn - forward-backward.
Beside forward and backard, the training needs three elements
to be complete.
a loss: a square loss for example
SquareLearningLoss
but it could beElasticLearningPenalty
.a way to update the weight: a simple learning rate for a stockastic gradient descent
LearningRateSGD
or something more complex such asLearningRateSGDNesterov
.a regularization applied to the weight, it could be seen as an extension of the loss but this design seemed more simple as it does not mix the gradient applied to the output and the gradient due to the regularization, the most simple regularization is no regularization with
NoLearningPenalty
, but it could be L1 or L2 penalty as well withElasticLearningPenalty
.
These parts can easily be replaced by the same pieces
implemented in pytorch. That’s what wrapper
class ORTModule offers except it starts from a pytorch
model then converted into ONNX. That’s what shows example
Benchmark, comparison torch - forward-backward. Class OrtGradientForwardBackwardOptimizer
directly starts with the ONNX graph and adds the pieces not implemented
in onnxruntime-training.


| I l@ve RuBoard |
5.11 The zipfile Module(New in 2.0) The zipfile module allows you to read and write files in the popular ZIP archive format. 5.11.1 Listing the ContentsTo list the contents of an existing archive, you can use the namelist and infolist methods used in Example 5-20. The former returns a list of filenames, and the latter returns a list of ZipInfo instances. Example 5-20. Using the zipfile Module to List Files in a ZIP FileFile: zipfile-example-1.py import zipfile file = zipfile.ZipFile("samples/sample.zip", "r") # list filenames for name in file.namelist(): print name, print # list file information for info in file.infolist(): print info.filename, info.date_time, info.file_size sample.txt sample.jpg sample.txt (1999, 9, 11, 20, 11, 8) 302 sample.jpg (1999, 9, 18, 16, 9, 44) 4762 5.11.2 Reading Data from a ZIP FileTo read data from an archive, simply use the read method used in Example 5-21. It takes a filename as an argument and returns the data as a string. Example 5-21. Using the zipfile Module to Read Data from a ZIP FileFile: zipfile-example-2.py import zipfile file = zipfile.ZipFile("samples/sample.zip", "r") for name in file.namelist(): data = file.read(name) print name, len(data), repr(data[:10]) sample.txt 302 'We will pe' sample.jpg 4762 '\377\330\377\340\000\020JFIF' 5.11.3 Writing Data to a ZIP FileAdding files to an archive is easy. Just pass the filename, and the name you want that file to have in the archive, to the write method. The script in Example 5-22 creates a ZIP file containing all files in the samples directory. Example 5-22. Using the zipfile Module to Store Files in a ZIP FileFile: zipfile-example-3.py import zipfile import glob, os # open the zip file for writing, and write stuff to it file = zipfile.ZipFile("test.zip", "w") for name in glob.glob("samples/*"): file.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED) file.close() # open the file again, to see what's in it file = zipfile.ZipFile("test.zip", "r") for info in file.infolist(): print info.filename, info.date_time, info.file_size, info.compress_size sample.wav (1999, 8, 15, 21, 26, 46) 13260 10985 sample.jpg (1999, 9, 18, 16, 9, 44) 4762 4626 sample.au (1999, 7, 18, 20, 57, 34) 1676 1103 ... The third, optional argument to the write method controls what compression method to use or, rather, it controls whether data should be compressed at all. The default is zipfile.ZIP_STORED, which stores the data in the archive without any compression at all. If the zlib module is installed, you can also use zipfile.ZIP_DEFLATED, which gives you "deflate" compression. The zipfile module also allows you to add strings to the archive. However, adding data from a string is a bit tricky; instead of just passing in the archive name and the data, you have to create a ZipInfo instance and configure it correctly. Example 5-23 offers a simple solution. Example 5-23. Using the zipfile Module to Store Strings in a ZIP FileFile: zipfile-example-4.py import zipfile import glob, os, time file = zipfile.ZipFile("test.zip", "w") now = time.localtime(time.time())[:6] for name in ("life", "of", "brian"): info = zipfile.ZipInfo(name) info.date_time = now info.compress_type = zipfile.ZIP_DEFLATED file.writestr(info, name*1000) file.close() # open the file again, to see what's in it file = zipfile.ZipFile("test.zip", "r") for info in file.infolist(): print info.filename, info.date_time, info.file_size, info.compress_size life (2000, 12, 1, 0, 12, 1) 4000 26 of (2000, 12, 1, 0, 12, 1) 2000 18 brian (2000, 12, 1, 0, 12, 1) 5000 31 |
| I l@ve RuBoard |


Open Education, Open Science and other forms of openness: can we benefit from each other?
In addition to open education, open access, open source software and open innovation, the open movement has also developed other varieties of "openness". Although many types of "openness" exist, they are all based on the same basic principles. What is meant by all these forms of openness? And should we strive to a more integrated approach when implementing these forms in real life situations? In this talk I will focus on open education and open science and present how these forms of openness are influenced by other appearances of openness.


The Met.Office makes no guarantees about the availability of this site or the information on it.
All information is Crown Copyright and may not be reproduced, sold on, broadcast or otherwise distributed without the permission of the Met.Office.
The Met.Office will not be liable for any damage, loss or personal injury arising from errors or omissions in the information or the loss of the information.


Craigslist Email Handles-
1<EMAIL_ADDRESS>2. ID @ sale.craigslist.org
3. ID @ reply.craigslist.org
FAQ-
Q: I would like to stop a particular user from contacting me
A: Click the flagging link at the bottom of the message.
Q: I accidentally flagged a message, how can I undo it?
A: At this time it cannot be undone.

A: Use the most recent link.
Q: Can I continue to communicate with respondents after my ad has been removed?
A: Yes, existing reply email communication threads can continue for up to 4 months.
Q: How did the poster find out my real name?
A: The “real name” field your email program provides is passed through to the recipient.
Q: Where can I get more help?
A: https://forums.craigslist.org/?forumID=9


WELCOME
TO DELANI STUDIO
AMAZING PEOPLE ARE MAKING AMAZING DESIGNS IN A FUN ENVIRONMENT
When you work with us, you are part of a team of committed collaborators. All aspects of our software development process are integrated, interactive and agile.
Our approach unites design, development and product management to create exceptional products.
We start each project by understanding your goals, the user's needs and the product requirements
Then we translate them into effective and elegant solutions.
Before we sign a contract or write a line of code our team will spend the necessary time to inderstand your product vision
The outcome of this scoping session is proposal or high-level statement of work
based on your requirements we can provide a complete offering or just the pieces you need.
DESIGN
Our design practice offers a full range of services including brand strategy, interaction and visual design and user experience testing.
Throughout your project, our designers create and implement visual design and workflows, solicit user feedback and work with you to make sure what gets built is what is needed.
DEVELOPMENT
All engineers are fluent in the latest enterprise, mobile and web development technologies.
They collaborate with your team to write, and improve code on a daily basis, using proven practices such as test-driven development and pair programming.
PRODUCT MANAGEMENT
Planning and development is iterative. Because we are constantly coding and testing, the products we build are always ready to go live.
This iterative process allows for changes as business requirements evolve.
DELANI STUDIO
2019


Crunch for use online and offline. Generate wordlists according to your requirements. Give max/min length and provide a character set.
Syntax: crunch <min> <max> <character-set> -t <patter> -o <path>
Pattern is optional
Example: crunch 3 4 ignite -o dict.txt
Will create dictionary min 3 letters, max 4 letters, using only characters found in 'ignite' and output to dict.txt


Open-source developers all over the world are working on millions of projects: writing code & documentation, fixing & submitting bugs, and so forth. GitHub Archive is a project to record the public GitHub timeline, archive it, and make it easily accessible for further analysis.
Looking for the daily top new & watched repository reports? Sign up here.
GitHub provides 18 event types, which range from new commits and fork events, to opening new tickets, commenting, and adding members to a project. The activity is aggregated in hourly archives, which you can access with any HTTP client:
| Query | Command |
|---|---|
| Activity for April 11, 2012, 3PM UTC | wget http://data.githubarchive.org/2012-04-11-15.json.gz |
| Activity for April 11, 2012 | wget http://data.githubarchive.org/2012-04-11-{0..23}.json.gz |
| Activity for April 2012 | wget http://data.githubarchive.org/2012-04-{01..31}-{0..23}.json.gz |
Note: timeline data is available starting February 12, 2011.
Each archive contains a stream of JSON encoded GitHub events (sample), which you can process in any language. Ruby example:
GitHub Archive dataset is also available via Google BigQuery. The JSON data is normalized and is updated every hour, allowing you to run arbitrary queries and analysis over the entire dataset in seconds. To get started, login into the BigQuery console (bigquery.cloud.google.com), and add the project (name: "githubarchive"), or take a look at the 03/11..05/11 snapshot of the data under "publicdata:samples":
An example query, for more check the repository readme:


The bash is very nice if you want to know exactly what your scripts are doing. Unfortunately, its almost always white colored text on a black background, without any accentuation. No bold text, nothing underlined and no colors are used.
You can change this standard behaviour. You can add color to your output.
This is the way you do it:
The mini-program tput can initialize a terminal or query terminfo database. If you want to know more about it, you can take a look at the tput manpage.
A quick example
# Text color variables
txtred=$(tput setaf 1) # Red
txtreset=$(tput sgr0) # Reset your text
echo "Roses are ${txtred}red${txtreset}."
Simply copy this example line by line and then you'll see the expected example.
A shorter way would be
echo "Roses are `tput setaf 1`red`tput sgr0`."
The sgr attribuge
tput sgr 0 1 turn off standout; turn on underline
tput sgr 0 0 turn off standout; turn off underline
tput sgr 1 1 turn on standout; turn on underline
tput sgr 1 0 turn on standout; turn off underline
tput sgr0 short for sgr 0 0
The setaf attribute
setaf 1 Red
setaf 2 Green
setaf 3 Yellow
setaf 4 Blue
setaf 5 Purple
setaf 6 Cyan
setaf 7 Gray
Misc
Make your text bold:
tput bold
Reset your style:
tput sgr0
Advanced Example
Imagine you had a script which generated much output. All messages are important for you, but some are more important than others. You definitely want to see all "[ERROR]" output. So you want to apply a red and bold modification to the stream.
This is the way how "[ERROR]" gets red and bold:
`tput setaf 1``tput bold`[ERROR]`tput sgr0`
You can test it with
echo "`tput setaf 1``tput bold`[ERROR]`tput sgr0`"
I've created a little python script called output.py for testing purposes. It simply outputs a quite long Lorem ipsum text with some random [ERROR] messages.
The next task is to replace the [ERROR] messages. The tool of my choice is sed. See the sed man page for more information. The basic usage is
sed 's/search/replace/'
So we pipe the output to sed:
python output.py | sed 's/$$ERROR$$/MYLOOOOOOOOOOOOOOOOOONGTEST/'
And now we bring it all together:
python output.py | sed 's/[ERROR]/`tput setaf 1``tput bold`[ERROR]`tput sgr0`/'
Doesn't work? Well, lets analyse it.  This means, something we did prevented the bash of replacing our command. If you look carefully at the command, you might see that I used ' instead of ". If you change this, everything is fine:
python output.py | sed "s/$$ERROR$$/`tput setaf 1``tput bold`[ERROR]`tput sgr0`/"
Colorize C / C++ output
You need ANSI color codes:
#include <stdio.h>
int main()
{
printf("\\033[30m%s\\033[0m\n", "black?");
printf("\\033[31m%s\\033[0m\n", "red");
printf("\\033[32m%s\\033[0m\n", "lime");
printf("\\033[33m%s\\033[0m\n", "yellow");
printf("\\033[34m%s\\033[0m\n", "blue");
printf("\\033[35m%s\\033[0m\n", "gray");
printf("\\033[36m%s\\033[0m\n", "blue");
printf("\\033[37m%s\\033[0m\n", "light gray");
printf("\\033[38m%s\\033[0m\n", "black?");
printf("\\033[39m%s\\033[0m\n", "black?");
printf("\\033[41m%s\\033[0m\n", "red background");
printf("\\033[1;34m%s\\033[0m\n", "bold and blue");
printf("\\033[4m%s\\033[0m\n", "underlined");
printf("\\033[9m%s\\033[0m\n", "strike");
return 0;
}
\033 is the ASCII 27 ESC character. It has to be followed by "[". After that you can write one or two numbers separated by ";". Then you have to write "m". You can get back to standard output with "\033[0m". The numbers 30–37 change the color, 4 is a single underline.
I guess these will also work for Java, but I didn't test it.
Do you know what setaf or sgr stand for? Do you know further "terminal enhancement" tricks? Just leave a post!


module_afa_to_nex module¶
This module is for afa_to_nex.py script and others, which use the same functions.
-
module_afa_to_nex.
afa_to_nex
(infilepath, outfilepath=None)[source]¶ Takes an aligned fasta file (protein) and writes a nexus format file.
-
module_afa_to_nex.
delete_extra_mesquite_lines
(infilepath)[source]¶ Remove extra blocks added by Mesquite, if present. This prevents Biopython from raising an error about an unmatched ‘end’ in one of the nexus blocks. The extra blocks are not necessary anyway.
-
module_afa_to_nex.
determine_alphabet
(filepath)[source]¶ Automatically determine what alphabet to use for a given file.
-
module_afa_to_nex.
nex_to_afa
(infilepath, outfilepath)[source]¶ Takes a nexus file (protein) and writes an aligned fasta file.


Checkout form
Your cart
Total (USD)
Billing address
First name
Valid first name is required.
Last name
Valid last name is required.
Email
Please enter a valid email address for shipping updates.
Payment
Credit card
Debit card
PayPal
Name on card
Full name as displayed on card
Name on card is required
Credit card number
Credit card number is required
Expiration
Expiration date required
CVV
Security code required
Continue to checkout


My annual appraisal
| Name | Position | Department | Manager | Goals | Behavioral competencies | Your impact | Development plan | |
|---|---|---|---|---|---|---|---|---|
| Ani Hakobyan | Regional marketing manager - CIS & Mongolia | Member firm development | Gurgen Hakobyan | View goals | View behavioral competencies | View your impact | View development plan |
Team members’ annual appraisal
| Name | Position | Department | Manager | Goals | Behavioral competencies | Your impact | Development plan | |
|---|---|---|---|---|---|---|---|---|
| Karen Poghosyan | Regional marketing manager - CIS & Mongolia | Member firm development | Gurgen Hakobyan | View goals | View behavioral competencies | View your impact | View development plan | |
| Karen Poghosyan | Regional marketing manager - CIS & Mongolia | Member firm development | Gurgen Hakobyan | View goals | View behavioral competencies | View your impact | View development plan |
SMART objectives
Read the guideline to help you shape up objectives for this year.
User guidelines
Learn how to use all features of MyPerformance system.


The Subutai Blockchain Router is a power-efficient, “green” broadband Cloud router, and open hardware IoT gateway (Industrial Edition). The residential edition serves as a plug-and-play cryptocurrency wallet and mining device that allows users to easily enter the cryptocurrency economy. Using just 40W (standalone; 100W with additional Mining Drives), the Subutai Blockchain Router is eco-friendly, cost-effective, and 10-20x more energy efficient for the same hash rate over traditional GPU-based mining devices —a critically important consideration in today’s energy-aware environment.
Subutai™ Blockchain Router
Beyond its advanced network functions, the Subutai Blockchain Router’s features benefit those telcos and ISPs who offer Subutai to their Internet subscribers. Users simply plug-and-mine cryptocurrency with no special technical skills needed. The device provides users a passive income of up to ~$400 USD worth of crypto per month (at current rates). The Router also provides a simple interface for users to easily select different coins to mine. The factory default however uses an "Auto Mode" to dynamically infer the most profitable PoW algorithm and coin network to mine on thanks to GEMNET's intelligent mining services.
The Router’s defense-grade hardware secured wallet with detachable Trusted Platform Module (TPM) eliminates software wallet confusion, and can be swapped into a new router in minutes to facilitate the RMA process.
The Subutai Blockchain Router provides users with a “personal ATM at home”. When needing to transact rapidly on the go, mobile integrations allow users to securely connect, manage, and transact with their router wallet’s funds protected by the router’s enhanced security.
The Subutai Blockchain Router v2.0 comes pre-installed with Subutai tuned using a hardware accelerated version of Subutai’s PeerOS. Users of the Blockchain Router can easily register with the Subutai Bazaar —“The Airbnb of Cloud and IoT Computing Resources”— to quickly list, share, and sell compute resources.
As a flexible IoT gateway, the Blockchain Router allows devices on the edge to be securely and efficiently connected to cloud applications. Subutai treats the cloud and the fog as one and the same, in a single continuum, to prevent unnecessary round-trip device communication with servers in data centers from impacting performance and security. As a multifunction device it can be configured to be a media center, a home/industrial automation and security system, and more.
Highly adaptive, the Blockchain Router’s security and performance-accelerated firmware dynamically changes its configuration to respond to usage behavior and to any potential threats encountered. Dynamic hardware acceleration allows the device to alter its circuitry as a field programmable device even years after purchasing it. The Router optimizes performance and provides additional security capabilities by filtering network packets at line rate. It analyzes traffic patterns to detect performance bottlenecks, potential security threats, and immediately deploy counter-measures. By hardware accelerating SDN and NFV functionality, the router enables the main CPU to remain focused on its core routing functions and multifunctions users configure it for.
Beyond the Blockchain Router’s field programmable aspects, entirely new functionality can be added by attaching shields for Arduinos and Raspberry Pi devices. Anything from a detector, to a motor controller, or even a peripheral connect bus can be added to create IoT applications limited only by the imagination.
The Router’s high speed flash-based storage can exceed the speeds of most SATA-III drives. It can be used as network attached storage (NAS) device or a high speed digital recorder.


--- layout: archive_en permalink: /documentation_en/ title: "Documentation" sidebar: nav: "documentation_en" ---
KARUTA is an opensource software for the construction of electronic portfolios. It is a flexible tool that allows the design of portfolios for multiple purposes: showcasing, support to learning, support to learning assessment.
Portfolio development may be done starting from scratch with the basic elements supplied in Karuta, or from templates supplied by the community and then adapted for specific needs.
The Karuta documentation is organized in three sections:
The Portfolio section presents the structural elements, the resources (elements that will contain the data), the metadata and the layout (CSS).
The Report Script section presents the commands used to build tables and dashboards, the layout of tables, and tables that can be edited by end users. The report script commands are used to navigate through portfolios, select certain elements, and display those elements in a table.
The Batch Script section presents the commands used to automate creating, updating and deleting portfolios, as well as creating or deleting user accounts.
KARUTA is multilingual (by default English and French). The element labels are saved in the
language selected in the language menu. In end user menus and end user help nodes, labels must
be appended with the language code and separated by the slash /
.
Example : Add a photo@en/Ajouter une photo@fr
A Karuta user is associated to a specific portfolio in a specific role - for example the student or teacher role (the designer decides on the role names). For each portfolio, a user group is created for each role the designer has defined. Then, to associate a user with a role, this user is placed in the corresponding user group.
There are three predefined roles:
designer
This is the user that builds portfolios. This person has all the rights
and permissions on all the portfolio elements, without regard to the roles specified in the
metadata of an element.
all
This keyword includes all roles defined on the portfolio.
user
This keyword will be replaced by the ID of the end user at the time of
portfolio instanciation. Only this specific user may then have this role.


Marseille
FRANCE
+33 6 67 89 50 79
FRANCE
<EMAIL_ADDRESS>REPLY IN 24 HOURS
Murat Kamberoglu
Graphic Designer
PHONE (FR)
: +33 6 67 89 50 79
EMAIL
<EMAIL_ADDRESS>View CV
This website is under construction
0
Coder Degrees
0
Project Completed
0
Satisfied Clients
0
Finished Projects


Static utility methods describing the TensorFlow runtime.
| static byte[] |
loadLibrary(String filename)
Load the dynamic library in filename and register the operations and kernels present in that
library.
|
| static byte[] |
registeredOpList()
All the TensorFlow operations available in this address space.
|
| static String |
version()
Returns the version of the underlying TensorFlow runtime.
|
Load the dynamic library in filename and register the operations and kernels present in that library.
| filename | Path of the dynamic library containing operations and kernels to load. |
|---|
| UnsatisfiedLinkError | if filename cannot be loaded. |
|---|
All the TensorFlow operations available in this address space.
Returns the version of the underlying TensorFlow runtime.


While coding is a relatively new enterprise for me, it satisfies a need for creativity and lifelong learning that I have carried throughout my career. I have recently (Oct 2017) completed the Full Stack Code Immersion program with Tech Talent South in Wilmington and I am currently taking their Javascript course. I had been a cook/chef for nearly 20 years and followed that with a year in Marketing and Customer Service. To say that Software Development felt like a leap of faith is a bit of an understatement, but past the challenges of learning something new I see the same joys that I saw in cooking. The camaraderie of a team environment, the steady quest for perfection, the joy of seeing something refined built out of raw ideas and the overall satisfaction of accomplishing goals.
Outside of work I'm family-oriented and I can be found most weekend spending time with my wife and pets or sharing a meal and football game with the in-laws. I'm a massive soccer fan and will happily talk your ear off about English Premier League Football and enjoy just about all types of music and movies. I feel like one of my greatest strengths is my wealth of different life experiences, making me a natural leader and team player and giving me great joy in seeing both myself and others succeed.


| Home | Trees | Indices | Help |
|
|---|
|
|
httplib.HTTPConnection --+ | HttpConnectionHandler
Implements HttpConnectionHandler.
Responsible for creating custom HTTP connection object to support HTTP proxy connection. Overwrites HTTPConnection, must putrequest.
|
|||
|
Inherited from |
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|
|||
http_proxy =
|
|||
|
Inherited from Inherited from |
|
Inits HttpConnectionHandler with host and port. Args: host: str proxy's HTTP host or combined form of host:port. [optional] port: int proxy's HTTP port number. strict: bool if True, causes BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. This argument is ignored. timeout: int blocking operations will timeout after that many seconds. This argument is ignored.
|
Send a line to the server consisting of the request string, the selector string, and the HTTP version. Args: method: str HTTP request method. url: str selector URL. [optional] skip_host: bool if True, disable automatic sending of Host header. skip_accept_encoding: bool if True, disable automatic sending of Accept-Encoding header.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |


--- layout: snippet title: "Radio" permalink: /examples/forms/radio-group-buttons/ sitemap: false ---