Provides highly customizable modules to enhance your shiny apps. Includes layout independent collapsible boxes and value boxes, a very fast autocomplete input, rhandsontable extensions for filtering and paging and much more.
| Version: | 0.0.1 |
| Imports: | shiny, htmltools |
| Suggests: | testthat, extrafont, ggplot2, jsonlite, rhandsontable, V8, htmlwidgets, shinytest |
| Published: | 2018-11-19 |
| Author: | Richard Kunze, Mirjam Rehr |
| Maintainer: | Richard Kunze <richard.kunze at daqana.com> |
| BugReports: | https://github.com/daqana/dqshiny/issues |
| License: | GPL (≥ 3) |
| URL: | https://github.com/daqana/dqshiny |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | dqshiny results |
| Reference manual: | dqshiny.pdf |
| Package source: | dqshiny_0.0.1.tar.gz |
| Windows binaries: | r-devel: dqshiny_0.0.1.zip, r-release: dqshiny_0.0.1.zip, r-oldrel: dqshiny_0.0.1.zip |
| OS X binaries: | r-release: dqshiny_0.0.1.tgz, r-oldrel: not available |
Please use the canonical form https://CRAN.R-project.org/package=dqshiny to link to this page.


| Total net profit | -138.66 | Gross profit | 85.46 | Gross loss | -224.12 |
| Profit factor | 0.38 | Expected payoff | -0.63 | ||
| Absolute drawdown | -138.66 | Maximal drawdown (%) | 137.72 (-14651.06%) | ||
| Total trades | 219 | Profit trades (% of total) | 82 (37.44%) | Loss trades (% of total) | 137 (62.56%) |
| Long positions (won %) | 112 (41.96%) | Short positions (won %) | 107 (32.71%) | ||
| Largest | profit trade | 5.3 | loss trade | -3.14 | |
| Average | profit trade | 1.04 | loss trade | -1.64 | |
| Minimum | profit trade | 0.04 | loss trade | -0.01 | |
| Maximum | take profit in pips | 89.2 | stop loss in pips | -48.9 | |
| Average | take profit in pips | 16.2 | stop loss in pips | -24.9 | |
| Minimum | take profit in pips | -17.6 | stop loss in pips | -5.8 | |
| Maximum | Reward-Risk | 5.6 | Duration in minutes | 3043 | |
| Average | Reward-Risk | 0.8 | Duration in minutes | 96.6 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0 | |
| Maximum | consecutive wins (profit in money) | 7.0 (4.53) | consecutive losses (loss in money) | 8.0 (-9.9) | |
| Average | consecutive wins | 1.0 | consecutive losses | 2.0 |
| Total net profit | -67.91 | Gross profit | 46.03 | Gross loss | -113.94 |
| Profit factor | 0.4 | Expected payoff | -0.61 | ||
| Absolute drawdown | -68.26 | Maximal drawdown (%) | 69.03 (8964.94%) | ||
| Total trades | 112 | Profit trades (% of total) | 47 (41.96%) | Loss trades (% of total) | 65 (58.04%) |
| Largest | profit trade | 4.86 | loss trade | -3.14 | |
| Average | profit trade | 0.98 | loss trade | -1.75 | |
| Minimum | profit trade | 0.04 | loss trade | -0.06 | |
| Maximum | take profit in pips | 89.2 | stop loss in pips | -48.9 | |
| Average | take profit in pips | 13.5 | stop loss in pips | -27.9 | |
| Minimum | take profit in pips | -17.6 | stop loss in pips | -10.3 | |
| Maximum | Reward-Risk | 5.6 | Duration in minutes | 1091.0 | |
| Average | Reward-Risk | 0.6 | Duration in minutes | 98.1 | |
| Minimum | Reward-Risk | 0.0 | Duration in minutes | 0.0 | |
| Maximum | consecutive wins (profit in money) | 4.0 (2.13) | consecutive losses (loss in money) | 5.0 (-8.78) | |
| Average | consecutive wins | 1.0 | consecutive losses | 2.0 |
| Total net profit | -70.75 | Gross profit | 39.43 | Gross loss | -110.18 |
| Profit factor | 0.36 | Expected payoff | -0.66 | ||
| Absolute drawdown | -70.75 | Maximal drawdown (%) | 69.81 (-7426.6%) | ||
| Total trades | 107 | Profit trades (% of total) | 35 (32.71%) | Loss trades (% of total) | 72 (67.29%) |
| Largest | profit trade | 5.3 | loss trade | -2.95 | |
| Average | profit trade | 1.13 | loss trade | -1.53 | |
| Minimum | profit trade | 0.23 | loss trade | -0.01 | |
| Maximum | take profit in pips | 69.1 | stop loss in pips | -38.2 | |
| Average | take profit in pips | 19.1 | stop loss in pips | -21.8 | |
| Minimum | take profit in pips | -0.1 | stop loss in pips | -5.8 | |
| Maximum | Reward-Risk | 5.1 | Duration in minutes | 3043.0 | |
| Average | Reward-Risk | 1.1 | Duration in minutes | 94.9 | |
| Minimum | Reward-Risk | Duration in minutes | 0.0 | ||
| Maximum | consecutive wins (profit in money) | 5.0 (4.29) | consecutive losses (loss in money) | 10.0 (-15.14) | |
| Average | consecutive wins | 1.0 | consecutive losses | 3.0 |


package element
Type Members
- final case class AuthMessageTestProtocol(text: String) extends TestProtocol with AuthMessageProtocol with Product with Serializable
- final case class LobbyMessageTestProtocol(text: String) extends TestProtocol with LobbyMessageProtocol with Product with Serializable
- abstract class TestProtocol extends AnyRef
- final case class VillageMessageTestProtocol(text: String) extends TestProtocol with VillageMessageProtocol with Product with Serializable


Request :
curl -X POST https://lucasfernandez.fr/gpt-2/generate \ --header "Content-Type: application/json" \ --data '{"text":"To be, or not to be", "length":100, "top_k":40}'
Answer :
b32a4fc6c95d83e9f759d0fcc8ac875d852587e3
{% extends "_project.html" %} {% set code = True %} {% block title %}GPT-2{% endblock %} {% block content %} {{ super() }}
Request :
curl -X POST https://lucasfernandez.fr/gpt-2/generate \ --header "Content-Type: application/json" \ --data '{"text":"To be, or not to be", "length":100, "top_k":40}'
Answer :
b32a4fc6c95d83e9f759d0fcc8ac875d852587e3
Request :
curl -X GET https://lucasfernandez.fr/gpt-2/generate/b32a4fc6c95d83e9f759d0fcc8ac875d852587e3
Answer if pending:
{"status": "pending"}
Answer if computed:
{ "status": "done", "result": "To be, or not to be, not to be is not enough!\" he says and takes his left foot. The next morning, when the house was set down, he found himself on the pavement for the only time he'd ever known. He walked and sat in the front garden, thinking, \"What is this?\" Then he walked over to where a young lady sat, and he said, \"What is this?\" Then he took a piece of grass at her heels, and put the leaf with the root, and, to", "task": { "length": 100, "text": "To be, or not to be", "top_k": 40 } }


jsonrpc-lib is a nodejs package for parsing and serialising JSON-RPC2 messages.
Inspired by jsonrpc-lite.
Version: 1.0.0
Date: December 24, 2019
Author: Andrea Lamparelli
This package implements the aforementioned JSON-RPC2, which is is a stateless, light-weight remote procedure call (RPC) protocol. It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments. It uses JSON (RFC 4627) as data format. This protocol defines three different kind of message, all of them share a common field called jsonrpc, which is a string specifying the version of the JSON-RPC protocol. In our case it MUST be exactly "2.0".
An rpc call is represented by sending a Request object to a Server. In addition to the jsonrpc field, this message has the following member:
A Notification is a Request object without an "id" member. A Request object that is a Notification signifies the Client's lack of interest in the corresponding Response object, and as such no Response object needs to be returned to the client. The Server MUST NOT reply to a Notification, including those that are within a batch request.
When a rpc call is made, the Server MUST reply with a Response, except for in the case of Notifications. The Response is expressed as a single JSON Object, there two different kind of responses, both includes the id member that MUST be the same provided in the request:
For more information about the protocol please take a look at JSON-RPC2 specification page.
You can easily install the package from the nodejs package manage (npm)
npm install @lampajr/jsonrpc-lib
Once you have installed the package either globally or locally, you just have to import the package whenever you require it, like as follow.
Using javascript:
const jsonrpc = require('@lampajr/jsonrpc-lib');
Using typescript:
import jsonrpc from '@lampajr/jsonrpc-lib';
This package provides some help functions that allow developers to easily generate instances of JSON-RPC2 messages, a complete mapping among JSON-RPC2 messages and jsonrpc-lib classes is explained in Table 1.
| JSON-RPC 2.0 Message | jsonrpc-lib Class |
|---|---|
| Request | JsonRpcRequest |
| Notification | JsonRpcNotification |
| Success Response | JsonRpcSuccess |
| Error Response | JsonRpcError |
| Error Object | ErrorObject |
Table 1 provide a mapping between the JSON-RPC2 messages and the equivalent jsonrpc-lib classes
You can easily generate new jsonrpc2 instances using the following functions:
jsonrpc.generateRequest(...) // generate a JsonRpcRequest object
jsonrpc.generateNotification(...) // generate a JsonRpcNotification object
jsonrpc.generateSuccess(...) // generate a JsonRpcSuccess response
jsonrpc.generateError(...) // generate a JsonRpcError response
Moreover this package provides a way to parse string payload messages (e.g., received from http request) into JSON-RPC2 objects (i.e., jsonrpc-lib classes) using a function called parse. This function parse the string data checking if it is a valid JSON-RPC2 message, if so it generate the equivalent class instance, otherwise it throws an error object which contains information about what went wrong during parsing. This object is a valid error object that can be put inside the JsonRpcError response and then sent to the client. The parse function can be easily used as follow:
const rpcMessage = jsonrpc.parse(msg);
where rpcMessage
will contain the class instance of the specific parsed msg, if valid, otherwise an ErrorObject will be thrown, hence the function should be properly surrounded by the try-catch statement.
In order to avoid the function to throws an Error, the msg
data should be a valid JSON-RPC2 payload or an array of them.
Success
This example shows a succeed invocation of the parse function, that will generate the equivalent JsonRpc class of the msg
parsed.
const msg =
'{"jsonrpc":"2.0", "id":"abcdefg", "method":"send", "params": {"from": "my-addr", "to":"your-addr", "amount":50}}';
try {
const rpcMessage = jsonrpc.parse(msg); // execution succeed
// rpcMessage is an instance of JsonRpcRequest
//{
// jsonrpc: "2.0",
// id: "abcdefg",
// method: "send",
// params: {
// "from": "my-addr",
// "to": "your-addr",
// "amount": 50
// }
//}
} catch (err) {
console.log(err); // this won't be executed
}
Fail
This, instead, provide ad example of failed invocation. In this case the failure is due to the fact that the client is trying to used an unsupported jsonrpc version.
const msg =
'{"jsonrpc":"1.0", "id":"abcdefg", "method":"send", "params": {"from": "my-addr", "to":"your-addr", "amount":50}}';
try {
// execution will fail since the jsonrpc 1.0 version is not supported
const rpcMessage = jsonrpc.parse(msg);
} catch (err) {
console.log(err); // this error is an ErrorObject instace
//{
// code: -32600
// message: "Invalid request"
// data: "Version 1.0 not supported! Please use 2.0 instead."
//}
}
Feel free to post questions and problems on the issue tracker. Pull requests are welcome!
Feel free to fork and modify or add new features and functionality to the library
Generated using TypeDoc


