Examples
Basic
basic / helloworld
basic / model
basic / mouse
basic / debugging
basic / extending
basic / threejs
Softbody
softbody / sphere
softbody / cloth
softbody / cloth2
softbody / cloth3
softbody / ropes
Design
design / easter
design / points
design / saturn
Physics
constraints / dof
constraints / hinge
constraints / point
constraints / slider
physics / domino
physics / filtering
FPS
fps / shooter
Post Processing
postprocessing / basic-glitch
Performance
performance / sticks
performance / softbodies
Source code


Further Info
Get in touch with DSG Physics Academy!
I have read and agreed with all the
Terms and Conditions.
REQUIRED FIELDS
SUBMIT
RESET


PLTOTF(1) PLTOTF(1) NAME pltotf - convert property list files to TeX font metric (tfm) format SYNOPSIS pltotf [-verbose] pl_file_name[.pl] [tfm_file_name[.tfm]] DESCRIPTION This manual page is not meant to be exhaustive. The complete documenta‐ tion for this version of TeX can be found in the info file or manual Web2C: A TeX implementation. The pltotf program translates a (human-oriented) property list file to a (program-oriented) TeX font metric file. Thus, after editing the property list file, a TFM file can be generated for use with, for example, tex(1). The pl_file_name is extended with .pl if it lacks a suffix. No path searching is done. If no tfm_file_name is given, the basename of pl_file_name with suffix .tfm is used; otherwise tfm_file_name is extended with .tfm if it lacks a suffix. OPTIONS Without the -verbose option, pltotf operates silently. With it, a banner and progress report are printed on stdout. SEE ALSO tftopl(1). Donald E. Knuth, TeX for nroffware. Donald E. Knuth, The Metafontbook, (Volume C of Computers and Typeset‐ ting), Addison-Wesley, 1986, ISBN 0-201-13445-4. AUTHORS Donald E. Knuth wrote the program. It was published as part of the TeX for nroffware technical report, available from the TeX Users Group. Howard Trickey, Pavel Curtis, and Richard Furuta originally ported it to Unix. Web2C 2012 27 December 1992 PLTOTF(1)


Please either:
- remove the out-of-policy shares from the files
- move the files to a parent folder for which these shares are permitted
{{ template "permissions" .NotificationMap }}
{{ template "policy" .FolderPolicyArr }}
{{ template "flags" .FlagArr }}
{{ template "logs" .LogArr }}


Toggle navigation
TeamApp
Start
Profile
Courses
Feedback
Log Out
Sign up
Type your new credentials:
Submit


--- type: buttons title: Base button usage: Base style for all buttons and links with the "btn" class. stylesheet: '/scss/elements/btn.scss' ---


The process of upgrading or replacing an existing Wep application demands careful planning, meticulous execution, and seamless transition to ensure the continued success of your digital offering. As we embark on the journey of building the successor to our current application, it is imperative that we recognize the pivotal role that thorough documentation plays in this transformative endeavor.
Documentation serves as the cornerstone upon which our replacement SPA will be constructed. It provides a bridge between the existing application's functionality and the future iteration's enhancements, enabling us to not only replicate but also refine the user experience. In the following sections, we will delve into the myriad reasons why comprehensive documentation is a strategic necessity, aiding us in delivering a replacement app that seamlessly upholds user expectations, functionality, and security.
The documentation outlined in this effort transcends being a mere reference; it's a blueprint that empowers our development team to reconstruct, elevate, and modernize the app while minimizing risks and disruptions. By meticulously recording critical aspects such as the application's structure, user interactions, API endpoints, security measures, and design guidelines, we ensure a synchronized transition that mitigates pitfalls and surprises.
Furthermore, this documentation safeguards institutional knowledge and expertise. It encapsulates insights acquired over time, providing a valuable resource for the replacement app's development team. As we navigate the complexities of evolving technology and changing user needs, this documentation equips us to make informed decisions, fostering continuity and innovation.
Our commitment to comprehensive documentation reflects a commitment to excellence. It is a proactive measure that demonstrates our dedication to delivering a replacement SPA that not only meets but exceeds user expectations. By embracing this endeavor, we pave the way for a smoother development process, a seamless user experience, and a robust foundation upon which we can continue to build and innovate.
In the subsequent sections, we will explore each facet of documentation in detail, illustrating how it contributes to the strategic roadmap that will guide us towards a successful transition. As we embark on this exciting journey, let us recognize the significance of the documentation effort in shaping our replacement SPA into a beacon of innovation and user-centric design.
Sitemap: A representation of the web application's structure, illustrating the hierarchy of pages and sections.
The sitemap offers a visual roadmap that aids developers in comprehending the app's layout and navigation, enabling them to replicate and enhance this structure in the replacement app efficiently.
User Story / Use Case Library: A compilation of user-focused scenarios or detailed cases describing interactions with the application.
User stories provide a user-centered view of the application's features, ensuring the replacement app maintains essential functionalities that align with user needs and expectations.
API Call Endpoint Listing: An inventory of available API endpoints, outlining their inputs, outputs, authentication requirements, and permissions.
This listing acts as a guide for developers, allowing them to integrate existing functionalities seamlessly into the replacement app's APIs, ensuring consistency and reliability.
Major Landing Pages: The primary entry points that users encounter when accessing the app.
Identifying major landing pages helps maintain a smooth transition for users by ensuring that familiar access points remain intact in the replacement app.
Landing Page Mapping to Use Cases: Connecting landing pages to specific user stories or use cases they support.
This mapping clarifies the relationships between app sections and user functionalities, facilitating a structured approach to replicating these interactions in the new app.
Security:
Understanding authentication methods ensures that user accounts remain secure during the transition to the replacement app.
Documenting authorization rules maintains data security and user access controls, providing a secure experience in the replacement app.
Proper session management guarantees a seamless and secure user experience during the migration to the new app.
Error Handling: The app's approach to managing errors, exceptions, and unexpected situations.
Documenting error handling strategies helps developers maintain user-friendly error messages, preserving the app's reliability and user satisfaction in the new version.
Maintenance Message/Behavior: How the app behaves during maintenance periods and communicates such events to users.
This documentation ensures a consistent approach to communicating maintenance periods, minimizing disruption and confusion during both the existing and new app's lifecycles.
Notifications: The methods through which the app communicates important messages or updates to users.
Understanding notification mechanisms ensures that users continue to receive relevant information in the replacement app, maintaining user engagement and satisfaction.
Personalization: Features allowing users to customize their experience based on preferences.
Documenting personalization aspects helps preserve user satisfaction by replicating tailored experiences in the replacement app.
Help (In-Application): Resources or assistance provided within the app to guide users in using its features.
Documenting help resources ensures that users can access assistance and guidance seamlessly in the replacement app, enhancing usability and reducing user frustration.
UX Style & Design Guide: Guidelines for the app's visual design, including elements like colors, typography, and layout.
Replicating the design guide maintains consistency in user experience and branding, providing a familiar and coherent interface for users in the replacement app.
Content (Logos, Icons, Images): Visual assets used in the app, including branding elements.
Documenting these assets facilitates the maintenance of a consistent visual identity, ensuring a seamless transition for users to the replacement app.


{% extends "learn/pages/level-2-base.html" %} {% import "partials/_utils.html" as utils %} {% import "learn/pages/partials/_learn_pages_utils.html" as learn_pages_utils %} {% block lhs_toc %} Table of contents
{% endblock %} {% block learn_content %}Before the lecture, please read the following chapters:
Question 1: Which of the following is a valid list comprehension?
{{ learn_pages_utils.render_question_responses(1, [ (False, "x = [append(2 * x) for x in range(5)]
", "Incorrect. We don't need append
"),
(False, "x = listcomp(2 * x, min=0, max=10)
", "Incorrect."),
(True, "x = [2 * x for x in range(5)]
", "Correct!"),
])
}}
Question 2: What is the result of executing following program?
a = [1, 1, 2, 3]
b = [1, 3, 5, 7]
print(set(a) - set(b))
{{
learn_pages_utils.render_question_responses(2, [
(True, "{2}
", "Correct!"),
(False, "{1, 2}
", "Incorrect. Close, but remember how set()
works"),
(False, "{2, 5, 7}
", "Incorrect. We're subtracting b
from a
(you did the opposite way)"),
(False, "{1, 2, 3, 5, 7}
", "Incorrect. Look again, we're doing set subtraction, not addition"),
(False, "(error)", "Incorrect. This is perfectly valid Python code"),
])
}}
Question 3: What will be printed by the following program?
def my_generator(start, end, step_size):
current = start
while current < end:
yield current
current += step_size
gen = my_generator(5, 50, 10)
next(gen)
print(next(gen))
{{
learn_pages_utils.render_question_responses(3, [
(False, "5", "Incorrect. Remember that generator objects have a concept of internal state"),
(False, "10", "Incorrect. Try tracing through the code again"),
(True, "15", "Correct!"),
(False, "50", "Incorrect. Try tracing through the code again"),
(False, "(error)", "Incorrect. This is perfectly valid Python code"),
])
}}
myfilter(lst, f)
that takes a list
(lst) and a function
(f) and returns a new list that represents a "filtered" list from calling f
on each element. Your myfilter
function should use a list comprehension. For example...def myfilter(lst, f):
# Your code here
pass
def is_odd(x):
return x % 2 == 1
my_list = [1, 2, 3, 4, 5]
new_list = myfilter(my_list, is_odd)
print(new_list)
# output: [1, 3, 5]
# file: a.txt
This is line 1.
This is another line.
Here is a third line!
I love Python!
# file: b.txt
I am another file
I love Python!
This is another line.
# running our program
$ python3 overlap.py a.txt b.txt
This is another line.
I love Python!
Congratulations! You've now finished the content of the level 2 course. You should have a solid understanding (or at least familiarity) with all of the major tools and concepts used as the building blocks for programming. Depending on your interests, there are many different ways you could go from here to extend your learning.
I want to learn more Python specifically
I want to learn more computer science
I want to learn some specific libraries for practical use
I want to take online courses to reinforce my learning
I just want to practice writing more projects


SLHISTROC Computes the ROC curve from value histogram $ Syntax $ - [thrs, fas, frs] = slhistroc(hist_a, hist_r, sepvals, op) $ Arguments $ - hist_a: the histogram of the values that should be accepted - hist_r: the histogram of the values that should be rejected - sepvals: the separation values of the histograms - op: the option of the attributes of the values - thrs: the sampled threshold values - fars: the false accept rates at the sampled thresholds - frrs: the false reject rates at the sampled thresholds $ Description $ - [thrs, fas, frs] = slhistroc(hist_a, hist_r, sepvals, op) computes the ROC curve based on histograms. The hist_a and hist_r should have corresponding bins, and the bins are sorted in ascending order of the values they represent. Suppose the number of bins be n, then sepvals are the values on the bin edges, and the length of sepvals should be n. Note that the histtograms should be created following the rules as in histc, so the last element of histogram is the number of elements that exactly match the last sep value. The op can be either 'low' or 'high', when it is 'low', the value lower than threshold would be accepted, otherwise the value higher than threshold would be accepted. The output thrs is just sepvals, while fars and frrs are corresponding false accept rates and false reject rates, with n = nbins + 1 elements. $ History $ - Created by Dahua Lin, on Aug 8th, 2006
0001 function [thrs, fars, frrs] = slhistroc(hist_a, hist_r, sepvals, op) 0002 %SLHISTROC Computes the ROC curve from value histogram 0003 % 0004 % $ Syntax $ 0005 % - [thrs, fas, frs] = slhistroc(hist_a, hist_r, sepvals, op) 0006 % 0007 % $ Arguments $ 0008 % - hist_a: the histogram of the values that should be accepted 0009 % - hist_r: the histogram of the values that should be rejected 0010 % - sepvals: the separation values of the histograms 0011 % - op: the option of the attributes of the values 0012 % - thrs: the sampled threshold values 0013 % - fars: the false accept rates at the sampled thresholds 0014 % - frrs: the false reject rates at the sampled thresholds 0015 % 0016 % $ Description $ 0017 % - [thrs, fas, frs] = slhistroc(hist_a, hist_r, sepvals, op) computes 0018 % the ROC curve based on histograms. The hist_a and hist_r should have 0019 % corresponding bins, and the bins are sorted in ascending order of 0020 % the values they represent. Suppose the number of bins be n, then 0021 % sepvals are the values on the bin edges, and the length of sepvals 0022 % should be n. Note that the histtograms should be created following 0023 % the rules as in histc, so the last element of histogram is the 0024 % number of elements that exactly match the last sep value. 0025 % The op can be either 'low' or 'high', when it is 'low', the value 0026 % lower than threshold would be accepted, otherwise the value higher 0027 % than threshold would be accepted. 0028 % The output thrs is just sepvals, while fars and frrs are 0029 % corresponding false accept rates and false reject rates, with 0030 % n = nbins + 1 elements. 0031 % 0032 % $ History $ 0033 % - Created by Dahua Lin, on Aug 8th, 2006 0034 % 0035 0036 %% parse and verify arguments 0037 0038 if nargin < 4 0039 raise_lackinput('slhistroc', 4); 0040 end 0041 0042 nbins = length(hist_a); 0043 if length(hist_r) ~= nbins 0044 error('sltoolbox:sizmismatch', ... 0045 'The sizes of hist_a and hist_r are inconsistent'); 0046 end 0047 if length(sepvals) ~= nbins 0048 error('sltoolbox:sizmismatch', ... 0049 'The length of sepvals should be number of bins'); 0050 end 0051 0052 0053 %% Compute ROC 0054 0055 % preprocess 0056 hist_r(end-1) = hist_r(end-1) + hist_r(end); 0057 hist_a(end-1) = hist_a(end-1) + hist_a(end); 0058 hist_r = hist_r(1:end-1); 0059 hist_a = hist_a(1:end-1); 0060 0061 hist_r = hist_r(:); 0062 hist_a = hist_a(:); 0063 thrs = sepvals(:); 0064 0065 nr = sum(hist_r); 0066 na = sum(hist_a); 0067 0068 0069 switch op 0070 case 'low' 0071 fars = [0; cumsum(hist_r)] / nr; 0072 frrs = [na; na - cumsum(hist_a)] / na; 0073 0074 case 'high' 0075 fars = [nr; nr - cumsum(hist_r)] / nr; 0076 frrs = [0; cumsum(hist_a)] / na; 0077 0078 otherwise 0079 error('sltoolbox:invalidarg', ... 0080 'Invalid option %s for roc', op); 0081 end 0082 0083 0084 0085


What is Mashment Maker :
How to use it :
Warning: Composed modules are shared.
Someone
could change/delete your modules or create evil ones!
Sources: visualres.js and engine.js
What is Mashment Maker :
How to use it :
Warning: Composed modules are shared.
Someone
could change/delete your modules or create evil ones!
Sources: visualres.js and engine.js


klarna-mobile-sdk / com.klarna.mobile.sdk.payments / KlarnaPaymentViewCallBack / onLoaded
onLoaded
@MainThread abstract fun onLoaded(view: PaymentView): Unit
Called after PaymentView.load was successful.
Parameters
view
- the view which has finished loading.


Server date and time:
Request type:
Status:
Refresh time: 0 sec
Expiration time: 0 sec
Server date and time:
Request type:
Status:
Refresh time: 0 sec
Expiration time: 0 sec
Current ID: 0
URL:
Server date and time:
Request type:
Status:
Refresh time: 0 sec
Expiration time: 0 sec


About Batdelger Otgonbaatar
My name is Batdelger, from Mongolia. I am predominant-kapha.
My Classes This Quarter
-
CS 401 - Modern Programming Practices
-
STC 506A - Science and Technology of Consciousness (Part 1)
-
CS 472 - Web Application Programming
My Favorite Movies
My Moods
Happy
Sad
Fun Facts About My Neighors
-
Chiba: He is trying to lose weight
-
Yohannes: He is a very hardworking guy


| Top |
A Hit Test is an operation to get context information about a given point in a WebKitWebView. WebKitHitTestResult represents the result of a Hit Test. It provides context information about what is at the coordinates of the Hit Test, such as if there's a link, an image or a media.
You can get the context of the HitTestResult with
webkit_hit_test_result_get_context()
that returns a bitmask of
WebKitHitTestResultContext flags. You can also use
webkit_hit_test_result_context_is_link()
, webkit_hit_test_result_context_is_image()
and
webkit_hit_test_result_context_is_media()
to determine whether there's
a link, image or a media element at the coordinates of the Hit Test.
Note that it's possible that several WebKitHitTestResultContext flags
are active at the same time, for example if there's a link containing an image.
When the mouse is moved over a WebKitWebView a Hit Test is performed for the mouse coordinates and “mouse-target-changed” signal is emitted with a WebKitHitTestResult.
guint
webkit_hit_test_result_get_context (WebKitHitTestResult *hit_test_result
);
Gets the value of the “context” property.
gboolean
webkit_hit_test_result_context_is_link
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_image
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_media
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_editable
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE
flag is present in
“context”.
gboolean
webkit_hit_test_result_context_is_selection
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION
flag is present in
“context”.
TRUE
if there's a selected element at the coordinates of the hit_test_result
,
or FALSE
otherwise
Since: 2.8
gboolean
webkit_hit_test_result_context_is_scrollbar
(WebKitHitTestResult *hit_test_result
);
Gets whether WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR
flag is present in
“context”.
const gchar *
webkit_hit_test_result_get_link_uri (WebKitHitTestResult *hit_test_result
);
Gets the value of the “link-uri” property.
the URI of the link element in the coordinates of the Hit Test,
or NULL
if there isn't a link element in hit_test_result
context
const gchar *
webkit_hit_test_result_get_link_title (WebKitHitTestResult *hit_test_result
);
Gets the value of the “link-title” property.
the title of the link element in the coordinates of the Hit Test,
or NULL
if there isn't a link element in hit_test_result
context or the
link element doesn't have a title
const gchar *
webkit_hit_test_result_get_link_label (WebKitHitTestResult *hit_test_result
);
Gets the value of the “link-label” property.
the label of the link element in the coordinates of the Hit Test,
or NULL
if there isn't a link element in hit_test_result
context or the
link element doesn't have a label
const gchar *
webkit_hit_test_result_get_image_uri (WebKitHitTestResult *hit_test_result
);
Gets the value of the “image-uri” property.
the URI of the image element in the coordinates of the Hit Test,
or NULL
if there isn't an image element in hit_test_result
context
const gchar *
webkit_hit_test_result_get_media_uri (WebKitHitTestResult *hit_test_result
);
Gets the value of the “media-uri” property.
the URI of the media element in the coordinates of the Hit Test,
or NULL
if there isn't a media element in hit_test_result
context
Enum values with flags representing the context of a WebKitHitTestResult.
“context”
property“context” guint
Bitmask of WebKitHitTestResultContext flags representing the context of the WebKitHitTestResult.
Flags: Read / Write / Construct Only
Default value: 0
“image-uri”
property“image-uri” gchar *
The URI of the image if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“link-label”
property“link-label” gchar *
The label of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“link-title”
property“link-title” gchar *
The title of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“link-uri”
property“link-uri” gchar *
The URI of the link if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL
“media-uri”
property“media-uri” gchar *
The URI of the media if flag WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
is present in “context”
Flags: Read / Write / Construct Only
Default value: NULL


2 Samuel 19:25
And it came to pass, when he was come to Jerusalem to meet the king, that the king said unto him, Wherefore wentest not thou with me, Mephibosheth?


DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON https://guides.rubyonrails.org.
Active Storage Overview
This guide covers how to attach files to your Active Record models.
After reading this guide, you will know:
- How to attach one or many files to a record.
- How to delete an attached file.
- How to link to an attached file.
- How to use variants to transform images.
- How to generate an image representation of a non-image file, such as a PDF or a video.
- How to send file uploads directly from browsers to a storage service, bypassing your application servers.
- How to clean up files stored during testing.
- How to implement support for additional storage services.
What is Active Storage?
Active Storage facilitates uploading files to a cloud storage service like Amazon S3, Google Cloud Storage, or Microsoft Azure Storage and attaching those files to Active Record objects. It comes with a local disk-based service for development and testing and supports mirroring files to subordinate services for backups and migrations.
Using Active Storage, an application can transform image uploads or generate image representations of non-image uploads like PDFs and videos, and extract metadata from arbitrary files.
Requirements
Various features of Active Storage depend on third-party software which Rails
will not install, and must be installed separately:
- libvips v8.6+ or ImageMagick for image analysis and transformations
- ffmpeg v3.4+ for video previews and ffprobe for video/audio analysis
- poppler or muPDF for PDF previews
Image analysis and transformations also require the image_processing
gem. Uncomment it in your Gemfile
, or add it if necessary:
gem "image_processing", ">= 1.2"
TIP: Compared to libvips, ImageMagick is better known and more widely available. However, libvips can be up to 10x faster and consume 1/10 the memory. For JPEG files, this can be further improved by replacing libjpeg-dev
with libjpeg-turbo-dev
, which is 2-7x faster.
WARNING: Before you install and use third-party software, make sure you understand the licensing implications of doing so. MuPDF, in particular, is licensed under AGPL and requires a commercial license for some use.
Setup
$ bin/rails active_storage:install
$ bin/rails db:migrate
This sets up configuration, and creates the three tables Active Storage uses:
active_storage_blobs
, active_storage_attachments
, and active_storage_variant_records
.
| Table | Purpose |
|---|---|
active_storage_blobs |
Stores data about uploaded files, such as filename and content type. |
active_storage_attachments |
A polymorphic join table that connects your models to blobs. If your model's class name changes, you will need to run a migration on this table to update the underlying record_type to your model's new class name. |
active_storage_variant_records |
If variant tracking is enabled, stores records for each variant that has been generated. |
WARNING: If you are using UUIDs instead of integers as the primary key on your models, you should set Rails.application.config.generators { |g| g.orm :active_record, primary_key_type: :uuid }
in a config file.
Declare Active Storage services in config/storage.yml
. For each service your
application uses, provide a name and the requisite configuration. The example
below declares three services named local
, test
, and amazon
:
local:
service: Disk
root: <%= Rails.root.join("storage") %>
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
amazon:
service: S3
access_key_id: ""
secret_access_key: ""
bucket: ""
region: "" # e.g. 'us-east-1'
Tell Active Storage which service to use by setting
Rails.application.config.active_storage.service
. Because each environment will
likely use a different service, it is recommended to do this on a
per-environment basis. To use the disk service from the previous example in the
development environment, you would add the following to
config/environments/development.rb
:
# Store files locally.
config.active_storage.service = :local
To use the S3 service in production, you add the following to
config/environments/production.rb
:
# Store files on Amazon S3.
config.active_storage.service = :amazon
To use the test service when testing, you add the following to
config/environments/test.rb
:
# Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test
NOTE: Configuration files that are environment-specific will take precedence:
in production, for example, the config/storage/production.yml
file (if existent)
will take precedence over the config/storage.yml
file.
It is recommended to use Rails.env in the bucket names to further reduce the risk of accidentally destroying production data.
amazon:
service: S3
# ...
bucket: your_own_bucket-<%= Rails.env %>
google:
service: GCS
# ...
bucket: your_own_bucket-<%= Rails.env %>
azure:
service: AzureStorage
# ...
container: your_container_name-<%= Rails.env %>
Continue reading for more information on the built-in service adapters (e.g.
Disk
and S3
) and the configuration they require.
Disk Service
Declare a Disk service in config/storage.yml
:
local:
service: Disk
root: <%= Rails.root.join("storage") %>
S3 Service (Amazon S3 and S3-compatible APIs)
To connect to Amazon S3, declare an S3 service in config/storage.yml
:
amazon:
service: S3
access_key_id: ""
secret_access_key: ""
region: ""
bucket: ""
Optionally provide client and upload options:
amazon:
service: S3
access_key_id: ""
secret_access_key: ""
region: ""
bucket: ""
http_open_timeout: 0
http_read_timeout: 0
retry_limit: 0
upload:
server_side_encryption: "" # 'aws:kms' or 'AES256'
cache_control: "private, max-age=<%= 1.day.to_i %>"
TIP: Set sensible client HTTP timeouts and retry limits for your application. In certain failure scenarios, the default AWS client configuration may cause connections to be held for up to several minutes and lead to request queuing.
Add the aws-sdk-s3
gem to your Gemfile
:
gem "aws-sdk-s3", require: false
NOTE: The core features of Active Storage require the following permissions: s3:ListBucket
, s3:PutObject
, s3:GetObject
, and s3:DeleteObject
. Public access additionally requires s3:PutObjectAcl
. If you have additional upload options configured such as setting ACLs then additional permissions may be required.
NOTE: If you want to use environment variables, standard SDK configuration files, profiles,
IAM instance profiles or task roles, you can omit the access_key_id
, secret_access_key
,
and region
keys in the example above. The S3 Service supports all of the
authentication options described in the AWS SDK documentation.
To connect to an S3-compatible object storage API such as DigitalOcean Spaces, provide the endpoint
:
digitalocean:
service: S3
endpoint: https://nyc3.digitaloceanspaces.com
access_key_id: ...
secret_access_key: ...
# ...and other options
There are many other options available. You can check them in AWS S3 Client documentation.
Microsoft Azure Storage Service
Declare an Azure Storage service in config/storage.yml
:
azure:
service: AzureStorage
storage_account_name: ""
storage_access_key: ""
container: ""
Add the azure-storage-blob
gem to your Gemfile
:
gem "azure-storage-blob", "~> 2.0", require: false
Google Cloud Storage Service
Declare a Google Cloud Storage service in config/storage.yml
:
google:
service: GCS
credentials: <%= Rails.root.join("path/to/keyfile.json") %>
project: ""
bucket: ""
Optionally provide a Hash of credentials instead of a keyfile path:
google:
service: GCS
credentials:
type: "service_account"
project_id: ""
private_key_id: <%= Rails.application.credentials.dig(:gcs, :private_key_id) %>
private_key: <%= Rails.application.credentials.dig(:gcs, :private_key).dump %>
client_email: ""
client_id: ""
auth_uri: "https://accounts.google.com/o/oauth2/auth"
token_uri: "https://accounts.google.com/o/oauth2/token"
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs"
client_x509_cert_url: ""
project: ""
bucket: ""
Optionally provide a Cache-Control metadata to set on uploaded assets:
google:
service: GCS
...
cache_control: "public, max-age=3600"
Optionally use IAM instead of the credentials
when signing URLs. This is useful if you are authenticating your GKE applications with Workload Identity, see this Google Cloud blog post for more information.
google:
service: GCS
...
iam: true
Optionally use a specific GSA when signing URLs. When using IAM, the metadata server will be contacted to get the GSA email, but this metadata server is not always present (e.g. local tests) and you may wish to use a non-default GSA.
google:
service: GCS
...
iam: true
gsa_email<EMAIL_ADDRESS>Add the google-cloud-storage
gem to your Gemfile
:
gem "google-cloud-storage", "~> 1.11", require: false
Mirror Service
You can keep multiple services in sync by defining a mirror service. A mirror service replicates uploads and deletes across two or more subordinate services.
A mirror service is intended to be used temporarily during a migration between services in production. You can start mirroring to a new service, copy pre-existing files from the old service to the new, then go all-in on the new service.
NOTE: Mirroring is not atomic. It is possible for an upload to succeed on the primary service and fail on any of the subordinate services. Before going all-in on a new service, verify that all files have been copied.
Define each of the services you'd like to mirror as described above. Reference them by name when defining a mirror service:
s3_west_coast:
service: S3
access_key_id: ""
secret_access_key: ""
region: ""
bucket: ""
s3_east_coast:
service: S3
access_key_id: ""
secret_access_key: ""
region: ""
bucket: ""
production:
service: Mirror
primary: s3_east_coast
mirrors:
- s3_west_coast
Although all secondary services receive uploads, downloads are always handled by the primary service.
Mirror services are compatible with direct uploads. New files are directly uploaded to the primary service. When a directly-uploaded file is attached to a record, a background job is enqueued to copy it to the secondary services.
Public access
By default, Active Storage assumes private access to services. This means generating signed, single-use URLs for blobs. If you'd rather make blobs publicly accessible, specify public: true
in your app's config/storage.yml
:
gcs: &gcs
service: GCS
project: ""
private_gcs:
<<: *gcs
credentials: <%= Rails.root.join("path/to/private_key.json") %>
bucket: ""
public_gcs:
<<: *gcs
credentials: <%= Rails.root.join("path/to/public_key.json") %>
bucket: ""
public: true
Make sure your buckets are properly configured for public access. See docs on how to enable public read permissions for Amazon S3, Google Cloud Storage, and Microsoft Azure storage services. Amazon S3 additionally requires that you have the s3:PutObjectAcl
permission.
When converting an existing application to use public: true
, make sure to update every individual file in the bucket to be publicly-readable before switching over.
Attaching Files to Records
has_one_attached
The has_one_attached
macro sets up a one-to-one mapping between records and
files. Each record can have one file attached to it.
For example, suppose your application has a User
model. If you want each user to
have an avatar, define the User
model as follows:
class User < ApplicationRecord
has_one_attached :avatar
end
or if you are using Rails 6.0+, you can run a model generator command like this:
bin/rails generate model User avatar:attachment
You can create a user with an avatar:
<%= form.file_field :avatar %>
class SignupController < ApplicationController
def create
user = User.create!(user_params)
session[:user_id] = user.id
redirect_to root_path
end
private
def user_params
params.require(:user).permit(:email_address, :password, :avatar)
end
end
Call avatar.attach
to attach an avatar to an existing user:
user.avatar.attach(params[:avatar])
Call avatar.attached?
to determine whether a particular user has an avatar:
user.avatar.attached?
In some cases you might want to override a default service for a specific attachment.
You can configure specific services per attachment using the service
option with the name of your service:
class User < ApplicationRecord
has_one_attached :avatar, service: :google
end
You can configure specific variants per attachment by calling the variant
method on yielded attachable object:
class User < ApplicationRecord
has_one_attached :avatar do |attachable|
attachable.variant :thumb, resize_to_limit: [100, 100]
end
end
Call avatar.variant(:thumb)
to get a thumb variant of an avatar:
<%= image_tag user.avatar.variant(:thumb) %>
You can use specific variants for previews as well:
class User < ApplicationRecord
has_one_attached :video do |attachable|
attachable.variant :thumb, resize_to_limit: [100, 100]
end
end
<%= image_tag user.video.preview(:thumb) %>
has_many_attached
The has_many_attached
macro sets up a one-to-many relationship between records
and files. Each record can have many files attached to it.
For example, suppose your application has a Message
model. If you want each
message to have many images, define the Message
model as follows:
class Message < ApplicationRecord
has_many_attached :images
end
or if you are using Rails 6.0+, you can run a model generator command like this:
bin/rails generate model Message images:attachments
You can create a message with images:
class MessagesController < ApplicationController
def create
= Message.create!( )
redirect_to
end
private
def
params.require(: ).permit(:title, :content, images: [])
end
end
Call images.attach
to add new images to an existing message:
@message.images.attach(params[:images])
Call images.attached?
to determine whether a particular message has any images:
@message.images.attached?
Overriding the default service is done the same way as has_one_attached
, by using the service
option:
class Message < ApplicationRecord
has_many_attached :images, service: :s3
end
Configuring specific variants is done the same way as has_one_attached
, by calling the variant
method on the yielded attachable object:
class Message < ApplicationRecord
has_many_attached :images do |attachable|
attachable.variant :thumb, resize_to_limit: [100, 100]
end
end
Attaching File/IO Objects
Sometimes you need to attach a file that doesn’t arrive via an HTTP request. For example, you may want to attach a file you generated on disk or downloaded from a user-submitted URL. You may also want to attach a fixture file in a model test. To do that, provide a Hash containing at least an open IO object and a filename:
@message.images.attach(io: File.open('/path/to/file'), filename: 'file.pdf')
When possible, provide a content type as well. Active Storage attempts to determine a file’s content type from its data. It falls back to the content type you provide if it can’t do that.
@message.images.attach(io: File.open('/path/to/file'), filename: 'file.pdf', content_type: 'application/pdf')
You can bypass the content type inference from the data by passing in
identify: false
along with the content_type
.
@message.images.attach(
io: File.open('/path/to/file'),
filename: 'file.pdf',
content_type: 'application/pdf',
identify: false
)
If you don’t provide a content type and Active Storage can’t determine the file’s content type automatically, it defaults to application/octet-stream.
Replacing vs Adding Attachments
By default in Rails, attaching files to a has_many_attached
association will replace
any existing attachments.
To keep existing attachments, you can use hidden form fields with the signed_id
of each attached file:
<% @message.images.each do |image| %>
<%= form.hidden_field :images, multiple: true, value: image.signed_id %>
<% end %>
<%= form.file_field :images, multiple: true %>
This has the advantage of making it possible to remove existing attachments selectively, e.g. by using JavaScript to remove individual hidden fields.
Form Validation
Attachments aren't sent to the storage service until a successful save
on the
associated record. This means that if a form submission fails validation, any new
attachment(s) will be lost and must be uploaded again. Since direct uploads
are stored before the form is submitted, they can be used to retain uploads when validation fails:
<%= form.hidden_field :avatar, value: @user.avatar.signed_id if @user.avatar.attached? %>
<%= form.file_field :avatar, direct_upload: true %>
Removing Files
To remove an attachment from a model, call purge
on the
attachment. If your application is set up to use Active Job, removal can be done
in the background instead by calling purge_later
.
Purging deletes the blob and the file from the storage service.
# Synchronously destroy the avatar and actual resource files.
user.avatar.purge
# Destroy the associated models and actual resource files async, via Active Job.
user.avatar.purge_later
Serving Files
Active Storage supports two ways to serve files: redirecting and proxying.
 The generated URLs are hard to guess, but permanent by design. If your files require a higher level of protection consider implementing Authenticated Controllers.
Redirect Mode
To generate a permanent URL for a blob, you can pass the blob to the
url_for
view helper. This generates a
URL with the blob's signed_id
that is routed to the blob's RedirectController
url_for(user.avatar)
# => /rails/active_storage/blobs/:signed_id/my-avatar.png
The RedirectController
redirects to the actual service endpoint. This
indirection decouples the service URL from the actual one, and allows, for
example, mirroring attachments in different services for high-availability. The
redirection has an HTTP expiration of 5 minutes.
To create a download link, use the rails_blob_{path|url}
helper. Using this
helper allows you to set the disposition.
rails_blob_path(user.avatar, disposition: "attachment")
WARNING: To prevent XSS attacks, Active Storage forces the Content-Disposition header to "attachment" for some kind of files. To change this behavior see the available configuration options in Configuring Rails Applications.
If you need to create a link from outside of controller/view context (Background
jobs, Cronjobs, etc.), you can access the rails_blob_path
like this:
Rails.application.routes.url_helpers.rails_blob_path(user.avatar, only_path: true)
Proxy Mode
Optionally, files can be proxied instead. This means that your application servers will download file data from the storage service in response to requests. This can be useful for serving files from a CDN.
You can configure Active Storage to use proxying by default:
# config/initializers/active_storage.rb
Rails.application.config.active_storage.resolve_model_to_route = :rails_storage_proxy
Or if you want to explicitly proxy specific attachments there are URL helpers you can use in the form of rails_storage_proxy_path
and rails_storage_proxy_url
.
<%= image_tag<EMAIL_ADDRESS>%>
Putting a CDN in Front of Active Storage
Additionally, in order to use a CDN for Active Storage attachments, you will need to generate URLs with proxy mode so that they are served by your app and the CDN will cache the attachment without any extra configuration. This works out of the box because the default Active Storage proxy controller sets an HTTP header indicating to the CDN to cache the response.
You should also make sure that the generated URLs use the CDN host instead of your app host. There are multiple ways to achieve this, but in general it involves tweaking your config/routes.rb
file so that you can generate the proper URLs for the attachments and their variations. As an example, you could add this:
# config/routes.rb
direct :cdn_image do |model, |
expires_in = .delete(:expires_in) { ActiveStorage.urls_expire_in }
if model.respond_to?(:signed_id)
route_for(
:rails_service_blob_proxy,
model.signed_id(expires_in: expires_in),
model.filename,
.merge(host: ENV['CDN_HOST'])
)
else
signed_blob_id = model.blob.signed_id(expires_in: expires_in)
variation_key = model.variation.key
filename = model.blob.filename
route_for(
:rails_blob_representation_proxy,
signed_blob_id,
variation_key,
filename,
.merge(host: ENV['CDN_HOST'])
)
end
end
and then generate routes like this:
<%= cdn_image_url(user.avatar.variant(resize_to_limit: [128, 128])) %>
Authenticated Controllers
All Active Storage controllers are publicly accessible by default. The generated
URLs use a plain signed_id
, making them hard to
guess but permanent. Anyone that knows the blob URL will be able to access it,
even if a before_action
in your ApplicationController
would otherwise
require a login. If your files require a higher level of protection, you can
implement your own authenticated controllers, based on the
ActiveStorage::Blobs::RedirectController
,
ActiveStorage::Blobs::ProxyController
,
ActiveStorage::Representations::RedirectController
and
ActiveStorage::Representations::ProxyController
To only allow an account to access their own logo you could do the following:
# config/routes.rb
resource :account do
resource :logo
end
# app/controllers/logos_controller.rb
class LogosController < ApplicationController
# Through ApplicationController:
# include Authenticate, SetCurrentAccount
def show
redirect_to Current.account.logo.url
end
end
<%= image_tag account_logo_path %>
And then you should disable the Active Storage default routes with:
config.active_storage.draw_routes = false
to prevent files being accessed with the publicly accessible URLs.
Downloading Files
Sometimes you need to process a blob after it’s uploaded—for example, to convert
it to a different format. Use the attachment's download
method to read a blob’s
binary data into memory:
binary = user.avatar.download
You might want to download a blob to a file on disk so an external program (e.g.
a virus scanner or media transcoder) can operate on it. Use the attachment's
open
method to download a blob to a tempfile on disk:
video.open do |file|
system '/path/to/virus/scanner', file.path
# ...
end
.
It's important to know that the file is not yet available in the after_create
callback but in the after_create_commit
only.
Analyzing Files
Active Storage analyzes files once they've been uploaded by queuing a job in Active Job. Analyzed files will store additional information in the metadata hash, including analyzed: true
. You can check whether a blob has been analyzed by calling analyzed?
on it.
Image analysis provides width
and height
attributes. Video analysis provides these, as well as duration
, angle
, display_aspect_ratio
, and video
and audio
booleans to indicate the presence of those channels. Audio analysis provides duration
and bit_rate
attributes.
Displaying Images, Videos, and PDFs
Active Storage supports representing a variety of files. You can call
representation
on an attachment to display an image variant, or a
preview of a video or PDF. Before calling representation
, check if the
attachment can be represented by calling representable?
. Some file formats
can't be previewed by Active Storage out of the box (e.g. Word documents); if
representable?
returns false you may want to link to
the file instead.
<ul>
<% @message.files.each do |file| %>
<li>
<% if file.representable? %>
<%= image_tag file.representation(resize_to_limit: [100, 100]) %>
<% else %>
<%= link_to rails_blob_path(file, disposition: "attachment") do %>
<%= image_tag "placeholder.png", alt: "Download file" %>
<% end %>
<% end %>
</li>
<% end %>
</ul>
Internally, representation
calls variant
for images, and preview
for
previewable files. You can also call these methods directly.
Lazy vs Immediate Loading
By default, Active Storage will process representations lazily. This code:
image_tag file.representation(resize_to_limit: [100, 100])
Will generate an <img>
tag with the src
pointing to the
ActiveStorage::Representations::RedirectController
. The browser will
make a request to that controller, which will perform the following:
- Process file and upload the processed file if necessary.
- Return a
302
redirect to the file either to- the remote service (e.g., S3).
- or
ActiveStorage::Blobs::ProxyController
which will return the file contents if proxy mode is enabled.
Loading the file lazily allows features like single use URLs to work without slowing down your initial page loads.
This works fine for most cases.
If you want to generate URLs for images immediately, you can call .processed.url
:
image_tag file.representation(resize_to_limit: [100, 100]).processed.url
The Active Storage variant tracker improves performance of this, by storing a
record in the database if the requested representation has been processed before.
Thus, the above code will only make an API call to the remote service (e.g. S3)
once, and once a variant is stored, will use that. The variant tracker runs
automatically, but can be disabled through config.active_storage.track_variants
.
If you're rendering lots of images on a page, the above example could result
in N+1 queries loading all the variant records. To avoid these N+1 queries,
use the named scopes on ActiveStorage::Attachment
.
images.with_all_variant_records.each do |file|
image_tag file.representation(resize_to_limit: [100, 100]).processed.url
end
.
Transforming Images
Transforming images allows you to display the image at your choice of dimensions.
To create a variation of an image, call variant
on the attachment. You
can pass any transformation supported by the variant processor to the method.
When the browser hits the variant URL, Active Storage will lazily transform
the original blob into the specified format and redirect to its new service
location.
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100]) %>
If a variant is requested, Active Storage will automatically apply transformations depending on the image's format:
Content types that are variable (as dictated by
config.active_storage.variable_content_types
) and not considered web images (as dictated byconfig.active_storage.web_image_content_types
), will be converted to PNG.If
quality
is not specified, the variant processor's default quality for the format will be used.
Active Storage can use either Vips or MiniMagick as the variant processor.
The default depends on your config.load_defaults
target version, and the
processor can be changed by setting config.active_storage.variant_processor
.
The two processors are not fully compatible, so when migrating an existing application between MiniMagick and Vips, some changes have to be made if using options that are format specific:
<!-- MiniMagick -->
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100], format: :jpeg, sampling_factor: "4:2:0", strip: true, interlace: "JPEG", colorspace: "sRGB", quality: 80) %>
<!-- Vips -->
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100], format: :jpeg, saver: { subsample_mode: "on", strip: true, interlace: true, quality: 80 }) %>
The parameters available are defined by the image_processing
gem and depend on the
variant processor that you are using, but both support the following parameters:
| Parameter | Example | Description |
|---|---|---|
resize_to_limit |
resize_to_limit: [100, 100] |
Downsizes the image to fit within the specified dimensions while retaining the original aspect ratio. Will only resize the image if it's larger than the specified dimensions. |
resize_to_fit |
resize_to_fit: [100, 100] |
Resizes the image to fit within the specified dimensions while retaining the original aspect ratio. Will downsize the image if it's larger than the specified dimensions or upsize if it's smaller. |
resize_to_fill |
resize_to_fill: [100, 100] |
Resizes the image to fill the specified dimensions while retaining the original aspect ratio. If necessary, will crop the image in the larger dimension. |
resize_and_pad |
resize_and_pad: [100, 100] |
Resizes the image to fit within the specified dimensions while retaining the original aspect ratio. If necessary, will pad the remaining area with transparent color if source image has alpha channel, black otherwise. |
crop |
crop: [20, 50, 300, 300] |
Extracts an area from an image. The first two arguments are the left and top edges of area to extract, while the last two arguments are the width and height of the area to extract. |
rotate |
rotate: 90 |
Rotates the image by the specified angle. |
image_processing
has more options available (such as saver
which allows image compression to be configured) in it's own documentation for the Vips) and [MiniMagick]) processors.
Previewing Files
Some non-image files can be previewed: that is, they can be presented as images.
For example, a video file can be previewed by extracting its first frame. Out of
the box, Active Storage supports previewing videos and PDF documents. To create
a link to a lazily-generated preview, use the attachment's preview
method:
<%= image_tag message.video.preview(resize_to_limit: [100, 100]) %>
To add support for another format, add your own previewer. See the
ActiveStorage::Preview
documentation for more information.
Direct Uploads
Active Storage, with its included JavaScript library, supports uploading directly from the client to the cloud.
Usage
Include
activestorage.js
in your application's JavaScript bundle.Using the asset pipeline:
//= require activestorage
Using the npm package:
import * as ActiveStorage from "@rails/activestorage" ActiveStorage.start()
Add
direct_upload: true
to your file field:<%= form.file_field :attachments, multiple: true, direct_upload: true %>
Or, if you aren't using a
FormBuilder
, add the data attribute directly:<input type="file" data-direct-upload-url="<%= rails_direct_uploads_url %>" />
Configure CORS on third-party storage services to allow direct upload requests.
That's it! Uploads begin upon form submission.
Cross-Origin Resource Sharing (CORS) Configuration
To make direct uploads to a third-party service work, you’ll need to configure the service to allow cross-origin requests from your app. Consult the CORS documentation for your service:
Take care to allow:
- All origins from which your app is accessed
- The
PUT
request method - The following headers:
Content-Type
Content-MD5
Content-Disposition
(except for Azure Storage)x-ms-blob-content-disposition
(for Azure Storage only)x-ms-blob-type
(for Azure Storage only)Cache-Control
(for GCS, only ifcache_control
is set)
No CORS configuration is required for the Disk service since it shares your app’s origin.
Example: S3 CORS Configuration
[
{
"AllowedHeaders": [
"Content-Type",
"Content-MD5",
"Content-Disposition"
],
"AllowedMethods": [
"PUT"
],
"AllowedOrigins": [
"https://www.example.com"
],
"MaxAgeSeconds": 3600
}
]
Example: Google Cloud Storage CORS Configuration
[
{
"origin": ["https://www.example.com"],
"method": ["PUT"],
"responseHeader": ["Content-Type", "Content-MD5", "Content-Disposition"],
"maxAgeSeconds": 3600
}
]
Example: Azure Storage CORS Configuration
<Cors>
<CorsRule>
<AllowedOrigins>https://www.example.com</AllowedOrigins>
<AllowedMethods>PUT</AllowedMethods>
<AllowedHeaders>Content-Type, Content-MD5, x-ms-blob-content-disposition, x-ms-blob-type</AllowedHeaders>
<MaxAgeInSeconds>3600</MaxAgeInSeconds>
</CorsRule>
</Cors>
Direct Upload JavaScript Events
| Event name | Event target | Event data (event.detail ) |
Description |
|---|---|---|---|
direct-uploads:start |
<form> |
None | A form containing files for direct upload fields was submitted. |
direct-upload:initialize |
<input> |
{id, file} |
Dispatched for every file after form submission. |
direct-upload:start |
<input> |
{id, file} |
A direct upload is starting. |
direct-upload:before-blob-request |
<input> |
{id, file, xhr} |
Before making a request to your application for direct upload metadata. |
direct-upload:before-storage-request |
<input> |
{id, file, xhr} |
Before making a request to store a file. |
direct-upload:progress |
<input> |
{id, file, progress} |
As requests to store files progress. |
direct-upload:error |
<input> |
{id, file, error} |
An error occurred. An alert will display unless this event is canceled. |
direct-upload:end |
<input> |
{id, file} |
A direct upload has ended. |
direct-uploads:end |
<form> |
None | All direct uploads have ended. |
Example
You can use these events to show the progress of an upload.
To show the uploaded files in a form:
// direct_uploads.js
addEventListener("direct-upload:initialize", event => {
const { target, detail } = event
const { id, file } = detail
target.insertAdjacentHTML("beforebegin", `
<div id="direct-upload-${id}" class="direct-upload direct-upload--pending">
<div id="direct-upload-progress-${id}" class="direct-upload__progress" style="width: 0%"></div>
<span class="direct-upload__filename"></span>
</div>
`)
target.previousElementSibling.querySelector(`.direct-upload__filename`).textContent = file.name
})
addEventListener("direct-upload:start", event => {
const { id } = event.detail
const element = document.getElementById(`direct-upload-${id}`)
element.classList.remove("direct-upload--pending")
})
addEventListener("direct-upload:progress", event => {
const { id, progress } = event.detail
const progressElement = document.getElementById(`direct-upload-progress-${id}`)
progressElement.style.width = `${progress}%`
})
addEventListener("direct-upload:error", event => {
event.preventDefault()
const { id, error } = event.detail
const element = document.getElementById(`direct-upload-${id}`)
element.classList.add("direct-upload--error")
element.setAttribute("title", error)
})
addEventListener("direct-upload:end", event => {
const { id } = event.detail
const element = document.getElementById(`direct-upload-${id}`)
element.classList.add("direct-upload--complete")
})
Add styles:
/* direct_uploads.css */
.direct-upload {
display: inline-block;
position: relative;
padding: 2px 4px;
margin: 0 3px 3px 0;
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 3px;
font-size: 11px;
line-height: 13px;
}
.direct-upload--pending {
opacity: 0.6;
}
.direct-upload__progress {
position: absolute;
top: 0;
left: 0;
bottom: 0;
opacity: 0.2;
background: #0076ff;
transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
transform: translate3d(0, 0, 0);
}
.direct-upload--complete .direct-upload__progress {
opacity: 0.4;
}
.direct-upload--error {
border-color: red;
}
input[type=file][data-direct-upload-url][disabled] {
display: none;
}
Custom drag and drop solutions
You can use the DirectUpload
class for this purpose. Upon receiving a file from your library
of choice, instantiate a DirectUpload and call its create method. Create takes
a callback to invoke when the upload completes.
import { DirectUpload } from "@rails/activestorage"
const input = document.querySelector('input[type=file]')
// Bind to file drop - use the ondrop on a parent element or use a
// library like Dropzone
const onDrop = (event) => {
event.preventDefault()
const files = event.dataTransfer.files;
Array.from(files).forEach(file => uploadFile(file))
}
// Bind to normal file selection
input.addEventListener('change', (event) => {
Array.from(input.files).forEach(file => uploadFile(file))
// you might clear the selected files from the input
input.value = null
})
const uploadFile = (file) => {
// your form needs the file_field direct_upload: true, which
// provides data-direct-upload-url
const url = input.dataset.directUploadUrl
const upload = new DirectUpload(file, url)
upload.create((error, blob) => {
if (error) {
// Handle the error
} else {
// Add an appropriately-named hidden input to the form with a
// value of blob.signed_id so that the blob ids will be
// transmitted in the normal upload flow
const hiddenField = document.createElement('input')
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("value", blob.signed_id);
hiddenField.name = input.name
document.querySelector('form').appendChild(hiddenField)
}
})
}
Track the progress of the file upload
When using the DirectUpload
constructor, it is possible to include a third parameter.
This will allow the DirectUpload
object to invoke the directUploadWillStoreFileWithXHR
method during the upload process.
You can then attach your own progress handler to the XHR to suit your needs.
import { DirectUpload } from "@rails/activestorage"
class Uploader {
constructor(file, url) {
this.upload = new DirectUpload(this.file, this.url, this)
}
upload(file) {
this.upload.create((error, blob) => {
if (error) {
// Handle the error
} else {
// Add an appropriately-named hidden input to the form
// with a value of blob.signed_id
}
})
}
directUploadWillStoreFileWithXHR(request) {
request.upload.addEventListener("progress",
event => this.directUploadDidProgress(event))
}
directUploadDidProgress(event) {
// Use event.loaded and event.total to update the progress bar
}
}
Integrating with Libraries or Frameworks
Once you receive a file from the library you have selected, you need to create
a DirectUpload
instance and use its "create" method to initiate the upload process,
adding any required additional headers as necessary. The "create" method also requires
a callback function to be provided that will be triggered once the upload has finished.
import { DirectUpload } from "@rails/activestorage"
class Uploader {
constructor(file, url, token) {
const headers = { 'Authentication': `Bearer ${token}` }
// INFO: Sending headers is an optional parameter. If you choose not to send headers,
// authentication will be performed using cookies or session data.
this.upload = new DirectUpload(this.file, this.url, this, headers)
}
upload(file) {
this.upload.create((error, blob) => {
if (error) {
// Handle the error
} else {
// Use the with blob.signed_id as a file reference in next request
}
})
}
directUploadWillStoreFileWithXHR(request) {
request.upload.addEventListener("progress",
event => this.directUploadDidProgress(event))
}
directUploadDidProgress(event) {
// Use event.loaded and event.total to update the progress bar
}
}
To implement customized authentication, a new controller must be created on the Rails application, similar to the following:
class DirectUploadsController < ActiveStorage::DirectUploadsController
skip_forgery_protection
before_action :authenticate!
def authenticate!
@token = request.headers['Authorization']&.split&.last
return head : unless valid_token?(@token)
end
end
NOTE: Using Direct Uploads can sometimes result in a file that uploads, but never attaches to a record. Consider purging unattached uploads.
Testing
Use file_fixture_upload
to test uploading a file in an integration or controller test.
Rails handles files like any other parameter.
class SignupController < ActionDispatch::IntegrationTest
test "can sign up" do
post signup_path, params: {
name: "David",
avatar: file_fixture_upload("david.png", "image/png")
}
user = User.order(:created_at).last
assert user.avatar.attached?
end
end
Discarding Files Created During Tests
System Tests
System tests clean up test data by rolling back a transaction. Because destroy
is never called on an object, the attached files are never cleaned up. If you
want to clear the files, you can do it in an after_teardown
callback. Doing it
here ensures that all connections created during the test are complete and
you won't receive an error from Active Storage saying it can't find a file.
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
# ...
def after_teardown
super
FileUtils.rm_rf(ActiveStorage::Blob.service.root)
end
# ...
end
If you're using parallel tests and the DiskService
, you should configure each process to use its own
folder for Active Storage. This way, the teardown
callback will only delete files from the relevant process'
tests.
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
# ...
parallelize_setup do |i|
ActiveStorage::Blob.service.root = "#{ActiveStorage::Blob.service.root}-#{i}"
end
# ...
end
If your system tests verify the deletion of a model with attachments and you're using Active Job, set your test environment to use the inline queue adapter so the purge job is executed immediately rather at an unknown time in the future.
# Use inline job processing to make things happen immediately
config.active_job.queue_adapter = :inline
Integration Tests
Similarly to System Tests, files uploaded during Integration Tests will not be
automatically cleaned up. If you want to clear the files, you can do it in an
teardown
callback.
class ActionDispatch::IntegrationTest
def after_teardown
super
FileUtils.rm_rf(ActiveStorage::Blob.service.root)
end
end
If you're using parallel tests and the Disk service, you should configure each process to use its own
folder for Active Storage. This way, the teardown
callback will only delete files from the relevant process'
tests.
class ActionDispatch::IntegrationTest
parallelize_setup do |i|
ActiveStorage::Blob.service.root = "#{ActiveStorage::Blob.service.root}-#{i}"
end
end
Adding Attachments to Fixtures
You can add attachments to your existing fixtures. First, you'll want to create a separate storage service:
# config/storage.yml
test_fixtures:
service: Disk
root: <%= Rails.root.join("tmp/storage_fixtures") %>
This tells Active Storage where to "upload" fixture files to, so it should be a temporary directory. By making it
a different directory to your regular test
service, you can separate fixture files from files uploaded during a
test.
Next, create fixture files for the Active Storage classes:
# active_storage/attachments.yml
david_avatar:
name: avatar
record: david (User)
blob: david_avatar_blob
# active_storage/blobs.yml
david_avatar_blob: <%= ActiveStorage::FixtureSet.blob filename: "david.png", service_name: "test_fixtures" %>
Then put a file in your fixtures directory (the default path is test/fixtures/files
) with the corresponding filename.
See the ::ActiveStorage::FixtureSet
docs for more information.
Once everything is set up, you'll be able to access attachments in your tests:
class UserTest < ActiveSupport::TestCase
def test_avatar
avatar = users(:david).avatar
assert avatar.attached?
assert_not_nil avatar.download
assert_equal 1000, avatar.byte_size
end
end
Cleaning up Fixtures
While files uploaded in tests are cleaned up at the end of each test, you only need to clean up fixture files once: when all your tests complete.
If you're using parallel tests, call parallelize_teardown
:
class ActiveSupport::TestCase
# ...
parallelize_teardown do |i|
FileUtils.rm_rf(ActiveStorage::Blob.services.fetch(:test_fixtures).root)
end
# ...
end
If you're not running parallel tests, use Minitest.after_run
or the equivalent for your test
framework (e.g. after(:suite)
for RSpec):
# test_helper.rb
Minitest.after_run do
FileUtils.rm_rf(ActiveStorage::Blob.services.fetch(:test_fixtures).root)
end
Configuring services
You can add config/storage/test.yml
to configure services to be used in test environment
This is useful when the service
option is used.
class User < ApplicationRecord
has_one_attached :avatar, service: :s3
end
Without config/storage/test.yml
, the s3
service configured in config/storage.yml
is used - even when running tests.
The default configuration would be used and files would be uploaded to the service provider configured in config/storage.yml
.
In this case, you can add config/storage/test.yml
and use Disk service for s3
service to prevent sending requests.
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
s3:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
Implementing Support for Other Cloud Services
If you need to support a cloud service other than these, you will need to
implement the Service. Each service extends
::ActiveStorage::Service
by implementing the methods necessary to upload and download files to the cloud.
Purging Unattached Uploads
There are cases where a file is uploaded but never attached to a record. This can happen when using Direct Uploads. You can query for unattached records using the unattached scope. Below is an example using a custom rake task.
namespace :active_storage do
desc "Purges unattached Active Storage blobs. Run regularly."
task purge_unattached: :environment do
ActiveStorage::Blob.unattached.where(created_at: ..2.days.ago).find_each(&:purge_later)
end
end
WARNING: The query generated by ActiveStorage::Blob.unattached
can be slow and potentially disruptive on applications with larger databases.


Do you suffer from a learning disorder?
This adjusts the overall color-contrast ratio.
This adjusts the overall color-contrast ratio.
This adjusts the overall color-contrast ratio.
This adjusts the font-family.
This adjusts the font-size across the web
This adjusts the space between characters
This adjusts the space between words


{% extends "layouts/base.html" %} {% block body%}
Below are a list of the keywords that can be used to prompt Dash to provide a particular response .
| Keyword | Description |
|---|---|
| Shortage | The difference between the quantity on hand and the reorder level. |
| Excess | The quantity of stock above the reorder level and lead-time demand at cost |
| Revenue | The income generated by the sale of total stock sold over historical period in the analysis. |
| Average Orders | The average quantity of orders placed for a SKU over the total period of the. |
| Inventory Turns | The number of times the current quantity on hand would be consumed based on historic demand. |
| Example | Result |
|---|---|
| "Show {SKU}", "Describe {SKU}", "Explain {SKU}" ... | Replacing {SKU} with a SKU ID from your inventory profile, returns a hyperlink to the analysis of that SKU. |
|
Replacing the braces with an appropriate adjective and keyword will return the SKU and value with the corresponding description. |
| "What is the {KEYWORD} for {SKU}? | Replacing braces with the appropriate keyword and SKU will return the values for the corresponding description. |


--- layout: default --- Grayscale A free, premium quality, responsive one page Bootstrap theme created by Start Bootstrap. {% for post in site.posts %} {%if post.fullwidth%} {{post.title}} {{post.content}} {%else%} {{post.title}} {{post.content}} {%endif%} {% endfor %}
A free, premium quality, responsive one page Bootstrap theme created by Start Bootstrap.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.openal.AudioImpl org.newdawn.slick.openal.DeferredSound
public class DeferredSound
A sound implementation that can load the actual sound file at a later point.
| Field Summary | |
|---|---|
static int |
AIF
Indicate a AIF to be loaded |
static int |
MOD
Indicate a MOD/XM to be loaded |
static int |
OGG
Indicate a OGG to be loaded |
static int |
WAV
Indicate a WAV to be loaded |
| Fields inherited from class org.newdawn.slick.openal.AudioImpl |
|---|
buffer, index, length, store |
| Constructor Summary | |
|---|---|
DeferredSound(java.lang.String ref,
java.io.InputStream in,
int type)
Create a new sound on request to load |
| Method Summary | |
|---|---|
java.lang.String |
getDescription()
Get a description of the resource to be loaded |
boolean |
isPlaying()
Check if the sound is playing as sound fx |
void |
load()
Load the actual resource |
int |
playAsMusic(float pitch,
float gain,
boolean loop)
Play this sound as music |
int |
playAsSoundEffect(float pitch,
float gain,
boolean loop)
Play this sound as a sound effect |
int |
playAsSoundEffect(float pitch,
float gain,
boolean loop,
float x,
float y,
float z)
Play this sound as a sound effect |
void |
stop()
Stop the sound effect |
| Methods inherited from class org.newdawn.slick.openal.AudioImpl |
|---|
getBufferID, getPosition, getSourceIndex, isPaused, pauseMusic, release, restartMusic, setPosition |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OGG
public static final int WAV
public static final int MOD
public static final int AIF
| Constructor Detail |
|---|
public DeferredSound(java.lang.String ref, java.io.InputStream in, int type)
ref
- The location of the sound to loadtype
- The type of sound to loadin
- The input stream to load from| Method Detail |
|---|
public void load() throws java.io.IOException
DeferredResource
load
in interface DeferredResource
java.io.IOException
- Indicates a failure to load the resourceDeferredResource.load()
public boolean isPlaying()
Audio
isPlaying
in interface Audio
isPlaying
in class AudioImpl
AudioImpl.isPlaying()
public int playAsMusic(float pitch, float gain, boolean loop)
Audio
playAsMusic
in interface Audio
playAsMusic
in class AudioImpl
pitch
- The pitch of the play backgain
- The gain of the play backloop
- True if we should loop
AudioImpl.playAsMusic(float, float, boolean)
public int playAsSoundEffect(float pitch, float gain, boolean loop)
Audio
playAsSoundEffect
in interface Audio
playAsSoundEffect
in class AudioImpl
pitch
- The pitch of the play backgain
- The gain of the play backloop
- True if we should loop
AudioImpl.playAsSoundEffect(float, float, boolean)
public int playAsSoundEffect(float pitch, float gain, boolean loop, float x, float y, float z)
playAsSoundEffect
in interface Audio
playAsSoundEffect
in class AudioImpl
pitch
- The pitch of the play backgain
- The gain of the play backloop
- True if we should loopx
- The x position of the soundy
- The y position of the soundz
- The z position of the sound
Audio.playAsSoundEffect(float, float, boolean, float, float, float)
public void stop()
Audio
stop
in interface Audio
stop
in class AudioImpl
AudioImpl.stop()
public java.lang.String getDescription()
DeferredResource
getDescription
in interface DeferredResource
DeferredResource.getDescription()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


|
| | PrintLanguage (Architecture *g, const string &nm) |
| | Constructor. More...
|
| |
|
virtual | ~PrintLanguage (void) |
| | Destructor.
|
| |
|
const string & | getName (void) const |
| | Get the language name.
|
| |
|
CastStrategy * | getCastStrategy (void) const |
| | Get the casting strategy for the language.
|
| |
|
ostream * | getOutputStream (void) const |
| | Get the output stream being emitted to.
|
| |
|
void | setOutputStream (ostream *t) |
| | Set the output stream to emit to.
|
| |
|
void | setScope (Scope *sc) |
| | Set the current Symbol scope.
|
| |
|
void | setMaxLineSize (int4 mls) |
| | Set the maximum number of characters per line.
|
| |
|
void | setIndentIncrement (int4 inc) |
| | Set the number of characters to indent per level of code nesting.
|
| |
| void | setLineCommentIndent (int4 val) |
| | Set the number of characters to indent comment lines. More...
|
| |
| void | setCommentDelimeter (const string &start, const string &stop, bool usecommentfill) |
| | Establish comment delimiters for the language. More...
|
| |
|
uint4 | getInstructionComment (void) const |
| | Get the type of comments suitable within the body of a function.
|
| |
|
void | setInstructionComment (uint4 val) |
| | Set the type of comments suitable within the body of a function.
|
| |
|
uint4 | getHeaderComment (void) const |
| | Get the type of comments suitable for a function header.
|
| |
|
void | setHeaderComment (uint4 val) |
| | Set the type of comments suitable for a function header.
|
| |
|
bool | emitsXml (void) const |
| | Does the low-level emitter, emit XML markup.
|
| |
| void | setXML (bool val) |
| | Set whether the low-level emitter, emits XML markup. More...
|
| |
| void | setFlat (bool val) |
| | Set whether nesting code structure should be emitted. More...
|
| |
|
virtual void | adjustTypeOperators (void)=0 |
| | Set basic data-type information for p-code operators.
|
| |
|
virtual void | clear (void) |
| | Clear the RPN stack and the low-level emitter.
|
| |
| virtual void | setIntegerFormat (const string &nm) |
| | Set the default integer format. More...
|
| |
| virtual void | setCommentStyle (const string &nm)=0 |
| | Set the way comments are displayed in decompiler output. More...
|
| |
| virtual bool | isCharacterConstant (const uint1 *buf, int4 size, int4 charsize) const =0 |
| | Decide is the given byte array looks like a character string. More...
|
| |
| virtual void | docTypeDefinitions (const TypeFactory *typegrp)=0 |
| | Emit definitions of data-types. More...
|
| |
|
virtual void | docAllGlobals (void)=0 |
| | Emit declarations of global variables.
|
| |
| virtual void | docSingleGlobal (const Symbol *sym)=0 |
| | Emit the declaration for a single (global) Symbol. More...
|
| |
| virtual void | docFunction (const Funcdata *fd)=0 |
| | Emit the declaration (and body) of a function.  More...
|
| |
| void | pushAtom (const Atom &atom) |
| | Push a variable token onto the RPN stack. More...
|
| |
| void | pushVnImplied (const Varnode *vn, const PcodeOp *op, uint4 m) |
| | Push an implied variable onto the RPN stack. More...
|
| |
| void | pushVnExplicit (const Varnode *vn, const PcodeOp *op) |
| | Push an explicit variable onto the RPN stack. More...
|
| |
| void | pushVnLHS (const Varnode *vn, const PcodeOp *op) |
| | Push a variable as the left-hand side of an expression. More...
|
| |
| bool | parentheses (const OpToken *op2) |
| | Determine if the given token should be emitted in its own parenthetic expression. More...
|
| |
| void | emitOp (const ReversePolish &entry) |
| | Send an operator token from the RPN to the emitter. More...
|
| |
| void | emitAtom (const Atom &atom) |
| | Send an variable token from the RPN to the emitter. More...
|
| |
| bool | escapeCharacterData (ostream &s, const uint1 *buf, int4 count, int4 charsize, bool bigend) const |
| | Emit a byte buffer to the stream as unicode characters. More...
|
| |
| void | recurse (void) |
| | Emit from the RPN stack as much as possible. More...
|
| |
| void | opBinary (const OpToken *tok, const PcodeOp *op) |
| | Push a binary operator onto the RPN stack. More...
|
| |
| void | opUnary (const OpToken *tok, const PcodeOp *op) |
| | Push a unary operator onto the RPN stack. More...
|
| |
|
int4 | getPending (void) const |
| | Get the number of pending nodes yet to be put on the RPN stack.
|
| |
| virtual void | printUnicode (ostream &s, int4 onechar) const =0 |
| | Print a single unicode character as a character constant for the high-level language. More...
|
| |
| virtual void | pushType (const Datatype *ct)=0 |
| | Push a data-type name onto the RPN expression stack. More...
|
| |
| virtual void | pushConstant (uintb val, const Datatype *ct, const Varnode *vn, const PcodeOp *op)=0 |
| | Push a constant onto the RPN stack. More...
|
| |
| virtual bool | pushEquate (uintb val, int4 sz, const EquateSymbol *sym, const Varnode *vn, const PcodeOp *op)=0 |
| | Push a constant marked up by and EquateSymbol onto the RPN stack. More...
|
| |
| virtual void | pushAnnotation (const Varnode *vn, const PcodeOp *op)=0 |
| | Push an address which is not in the normal data-flow. More...
|
| |
| virtual void | pushSymbol (const Symbol *sym, const Varnode *vn, const PcodeOp *op)=0 |
| | Push a specific Symbol onto the RPN stack. More...
|
| |
| virtual void | pushUnnamedLocation (const Address &addr, const Varnode *vn, const PcodeOp *op)=0 |
| | Push an address as a substitute for a Symbol onto the RPN stack. More...
|
| |
| virtual void | pushPartialSymbol (const Symbol *sym, int4 off, int4 sz, const Varnode *vn, const PcodeOp *op, Datatype *outtype)=0 |
| | Push a variable that represents only part of a symbol onto the RPN stack. More...
|
| |
| virtual void | pushMismatchSymbol (const Symbol *sym, int4 off, int4 sz, const Varnode *vn, const PcodeOp *op)=0 |
| | Push an identifier for a variable that mismatches with its Symbol. More...
|
| |
| virtual void | emitLineComment (int4 indent, const Comment *comm) |
| | Emit a comment line. More...
|
| |
| virtual void | emitVarDecl (const Symbol *sym)=0 |
| | Emit a variable declaration. More...
|
| |
| virtual void | emitVarDeclStatement (const Symbol *sym)=0 |
| | Emit a variable declaration statement. More...
|
| |
| virtual bool | emitScopeVarDecls (const Scope *scope, int4 cat)=0 |
| | Emit all the variable declarations for a given scope. More...
|
| |
| virtual void | emitExpression (const PcodeOp *op)=0 |
| | Emit a full expression. More...
|
| |
| virtual void | emitFunctionDeclaration (const Funcdata *fd)=0 |
| | Emit a function declaration. More...
|
| |
| virtual bool | checkPrintNegation (const Varnode *vn)=0 |
| | Check whether a given boolean Varnode can be printed in negated form. More...
|
| |
The base class API for emitting a high-level language.
Instances of this object are responsible for converting a function's (transformed) data-flow graph into the final stream of tokens of a high-level source code language. There a few main entry points including:
The system is responsible for printing:
- Control-flow structures
- Expressions
- Type declarations
- Function prototypes
- Comments
As part of all this printing, the system is also responsible for
- Emitting integers, floats, and character constants
- Placing parentheses within expressions to properly represent data-flow
- Deciding whether cast operations need an explicit cast token
- Indenting and line wrapping
To accomplish this, the API is broken up into three sections. The first section are the main entry point 'doc' methods. The second section are 'emit' methods, which are responsible for printing a representation of a particular high-level code construct. The third section are 'push' and 'op' methods, which are responsible for walking expression trees. The order in which tokens are emitted for an expression is determined by a Reverse Polish Notation (RPN) stack, that the 'push' methods manipulate. Operators and variables are pushed onto this stack and are ultimately emitted in the correct order.
The base class provides a generic printing modifications stack and a symbol scope stack to provide a printing context mechanism for derived classes.


Mayor Schaff on Oakland's clean economy
Libby Schaaf, the mayor of Oakland, welcomes the VERGE community to the city. She announces the City's official Clean Economy Week and speaks to the ways in which cities like Oakland are critical to accelerating the clean economy.


These plots show the latest predicted planetary geomagnetic activity index (Kp) from the
U. S. Air Force Weather Agency Wing Kp model. The plots are of 1-hour and 4-hour Kp predictions,
along with the observed Estimated Kp.
1-hour predictions are plotted with green filled-in
circles, 4-hour predictions are plotted in green plus (+) symbols, and the solid blue line
is the observed Estimated Kp index. The solid horizontal green bars show the 3-hour
interval over which the latest predictions are valid. Vertical error bars
are plotted in green to show the 50% confidence interval.
Source: http://www.swpc.noaa.gov/products/wing-kp


Iran bans sale of Israeli author accused of Darwinism
TEHRAN, Iran (AP) - The Tehran publishers’ league in Iran says it has outlawed buying or selling books by the bestselling Israeli author Yuval Noah Harari.
Iran’s culture ministry banned his books from publication in May. The ministry alleges they promote the theory of evolution and fabricate history.
The official IRNA news agency reported Monday on the new warning by the publishers’ league of “possible” legal prosecution for selling Harari’s books.
Hardliners in Iran have long criticized the circulation of his books, calling him a Zionist.
They’re concerned about the influence of Western culture, seeing it as part of efforts aimed at the “soft toppling” of the country’s Islamic system.
Titles by Harari on the banned list include “Sapiens,” ”Homo Deus,” ”21 Lessons for the 21st Century” and “Money.”
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


--- layout: page title: About header-img: "img/about-bg.png" ---
Hi everyone! Yup, that's my name and nope, not "The Diesel". I'm originally from the Philippines but I migrated here in the U.S.A. about 2 years ago. I currently live in Jacksonville, FL. I'm a borderline hardcore gamer LOL, but of course right now I'm toning it down because of the boot camp and my full-time job. Good luck to all of us, let's get it!


Minister for common cattle sheds in villages
Will help keep villages clean and neat, says Harish Rao
by ?Special CorrespondentFinance Minister T. Harish Rao called upon the officials to construct common cattle sheds in the villages stating that it would keep the villages clean and neat.
Participating in a review meeting held here on Friday along with Collector P. Venkatarami Reddy, the Minister said that such sheds had been built at Ibrahimpur, Irkod and Narmetta villages and they were running successfully. He directed the officials to ensure that cattle sheds were built in all villages without delay.
Further, he asked officials to focus on developing food processing industries at the village-level. He suggested that units producing chicken and mutton pickles and chutneys could be developed at Irkod, pulses at Mittapaly and Ginger paste at Chinnagundavelli. He asked the officials to create their own brand.


Hi, I am Rishabh Kumar.A Second year student of B.Tech, Computer Science & Information Technology at Institute of Technical Education and Research, Bhubaneswar. I am a Java, C developer and currently learning web development. I am a Tech Enthusiast who loves developing Websites. My hobbies includes gaming and coding.
Company - Highradius Pvt. Ltd.
Duration - 18 days [June 2021]
Company - Verzeo Edu Tech Pvt. Ltd.
Duration - 2 months [January 2020 to February 2020]
Company - Kyrion Technologies Pvt. Ltd.
Duration - 1 months [June 2019]
Institution - Institute of Technical Education and Research - Siksha 'O' Anusandhan Deemed to be University
Session - 2018 - 2022
Institution - Rajendra Vidyalaya
Duration - 2016 - 2018
Institution - R.V.S Academy
Duration - 2015 - 2016
Issued By - Microsoft Technology Associate (MTA)
Verify here
Issued By - Qwiklabs Google Cloud
Verify here
Issued By - What After College (WAC)
Verify here
Issued By - Verzeo Edu Tech Pvt. Ltd.
Verify here
NAME - RISHABH KUMAR
ADDRESS - Boy's Hostel No. 9,
Institute of Technical Education and Research,
Bhubaneswar,Odisha-751030, India
PHONE NO. - +91879787****
EMAIL ID - rishabhkumar.jsrair@gmail.com


{{/*Copyright 2019 Google LLC*/}} {{/*Licensed under the Apache License, Version 2.0 (the "License");*/}} {{/*you may not use this file except in compliance with the License.*/}} {{/*You may obtain a copy of the License at*/}} {{/*https://www.apache.org/licenses/LICENSE-2.0*/}} {{/*Unless required by applicable law or agreed to in writing, software*/}} {{/*distributed under the License is distributed on an "AS IS" BASIS,*/}} {{/*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.*/}} {{/*See the License for the specific language governing permissions and*/}} {{/*limitations under the License.*/}}


Before Change
spatial_shape = window_shape[1:-1]
n_spatial = len(spatial_shape)
// import pdb; pdb.set_trace()
assert all([win_size > 2 * border_size
for (win_size, border_size)
in zip(spatial_shape, border[:n_spatial])]), \
"window sizes should be larger than inference border size * 2" \
" received: {}: {}".format(spatial_shape, border[:n_spatial])
if n_spatial == 1:
window = window[:,
border[0]:spatial_shape[0] - border[0],
np.newaxis, np.newaxis, ...]
After Change
if np.any(location < 0):
return window, location
cropped_shape = np.max(location[:, 4:7] - location[:, 1:4], axis=0)
left = np.floor(
(spatial_shape - cropped_shape[:n_spatial])/2.0).astype(np.int)
if np.any(left < 0):
tf.logging.fatal(


Preparation time
less than 30 mins
Cooking time
30 mins to 1 hour
Serves
Serves 2
Quail is wonderful paired with crunchy roasted chestnuts and butternut squash.
Bring 500ml/18fl oz water and the brine ingredients to the boil then remove from the heat and cool.
Spatchcock the quail by cutting up the back with a pair of scissors. Place in a bowl and cover with the cooled brine and chill for 30 minutes in the fridge.
Remove the quail from the brine and pat dry. Season with the oil and a little salt and pepper.
Place a large griddle pan over a hih heat. Once hot, cook the quail skin side down for 3½ minutes, then 3½ minutes on the other side. (The quail will still have some pink parts when done.)
For the salad, mix all of the salad ingredients, except the butternut squash. Set aside.
For the dressing, whisk all the dressing ingredients in a small bowl. Put the butternut squash in the dressing for 5 minutes to soften. Just before serving add the dressing to the salad.
Heat the oil in a frying pan with the finely chopped chestnuts. Cook for 1-2 minutes.
Place the quail on serving plates and drizzle over the chopped chestnuts. Serve the salad alongside.


ESGF CoG User Accounts¶
Migrating CoG User Accounts to ESGF¶
When a CoG instance is installed upon an existing ESGF node, user accounts are seamlessly integrated between the two - no additional work is required by the node administrator. Specifically:
If a user has an existing ESGF account, they can use their existing OpenID to log onto CoG. Upon their first login, they will be asked for a few pieces of missing information to complete their CoG profile (country and institution), after which a CoG account will be automatically created.
If a user creates a new CoG account, their information will be automatically transferred to the database of the local ESGF node. In particular, a new OpenID will be created for them, which they can use to log onto the local ESGF IdP and CoG instance.


{{ day.date | moment:"YYYY/MM/DD" }}
{{ day.day.subtotal | currency:'$':0 }}
{{ day.day.discount | currency:'$':0 }}
{{ day.day.shipping | currency:'$':0 }}
{{ day.day.tax | currency:'$':0 }}
{{ day.day.net | currency:'$':0 }}
{{ day.month.net | currency:'$':0 }}
{{ day.year.net | currency:'$':0 }}
{{ day.total.net | currency:'$':0 }}


Neuroplasticity
Discuss how understanding the principles of neuroplasticity benefits people
Neuroplasticity refers to our ability to learn and retain informationm, and how powerfull our thoughts alone can be. For an instance has there been carried out
out research on people where one group learn the more traditional, practical way and the other group learn by simply thinking about the steps they are needed to take.
The resarch showed that our brain alone can help us become pretty amazing at whatever skill we are wanting to take up - this is better explained in the YouTube video provided.
So, having an understanding of neuroplasticity can certainly benefit people on their learning journey.
Discuss how you might engage with the principals of neuroplasticity for your own benefit
Personally I have been trying to use the power of thought and reflections to look back on what I have done throughout the day and following. Repitition of the material and
prectice, prectice, practice! On top of that, ensuring I get quality sleep and increase my own mindfulness to give my brain a chance to reset for more learning.
What are some of the ways to increase your neuroplasticity
I decided to investigate further what could increase my neuroplasticity as effectively as possible, which lead me to find Dr. Brady Salcido. According to him
in order to help increase your neuroplasticity we need to consider the following areas:
Sleep!  Ensure you get your 7.5 hours of quality sleep each night.
Meditation & mindfulness, which we already have a lot of focus on within this course. Allowing yourself to take time out to meditate and treat yourself this way
will do wonders for your neuroplasticity.
Exercise - especially aerobic exercises such as walking 3-4 times a week is very beneficial to our mood and regenrating our brain, so it is ready to learn and grow.
I found the following video which addresses exercise and how you can help increase your neuroplasticity with help of exercise by Dr. Wendy Suzuki:
Healthy diet - now, Dr. Brady Salcido believes in a ketogenic diet following the intermitting fasting principles. Due to my own health issues, I know personally
that keto and intermitting fasting helps me - but we are not all build the same way! You need to find the healthy diet there suits you and your schedule.
It is also mentioned that we need to ensure we get DHA (so omega-3) in our diet along with curcumins (or tumeric) which has shown to have very positive benefits for our brain.
For your reference, this is the full video made by Dr. Brady Salcido:
Having a Growth mindset
What does it mean to have a Growth mindset?
If you have a growth mindset, you believe that it is possible to learn anything you set your mind on to! You understand that what you see, is not what you get
and there is potential for growth at any time you wish! If you feel you are bad at math? Someone with a fixed mindset would tell themselves "If I am not good at math now,
I will never be" - whereas someone with a growth mindset would rather have the tendency to say "I might not be good at math NOW, but I can be!"
In this exploration, did anything surprise you? Change for you?
I did feel I have been aware of the growth mindset, but without really realising there was more to it than the very basic and being told "you can do anything you
set your mind to do". I am now more aware of the differences between having a fixed vs. growth mindset, which have enabled me to reflect more on "which mindset am I in?"
How will you integrate growth mindset into your learning journey?
I feel I do need to remind myself sometimes, that even if I feel I really don't get something today - doesn't mean I won't get it tomorrow! Here I believe the use of
meditating and mindfulness will help me stay in a growth mindset and limit my time my fixed mindset.


{% extends "reports/base.html" %} {% load report_tags %} {% block css %} .col { float: left; margin-right: 4em; } .progress { font-size: 10px; font-weight: bold; display: inline-block; background: #f99; width: 4em; height: 1.3em; } .progress .bar { display: inline-block; position: absolute; background: #3f3; z-index: 0; } li:hover { background: #ddd; } ul { list-style-type: none; margin: 2px 10px 2px 0; padding: 0; } {% endblock %} {% block title %} OpenGL capabilities database - index {% endblock %} {% block heading %} OpenGL capabilities database {% endblock %} {% block content %}
Based on data submitted by players of {{ PROJECT_NAME }} See the index page for more stuff. Contact the {{ PROJECT_NAME }} development team for questions.
{% if ENABLE_JSON %}Browse the data here, or download as JSON (see format description). Feel free to do whatever you want with the data.
{% endif %}The listed extensions are based on the GL_EXTENSIONS string: we don't show an extension as supported if it's not explicitly advertised, even if GL_VERSION is a version where that extension was folded into the main spec.
The extension support percentages are based on the number of user/device/driver combinations, from a total of {{ num_users }}. This is obviously hopelessly biased and unrepresentative so don't read too much into the numbers.
The listed device names are based on GL_RENDERER, with boring components stripped out. Driver versions on Windows are determined from DLL versions; if we can't guess which is the correct DLL then we try to list all the detectable DLLs. Driver versions on Linux are determined from GL_VERSION, when it's encoded in there.


Johnson promises post-Brexit trade | Pence testifies in impeachment: WATCH the top world news videos for today
Boris Johnson makes NI trade pledge as he highlights Brexit deal
Frictionless trade between Northern Ireland and the rest of the UK would be maintained under the proposed Brexit deal, the Prime Minister has said.
Pence aide testifies in impeachment probe, another transcript released
US congressional committees conducting an impeachment investigation of President Donald Trump met on Thursday for the first time with a top adviser to Vice President Mike Pence, one of the last witnesses to testify behind closed doors before public hearings.
Analyst: Authoritarian states threaten online data
A technology watchdog group says authoritarian regimes can threaten privacy on social media platforms. This comes a day after US prosecutors alleged that Saudi Arabia recruited two Twitter employees to spy on thousands of accounts.
Germany, US defend NATO after Macron brands transatlantic alliance brain dead
Angela Merkel has said the French president was overreacting.
DOJ: Company sold Chinese security systems to US military
Federal prosecutors have filed criminal charges accusing a New York company of exposing the US government and private customers to security risks by illegally importing and selling surveillance and security equipment from China.