Photo Attribution:
API Photo - By Camwilliams96 (Own work) [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)], via Wikimedia Commons
Maboneng - By South African Tourism [CC BY 2.0 (https://creativecommons.org/licenses/by/2.0/legalcode)], via Flickr
Chale Wote - By Kwabena Akuamoah-Boateng [CC BY 2.0 (https://creativecommons.org/licenses/by/2.0/legalcode)], via Flickr
Hackathon - By Beyond Access [CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0)], via Flickr
Other Photos [CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)]


My creator's firstname is: firstname My creator's lastname is: lastname My creator's fullname is: fullname My filename is: document.filename


I figured I would experiment some more with Kratom tolerance and withdrawal. So, in the name of science, I drank moderate doses of kratom tea, 4 days in a row (1/2 to 3/4 tablespoon of 'premium' each day). At the end of day 4, I took approximately 10-15mg naltrexone (a potent opiate antagonist). Within 45 minutes, my stomach became a tight knot, all sensory input became overwhelming, I began sweating profusely (and had to remove my shirt - I felt like I was burning up). My body temperature dropped by one degree even though I was pouring sweat, and I felt very dizzy. My eyes had dark circles around them and I became extremely pale. The feeling was extremely, extremely unpleasant and intense. All I could do was lay on the bathroom floor, wondering if/when I would vomit, and trying to cool myself down. Throughout the sweat, it felt as if my whole body had 'pins and needles' -- a kind of strange prickling effect.
20 to 30 minutes after the episode had started, it slowly tapered off. I was exhausted, laying on the bathroom floor to keep cool, but I felt like I had been through the wringer and had made it out the other side. I felt slightly detached from reality, exhausted, and my eyes were wet -- like crying without being sad, but other than that, I felt pretty much back to normal.
The next day I felt very, very slightly on-edge, but it dissipated quickly once I got moving in the morning. I took 10mg more naltrexone that night and experienced no more withdrawal effects, although I woke up several times during the night. On the third day, I took more naltrexone with no ill effects.
In previous experiments -- without naltrexone -- subtle withdrawal effects, only very minor, emerged after 36 hours after last ingestion of kratom and lasted for approximately 2-3 days.
In conclusion, I believe that the naltrexone precipitated some sort of 'fast withdrawal', which lasted approximately 20-30 minutes and was extremely, extremely unpleasant and intense. However, the only remaining withdrawal effect after the 'quick withdrawal' was a slight anxiousness and difficulty in sleeping and remaining asleep. Even these effects were gone after 12 hours.
My next experiment will be with low dose naltrexone (3-4mg each night) administered over the course of a week to determine if it can reverse kratom tolerance.
---------------------
Follow-up
I want to make it clear that it was naltrexone, and not naloxone. They are very easy to get mixed up due to the similar names, but the potency, duration of effect, and absorbtion is much different. Naloxone is what they inject intravenously or intramuscularly in opiate overdose emergencies, and it has a very short duration. 10mg of naltrexone (what I took) is 1/5th of a normal 50mg ReVia pill, and the effects of a 50mg pill can last 24-48 hours. It is readily absorbed when taken orally.
I performed my experiment after taking 2.5mg diazepam, which I should have mentioned in my prior post. I can't imagine what it would have been like without it -- far worse, I'm sure...!
Kratom has been used by others, once or twice a week (max), never taking a dose two days in a row. Tolerance and/or physical dependence does not have to occur at all with such a schedule.
I am not a big fan of Kratom's effects, which is one of the primary reasons I choose to experiment with kratom versus other opiate-related substances. It is extremely important to note that I have never experienced any significant degree of psychological craving for Kratom -- which makes it an excellent substance to study in regards to physical tolerance, etc.! All other opiates I have run across induce far greater psychological cravings in my experience, and after several periods of experimentation many years ago, I refuse to experiment with them. Kratom seems much safer (psychologically and physically) to explore in a pseudo-scientific/bioassay manner.
The majority of my interest in Kratom comes from knowing some friends who, at various times, have struggled with heroin use and addiction, and from my overall personal and professional interest in psychopharmacology. Anything that can be learned to help people live their life how they desire is worth exploring, in my opinion, whether it be through mood and energy enhancement, like a pick-me-up from caffeine, through self-exploration via hallucinogens or meditation, or in successfully disentangling from physical and psychological addiction -- not only to drugs, but to food and other addictions as well.
I am also interested in exploring a dosage-reduction plan, where dosages of opiates are gradually reduced via tolerance-reversal with ultra-low-dose opiate antagonists. There are several interesting articles on the subject. One of the most
well-known is entitled, 'Paradoxical effects of the opioid antagonist Naltrexone on morphine analgesia, tolerance, and reward in rats.' by Powell et al, 2002. I am also interested in the idea of people 'graduating from stronger drug usage to kratom usage' as an intermediary step towards non-dependence.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


#include <CCMCTime.h>
| ccmc::Time::Time |
( |
const std::string & |
epochString | ) |
|
| ccmc::Time::Time |
( |
double |
epoch | ) |
|
| short ccmc::Time::getDay |
( |
| ) |
const |
| double ccmc::Time::getEpoch |
( |
| ) |
const |
| short ccmc::Time::getHour |
( |
| ) |
const |
| short ccmc::Time::getMilliseconds |
( |
| ) |
const |
| short ccmc::Time::getMinute |
( |
| ) |
const |
| short ccmc::Time::getMonth |
( |
| ) |
const |
| short ccmc::Time::getSeconds |
( |
| ) |
const |
| short ccmc::Time::getYear |
( |
| ) |
const |
| void ccmc::Time::setDay |
( |
short |
day | ) |
|
| void ccmc::Time::setEpoch |
( |
double |
epoch | ) |
|
| void ccmc::Time::setHour |
( |
short |
hour | ) |
|
| void ccmc::Time::setMilliseconds |
( |
short |
milliseconds | ) |
|
| void ccmc::Time::setMinute |
( |
short |
minute | ) |
|
| void ccmc::Time::setMonth |
( |
short |
month | ) |
|
| void ccmc::Time::setSeconds |
( |
double |
seconds | ) |
|
| void ccmc::Time::setYear |
( |
short |
year | ) |
|
| std::string ccmc::Time::toString |
( |
| ) |
const |
The documentation for this class was generated from the following files:
- /Users/apembrok/Documents/workspaces/workspace.bak2/workspace.backup/kameleon-plus/src/ccmc/CCMCTime.h
- /Users/apembrok/Documents/workspaces/workspace.bak2/workspace.backup/kameleon-plus/src/ccmc/CCMCTime.cpp


Hash vs Arrays
In Ruby, while both Arrays and Hashes are ordered collections of elements, these two objects have key differences:
An Array is ordered through a consecutive numerical index. >> Star_Wars_Sequels = Array.new(["Episode IV","Episode V", "Episode VI"]) => [Episode IV, Episode V, Episode VI] As can be seen, the Array is used to sequentially order the objects of the Array.
A Hash is ordered through being stored in pairs, each consisting of a key and a value. For example: >> ratings = Hash.new => ratings["Revenant"] = 10 In this example, we're not ordering the Hash object sequentially, we are merely assigning a rating value to the movie Revenant.


Rock–paper–scissors game
Computer has
0
balls!
developed by
Musobek Madrimov
PLAY
Let's Play Together!
Your Choose:
You have
0
balls!


JUNE 29 Saints Peter and Paul, Apostles
Vigil Mass (Mass during the Day)
FIRST
A reading from the Acts of the Apostles 3:1-10
In those days: Peter and John were going up to
the temple at the hour of prayer, the ninth hour. And a man lame from birth was
being carried, whom they laid daily at that gate of the temple which is called
Beautiful to ask alms of those who entered the temple. Seeing Peter and John
about to go into the temple, he asked for alms. And Peter directed his gaze at
him, with John, and said, "Look at us." And he fixed his attention
upon them, expecting to receive something from them. But Peter said, "I
have no silver and gold, but I give you what I have; in the name of Jesus
Christ of Nazareth, walk." And he took him by the right hand and raised
him up; and immediately his feet and ankles were made strong. And leaping up he
stood and walked and entered the temple with them, walking and leaping and
praising God. And all the people saw him walking and praising God, and
recognized him as the one who sat for alms at the Beautiful Gate of the temple;
and they were filled with wonder and amazement at what had happened to
him.
The word of the Lord
RESPONSORIAL PSALM Psalm 19
R. Their sound goes forth through all the earth.
The heavens declare the glory of God, and the
firmament proclaims the work of his hands. Day unto day conveys the message,
and night unto night imparts the knowledge.
R. Their sound goes forth
through all the earth.
No speech, no word, whose voice goes unheeded;
their sound goes forth through all the earth, their message to the utmost
bounds of the world.
R. Their sound goes forth
through all the earth.
SECOND
A reading from the letter of St. Paul to the Galatians 1:11-20
I would have you know that the Gospel which was preached by me is not
man's gospel. For I did not receive it from man, nor was I taught it, but it
came through a revelation of Jesus Christ. For you have heard of my former life
in Judaism, how I persecuted the church of God violently and tried to destroy
it; and I advanced in Judaism beyond many of my own age among my people, so extremely
zealous was I for the traditions of my fathers. But when he who had set me
apart before I was born, and had called me through his grace, was pleased to
reveal his Son to me, in order that I might preach him among the Gentiles, I
did not confer with flesh and blood, nor did I go up to Jerusalem to those who
were apostles before me, but I went away into Arabia; and again I returned to
Damascus. Then after three years I went up to
The word of the Lord
ALLELUIA John 21:17
R. Alleluia. Lord, you know everything; you know that I love you. R. Alleluia.
GOSPEL
A reading from the holy Gospel according to John 21:15-19
When [Jesus had revealed himself to his disciples and] they had finished
breakfast, Jesus said to Simon Peter, "Simon, son of John, do you love me
more than these?" He said to him, "Yes, Lord; you know that I love
you." He said to him, "Feed my lambs." A second time he said to
him, "Simon, son of John, do you love me?" He said to him, "Yes,
Lord; you know that I love you." He said to him, "Tend my
sheep." He said to him the third time, "Simon, son of John, do you
love me?" Peter was grieved because he said to him the third time,
"Do you love me?" And he said to him, "Lord, you know everything;
you know that I love you." Jesus said to him, "Feed my sheep.  (This he said to
show by what death he was to glorify God.) And after this he said to him,
"Follow me."
The Gospel of the Lord
FIRST
A reading from the Acts of the Apostles 12:1-11
In those days: Herod the king laid violent hands upon
some who belonged to the Church. He killed James the brother of John with the
sword; and when he saw that it pleased the Jews, he proceeded to arrest Peter
also. This was during the days of Unleavened Bread. And when he had seized him,
he put him in prison, and delivered him to four squads of soldiers to guard
him, intending after the Passover to bring him out to the people. So Peter was
kept in prison; but earnest prayer for him was made to God by the church. The
very night when Herod was about to bring him out, Peter was sleeping between
two soldiers, bound with two chains, and sentries before the door were guarding
the prison; and behold, an angel of the Lord appeared, and a light shone in the
cell; and he struck Peter on the side and woke him, saying, "Get up
quickly." And the chains fell off his hands. And the angel said to him,
"Dress yourself and put on your sandals." And he did so. And he said
to him, "Wrap your mantle around you and follow me." And he went out
and followed him; he did not know that what was done by the angel was real, but
thought he was seeing a vision. When they had passed the first and the second
guard, they came to the iron gate leading into the
city. It opened to them of its own accord, and they went out and passed on
through one street; and immediately the angel left him. And Peter came to
himself, and said, "Now I am sure that the Lord has sent his angel and
rescued me from the hand of Herod and from all that the Jewish people were
expecting."
The word of the Lord
RESPONSORIAL PSALM
Psalm 34
R. From all my terrors, the Lord set me free.
I will bless the LORD at all times,
praise of him is always in my mouth. In the LORD my soul shall make its boast;
the humble shall hear and be glad.
R. From
all my terrors, the Lord set me free.
Glorify the LORD with me; together let us
praise his name. I sought the LORD, and he answered me; from all my terrors he
set me free.
R. From
all my terrors, the Lord set me free.
Look towards him and be radiant; let your faces
not be abashed. This lowly one called; the LORD heard, and rescued him from all
his distress.
R. From
all my terrors, the Lord set me free.
The angel of the LORD is encamped around those
who fear him, to rescue them. Taste and see that the LORD is good. Blessed the man who seeks refuge in him.
R. From
all my terrors, the Lord set me free.
SECOND
A reading from the second letter of St. Paul to Timothy 4:6-8.17-18
Beloved: I am already on the point of being
sacrificed; the time of my departure has come. I have fought the good fight, I
have finished the race, I have kept the faith.
Henceforth there is laid up for me the crown of righteousness, which the Lord,
the righteous judge, will award to me on that Day, and not only to me but also
to all who have loved his appearing. But the Lord stood by me and gave me
strength to proclaim the message fully, that all the Gentiles might hear it. So
I was rescued from the lion's mouth. The Lord will rescue me from every evil
and save me for his heavenly kingdom. To him be the
glory for ever and ever. Amen.
The word of the Lord
ALLELUIA Matthew 16:18
R. Alleluia. You are Peter, and on this rock I will build my Church, and the gates of Hades shall not prevail against it. R. Alleluia.
GOSPEL
A reading from the holy Gospel according to Matthew 16:13-19
At that time: When Jesus came into the district
of Caesarea Philippi, he asked his disciples, "Who do men say that the Son
of man is?" And they said, "Some say John
the Baptist, others say Elijah, and others Jeremiah or one of the
prophets." He said to them, "But who do you say that I am?"
Simon Peter replied, "You are the Christ, the Son of the living God."
And Jesus answered him, "Blessed are you, Simon Bar-Jona! For flesh and blood has not revealed this to you, but my Father who
is in heaven. And I tell you, you are Peter, and on this rock I will
build my church, and the powers of death shall not prevail against it. I will
give you the keys of the kingdom of heaven, and whatever you bind on earth
shall be bound in heaven, and whatever you loose on earth shall be loosed in
heaven."
The Gospel of the Lord


The ggf-grayscale classes add a grayscale effect to an element.
Note: The ggf-grayscale classes are not supported in IE 11 and earlier versions.
Normal:
ggf-grayscale-min:
ggf-grayscale:
ggf-grayscale-max (black and white):
Red with grayscale
Blue with grayscale
Green with grayscale


Previous Colours:
Fontend Links
W3Schools
MDN Web Docs
HTML
CSS
Javascript
General Programming
Tim Corey .NET
Filling
Up
Space
With
Extra
Words


Home
Store
Todo
Angular
User List
Example
Dynamic Forms
{{city}}
Total Clicks: {{ data.totalClicks }}


Module: ActiveRecord::QueryMethods
| Child Classes: | WhereChain |
| Extended by: | ActiveSupport::Concern |
| Includes: | ActiveModel::ForbiddenAttributesProtection |
| Included in: | Relation |
| Defined in: |
Constant Summarycollapse
- VALID_UNSCOPING_VALUES =
-
Set.new([:where, :select, :group, :order, :lock, :limit, :offset, :joins, :includes, :from, :readonly, :having])
Instance Method Summary collapse
-
#arel
Returns the Arel object associated with the relation.
-
#create_with(value)
Sets attributes to be used when creating new records from a relation object.
-
#distinct(value = true)
(also: #uniq)
Specifies whether the records should be unique or not.
-
#distinct!(value = true)
(also: #uniq!)
Like #distinct, but modifies relation in place.
-
#eager_load(*args)
Forces eager loading by performing a LEFT OUTER JOIN on
args
: -
#extending(*modules, &block)
Used to extend a scope with additional methods, either through a module or through a block provided.
- #extensions
-
#from(value, subquery_name = nil)
Specifies table from which the records will be fetched.
-
#group(*args)
Allows to specify a group attribute:
-
#having(opts, *rest)
Allows to specify a HAVING clause.
-
#includes(*args)
Specify relationships to be included in the result set.
-
#joins(*args)
Performs a joins on
args
: -
#limit(value)
Specifies a limit for the number of records to retrieve.
-
#lock(locks = true)
Specifies locking settings (default to
true
). -
#none
Returns a chainable relation with zero records.
-
#offset(value)
Specifies the number of rows to skip before returning rows.
-
#order(*args)
Allows to specify an order attribute:
-
#preload(*args)
Allows preloading of
args
, in the same way thatincludes
does: -
#readonly(value = true)
Sets readonly attributes for the returned relation.
-
#references(*table_names)
Use to indicate that the given
table_names
are referenced by an SQL string, and should therefore be JOINed in any query rather than loaded separately. -
#reorder(*args)
Replaces any existing order defined on the relation with the specified order.
-
#reverse_order
Reverse the existing order clause on the relation.
-
#rewhere(conditions)
Allows you to change a previously set where condition for a given attribute, instead of appending to that condition.
-
#select(*fields)
Works in two unique ways.
-
#uniq(value = true)
Alias for #distinct.
-
#uniq!(value = true)
Alias for #distinct!.
-
#unscope(*args)
Removes an unwanted relation that is already defined on a chain of relations.
-
#where(opts = :chain, *rest)
Returns a new relation, which is the result of filtering the current relation according to the conditions in the arguments.
Methods included from ActiveSupport::Concern
append_features, class_methods, .extended, included
Instance Method Details
#arel
Returns the Arel object associated with the relation.
857 858 859
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 857 def arel # :nodoc: @arel ||= build_arel end
#create_with(value)
Sets attributes to be used when creating new records from a relation object.
users = User.where(name: 'Oscar')
users.new.name # => 'Oscar'
users = users.create_with(name: 'DHH')
users.new.name # => 'DHH'
You can pass nil
to create_with
to reset
attributes:
users = users.create_with(nil)
users.new.name # => 'Oscar'
726 727 728
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 726 def create_with(value) spawn.create_with!(value) end
#distinct(value = true) Also known as: uniq
Specifies whether the records should be unique or not. For example:
User.select(:name)
# => Might return two records with the same name
User.select(:name).distinct
# => Returns 1 record per distinct name
User.select(:name).distinct.distinct(false)
# => You can also remove the uniqueness
776 777 778
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 776 def distinct(value = true) spawn.distinct!(value) end
#distinct!(value = true) Also known as: uniq!
Like #distinct, but modifies relation in place.
782 783 784 785
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 782 def distinct!(value = true) # :nodoc: self.distinct_value = value self end
#eager_load(*args)
Forces eager loading by performing a LEFT OUTER JOIN on args
:
User.eager_load(:posts)
#=> SELECT "users"."id" AS t0_r0, "users"."name" AS t0_r1, ...
FROM "users" LEFT OUTER JOIN "posts" ON "posts"."user_id" =
"users"."id"
163 164 165 166
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 163 def eager_load(*args) check_if_method_has_arguments!(:eager_load, args) spawn.eager_load!(*args) end
#extending(*modules, &block)
Used to extend a scope with additional methods, either through a module or through a block provided.
The object returned is a relation, which can be further extended.
Using a module
module Pagination
def page(number)
# pagination code goes here
end
end
scope = Model.all.extending(Pagination)
scope.page(params[:page])
You can also pass a list of modules:
scope = Model.all.extending(Pagination, SomethingElse)
Using a block
scope = Model.all.extending do
def page(number)
# pagination code goes here
end
end
scope.page(params[:page])
You can also use a block and a module list:
scope = Model.all.extending(Pagination) do
def per_page(number)
# pagination code goes here
end
end
824 825 826 827 828 829 830
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 824 def extending(*modules, &block) if modules.any? || block spawn.extending!(*modules, &block) else self end end
#extensions
[ GitHub ]109
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 109 alias extensions extending_values
#from(value, subquery_name = nil)
Specifies table from which the records will be fetched. For example:
Topic.select('title').from('posts')
# => SELECT title FROM posts
Can accept other relation objects. For example:
Topic.select('title').from(Topic.approved)
# => SELECT title FROM (SELECT * FROM topics WHERE approved = 't') subquery
Topic.select('a.title').from(Topic.approved, :a)
# => SELECT a.title FROM (SELECT * FROM topics WHERE approved = 't') a
754 755 756
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 754 def from(value, subquery_name = nil) spawn.from!(value, subquery_name) end
#group(*args)
Allows to specify a group attribute:
User.group(:name)
#=> SELECT "users".* FROM "users" GROUP BY name
Returns an array with distinct records based on the group
attribute:
User.select([:id, :name])
#=> [#<User id: 1, name: "Oscar">, #<User id: 2, name: "Oscar">, #<User id: 3, name: "Foo">
User.group(:name)
#=> [#<User id: 3, name: "Foo", ...>, #<User id: 2, name: "Oscar", ...>]
User.group('name AS grouped_name, age')
#=> [#<User id: 3, name: "Foo", age: 21, ...>, #<User id: 2, name: "Oscar", age: 21, ...>, #<User id: 5, name: "Foo", age: 23, ...>]
Passing in an array of attributes to group by is also supported.
User.select([:id, :first_name]).group(:id, :first_name).first(3)
#=> [#<User id: 1, first_name: "Bill">, #<User id: 2, first_name: "Earl">, #<User id: 3, first_name: "Beto">]
286 287 288 289
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 286 def group(*args) check_if_method_has_arguments!(:group, args) spawn.group!(*args) end
#having(opts, *rest)
Allows to specify a HAVING clause. Note that you can't use HAVING without also specifying a GROUP clause.
Order.having('SUM(price) > 30').group('user_id')
604 605 606
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 604 def having(opts, *rest) opts.blank? ? self : spawn.having!(opts, *rest) end
#includes(*args)
Specify relationships to be included in the result set. For example:
users = User.includes(:address)
users.each do |user|
user.address.city
end
allows you to access the address
attribute of the
User
model without firing an additional query. This will often
result in a performance improvement over a simple join
.
You can also specify multiple relationships, like this:
users = User.includes(:address, :friends)
Loading nested relationships is possible using a Hash:
users = User.includes(:address, friends: [:address, :followers])
conditions
If you want to add conditions to your included models you'll have to explicitly reference them. For example:
User.includes(:posts).where('posts.name = ?', 'example')
Will throw an error, but this will work:
User.includes(:posts).where('posts.name = ?', 'example').references(:posts)
Note that includes
works with association names while
references
needs the actual table name.
144 145 146 147
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 144 def includes(*args) check_if_method_has_arguments!(:includes, args) spawn.includes!(*args) end
#joins(*args)
Performs a joins on args
:
User.joins(:posts)
#=> SELECT "users".* FROM "users" INNER JOIN "posts" ON "posts"."user_id" = "users"."id"
You can use strings in order to customize your joins:
User.joins("LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id")
#=> SELECT "users".* FROM "users" LEFT JOIN bookmarks ON bookmarks.bookmarkable_type = 'Post' AND bookmarks.user_id = users.id
428 429 430 431
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 428 def joins(*args) check_if_method_has_arguments!(:joins, args) spawn.joins!(*args) end
#limit(value)
Specifies a limit for the number of records to retrieve.
User.limit(10) # generated SQL has 'LIMIT 10'
User.limit(10).limit(20) # generated SQL has 'LIMIT 20'
620 621 622
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 620 def limit(value) spawn.limit!(value) end
#lock(locks = true)
Specifies locking settings (default to true
). For more
information on locking, please see Locking.
647 648 649
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 647 def lock(locks = true) spawn.lock!(locks) end
#none
Returns a chainable relation with zero records.
The returned relation implements the Null Object pattern. It is an object with defined null behavior and always returns an empty array of records without querying the database.
Any subsequent condition chained to the returned relation will continue generating an empty relation and will not fire any query to the database.
Used in cases where a method or scope could return zero records but the result needs to be chainable.
For example:
@posts = current_user.visible_posts.where(name: params[:name])
# => the visible_posts method is expected to return a chainable Relation
def visible_posts
case role
when 'Country Manager'
Post.where(country: country)
when 'Reviewer'
Post.published
when 'Bad User'
Post.none # It can't be chained if [] is returned.
end
end
690 691 692
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 690 def none where("1=0").extending!(NullRelation) end
#offset(value)
Specifies the number of rows to skip before returning rows.
User.offset(10) # generated SQL has "OFFSET 10"
Should be used with order.
User.offset(10).order("name ASC")
636 637 638
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 636 def offset(value) spawn.offset!(value) end
#order(*args)
Allows to specify an order attribute:
User.order(:name)
#=> SELECT "users".* FROM "users" ORDER BY "users"."name" ASC
User.order(email: :desc)
#=> SELECT "users".* FROM "users" ORDER BY "users"."email" DESC
User.order(:name, email: :desc)
#=> SELECT "users".* FROM "users" ORDER BY "users"."name" ASC, "users"."email" DESC
User.order('name')
#=> SELECT "users".* FROM "users" ORDER BY name
User.order('name DESC')
#=> SELECT "users".* FROM "users" ORDER BY name DESC
User.order('name DESC, email')
#=> SELECT "users".* FROM "users" ORDER BY name DESC, email
317 318 319 320
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 317 def order(*args) check_if_method_has_arguments!(:order, args) spawn.order!(*args) end
#preload(*args)
Allows preloading of args
, in the same way that
includes
does:
User.preload(:posts)
#=> SELECT "posts".* FROM "posts" WHERE "posts"."user_id" IN (1, 2, 3)
177 178 179 180
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 177 def preload(*args) check_if_method_has_arguments!(:preload, args) spawn.preload!(*args) end
#readonly(value = true)
Sets readonly attributes for the returned relation. If value is true (default), attempting to update a record will result in an error.
users = User.readonly
users.first.save
#=> ActiveRecord::ReadOnlyRecord: ActiveRecord::ReadOnlyRecord
704 705 706
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 704 def readonly(value = true) spawn.readonly!(value) end
#references(*table_names)
Use to indicate that the given table_names
are referenced by
an SQL string, and should therefore be JOINed in any query rather than
loaded separately. This method only works in conjunction with
includes
. See #includes for more details.
User.includes(:posts).where("posts.name = 'foo'")
# => Doesn't JOIN the posts table, resulting in an error.
User.includes(:posts).where("posts.name = 'foo'").references(:posts)
# => Query now knows the string references posts, so adds a JOIN
197 198 199 200
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 197 def references(*table_names) check_if_method_has_arguments!(:references, table_names) spawn.references!(*table_names) end
#reorder(*args)
Replaces any existing order defined on the relation with the specified order.
User.order('email DESC').reorder('id ASC') # generated SQL has 'ORDER BY id ASC'
Subsequent calls to order on the same relation will be appended. For example:
User.order('email DESC').reorder('id ASC').order('name ASC')
generates a query with 'ORDER BY id ASC, name ASC'.
338 339 340 341
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 338 def reorder(*args) check_if_method_has_arguments!(:reorder, args) spawn.reorder!(*args) end
#reverse_order
Reverse the existing order clause on the relation.
User.order('name ASC').reverse_order # generated SQL has 'ORDER BY name DESC'
845 846 847
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 845 def reverse_order spawn.reverse_order! end
#rewhere(conditions)
Allows you to change a previously set where condition for a given attribute, instead of appending to that condition.
Post.where(trashed: true).where(trashed: false) # => WHERE `trashed` = 1 AND `trashed` = 0
Post.where(trashed: true).rewhere(trashed: false) # => WHERE `trashed` = 0
Post.where(active: true).where(trashed: true).rewhere(trashed: false) # => WHERE `active` = 1 AND `trashed` = 0
This is short-hand for unscope(where: conditions.keys).where(conditions). Note that unlike reorder, we're only unscoping the named conditions – not the entire where statement.
596 597 598
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 596 def rewhere(conditions) unscope(where: conditions.keys).where(conditions) end
#select(*fields)
Works in two unique ways.
First: takes a block so it can be used just like Array#select
.
Model.all.select { |m| m.field == value }
This will build an array of objects from the database for the scope,
converting them into an array and iterating through them using
Array#select
.
Second: Modifies the SELECT statement for the query so that only certain fields are retrieved:
Model.select(:field)
# => [#<Model id: nil, field: "value">]
Although in the above example it looks as though this method returns an array, it actually returns a relation object and can have other query methods appended to it, such as the other methods in ActiveRecord::QueryMethods.
The argument to the method can also be an array of fields.
Model.select(:field, :other_field, :and_one_more)
# => [#<Model id: nil, field: "value", other_field: "value", and_one_more: "value">]
You can also use one or more strings, which will be used unchanged as SELECT fields.
Model.select('field AS field_one', 'other_field AS field_two')
# => [#<Model id: nil, field: "value", other_field: "value">]
If an alias was specified, it will be accessible from the resulting objects:
Model.select('field AS field_one').first.field_one
# => "value"
Accessing attributes of an object that do not have fields retrieved by a
select except id
will throw
ActiveModel::MissingAttributeError
:
Model.select(:field).first.other_field
# => ActiveModel::MissingAttributeError: missing attribute: other_field
249 250 251 252 253 254 255 256
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 249 def select(*fields) if block_given? to_a.select { |*block_args| yield(*block_args) } else raise ArgumentError, 'Call this with at least one field' if fields.empty? spawn._select!(*fields) end end
#uniq(value = true)
Alias for #distinct.
#uniq!(value = true)
Alias for #distinct!.
#unscope(*args)
Removes an unwanted relation that is already defined on a chain of relations. This is useful when passing around chains of relations and would like to modify the relations without reconstructing the entire chain.
User.order('email DESC').unscope(:order) == User.all
The method arguments are symbols which correspond to the names of the methods which should be unscoped. The valid arguments are given in VALID_UNSCOPING_VALUES. The method can also be called with multiple arguments. For example:
User.order('email DESC').select('id').where(name: "John")
.unscope(:order, :select, :where) == User.all
One can additionally pass a hash as an argument to unscope specific :where values. This is done by passing a hash with a single key-value pair. The key should be :where and the value should be the where value to unscope. For example:
User.where(name: "John", active: true).unscope(where: :name)
== User.where(active: true)
This method is similar to except
, but unlike
except
, it persists across merges:
User.order('email').merge(User.except(:order))
== User.order('email')
User.order('email').merge(User.unscope(:order))
== User.all
This means it can be used in association definitions:
has_many :comments, -> { unscope where: :trashed }
388 389 390 391
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 388 def unscope(*args) check_if_method_has_arguments!(:unscope, args) spawn.unscope!(*args) end
#where(opts = :chain, *rest)
Returns a new relation, which is the result of filtering the current relation according to the conditions in the arguments.
#where accepts conditions in one of several formats. In the examples below, the resulting SQL is given as an illustration; the actual query generated may be different depending on the database adapter.
string
A single string, without additional arguments, is passed to the query constructor as an SQL fragment, and used in the where clause of the query.
Client.where("orders_count = '2'")
# SELECT * from clients where orders_count = '2';
Note that building your own string from user input may expose your application to injection attacks if not done properly. As an alternative, it is recommended to use one of the following methods.
array
If an array is passed, then the first element of the array is treated as a template, and the remaining elements are inserted into the template to generate the condition. Active Record takes care of building the query to avoid injection attacks, and will convert from the ruby type to the database type where needed. Elements are inserted into the string in the order in which they appear.
User.where(["name = ? and email = ?", "Joe"<EMAIL_ADDRESS># SELECT * FROM users WHERE name = 'Joe' AND email =<EMAIL_ADDRESS>Alternatively, you can use named placeholders in the template, and pass a hash as the second element of the array. The names in the template are replaced with the corresponding values from the hash.
User.where(["name = :name and email = :email", { name: "Joe", email<EMAIL_ADDRESS>}])
# SELECT * FROM users WHERE name = 'Joe' AND email =<EMAIL_ADDRESS>This can make for more readable code in complex queries.
Lastly, you can use sprintf-style % escapes in the template. This works
slightly differently than the previous methods; you are responsible for
ensuring that the values in the template are properly quoted. The values
are passed to the connector for quoting, but the caller is responsible for
ensuring they are enclosed in quotes in the resulting SQL. After quoting,
the values are inserted using the same escapes as the Ruby core method
Kernel::sprintf
.
User.where(["name = '%s' and email = '%s'", "Joe"<EMAIL_ADDRESS># SELECT * FROM users WHERE name = 'Joe' AND email =<EMAIL_ADDRESS>If #where is called with multiple arguments, these are treated as if they were passed as the elements of a single array.
User.where("name = :name and email = :email", { name: "Joe", email<EMAIL_ADDRESS>})
# SELECT * FROM users WHERE name = 'Joe' AND email =<EMAIL_ADDRESS>When using strings to specify conditions, you can use any operator available from the database. While this provides the most flexibility, you can also unintentionally introduce dependencies on the underlying database. If your code is intended for general consumption, test with multiple database backends.
hash
#where will also accept a hash condition, in which the keys are fields and the values are values to be searched for.
Fields can be symbols or strings. Values can be single values, arrays, or ranges.
User.where({ name: "Joe", email<EMAIL_ADDRESS>})
# SELECT * FROM users WHERE name = 'Joe' AND email =<EMAIL_ADDRESS>User.where({ name: ["Alice", "Bob"]})
# SELECT * FROM users WHERE name IN ('Alice', 'Bob')
User.where({ created_at: (Time.now.midnight - 1.day)..Time.now.midnight })
# SELECT * FROM users WHERE (created_at BETWEEN '2012-06-09 07:00:00.000000' AND '2012-06-10 07:00:00.000000')
In the case of a belongs_to relationship, an association key can be used to specify the model if an ActiveRecord object is used as the value.
= Author.find(1)
# The following queries will be equivalent:
Post.where(author: )
Post.where(author_id: )
This also works with polymorphic belongs_to relationships:
treasure = Treasure.create(name: 'gold coins')
treasure.price_estimates << PriceEstimate.create(price: 125)
# The following queries will be equivalent:
PriceEstimate.where(estimate_of: treasure)
PriceEstimate.where(estimate_of_type: 'Treasure', estimate_of_id: treasure)
Joins
If the relation is the result of a join, you may create a condition which uses any of the tables in the join. For string and array conditions, use the table name in the condition.
User.joins(:posts).where("posts.created_at < ?", Time.now)
For hash conditions, you can either use the table name in the key, or use a sub-hash.
User.joins(:posts).where({ "posts.published" => true })
User.joins(:posts).where({ posts: { published: true } })
no argument
If no argument is passed, #where returns a new instance of WhereChain,
that can be chained with #not
to return a new relation that negates the
where clause.
User.where.not(name: "Jon")
# SELECT * FROM users WHERE name != 'Jon'
See WhereChain for more details on #not
.
blank condition
If the condition is any blank-ish object, then #where is a no-op and returns the current relation.
568 569 570 571 572 573 574 575 576
# File 'activerecord/lib/active_record/relation/query_methods.rb', line 568 def where(opts = :chain, *rest) if opts == :chain WhereChain.new(spawn) elsif opts.blank? self else spawn.where!(opts, *rest) end end


Approved Drug List
Training Requirement for Health Sector
Private Health Facilities Registered Under Ministry of Health
Research Abstract Submission Format
Registered Pharmacy list, February 2018
Approved Alternative / Dhivehi beys List, February 2018
Approved Importers List, February 2018
Dhunfathuge Isthiumaalukurun Manaa Thanthan Kanda-alhaa Qawaaidhu


Add a new device
a. If you're using wired network, just plugin your network cable
b. If you're using wireless network, please refer to this guide to configure your image
a. Connect the supplied LED module to the GPIO headers as shown below
(the LED will show the following patterns: =0_1_2_3_4_5_6_7_8_9-,in this case<PHONE_NUMBER> is the pin code)
b. Alternatively, you can find the code in the file: /etc/enrol.log (requires a monitor, mouse and keyboard)
7.Enter the number below to enroll the device:
Error


| Package | sandy.math |
| Class | public class FastMath |
| Method | Defined by | ||
|---|---|---|---|
|
cos(radians:Number):Number
[static]
Returns the cosine of a given value, by looking up it's approximation in a
precomputed table.
| FastMath | ||
|
sin(radians:Number):Number
[static]
Returns the sine of a given value, by looking up it's approximation in a
precomputed table.
| FastMath | ||
|
tan(radians:Number):Number
[static]
Returns the tangent of a given value, by looking up it's approximation in a
precomputed table.
| FastMath |
| Constant | Defined by | ||
|---|---|---|---|
| HALF_PI : Number [static]
Math constant pi/2.
| FastMath | ||
| initialized : Boolean [static]
Whether this class has been initialized.
| FastMath | ||
| PRECISION : int = 0x020000 [static]
The precision of the lookup table.
| FastMath | ||
| PRECISION_DIV_2PI : Number [static]
PRECISION / TWO_PI . | FastMath | ||
| PRECISION_S : int = 131071 [static]
PRECISION - 1. | FastMath | ||
| TWO_PI : Number [static]
Math constant pi*2.
| FastMath |
| cos | () | method |
public static function cos(radians:Number):Number
Returns the cosine of a given value, by looking up it's approximation in a precomputed table.
Parametersradians:Number — The value to cosine.
|
Number — The approximation of the value's cosine.
|
| sin | () | method |
public static function sin(radians:Number):Number
Returns the sine of a given value, by looking up it's approximation in a precomputed table.
Parametersradians:Number — The value to sine.
|
Number — The approximation of the value's sine.
|
| tan | () | method |
public static function tan(radians:Number):Number
Returns the tangent of a given value, by looking up it's approximation in a precomputed table.
Parametersradians:Number — The value to tan.
|
Number — The approximation of the value's tangent.
|
| HALF_PI | constant |
public static const HALF_PI:Number
Math constant pi/2.
| initialized | constant |
public static const initialized:Boolean
Whether this class has been initialized.
| PRECISION | constant |
public static const PRECISION:int = 0x020000
The precision of the lookup table.
The bigger this number, the more entries there are in the lookup table, which gives more accurate results.
| PRECISION_DIV_2PI | constant |
public static const PRECISION_DIV_2PI:Number
PRECISION
/ TWO_PI
.
| PRECISION_S | constant |
public static const PRECISION_S:int = 131071
PRECISION
- 1.
| TWO_PI | constant |
public static const TWO_PI:Number
Math constant pi*2.


Index of /wp-includes/js/swfupload
Parent Directory
handlers.js
handlers.min.js
license.txt
plugins/
swfupload.js
swfupload.swf
Apache Server at ivan.olimpiadascientificas.com Port 80


Products
Cafe
Events
Service
Order
DIAZEPAM ORIGINAL ICE CREAM
Single?Double? choose any flavour what you want
Flavour:Vanilla, Black Chocolate,Cookies and cream, Strawberry, Oreo, Coffee
INFORMATION
About Us
CUSTOMER SERVICE
FAQs
Contact Us
MY ACCOUNT
Sign Up
Sign In


Basic WebRTC Implementation
Note: As Webrtc works Peer to Peer, it may fails depending on network configuration mainly if your Router is configured with Symmertic NAT.


I'm a software engineer proficient in JavaScript, Node, and React with a STEM background in Chemical Engineering. I transitioned from DNA Research at Stanford to web development to help companies create responsive, scalable, and maintainable web experiences. My latest work involves implementing UI's in React and integration with APIs at Women Who Code Silicon Valley Chapter Tools Project.
Seattle, WA
Download ResumeNews explorer is a MERN stack application that fetches and displays articles from the News API.
After the users are authenticated, can bookmark articles and view on their profile page.
This app was created with Create-React-App. The development process was done in 2-week agile sprints. The backend is built in Node/Express.js and served on AWS(EC2) cloud server. User data, credentials, and saved articles are stored in MongoDB.
Around the U.S. is an Instagram-like content-sharing app. This is a responsive single page React app with router navigation. Server-side API is powered by Express.js server and hosted on Heroku.
The app features user profile registration and login. Authenticated users are redirected to the main page and can add pictures to the gallery and see the cards created by other users. Additionally, the users can like/dislike or remove pictures.
This is a landing page that I created during my web development training program. It demonstrates my proficiency in semantic HTML, CSS (flexbox, grid, animations), and BEM methodology and ability to create layouts from designs provided in Figma. The page is responsive and scales up to different screen resolutions.
ykhilko@gmail.com


Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big
Shop these Shopname deals of the day to save as much...
Don't miss out on all the coupon savings.Get you coupon now and save big
Buy online and pick-up in-store to save 15% or 20%...
Don't miss out on all the coupon savings.Get you coupon now and save big


Toggle Heatmap
Merge Scan
Clear maps
Filter
Get Signal Area
Clear Polygon
Informations
Add data
Delete data
SSID
Number of
Location
Signal Area
low
medium
high
Add Data Parameters
Signal Strenght:
1
2
3
4
5


Anushka Sharma is a vision in white as she decks up for Karan Johar's house party
by TIMESOFINDIA.COMKaran Johar hosted a welcome party for international pop singer Katy Perry at his residence last night. Several Bollywood celebs like Aishwarya Rai Bachchan, Abhishek Bachchan, Anushka Sharma, Alia Bhatt, Shahid Kapoor, Ananya Panday, Kunal Kemmu, Sanjay Kapoor, Dinesh Vijan, Kajol, Karisma Kapoor, Arjun Kapoor, Malaika Arora and more attended the bash.
Actress Anushka Sharma was also present at the star-studded bash. Before arriving for the celebration, the actress shot for a photoshoot donning her last night's OOTD. The actress was looking a vision in white as she posed for the lenses.
The 'Zero' actress was seen wearing a simple yet shiny white short dress with long puffed sleeves. She accessorised her look with watch and bracelet set and opted for smokey eye make-up. Her beautiful open hair jazzed up her overall look.
On the work front, she was last seen in 'Zero' alongside Shah Rukh Khan and Katrina Kaif. She hasn't announced any project yet.
Pictures Courtesy: Anushka Sharma Instagram


--- title: Journals of Fedran layout: default ---
This issue is only available for those who contribute via Patreon.
Religion is a thread that weaves throughout the tapestry of life. It doesn't matter if it is a shopkeeper who whispers prayers in hope of a quick sale or a priest who founded his own religion while struggling with his own faith. There are a wide variety of religions and faiths in Fedran and this issue tries to explore many of them.
The premier issue of Journals of Fedran, this focuses a critical aspect of the world, resonance. Resonance affects how magic works, and more importantly, how it reacts poorly to other magic. This resulted in the invention of steam engines and gave birth to the beginning of the Industrial Age.


Ghar Jagga
Real real-estates
Toggle navigation
Home
(current)
Buy
Sell
Search
Ana
Square Foot
Square Meter
Ropani
Katha
Dhur
Dam
Paisa
Ana
Square Foot
Square Meter
Ropani
Katha
Dhur
Dam
Paisa
Output Area
Convert


--- title: Create a high quality podcast your audience loves. description: We'll do all the heavy lifting. ---


{{ blog.title }}
{{ blog.intro|truncatewords:15 }}
{% extends "base.html" %} {% load wagtailcore_tags navigation_tags wagtailimages_tags %} {% block content %}
{{ blog.intro|truncatewords:15 }}
Oh, snap. Looks like we were too busy baking to write any blog posts. Sorry.


Article Image
Important update
The registration is to take place in the St. David's Room of King's Building, Strand campus, King's College London .
The conference
The ETSF YRM 2016 will be held at the Strand Campus of King’s College London (KCL) in London, UK. The campus is situated at the very center of London 20 min walk from such tourist attractions as the Houses of Parliament, St Paul's Cathedral, Trafalgar Square, etc. It's easily accessible by city transport such as tube or buses.
Talks and poster sessions
Mondays and Friday talks will take place in K-1.14 room of the King's Building, while from Tuesday until Thursday in room K2.31. St. David's Room will be designated for posters and the coffee breaks.
Accomodation
Private rooms:
Shared rooms:


@@include('../analytics-code.html') @@include('../styles.html')
You need a marketplace where your users could buy, sell or rent their products? Or a booking marketplace where users can book services? Or a marketplace for digital goods? We cover them all!
You can allow your users to either signup with their email address, or with their facebook account.
Your users will be able to add details, geolocation, price, date, duration and images to their listings. Additionally, listings have public discussion where users can comment or discuss on the specific listing.
Allow your users to browse, filter and search items. Your users can browse listings as a list, grid or map. It is possible to filter items based on their location, category name and price.
We provide you with booking calendar that will make your users specify the listing's availability, which is shown to users in the listing's calendar.
The users have their own verified profile page with their preferences, short biography, picture, and ratings and reviews.
We support different booking scenarios for your Marketplace. Listings can have many requests and many bookings, many requests but one booking, or one request and one booking.
We support Stripe and MangoPay as payment provider.
The users will be able to rate and leave reviews to the listings.
Your users can connect with each other through chat. The users will have their own inbox inside the marketplace, which helps them keep track of their orders.
Your platform sends automated emails, of which you can configure the content.
Our solution is available in different languages and currencies.
Easily configure and manage your marketplace from admin dashboard.
We integrate Google Analytics into your marketplace so that you see what is happening in the platform and optimize it accordingly.
We also offer integration with Mandrill for your marketing emails.


Static helper functions.
Public Static Methods | |
| static string | path (string ... $args) |
| Joins string pieces and formats it as an absolute path. More... | |
| static string | slug (string ... $args) |
| Joins string pieces and formats it as a human friendly slug. More... | |
|
static |
Joins string pieces and formats it as an absolute path.
| string | ...$args |
|
static |
Joins string pieces and formats it as a human friendly slug.
| string | ...$args |


{% extends "base.html" %} {% block title %}{% load strip_up %}{{ X |strip_up:request.path }}{% endblock %} {% block content %}
Enter your address into the box below and allow Google to show you where to go!


HOME
Total Steps
Calories
BP
Pulse rate
Sugar level
Sleep Record
Menstural Cycle
Body Temperature
SpO2


{% extends "skeleton/_body.html" %} {%hyde title: "Cast Client - Upgrading an Application Instance" created: 2011-03-01 listing: False %} {% block content_body %} {% include "docs/client/instances/upgrade/doc.stub" %} {% endblock %}


| Number of Classes | Line Coverage | Mutation Coverage |
|---|---|---|
| 3 | 96% | 89% |
| Name | Line Coverage | Mutation Coverage |
|---|---|---|
| PkgTypesScanner.java | 100% |
67% |
| ReflectionUtils.java | 100% |
100% |
| ReflectionsModel.java | 95% |
87% |


Unicode Fraction Creator
Unfortunately, some of the characters that you have used are not supported in fraction form. Please only
use:
- numbers 0-9
- spaces, plus, minus, equals, parenthesis
- limited lowercase letters (a, e, h, i, j, k, l, m, n, o, p, r, s, t, u, v, x are supported in both the numerator and denominator)
Numerator
Denominator
Original
Simplified


Hello, I'm
John Doe
I am designer with fifteen years of experience and focused on creating perfect apps
Hire Me


These documents are HTML versions of the man pages for all of the LLVM tools. These pages describe how to use the LLVM commands and what their options are. Note that these pages do not describe all of the options available for all tools. To get a complete listing, pass the -help (general options) or -help-hidden (general+debugging options) arguments to the tool you are interested in.


abstract fun getRootLinearLayoutId(): Int
Supply the root linear layout id for the customization of ParentItem
Return Id of root linear layout


Across: 1. Close fashionable fellows in beastly accommodation (6) 4. Reportedly my intention is to get to Avalon (4) 7. Confused Spaniard swaps 500 for one with French citizen (8) 8. Hard to find Mark, now (6) 10. Island walk with swimmer (8) 13. One gets a cold chicken in German city (6) 14. Sweet is very French half-tossed turnover (7) 15. Welshman takes disheartened sister to cathedral (6) 18. These may have the same effect as pot and ecstasy I mixed (7) 19. Drink fizzy pop in city (6) 20. Fabulous creature has meal at Oxford, maybe (7) 25. Need to accept removal of the Queen (6) 26. Broken reel is on playground? (8) 27. Descendants are boys carrying the beginnings of childhood infections (6) 28. Recoil from illegal payment! (8) 29. Colourless, avaricious journalist left (4) 30. Friend’s writing about Bob’s songs (6) Down: 1. Small charge is about right for dance... (6) 2. ...Shoes kicked off for hot-sound shuffle! (6) 3. Money for priests holding party in Africa (6) 5. Old Greek takes back large boxes (8) 6. Going to ground with one of us left out! (8) 7. Quietly accept award in splendour (4) 9. Resent silly name!... (6) 11. ...React when silly person doesn’t start! (7) 12. A cold snake slithers suspiciously! (7) 13. Rights to enter places to get money owed (7) 16. Pitches you and me into Paul’s place! (6) 17. Taking back what one said to make His Majesty go faster? (8) 18. No money to get in Uxbridge and live initially in luxury (8) 21. Duck slide is treacherous for this group of people (6) 22. Mark gets the Spanish coin (6) 23. Sam and Don mix with travellers (6) 24. Knock down cards (4)


{% extends 'base.html' %} {% block banner %}
Add a new course to our courses or add a material to an existing course


.. raw:: html
Stream-function-based coil design in arbitrary geometries and with multiple constraints Check it out
Surface harmonics basis for compact representation of surface currents Check it out
Arbitrary closed geometries, modeling and prospective compensation Check it out
Computation of thermal magnetic noise, including frequency-dependence Check it out


Blocking the library/request can also be caused by your Security Suites Webprotection.
The javascript miner is in no way malicious but it was secretly embedded in a lot of websites or even browser extensions without notifying it's users, therefore Security Suites started outright blocking it. In the future there will be a forced opt-in to prevent this. Preview
Coinhive offers a JavaScript miner for the Monero Blockchain (CryptoCurrency like BitCoin) that can be embedded in a website. The miner is run directly in your Browser and mines XMR as an alternative form of support instead of donating money.
This miner uses your CPU. By increasing or decreasing the Threads you are using more or less of your CPUs cores and by changing the Speed you can adjust every cores utilization. You can check the actual CPU usage of this miner by looking at your Windows Task Manager or your Browser's Task Manager, for example in Chrome.


CD Certificate Generator
Template
Uploaded
Standard
Simon
Form Data
Participand Name
Name of the training
Date of issue
Training location
Trainer Name
Cancel
© 2014, Simon Wunderlin


Delphi TZDBUnits Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
TZDB for Delphi Documentation by pasdoc 2018-03-04
All Types
| PTZ_Instance |
TZCAPI |
A <c>Pointer</c> to a <see cref="TZCAPI|TZ_Instance"/> stucture. |
| PTZ_Time |
TZCAPI |
A <c>Pointer</c> to a <see cref="TZCAPI|TZ_Time"/> type. |
| TLocalTimeType |
TZDB |
Defines four types that a local date/time type can be in. |
| TZ_EnumProc |
TZCAPI |
Time zone enumerator procedure. <param name="Data">A data object provided by the consumer code.</param> <param name="Name">The name of the currently enumerated time zone.</param> <returns>Consmer must return <c>True</c> to interrupt the enumeraton process.</returns> |
| TZ_Result |
TZCAPI |
A somewhat generic type used for most API methods in this library. <remarks>All negative values of this type signify an error. |
| TZ_Time |
TZCAPI |
An <c>Int64</c> representing the C/UNIX time format. |
prepared by M.Taylor
Generated by PasDoc 0.15.0.
|


1 使用R语言获得数据
开始使用R去探索数据前，先要了解以下几个重要内容：
- 什么是R 和 Rstudio ?
- 如果开始编写R语言 ?
- 什么是R package ?
如果你己经了解这几个内容。你可以跳过以下部分
1.4 below introducing some of the datasets we will explore in depth in this book. Much of this chapter is based on two sources which you should feel free to use as references if you are looking for additional details:
- ModernDive co-author Chester Ismay’s Getting used to R, RStudio, and R Markdown [@usedtor2016], which includes video screen recordings that you can follow along and pause as you learn.
- DataCamp’s online tutorials. DataCamp is a browser-based interactive platform for learning data science and their tutorials will help facilitate your learning of the above concepts (and other topics in this book). Go to DataCamp and create an account before continuing.
1.1 什么是R 和 Rstudio?
For much of this book, we will assume that you are using R via RStudio. First time users often confuse the two. At its simplest:
- R is like a car’s engine
- RStudio is like a car’s dashboard
| R: Engine | RStudio: Dashboard |
|---|---|
More precisely, R is a programming language that runs computations while RStudio is an integrated development environment (IDE) that provides an interface by adding many convenient features and tools. So the way of having access to a speedometer, rearview mirrors, and a navigation system makes driving much easier, using RStudio’s interface makes using R much easier as well.
Optional: For a more in-depth discussion on the difference between R and RStudio IDE, watch this DataCamp video (2m52s).
1.1.1 安装 R 和 RStudio
If your instructor has provided you with a link and access to RStudio Server, then you can skip this section. We do recommend though after a few months of working on the RStudio Server that you return to these instructions. If you don’t know what RStudio Server is, then please read this section.
You will first need to download and install both R and RStudio (Desktop version) on your computer.
- Download and install R.
- Note: You must do this first.
- Click on the download link corresponding to your computer’s operating system.
- Download and install RStudio.
- Scroll down to “Installers for Supported Platforms”
- Click on the download link corresponding to your computer’s operating system.
Optional: If you need more detailed instructions on how to install R and RStudio, watch this DataCamp video (1m22s).
1.1.2 在RStudio中使用R
Recall our car analogy from above. Much as we don’t drive a car by interacting directly with the engine but rather by using elements on the car’s dashboard, we won’t be using R directly but rather we will use RStudio’s interface. After you install R and RStudio on your computer, you’ll have two new programs AKA applications you can open. We will always work in RStudio and not R. In other words:
| R: Do not open this | RStudio: Open this |
|---|---|
After you open RStudio, you should see the following:
Watch the following DataCamp video (4m10s) to learn about the different panes in RStudio, in particular the Console pane where you will later run R code.
1.2 如果开始编写R语言?
Now that you’re set up with R and RStudio, you are probably asking yourself “OK. Now how do I use R?” The first thing to note as that unlike other software like Excel, STATA, or SAS that provide point and click interfaces, R is an interpreted language, meaning you have to enter in R commands written in R code i.e. you have to program in R (we use the terms “coding” and “programming” interchangeably in this book).
While it is not required to be a seasoned coder/computer programmer to use R, there is still a set of basic programming concepts that R users need to understand. Consequently, while this book is not a book on programming, you will still learn just enough of these basic programming concepts needed to explore and analyze data effectively.
1.2.1 基本编程概念和术语
To introduce you to many of these basic programming concepts and terminology, we direct you to the following DataCamp online interactive tutorials. For each of the tutorials, we give a list of the basic programming concepts covered. Note that in this book, we will use a different font to distinguish regular font from computer_code
.
It is important to note that while these tutorials serve as excellent introductions, a single pass through them is insufficient for long-term learning and retention. The ultimate tools for long-term learning and retention are “learning by doing” and repetition, something we will have you do over the course of the entire book and we encourage this process as much as possible as you learn any new skill.
- From the Introduction to R course complete the following chapters. As you work through the chapters, carefully note the important terms and what they are used for. We recommend you do so in a notebook that you can easily refer back to.
- Chapter 1 Intro to basics:
- Console pane: where you enter in commands
- Objects: where values are saved, how to assign values to objects.
- Data types: integers, doubles/numerics, logicals, characters.
- Chapter 2 Vectors:
- Vectors: a series of values.
- Chapter 4 Factors:
- Categorical data (as opposed to numerical data) are represented in R as
factor
s.
- Categorical data (as opposed to numerical data) are represented in R as
- Chapter 5 Data frames:
- Data frames are analogous to rectangular spreadsheets: they are representations of datasets in R where the rows correspond observations and the columns correspond to variables that describe the observations. We will revisit this later in Section 1.4.
- Chapter 1 Intro to basics:
- From the Intermediate R course complete the following chapters:
- Chapter 1 Conditionals and Control Flow:
- Testing for equality in R using
==
(and not=
which is typically used for assignment). Ex:2 + 1 == 3
compares2 + 1
to3
and is correct R syntax, while2 + 1 = 3
is not and is incorrect R syntax. - Boolean algebra:
TRUE/FALSE
statements and mathematical operators such as<
(less than),<=
(less than or equal), and!=
(not equal to). - Logical operators:
&
representing “and”,|
representing “or”. Ex:(2 + 1 == 3) & (2 + 1 == 4)
returnsFALSE
while(2 + 1 == 3) | (2 + 1 == 4)
returnsTRUE
.
- Testing for equality in R using
- Chapter 3 Functions:
- Concept of functions: they take in inputs (called arguments) and return outputs.
- You either manually specify a function’s arguments or use the function’s defaults.
- Chapter 1 Conditionals and Control Flow:
This list is by no means an exhaustive list of all the programming concepts and terminology needed to become a savvy R user; such a list would be so large it wouldn’t be very useful, especially for novices. Rather, we feel this is the bare minimum you need to know before you get started; the rest we feel you can learn as you go. Remember that your knowledge of all of these concepts will build as you get better and better at “speaking R” and getting used to its syntax.
1.2.2 学习编程的提示
Learning to code/program is very much like learning a foreign language, it can be very daunting and frustrating at first. However just as with learning a foreign language, if you put in the effort and are not afraid to make mistakes, anybody can learn. Lastly, there are a few useful things to keep in mind as you learn to program:
- Computers are stupid: You have to tell a computer everything it needs to do. Furthermore, your instructions can’t have any mistakes in them, nor can they be ambiguous in any way.
- Take the “copy/paste/tweak” approach: Especially when learning your first programming language, it is often much easier to taking existing code that you know works and modify it to suit your ends, rather than trying to write new code from scratch. We call this the copy/paste/tweak approach. So early on, we suggest not trying to code from scratch, but please take the code we provide throughout this book and play around with it!
- Practice is key: Just as the only solution to improving your foreign language skills is practice, so also the only way to get better at R is through practice. Don’t worry however, we’ll give you plenty of opportunities to practice!
1.3 什么是 R packages?
Another point of confusion with new R users is the notion of a package. R packages extend the functionality of R by providing additional functions, data, and documentation and can be downloaded for free from the internet. They are written by a world-wide community of R users. For example, among the many packages we will use in this book are the
There are two key things to remember about R packages:
- Installation: Most packages are not installed by default when you install R and RStudio. You need to install a package before you can use it. Once you’ve installed it, you likely don’t need to install it again unless you want to update it to a newer version of the package.
- Loading: Packages are not loaded automatically when you open RStudio. You need to load them every time you open RStudio using the
library()
command.
A good analogy for R packages is they are like apps you can download onto a mobile phone:
| R: A new phone | R Packages: Apps you can download |
|---|---|
So, expanding on this analogy a bit:
- R is like a new mobile phone. It has a certain amount of functionality when you use it for the first time, but it doesn’t have everything.
- R packages are like the apps you can download onto your phone, much like those offered in the App Store and Google Play. For example: Instagram.
- In order to use a package, just like in order to use Instagram, you must:
- First download it and install it. You do this only once.
- Load it, or in other words, “open” it, using the
library()
command.
So just as you can only start sharing photos with your friends on Instagram if you first install the app and then open it, you can only access an R package’s data and functions if you first install the package and then load it with the library()
command. Let’s cover these two steps:
1.3.1 安装 Package
(Note that if you are working on an RStudio Server, you probably will not need to install your own packages as that has been already done for you. Still it is important that you know this process for later when you are not using the RStudio Server but rather your own installation of RStudio Desktop.)
There are two ways to install an R package. For example, to install the ggplot2
package:
- Easy way: In the Files pane of RStudio:
- Click on the “Packages” tab
- Click on “Install”
- Type the name of the package under “Packages (separate multiple with space or comma):” In this case, type
ggplot2
- Click “Install”
- Alternative way: In the Console pane run
install.packages("ggplot2")
(you must include the quotation marks).
Repeat this for the dplyr
and nycflights13
packages.
Note: You only have to install a package once, unless you want to update an already installed package to the latest version. If you want to update a package to the latest version, then re-install it by repeating the above steps.
1.3.2 加载 Package
After you’ve installed a package, you can now load it using the library()
command. For example, to load the ggplot2
and dplyr
packages, run the following code in the Console pane:
library(ggplot2)
library(dplyr)
Note: You have to reload each package you want to use every time you open a new session of RStudio. This is a little annoying to get used to and will be your most common error as you begin. When you see an error such as
Error: could not find function
remember that this likely comes from you trying to use a function in a package that has not been loaded. Remember to run the library()
function with the appropriate package to fix this error.
1.4 探索 你的第一个数据集
Let’s put everything we’ve learned so far into practice and start exploring some real data! Data comes to us in a variety of formats, from pictures to text to numbers. Throughout this book, we’ll focus on datasets that can be stored in a spreadsheet as that is among the most common way data is collected in the many fields. Remember from Subsection 1.2.1 that these “spreadsheet”-type datasets are called data frames in R and we will focus on working with data frames throughout this book.
Let’s first load all the packages needed for this chapter (This assumes you’ve already installed them. Read Section 1.3 for information on how to install and load R packages if you haven’t already.) At the beginning of all subsequent chapters in this text, we’ll always have a list of packages similar to what follows that you should have installed and loaded to work with that chapter’s R code.
library(dplyr)
# Be sure to install these first!
library(nycflights13)
## Warning: package 'nycflights13' was built under R version 3.5.2
library(knitr)
1.4.1 nycflights13 package
We likely have all flown on airplanes or know someone who has. Air travel has become an ever-present aspect in many people’s lives. If you live in or are visiting a relatively large city and you walk around that city’s airport, you see gates showing flight information from many different airlines. And you will frequently see that some flights are delayed because of a variety of conditions. Are there ways that we can avoid having to deal with these flight delays?
We’d all like to arrive at our destinations on time whenever possible. (Unless you secretly love hanging out at airports. If you are one of these people, pretend for the moment that you are very much anticipating being at your final destination.) Throughout this book, we’re going to analyze data related to flights contained in the nycflights13
package [@R-nycflights13]. Specifically, this package contains five datasets saved as “data frames” (see Section 1.2) with information about all domestic flights departing from New York City in 2013, from either Newark Liberty International (EWR), John F. Kennedy International (JFK), or LaGuardia (LGA) airports:
flights
: information on all 336,776 flightsairlines
: translation between two letter IATA carrier codes and names (16 in total)planes
: construction information about each of 3,322 planes usedweather
: hourly meteorological data (about 8705 observations) for each of the three NYC airportsairports
: airport names and locations
1.4.2 flights 数据集
We will begin by exploring the flights
data frame that is included in the nycflights13
package and getting an idea of its structure. Run the following in your code in your console: it loads in the flights
dataset into your Console.  This particular data frame has336,776
rows19
columns corresponding to 19 variables describing each observation
year month day dep_time sched_dep_time dep_delay arr_time
are different columns, in other words variables, of this data frame.- We then have the first 10 rows of observations corresponding to 10 flights.
... with 336,766 more rows, and 11 more variables:
indicating to us that 336,766 more rows of data and 11 more variables could not fit in this screen.
Unfortunately, this output does not allow us to explore the data very well. Let’s look at different tools to explore data frames.
1.4.3 探索数据集
Among the many ways of getting a feel for the data contained in a data frame such as flights
, we present three functions that take as their argument the data frame in question:
- Using the
View()
function built for use in RStudio. We will use this the most. - Using the
glimpse()
function loaded viadplyr
package - Using the
kable()
function in theknitr
package - Using the
$
operator to view a single variable in a data frame
1. View()
:
Run View(flights)
in your Console in RStudio and explore this data frame in the resulting pop-up viewer. You should get into the habit of always View
ing any data frames that come your way.
Note the capital “V” in View
. R is case-sensitive so you’ll receive an error is you run view(flights)
instead of View(flights)
.
Learning check
(LC2.1) What does any ONE row in this flights
dataset refer to?
- A. Data on an airline
- B. Data on a flight
- C. Data on an airport
- D. Data on multiple flights
By running View(flights)
, we see the different variables listed in the columns and we see that there are different types of variables. Some of the variables like distance
, day
, and arr_delay
are what we will call quantitative variables. These variables are numerical in nature. Other variables here are categorical.
Note that if you look in the leftmost column of the View(flights)
output, you will see a column of numbers. These are the row numbers of the dataset. If you glance across a row with the same number, say row 5, you can get an idea of what each row corresponds to. In other words, this will allow you to identify what object is being referred to in a given row. This is often called the observational unit. The observational unit in this example is an individual flight departing New York City in 2013. You can identify the observational unit by determining what the thing is that is being measured in each of the variables.
2. glimpse()
:
The second way to explore a data frame is using the glimpse()
function that you can access after you’ve loaded the dplyr
package. It provides us with much of the above information and more.
glimpse(flights)
## Observations: 336,776
## Variables: 19
## $ year <int> 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013,...
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
## $ day <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
## $ dep_time <int> 517, 533, 542, 544, 554, 554, 555, 557, 557, 55...
## $ sched_dep_time <int> 515, 529, 540, 545, 600, 558, 600, 600, 600, 60...
## $ dep_delay <dbl> 2, 4, 2, -1, -6, -4, -5, -3, -3, -2, -2, -2, -2...
## $ arr_time <int> 830, 850, 923, 1004, 812, 740, 913, 709, 838, 7...
## $ sched_arr_time <int> 819, 830, 850, 1022, 837, 728, 854, 723, 846, 7...
## $ arr_delay <dbl> 11, 20, 33, -18, -25, 12, 19, -14, -8, 8, -2, -...
## $ carrier <chr> "UA", "UA", "AA", "B6", "DL", "UA", "B6", "EV",...
## $ flight <int> 1545, 1714, 1141, 725, 461, 1696, 507, 5708, 79...
## $ tailnum <chr> "N14228", "N24211", "N619AA", "N804JB", "N668DN...
## $ origin <chr> "EWR", "LGA", "JFK", "JFK", "LGA", "EWR", "EWR"...
## $ dest <chr> "IAH", "IAH", "MIA", "BQN", "ATL", "ORD", "FLL"...
## $ air_time <dbl> 227, 227, 160, 183, 116, 150, 158, 53, 140, 138...
## $ distance <dbl> 1400, 1416, 1089, 1576, 762, 719, 1065, 229, 94...
## $ hour <dbl> 5, 5, 5, 5, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,...
## $ minute <dbl> 15, 29, 40, 45, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, ...
## $ time_hour <dttm> 2013-01-01 05:00:00, 2013-01-01 05:00:00, 2013...
Learning check
(LC2.2) What are some examples in this dataset of categorical variables? What makes them different than quantitative variables?
(LC2.3) What does int
, dbl
, and chr
mean in the output above?
We see that glimpse
will give you the first few entries of each variable in a row after the variable. In addition, the data type (See Subsection 1.2.1) of the variable is given immediately after each variable’s name inside < >
. Here, int
and num
refer to quantitative variables. In contrast, chr
refers to categorical variables. One more type of variable is given here with the time_hour
variable: dttm
. As you may suspect, this variable corresponds to a specific date and time of day.
3. kable()
:
The final way to explore the entirety of a data frame is using the kable()
function from the knitr
package. Let’s explore the different carrier codes for all the airlines in our dataset two ways. Run both of these in your Console:
airlines
kable(airlines)
At first glance of both outputs, it may not appear that there is much difference. However, we’ll see later on, especially when using a tool for document production called R Markdown, that the latter produces output that is much more legible.
4. $
operator
Lastly, the $
operator allows us to explore a single variable within a data frame. For example, run the following in your console
airlines
airlines$name
We used the $
operator to extract only the name
variable and return it as a vector of length 16. We will only be occasionally exploring data frames using this operator.
1.4.4 帮助文件
Another nice feature of R is the help system. You can get help in R by entering a ?
before the name of a function or data frame in question and you will be presented with a page showing the documentation. For example, let’s look at the help file for the flights
data frame:
?flights
A help file should pop-up in the Help pane of RStudio. Note the content of this particular help file is also accessible on the web on page 3 of the PDF document. You should get in the habit of consulting the help file of any function or data frame in R about which you have questions.
1.5 结论
We’ve given you what we feel are the most essential concepts to know before you can start exploring data in R. Is this chapter exhaustive? Absolutely not. To try to include everything in this chapter would make the chapter so large it wouldn’t be useful! However, as we stated earlier, the best way to learn R is to learn by doing. Now let’s get into learning about how to create good stories about and with data. In Chapter ??, we start with what we feel is the most important tool in a data scientist’s toolbox: data visualization.
1.5.1 下一集有什么内容?
We’ll now start the “data science” portion of the in Chapter ??, where we will further explore the datasets include the nycflights13
package. We’ll see that data visualization is a powerful tool to add to our toolbox for exploring what is going on in a dataset beyond the View
and glimpse
functions we introduced in this chapter.


An enterprise webapp centered around lean manufacturing
Lean manufaturing allows industries to operate in near realtime inventories and workflows. This product enables processes and workflows that deliver lean to its customers.


for _, evaluationset in tasksets:
for evaluation, sub in evaluationset:
results = evaluation(subject_id, data, sub)
for group_by in results:
metrics[group_by].extend(results[group_by])
cache.clear()
return metrics
// run grouped evaluations
for _, evaluationset in tasksets:
for evaluation, sub in evaluationset:
results = evaluation(subject_id, data, sub)
metrics.update_all(results)
cache.clear()
return metrics
class DataFrameAggregator(object):