constructor Create(Owner: TCustomBitmap32; IsTemporary: Boolean = True; const MapFileName: string = ''); virtual;
Creates and initializes an instance of TMMFBackend.
If Owner is specified the new back-end instance is automatically assigned to the TCustomBitmap32 instance. The existing back-end of the bitmap instance will be replaced and surface data is transfered to the new back-end instance via the Assign method.
IsTemporary defines whether the allocated file should only be used for the life-cycle of the surface.
MapFileName defines the filename of the file that should created or re-used as memory-mapped file. Passing an empty string as MapFileName will result in using a part of the swap file for the surface.
Setting IsTemporary to false while defining a MapFileName will result in a permanent file being created that can be re-used.
For an usage example of the constructor please refer to the additional topic Back-ends in this documentation.


Crystal Watkins
About
(current)
Portfolio
(current)
Contact Me
(current)
Portfolio
Done n Dusted
Done n Dusted
Profile Page
Profile Page
Employee Management
Employee Management
Note Taker
Note Taker
Read Me Generator
Read Me Generator
Employee Tracker
Employee Tracker
Project One- Destination Staycation
Project One
Third Party Weather API Webpage
Weather Dashboard
Work Day Scheduler
Work Day Scheduler
Web Api Quiz Page
Web Api Quiz
Password Generator
Password Generator
Using Semantic Tags in HTML
Semantics in HTML


To become a Paladin your level must be over 40 and you must collect the Mark of Duty, the Mark of Trust, and the Mark of the Healer.
Obviously your skills need improvement and you have not collected the necessary marks.
Didn't I make myself clear on the requirements for this occupation earlier? Come back after collecting the marks and increasing your level above 40. Then I shall change your occupation to Paladin.


Colors
@@adsenseMetro UI CSS provides access to the main colors used in Windows 8. You can sets: background, text color, outline, border color for any elements.
Predefined colors
To set background color: use prefix bg-, to set foreground color: use prefix fg-, to set outline color: use prefix ol-, to set border color: use prefix bd-. Also you can set active, hover and focus colors with classes bg(fg)-hover-*, bg(fg)-active- and bg(fg)-focus-. Also you can change :before and :after color and background for element with classes: before-bg-*, before-fg-*, after-bg-*, after-fg-*.
Before and after colors
To create ribbed background use prefix ribbed-.


Your post has been submitted and will be published once it has been approved.
Click here to see the pull request you generated.
OK


China hopes for US trade deal 'as soon as possible'
China says it hopes to make a trade deal with the United States as soon as possible amid intense discussions before fresh US tariffs on Chinese imports are due to kick in at the end of the week.
Beijing hopes it could reach a trade agreement with the United States that satisfies both sides, Assistant Commerce Minister Ren Hongbin told reporters on Monday (local time).
"On the question of China-US trade talks and negotiations, we wish that both sides can, on the foundation of equality and mutual respect, push forward negotiations, and in consideration of each others' core interests, reach an agreement that satisfies all sides as soon as possible," Ren said.
Related News
Is NZ safe from fallout from the US-China trade war?
How the US v China trade war affects New Zealand
China and the United States are negotiating a so-called "phase one" deal aimed at de-escalating their prolonged trade dispute but it is unclear whether such an agreement can be reached in the near term.
Washington's next round of tariffs against Chinese goods are scheduled to take effect on December 15.
China has demanded that some of the existing US tariffs imposed on about $US375 billion worth of its exports be removed, as well as cancellation of the December 15 tariffs on $US156 billion of its remaining exports to the United States.
US President Donald Trump has demanded China commit to specific minimum purchases of US agricultural products, among other concessions on intellectual property rights, currency and access to China's financial services markets.
White House economic adviser Larry Kudlow said on Friday the two sides had talked almost daily but there were no plans for face-to-face talks or a signing ceremony between Trump and Chinese President Xi Jinping.
With less than a week to go before the deadline amid "intense" negotiations, Kudlow said Trump would make the final decision on the tariffs, which would hit Chinese-made mobile phones, laptop computers, toys and clothing.
"We'll have to see, but right now we're moving along," Trump said last week.
"On December 15th, something could happen but we are not discussing that yet. We are having very good discussions with China, however."
Reuters


const struct STP_BRIDGE_ADDRESS* STP_GetBridgeAddress ( const STP_BRIDGE* bridge, );
Gets the bridge address that was set with STP_CreateBridge or STP_SetBridgeAddress.
Pointer to the bridge address.
See the Remarks section in STP_SetBridgePriority for information on how the bridge priority is calculated from the bridge address.
It is allowed to call this function from within an STP callback.


{% extends "withnav_template.html" %} {% from "components/page-header.html" import page_header %} {% from "govuk_frontend_jinja/components/button/macro.html" import govukButton %} {% from "govuk_frontend_jinja/components/back-link/macro.html" import govukBackLink %} {% block service_page_title %} Accept our data sharing and financial agreement {% endblock %} {% block backLink %} {{ govukBackLink({ "href": url_for('main.request_to_go_live', service_id=current_service.id) }) }} {% endblock %} {% block maincolumn_content %}
Before you can use GOV.UK Notify, you need to accept our data sharing and financial agreement.
This must be done by, or on behalf of, someone with the authority to sign contracts for {{ current_service.organisation.name }}.
Once accepted, the agreement covers all Notify services from {{ current_service.organisation.name }}.
Download a copy of the data sharing and financial agreement (PDF).
The agreement is confidential and should not be shared outside your organisation.
{{ govukButton({ "element": "a", "text": "Continue", "href": url_for('main.service_accept_agreement', service_id=current_service.id), }) }}


BestBite
About
Sign up
Log In
Browse.
Create.
Share.
Always have the answer to "What's for dinner?"
Learn More
Newest Contributions
Breakfast
Fresh apple pie
Croisson and coffee
Dinner
Steak on the grill
Tuna salad
Desert
Chocopie
Caramel temptation


"as an educational, advocacy, and stewardship organization at a cusp moment in the history of that culture."
Women in open source
Women in tech professions


HOME
EXPLORE
GEAR
ORDERS
0
TUTORIALS
ACCOUNT
Sign up and get 50% off on your first order.
Sign Me Up!
The best camping experience starts with Camply!
Previous
Next
PRODUCT
PRICE
QUANTITY
TOTAL
Proceed To Checkout
Checkout
Shipping Address
First Name
Please provide your first name.
Looks good!
Last Name
Please provide your last name.
Looks good!
Address
Please provide your street address.
Looks good!
Address 2
City
Please provide a valid city.
Looks good!
State
Choose...
AL
AK
AZ
AR
CA
CO
CT
DE
FL
GA
HI
ID
IL
IN
IA
KS
KY
LA
ME
MD
MA
MI
MN
MS
MO
MT
NE
NV
NH
NJ
NM
NY
NC
ND
OH
OK
OR
PA
RI
SC
SD
TN
TX
UT
VT
VA
WA
WV
WI
WY
Please select a valid state.
Looks good!
Zip
Please provide a valid zip.
Looks good!
Back
Next
Billing Address
(Same As Shipping)
First Name
Please provide your first name.
Looks good!
Last Name
Please provide your last name.
Looks good!
Address
Please provide your street address.
Looks good!
Address 2
City
Please provide a valid city.
Looks good!
State
Choose...
AL
AK
AZ
AR
CA
CO
CT
DE
FL
GA
HI
ID
IL
IN
IA
KS
KY
LA
ME
MD
MA
MI
MN
MS
MO
MT
NE
NV
NH
NJ
NM
NY
NC
ND
OH
OK
OR
PA
RI
SC
SD
TN
TX
UT
VT
VA
WA
WV
WI
WY
Please select a valid state.
Looks good!
Zip
Please provide a valid zip.
Looks good!
Back
Next
Payment Information
Cardholder's Name (As it appears on card)
Please provide the Cardholder's Name.
Looks good!
Expiration Date
Please provide card's Expiration Date.
Looks good!
Credit/Debit Card Number
Please provide your credit or debit card number.
Looks good!
Security Code
Please provide your card's CVV.
Looks good!
Agree to terms and conditions
You must agree before submitting.
Back
Buy


Topic 1-Tutorial.md
Tutorial.
Here we will build a few programs, step-by-step.
Data logger
First we will do a data logger, that will save information read from an AX-12 motor to a file. We will call the task "axlogger".
We start by editing the configuration file. We must configure two things: enable the dynamixel device loader, and register the new task, adding the configuration parameters we might use. We do that by adding the following lines to miconf.conf:
deviceloaders.dynamixel.load = true deviceloaders.dynamixel.filename = '/dev/ttyUSB0' tasks.axlogger.load=true tasks.axlogger.motorname='ax12:3' tasks.axlogger.interval=1 tasks.axlogger.outfile='motor.log'
Then we place the task's code in the tasks/ folder. The tasks/axlogger.lua file:
local M = {} local sched=require 'sched' local toribio = require 'toribio' M.init = function(conf) local file = io.open(conf.outfile or 'data.log', 'w') local motor = toribio.wait_for_device(conf.motorname) while true do local l = motor:get_load() file:write(sched.get_time()..' '..l..'\n') file:flush() sched.sleep(conf.interval or 5) end end return M
The log file will contain motor load readings. The process (the function provided to sched.run) starts opening a file for writing and getting the Device for the specified motor.
The process will loop reading data from the motor and logging it, and then sleeping for the specified interval.
Notice how in the program we provide default values for configuration parameters in case they're missing (like a 5 second interval).
Finally, we run the program:
lua toribio-go.lua -c miconf.conf
Remote controlled robot
We will do a remote controlled robot. The idea is that we want to control a two-wheled differential robot using the mouse on another machine. We will see two methods: one using the Lumen's proxy service, and explicitly opening a socket.
Remote control using a proxy
This is is the simplest method. The proxy task provided with Lumen allows a Toribio to receive events from another Toribio instance, trough a network. Thus the ""remote control"" Toribio only have to start the proxy task and load the mouse device, and the 'robot' Toribio can receive mouse events as if they were local.
There is no need to write code for the remote control, everything is achieved trough configuration:
deviceloaders.mice.load = true tasks.proxy.load = true
The robot will have a task (named rcp_bot.lua) that will use the proxy service to receive the mouse events. For the moment, we will only show how to receive the mouse events without actually moving the motors. The configuration file will have the following:
tasks.rcp_bot.load = true tasks.rcp_bot.rc_ip = "<IP_ADDRESS>" tasks.rcp_bot.rc_port = 1985 --default port for proxy
The rcp_bot.lua file to place in the tasks/ folder is the following:
local M = {} local toribio = require 'toribio' local sched = require 'sched' local proxy = require 'tasks/proxy' M.init = function(conf) local waitd = proxy.new_remote_waitd(conf.rc_ip, conf.rc_port, { events = {'move', 'leftbutton'}, }) local left, right = 0, 0 sched.sigrun(waitd, function(_, event, v1, v2) print (event, v1, v2) end) end return M
The "robot" will print 'move', x, y
as the mouse is moved and 'leftbutton', 'true'
when the left button is clicked and 'leftbutton', 'false'
when released.
This method is very convenient, but does not adapt very well for a remote control: the robot is the one connecting to the control, which is somehow backwards. We will implement a more traditional remote control application next. In this implementation one instance of toribio will read inputs from the mouse (the task rc_control), and generate commands over a UDP link to a Toribio instance in a robot (task rc_robot) which will receive and parse the commands.
Remote Control
We will need the mice device, and a task to process mice input and generate commands. We begin with the rc_control.conf configuration file:
deviceloaders.mice.load = true tasks.rc_control.load=true tasks.rc_control.ip='<IP_ADDRESS>' --change with the ip adress of the robot tasks.rc_control.port=9999
The remote control will behave as follows: it tracks mouse's movements, generates messages of the form "left, right" and sends them over udp. A message is sent at least each 0.5 seconds, so if we stop transmitting the robot can deduce it must stop. The skeleton for the tasks/rc_control.lua file is as follows:
local M = {} local toribio = require 'toribio' local sched = require 'sched' M.init = function(conf) local function generate_output(x, y) --calculate velocities and send them over udp end local mice = toribio.wait_for_device('mice:/dev/input/mice') local lastx, lasty = 0, 0 mice:register_callback('move', function (x, y) if x then generate_output(x, y) lastx, lasty = x, y else -- timeout with no mouse movements generate_output(lastx, lasty) end end, 0.5) end return M
In this program we use the register_callback method, instead of the explicit loop with a sched.wait inside as in the first program. This will start yet another process (the one listening for the signal), that will keep runing while the first process (the one started with sched.run) will finish immediatelly. The register_callback method has a timeout parameter set (the 0.5 at the end). When the timeout runs out without signals, it will wake our function with nil, 'timeout'
as parameters: that's why we check for x to see wether we have a new coordinate, or must use the last recorded set of coordinates.
The only part missing is the generate_output function. We will use nixio to create a UDP socket and use it to send the messages.
local nixio = require 'nixio' local udp = assert(nixio.bind('*', 0, 'inet', 'dgram')) udp:connect(conf.ip, conf.port) local function generate_output(x, y) local left = (y + x)/2 local right = (y - x)/2 udp:send(left..','..right) end
This program can be easily improved adding a callback that would react to mouse clicks. For example adding the following callback allows to stop the robot clicking the left button.
mice:register_callback('leftbutton', function (is_pressed) if is_pressed then generate_output(0, 0) mice.reset_pos(0, 0) lastx, lasty = 0, 0 end end)
Controlled bot
The bot listens for UDP packets, parses them and set motor velocities. As allways, the configuration in rc_bot.conf:
deviceloaders.dynamixel.load = true deviceloaders.dynamixel.filename = '/dev/ttyUSB0' tasks.rc_bot.load = true tasks.rc_bot.ip = '<IP_ADDRESS>' --change with the ip adress of the robot tasks.rc_bot.motor_left='ax12:3' tasks.rc_bot.motor_right='ax12:12' tasks.rc_bot.port = 9999
And the tasks/rc_bot.lua skeleton:
local M = {} local toribio = require 'toribio' local sched = require 'sched' M.init = function(conf) --initialize motors local motor_left = toribio.wait_for_device(conf.motor_left) local motor_right = toribio.wait_for_device(conf.motor_right) motor_left.init_mode_wheel() motor_right.init_mode_wheel() --initialize socket local nixio = require 'nixio' local udp = assert(nixio.bind(conf.ip, conf.port, 'inet', 'dgram')) local selector = require 'tasks/selector' local udp = selector.new_udp(conf.ip, conf.port, 1480) --listen for messages sched.sigrun({udp.events.data, timeout=1}, function(_, _, msg) local left, right = 0, 0 if msg then left, right = msg:match('^([^,]+),([^,]+)$') end motor_left.set_speed(left) motor_right.set_speed(right) end ) end return M
Notice how we use the selector service to create a udp socket object, that will emit signals when data arrives. Then we listen for these signals with a function (registered in the sched.sigrun call). The timeout is set so if we do not receive a command within a second, the robot will stop.
Now we run toribio with rc_control task enabled on one machine, connected to a second machine with rc_bot enabled.
lua toribio-go.lua -c rc_control.conf
and
lua toribio-go.lua -c rc_bot.conf
Notice that rc_control might have to be run as sudo, if your distribution request such thing for accesing /dev/input/mice.
Reactive robotics
In this example, we will use a usb4butia IO board. Our task will be called bootia, and we will use the deviceloader/bobot task to access the hardware. Thus, our configuration file will have the following:
deviceloaders.bobot.load = true deviceloaders.bobot.path = '../bobot' --path to bobot library deviceloaders.bobot.comms = {"usb"} deviceloaders.bobot.timeout_refresh = 10 tasks.bootia.load=true
The code for the tasks/bootia.lua might be as follows:
local M = {} local sched = require 'sched' local toribio = require 'toribio' M.init = function() sched.run(function() local button = toribio.wait_for_device({module='bb-button'}) local pressed = false while true do local now = ( button.getValue()==1 ) if pressed and not now then print ("pressed!") pressed=now elseif not pressed and now then print ("released!") pressed=now end sched.sleep(0.1) end end) end return M
This process polls a button connected to the usb4butia board (any button will do), and prints "pressed!" or "released!" when the button changes state. You can change the polling rate in the sched.sleep() call. The absolutely minimum you can expect to work is at least call sched.yield() from time to time, to give opportunity to other processes to do their stuff.
Now suppose you have a usb4butia powered robot that only goes forward and backwards, changind the direction with a button press. You could put the direction changind code right in the previous process, but we will do it using a more flexible method: signalling.
The idea is that there will be a signal that requests a direction change, and a separate process that will wait for these signals and apply them. The previous process will be modified to emit a signal as follows:
if pressed and not now then sched.signal('change direction!') pressed=now elseif not pressed and now then pressed=now end
Now that button process fires events, we can start another process that will listen for them and change the motor direction (the motors will start moving at the first button press):
sched.run(function() local motors = toribio.wait_for_device('bb-motors') local direction = 1 sched.sigrun({'change direction!'}, function() motors.setvel2mtr(direction, 500, direction, 500) direction=1-direction end) end)
Because our wait descriptor for changing direction accepts events from anyone (the emitter='*'
field), we can have more processes that fire it. Suppose that we want to add the behavior that the robot will change direction randomly, anywhere between 10 to 20 seconds. We can have it simply adding another process:
sched.run(function() while true do sched.sleep(10 + 10*math.random()) sched.signal('change direction!') end end)


Rising Ayrshire artist launches first collection after being headhunted by online firm
Prints of Kilwinning's Julian McLaughlan first collection - which sold out in under 15 minutes- are now available to buy online
by Toni Lennox, https://www.dailyrecord.co.uk/authors/toni-lennox/Kilwinning artist Julian McLaughlan has launched a range of abstract prints, canvas and pillows ahead of his second exhibition.
The 23-year-old artist teamed up with awesomeart.com to sell prints of his first ever collection depicting the personification of mental health issues.
And now the painter is hard at work preparing for his next art show in Ayr’s 1517 on Saturday, November 23.
Awesomeart - A UK company- was tipped off about Julian’s abstract work by artist Steven Brown.
Julian said: “It feels amazing knowing that someone has seen my work and thought it’s good enough to push out there.”
Following his sell out debut show in Glasgow, Julian is now gearing up for his Ayr show. He explained: “This show will exhibit about six pieces, possibly more, some on larger scale.”
It’s only been two months since the Ayrshire talent’s debut. He added: “It’s been mega stressful.”
Julian is keeping his cards close to his chest when asked for details about the showcase. But as a friend of Irvine Herald he has given us an exclusive sneak peek at one of the paintings.
You can view the Julian McLaughlan range by visiting www.awesomeart.uk/collections/uk-artist-julian-mclaughlan.
Doors open at 7pm for Julian’s second showcase.


The Unity3d globalArgLine. Allows you to define a per default global configuration for all your unity3d builds.
Combined with a plugin like EnvInject, allows you to configure most of your projects in one place.
For example: use:
-logFile "$WORKSPACE/unity3d_editor.log" -quit -batchmode -executeMethod $UNITY_EXECUTEMETHOD $UNITY_EXTRA_ARGUMENTS
and define per project the UNITY_EXECUTEMETHOD and optional UNITY_EXTRA_ARGUMENTS variables.
Is overriden by the per project argLine
value.


senior hight school Grade 5
Aeadewie 2018
senior hight school Grade 4
Aeadewie 2017
senior hight school Grade 6
Aeadewie 2019


Type in some text below as if you were sending a "tweet". Be sure to try to "mention" someone by typing the @ symbol, then some text
In this example, a full name, image, and username is shown in the resulting list. You can query by username OR full name (try typing @Jenna)
In this example, a full name and username is shown in the resulting list.
In this example, a full name and username is shown in the resulting list. You can only query by typing the username


The C# ("C sharp") programming language is most commonly used with the .NET framework. Students who are well-versed in C# programming can use it to create client applications, database applications, distributed components, and much more. Students who learn C# programming and combine it with their knowledge of the .NET framework can target larger enterprises, government agencies, and companies serving enterprise and government clients for employment.
Java is arguably the most popular programming language today. It's used for everything from web applications to backend services to mobile applications to embedded systems. Students who learn Java programming will be able to create dynamic web applications, and be able continue into our Android track.
CSS is the language for describing the presentation of Web pages, including colors, layout, and fonts. It allows one to adapt the presentation to different types of devices, such as large screens, small screens, or printers. CSS is independent of HTML and can be used with any XML-based markup language.
Ruby is a programming language focused on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. The Ruby programming language is most commonly used with the Ruby on Rails framework. Ruby and Rails are typically used by younger companies and startups, especially for building interactive web applications.


--- layout: default title: Sponsors id: sponsors ---
If there are particular events you are interested in sponsoring, please let us know which, and how much you would like to contribute. If you don’t have a particular event in mind, we are always in need of funds we can apply across events, and we will happily give your company credit at events we fund using your contributions. We have included amounts that we request in order to sponsor an event, but we are always able to make use of contributions, however large or small.
Here are a few events we do regularly:
On every other Tuesday evening, we invite one speaker to give a brief technical talk at our Hacker Lounge event. Speakers are usually either students showing off cool projects they’ve been working on, or people from industry who come to talk about technical topics that might interest UT hackers. If you’re interested in giving a tech talk, check out hackut.com for upcoming open slots and send us an email at<EMAIL_ADDRESS>For established companies who give tech talks, we request a minimum of $200 to cover the costs of food.
The key word in Tech Talk is tech – we want technical topics that will be interesting to CS and Engineering students. A Tech Talk should not be a recruiting pitch for your company, though it’s fine if you mention that you are recruiting. We want people to find the talks interesting even if they are not looking for a job, and a good Tech Talk is better than a recruiting pitch at getting the attention of UT Austin students anyway.
Once per semester, HL hosts an intense coding competition for valuable prizes. We rely on corporate sponsorship to be able to afford the prizes. Sponsors are welcome to attend the event (especially the demonstrations and judging at the end). We request $500 to $1000 to sponsor this event in order to cover prizes.
At least once a semester, UT Austin hosts workshops to teach students useful real-world hacking skills. Hosting workshops is one of the best ways to gain respect for your company and show students that you’re more than just talk and no action.
If any of these events sound like something your organization would be interested in sponsoring, you can send us email at hackerlounge@hackut.com.


--- layout: default title: Using Shuffle with Requirejs description: A simple example of how you can use Shuffle with an AMD loader like RequireJS. image: /demos/requirejs.jpg extraJS: [] prism: false shuffle: false pagejs: false ---
Shuffle uses a UMD wrapper, so it is compatible with AMD loaders like RequireJS. The UMD wrapper also allows Shuffle to work with CommonJS modules. You can take a peek at the config file used on this page.
{{ site.longDescription }}


作為Steemit的新手，我們很多時候都不知道怎樣把文章寫得更好、運用我們的voting power、我們的投票的價值和其他與我們帳戶相關的資訊。這裡就一次性地介紹幾個網站給大家，方便大家查閱。
As a newbie in Steemit, we often find that it is difficult for us to find some useful informations about our voting power, account and how much our vote worths. So I am introducing some very useful websites here that you can find a lot of useful information related to Steemit.
Steemtools
首先要介紹的是Steemtools，這是一個陳列了所有對Steemians有用的網站，包羅萬有，無論你是author，curator 還是developer，都可以輕易在這兒找到對你有用的網站。
The first one to introduce is Steemtools. You can find almost everything you need here, no matter you are an author, curator or a developer. There are some incredible websites that you must visit.
作為一個作者，最需要的就係靈感和怎樣排板令文章看上去更美觀， 以下就有幾個網站適合作者去瀏覽，有豐富的資訊令你能把文章寫得更好。
As an author, we always wonder how can we make our articles more beautiful and easy to read, and where can we find the ideas. These websites offer great help to authors like you and me.
當然你也可找到一些方便的工具來查一下自己在Steemit上的數據。
Of course you can also find some useful tools here to know more about your statistics.
當然也有不少程式開發員有機會用到的工具，但我不是專家，就不一一陳述了，在介面上你很容易就能找到各種有用的工具。
Of course there are also many useful tools for developers too, but I am not an expert in this field. You can easily decide which kinds of resources you need and know where you can find them on this website.
這是一個設計得非常好的網站，你可以在這裡看見你帳戶的成長，看到帳戶的估算價值，奬勵和追隨者數目的圖表，十分適合用來反思一下自己在某段時間的表現。
This is a well designed website. You can see your account growth here in terms of estimated account value, followers and rewards.
我的帳戶在過去一個月呈爆發性的增長呢，希望能夠繼續維持下去，哈哈。
As you can see, this is how my account grew in the past month, it’s just like a rocket taking off. If I were a stock, you would be pleased to have invested in me. Thank you my followers. Hope that it can keep moving like that!
Steemnow is a very useful website. You can find a lot of useful information here.
例如在這裡，你能看到你現在的100% upvote值多少錢。
For example, you can see how much your 100% upvote worth here.
在這你可以看見自己現在的voting power
You can also see how much voting power you currently have
這裡可以看見別人最近給你投的票，投了多少%。
Here you can see how many upvotes you received recently and their %.
你也可以輕易得知自己過去一星期寫的文章大約有多少奬勵
You can also easily learn how much rewards did you get in the past week.
Steemstats is a website developed by @jesta. It is neat and clear. You can directly see what are the posts you have voted and how much curation rewards are expected. You can view multiple accounts here!
當然在這你也可以得知自己的voting power 啦，但大家不會關心我的voting power啦，更關心的應該是這個吧，有用esteem 手機應用的可以根據good-karma 現在的voting power來決定要不要用esteem回覆。（當然也可以知道A神現在的voting power啦哈哈）
You can also know how much is your current voting power here
在Witnesses裏，你可以得知現在的見證人排名、你投了誰和他們的票數。在這也再一次呼籲大家投A神一票啦。
You can know about the votes of witnesses and their ranking on the witness page, also who you have voted.
Steemit.deadfollowers.info
最後一個比較簡單，在這個網站，你可以知道你實際上有多少追蹤者，有哪些是已「死」了，就是已不活躍，很久沒上線的意思啦。如果你也有追蹤他們，當然也可取消追蹤啦。
You can know how many actual followers you have, who are already ‘dead’, which means they haven’t been online for a long time.
Image:
加個朋友，一起在cn區內成長，
別忘了
Follow me and grow in Steemit together,
don’t forget to
This page is synchronized from the post: ‘新人請進，你不可不知的Steemit相關網站 Welcome Newbies, the Steemit related websites that you must know’


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/type.20class.20inference.20with.20parameters.html ---
Is there a way to tell type class inference to "use the current parameter"? In the following code, the apply_instance
fails, because the argument of type decidable_eq A
is a metavariable, and I want Lean to use the parameter.
section parameters {A : Type} {h : decidable_eq A} def X := A ⊕ A def decidable_eq_X : decidable_eq X := @sum.decidable_eq _ h _ h local attribute [instance] decidable_eq_X set_option trace.class_instances true def foo : decidable_eq X := by apply_instance end
(note: it is unacceptable in my actual application to let X
depend on h
)
What if you use [ ]
around the declaration of h
?
That works, but in my actual example h
is not a type class parameter, but just some extra data to construct a setoid
.
You could do something like by haveI := h; apply_instance
, replacing h
with whatever you need it to be.
(you need mathlib
for haveI
by the way, and to import tactic
)
this is a more faithful representation of my actual scenario:
constant some_data (α : Type) : Type definition foo {α : Type} (h : some_data α) : setoid (α ⊕ α) := sorry section parameters {α : Type} (h : some_data α) def X := α ⊕ α def setoid_X : setoid X := foo h local attribute [instance] setoid_X set_option trace.class_instances true def foo : setoid X := by apply_instance end
yes, that works, but is still a little annoying.
I only have a problem with quotient.mk
, so currently I just have something like def my_quotient.mk := @quotient.mk _ setoid_X
, which is also a little annoying.
There's been a couple of back-and-forth on the subject. Leo doesn't like to allow instances to be created on the fly but he still granted us a way to do it.
Does it work if you replace @quotient.mk _ setoid_X
with by haveI := setoid_X; apply quotient.mk
?
There's been a couple of back-and-forth on the subject. Leo doesn't like to allow instances to be created on the fly but he still granted us a way to do it.
Yeah, I know, but I don't want to add instances on the fly, I just want that in that section I have an instance of type setoid X
.
I see. I mistook your issue. I think the problem is that your instance depend on stuff that can't be inferred. You may have to make some_data
a class locally.
Last updated: Apr 24 2020 at 19:02 UTC


Photography:
This is a recent passion, I don't have much time for it, but I like it a lot, soon my gallery will be full of my best images.You can meet me on Flickr as @ericxlima
Sports:
Running, cycling and gymnastics are my favorite sports. Sports help the body and soul. In addition to relationships.You can meet me on Instagram as @ericdelima_
Games:
I really enjoy playing strategy and adventure games. You can meet me on Steam as @ericxlima.


IntervYou is a place where developers can practice technical interview questions. You can view questions and clicking the link on the top left. Click on a question to view its answers.
IntervYou is designed to be a community-driven application, so please create an account! With an account, you can post questions and answers.
*** Currently, if you post, edit or delete question or answers, the changes will not show up unless you refresh the page. I'm working on fixing this bug. ***
This application is still in development, so I'd love to hear your feedback. Below is a list of planned future features.


Camila Cabello and Shawn Mendes in steamy AMAs performance
They picked up an award for their hit single Senorita.
Camila Cabello and Shawn Mendes performed a steamy rendition of their hit single Senorita before winning collaboration of the year at the American Music Awards.
The celebrity couple took to the stage at the AMAs for an eye-catching performance, shortly before picking up their prize.
Cuban-American pop star Cabello, 22, and 21-year-old Canadian singer Mendes gazed into each other’s eyes during the song, before she leaned back into his arms.
The intense performance was well-received by the star-studded audience, with Taylor Swift and actor Billy Porter looking particularity impressed.
The couple, who have been together since July, won collaboration of the year in a category also containing Lady Gaga and Bradley Cooper’s Shallow, Lil Nas X and Billy Ray Cyrus’ Old Town Road, Marshmellow and Bastille’s Happier and Post Malone and Swae Lee’s Sunflower.
During their acceptance speech, Cabello thanked Mendes’s mother, Karen, as well as the fans who voted for them.
It is not the first time they have performed Senorita – which reached number one in the UK singles charts – at a major awards show.
Cabello and Mendes took to the stage together at the MTV Video Music Awards in August.


-
class ApplicationController < ActionController::Base
-
# Prevent CSRF attacks by raising an exception.
-
# For APIs, you may want to use :null_session instead.
-
-
protect_from_forgery with: :exception
-
before_filter :authenticate_user!
-
-
-
-
-
end
-
# The Appointments Controller controls appointments. It is responsible for creating, viewing, editing, canceling and deleting appointments and telling the Mailer to send appointment reminder emails.
-
-
class AppointmentsController < ApplicationController
-
before_action :set_appointment, only: [:show, :edit, :update, :destroy, :send_house_reminder] # loads the correct appointment before viewing/updating/destroying/emailing appointments
-
before_action :check_workstation_head, only: [:new, :edit, :create, :update, :destroy] # checks if the user is a workstation head before creating/updating/deleting appointments
-
before_action :check_admin, only: [:destroy, :send_house_reminder] # checks if the user is an admin before deleting appointments or sending reminder emails
-
before_action :check_house, only: [:edit, :update] # checks the user house before editing or updating an appointment
-
helper_method :sort_column, :sort_direction # helper methods for sorting
-
-
# GET /appointments
-
# GET /appointments.json
-
# index - the main page of our web application
-
# Checks the request parameters first for certain page parameters, then populates fields on the view with those params if present
-
# These params are also used to filter the appointments displayed on the calendar
-
def index
-
@residents = Resident.all
-
@houses = House.all
-
@past_appointments = Appointment.where('date < ?', Date.today)
-
@upcoming_appointments = Appointment.where('date >= ?', Date.today).order([:date, :time]).paginate( :page => params[:page], :per_page => 10).order(sort_column + " " + sort_direction)
-
if params.has_key?(:res_id) # Retrieves the resident_id to filter appointments with, if a resident_id is present
-
session[:res_id] = params[:res_id]
-
end
-
if params.has_key?(:house_id) # Retrieves the house_id to filter appointments with, if a house_id is present
-
session[:house_id] = params[:house_id]
-
begin
-
@house = House.find(session[:house_id])
-
rescue
-
@house = nil
-
end
-
end
-
-
if (@house != nil and @house.name == "Workstations") or (@house != nil and @house.name == "Office Staff")
-
session[:house_id] = ''
-
end
-
-
if session.has_key?(:res_id) and session[:res_id] != '' # Filters the list of appoinments based on the resident selected by the dropdown selector, if resident is not blank
-
@appointments = Appointment.where('resident_id = ?', session[:res_id])
-
@appointments_counts = @appointments.group("date").count
-
elsif session.has_key?(:house_id) and session[:house_id] != '' # Filters list of appointments based on selected house, if house is not blank
-
@appointments = Appointment.joins('LEFT OUTER JOIN residents ON resident_id = residents.id').where('house_id = ?', session[:house_id])
-
@appointments_counts = @appointments.group("date").count
-
else # Return all appointments if no resident or house was selected
-
@appointments = Appointment.all
-
@appointments_counts = @appointments.group('date').count
-
end
-
respond_to do |format|
-
format.html # Returns the html for the page
-
format.json # Format selected appointments as a json file containing appointments to populate calendar
-
format.js # Returns the page javascript
-
format.csv { render<EMAIL_ADDRESS>} # Allows appointments to be downloaded as a CSV file
-
end
-
end
-
-
# GET appointments/upcoming - usually called from other page/method
-
# upcoming - used to render a table of the upcoming appointments, ordered by appointment date
-
# Checks the request parameters first for certain page parameters, then filters the list of upcoming appointments with those params if present
-
def upcoming
-
if params.has_key?(:res_id) # Checks to see if a resident is specified in the request
-
session[:res_id] = params[:res_id]
-
end
-
if params.has_key?(:house_id) # Checks to see if a house is specified in the request
-
session[:house_id] = params[:house_id]
-
begin
-
@house = House.find(session[:house_id])
-
rescue
-
@house = nil
-
end
-
end
-
-
if (@house != nil and @house.name == "Workstations") or (@house != nil and @house.name == "Office Staff")
-
session[:house_id] = ''
-
end
-
-
if session.has_key?(:res_id) and session[:res_id] != '' # Selects upcoming appointments based on specified resident and orders them by date
-
@upcoming_appointments = Appointment.where('resident_id = ?', session[:res_id]).order([:date, :time]).where('date >= ?', Date.today).paginate(:per_page => 10, :page => params[:page])
-
elsif session.has_key?(:house_id) and session[:house_id] != '' # Selects upcoming appointments based on specified house and orders them by date
-
@upcoming_appointments = Appointment.joins('LEFT OUTER JOIN residents ON resident_id = residents.id').where('house_id = ?', session[:house_id]).where('date >= ?', Date.today).order([:date, :time]).paginate(:per_page => 10, :page => params[:page])
-
else # Selects all upcoming appointments and orders them by date
-
@upcoming_appointments = Appointment.where('date >= ?', Date.today).order([:date, :time]).paginate(:per_page => 10, :page => params[:page])
-
end
-
@paginate = true #paginate variable is used in view to determine whether the table used to display appointments is one page with all appointments, or many pages, each with 10 appointments
-
render "appointments/_upcoming", :layout => false # _upcoming is a partial used to format the appointment list as a table of upcoming appointments
-
end
-
-
# GET appointments/appointments_for_day - usually called from other page/method
-
# appointments_for_day - provides a list of that day's appointments, for daily email reminders, in a table view
-
def appointments_for_day
-
if params.has_key?(:date) # allows for filtering by date
-
session[:date] = params[:date]
-
end
-
if params.has_key?(:res_id) # allows for filtering by resident
-
session[:res_id] = params[:res_id]
-
end
-
if params.has_key?(:house_id) # allows for filtering by house
-
session[:house_id] = params[:house_id]
-
end
-
if session.has_key?(:date) and session[:date] != '' # gets the appointments filtered by above parameters
-
@upcoming_appointments = Appointment.where('date = ?', Time.parse(session[:date]).to_date).order([:date, :time]).paginate(:per_page => 10, :page => params[:page])
-
end
-
@paginate = false # Display these as a single page, with as many appointments in the table as are happening
-
render "appointments/_upcoming", :layout => false # _upcoming is a partial used to format the appointment list as a table of upcoming appointments
-
end
-
-
# GET /appointments
-
# GET /appointments.json
-
# update_residents - updates the residents available in the resident dropdown menu when the house dropdown value is changed
-
# Not a URL called directly, as it depends on being called asynchronously from the main appointments page
-
def update_residents
-
if (params[:house_id] != '')
-
@residents = Resident.where("house_id = ?", params[:house_id]) # selects the residents in that house
-
else
-
@residents = Resident.all # selects all residents if no house is selected
-
end
-
respond_to do |format|
-
format.html
-
format.js
-
end
-
end
-
-
# GET /appointments/1
-
# GET /appointments/1.json
-
# show - shows an individual appointment
-
def show
-
end
-
-
# GET /appointments
-
# set_recurring_reminder - used to set a reminder that an appointment is recurring and will need to be scheduled again in the future
-
def set_recurring_reminder
-
if params.has_key?(:reminder_date) and params.has_key?(:appointment_id)
-
@reminder = RecurringReminder.new
-
@reminder.notification_date = params[:reminder_date] # date when a reminder will be sent
-
@reminder.appointment_id = params[:appointment_id] # appointment that reminder is set for
-
@reminder.save # saves the reminder in the database
-
end
-
end
-
-
# GET /appointments/new
-
# new - populates data fields needed to create a new appointment
-
def new
-
@types = AptType.all.order(apt_type: :asc)
-
@appointment = Appointment.new
-
@appointment.date = Date.today
-
@appointment.time = Time.now
-
@residents = Resident.all.order(name: :asc)
-
@upcoming_appointments = Appointment.where('date >= ?', Date.today).order([:date, :time]).paginate(:per_page => 10, :page => params[:page])
-
end
-
-
# GET /appointments/add_apt_type
-
# add_apt_type - allows for adding a new appointment type and then updates the displayed list of appointment types
-
def add_apt_type
-
if AptType.where('apt_type = ?', params[:apt_type]).empty? and params[:apt_type] != ''
-
@type = AptType.new
-
@type.update_attribute(:apt_type, params[:apt_type])
-
@type.save
-
end
-
@types = AptType.all
-
respond_to do |format|
-
format.html
-
format.js
-
end
-
-
end
-
-
# GET /appointments/1/edit
-
# edit - populates data fields needed to edit an appointment
-
def edit
-
@types = AptType.all
-
end
-
-
# POST /appointments
-
# POST /appointments.json
-
# create - POSTed to when the "Create Appointment" button is clicked after filling out a new appointment
-
# Saves appointment data, where it is validated in the model, and sends email notifications to associated users and medical coordinators
-
# Also populates fields needed for main page (where we are routed if appointment is saved correctly)
-
# On failure, it will remain on the new page and tell the user what errors are present
-
def create
-
@appointment = Appointment.new(appointment_params)
-
@types = AptType.all.order(apt_type: :asc)
-
@residents = Resident.all.order(name: :asc)
-
@upcoming_appointments = Appointment.where('date >= ?', Date.today).order([:date, :time]).paginate(:per_page => 10, :page => params[:page])
-
respond_to do |format|
-
if @appointment.save # if there are no errors in the appointment data
-
coordinators = User.where(medical_coordinator: true).where(email_pref: true) # get a list of medical coordinators...
-
coordinators.each do |coordinator|
-
NotificationMailer.new_appointment_notification(@appointment, coordinator).deliver # ... and email all of them!
-
end
-
if<EMAIL_ADDRESS># if a user was associated with the appointment, email them as well
-
NotificationMailer.appointment_assignment_notification(@appointment).deliver
-
end
-
format.html { redirect_to @appointment, notice: 'Appointment was successfully created.' } # redirects browser to main appointments page, and notifies them the appointment was created successfully
-
format.json { render :show, status: :created, location: @appointment }
-
else # if there are errors in the appointment data tell the user what errors are present
-
format.html { render :new }
-
format.json { render json: @appointment.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# PATCH/PUT /appointments/1
-
# PATCH/PUT /appointments/1.json
-
# update - PATCH/PUTed to when the "Update Appointment" button is clicked on the appointment edit page
-
# Saves appointment data, where it is validated in the model, and sends email notifications to associated users
-
# Also populates fields needed for main page (where we are routed if appointment is updated correctly)
-
# On failure, it will remain on the edit page and tell the user what errors are present
-
def update
-
respond_to do |format|
-
if @appointment.update(appointment_params)
-
if<EMAIL_ADDRESS># emails associated users to let them know that the appointment was updated
-
NotificationMailer.appointment_assignment_notification(@appointment).deliver
-
end
-
format.html { redirect_to @appointment, notice: 'Appointment was successfully updated.' } # redirects browser to main appointments page, and notifies them the appointment was created successfully
-
format.json { render :show, status: :ok, location: @appointment }
-
else # if there are errors in the appointment data tell the user what errors are present
-
@types = AptType.all
-
format.html { render :edit }
-
format.json { render json: @appointment.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# DELETE /appointments/1
-
# DELETE /appointments/1.json
-
# destroy - used to delete an appointment. Redirects to main appointment page and shows the user a success message
-
def destroy
-
@appointment.destroy
-
respond_to do |format|
-
format.html { redirect_to appointments_url, notice: 'Appointment was successfully deleted.' }
-
format.json { head :no_content }
-
end
-
end
-
-
def appointments
-
@appointments
-
end
-
-
def residents
-
@residents
-
end
-
-
# POST /appointments/:id/send_house_reminder
-
# send_house_reminder - used to send an appointment reminder to the users whose resident has an appointment
-
def send_house_reminder
-
users = User.where(house: @appointment.resident.house) # gets the users in the same house as the resident
-
users.each do |user| # sends an email reminder for each user in that house
-
NotificationMailer.house_reminder(@appointment, user).deliver
-
end
-
if<EMAIL_ADDRESS># sends an additional reminder to the user associated with the appointment
-
NotificationMailer.house_reminder(@appointment, @appointment.user).deliver
-
end
-
redirect_to @appointment, notice: "Emails sent"
-
end
-
-
private
-
# check_workstation_head - Check to see if the user is a workstation head
-
# This is done because workstation heads are not allowed to modify appointments, unless they are also admin users
-
def check_workstation_head
-
redirect_to appointments_path, alert: "Workstation heads may not modify appointments." unless current_user.admin || current_user.house.name != 'Workstations'
-
end
-
-
# set_appointment - gets the current appointment based on id
-
# Use callbacks to share common setup or constraints between actions.
-
def set_appointment
-
@appointment = Appointment.find(params[:id])
-
end
-
-
# appointment_params - define the exact parameters for each appointment
-
# Never trust parameters from the scary internet, only allow the white list through.
-
def appointment_params
-
params.require(:appointment).permit(:resident_id, :doctor_id, :user_id, :date, :time, :apt_type, :notes, :res_id, :house_id, :date, :apt_type, :cancel)
-
end
-
-
# sort_column - defines how appointments are sorted
-
def sort_column
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "resident_id"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "doctor_id"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "user_id"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "date"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "time"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "apt_type"
-
end
-
-
# sort_direction - defines how items are sorted. If an order is specified it will sort them that way, otherwise it defaults to ascending
-
def sort_direction
-
%w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
-
end
-
-
# check_house - Check to see if the user has permissions to create or modify an appointment
-
# The user will have permission if they are in the same house as the resident associated with that appointment
-
def check_house
-
redirect_to appointments_path, alert: "You do not have admin privileges." unless current_user.admin || current_user.house == @appointment.resident.house
-
end
-
-
#check_admin - checks to see if the user is an admin used based on their account type
-
def check_admin
-
redirect_to appointments_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
end
-
class AptTypesController < ApplicationController
-
def destroy
-
@typ = AptType.find(params[:id])
-
@typ.destroy
-
redirect_to new_appointment_path
-
end
-
end
-
class CarsController < ApplicationController
-
include CarsHelper
-
before_filter :check_admin, only: [:edit, :update, :destroy, :new, :create, :manage]
-
before_action :set_car, only: [:show, :edit, :update, :destroy, :toggle]
-
before_action :set_reservation, only: [:show_reservation, :destroy_reservation]
-
-
# GET /cars
-
# GET /cars.json
-
def index
-
end
-
-
# post 'cars/manage'
-
def manage
-
@cars = Car.all
-
end
-
-
# get 'reservations'
-
def get_reservations
-
@reservations = Reservation.all
-
end
-
-
# get 'reservations/:id'
-
def show_reservation
-
end
-
-
# post 'reservation/availability'
-
# given a start and end date, find all available cars in that range
-
def get_availability
-
start = parse_time(params[:date], params[:reservation_start])
-
finish = parse_time(params[:date], params[:reservation_end])
-
# redirect if the times aren't valid (in the past, end before finish, etc)
-
redirect_to new_reservation_path, notice: "Invalid reservation times" unless valid_times?(start, finish)
-
@cars = Array.new
-
# for each car, check if it is available. save it if so
-
Car.all.each do |car|
-
@cars << car if car_available?(car, start, finish)
-
end
-
# if no cars are available, redirect back to the new reservation
-
redirect_to new_reservation_path, method: :post, notice: "No cars available at that time" if @cars.empty?
-
@reservation = Reservation.new
-
@reservation.start = start
-
@reservation.finish = finish
-
user_id = params[:user_id] || current_user
-
@reservation.user = User.find(user_id)
-
end
-
-
# post 'reservation/new'
-
def new_reservation
-
@reservation = Reservation.new
-
@cars = Car.all
-
end
-
-
# GET /cars/1
-
# GET /cars/1.json
-
def show
-
end
-
-
# GET /cars/new
-
def new
-
@car = Car.new
-
end
-
-
# GET /cars/1/edit
-
def edit
-
end
-
-
# post 'reservation'
-
def save_reservation
-
@reservation = Reservation.new
-
@reservation.start = params[:reservation_start]
-
@reservation.finish = params[:reservation_end]
-
@reservation.car_id = params[:car]
-
@reservation.note = params[:note]
-
user_id = params[:user_id] || current_user
-
@reservation.user = User.find(user_id)
-
if @reservation.save
-
redirect_to action: "index", notice: "Reservation created"
-
else
-
redirect_to new_reservation_path, notice: "There was an issue creating your reservation"
-
end
-
end
-
-
# delete 'reservations/:id'
-
def destroy_reservation
-
@reservation.destroy
-
redirect_to cars_url, notice: 'Reservation was deleted.'
-
end
-
-
# POST /cars
-
# POST /cars.json
-
def create
-
@car = Car.new(car_params)
-
respond_to do |format|
-
if @car.save
-
format.html { redirect_to cars_path, notice: 'Car (' + @car.name + ') was successfully created.' }
-
format.json { render :show, status: :created, location: @car }
-
else
-
format.html { render :new }
-
format.json { render json: @car.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# PATCH/PUT /cars/1
-
# PATCH/PUT /cars/1.json
-
def update
-
respond_to do |format|
-
if @car.update(car_params)
-
format.html { redirect_to @car, notice: 'Car (' + @car.name + ') was successfully updated.' }
-
format.json { render :show, status: :ok, location: @car }
-
else
-
format.html { render :edit }
-
format.json { render json: @car.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# DELETE /cars/1
-
# DELETE /cars/1.json
-
def destroy
-
@car.destroy
-
respond_to do |format|
-
format.html { redirect_to cars_url, notice: 'Car (' + @car.name + ') was successfully deleted.' }
-
format.json { head :no_content }
-
end
-
end
-
-
private
-
# Use callbacks to share common setup or constraints between actions.
-
def set_car
-
@car = Car.find(params[:id])
-
end
-
-
def set_reservation
-
@reservation = Reservation.find(params[:id])
-
end
-
-
# Never trust parameters from the scary internet, only allow the white list through.
-
def car_params
-
params.require(:car).permit(:name, :user_id, :for, :color)
-
end
-
-
def check_admin
-
redirect_to root_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
end
-
# Doctors Controller controls all the manipulation of doctors, it allows you to view, create, edit and delete doctors.
-
-
class DoctorsController < ApplicationController
-
before_filter :check_admin, only: [:edit, :update, :destroy, :new, :create]
-
before_action :set_doctor, only: [:show, :edit, :update, :destroy]
-
before_action :set_most_recent, ony: [:new]
-
helper_method :sort_column, :sort_direction
-
-
-
# GET /doctors
-
# GET /doctors.json
-
# Index page displays the list of all doctors and their corresponding information
-
-
def index
-
@doctors = Doctor.order(sort_column + " " + sort_direction) # allows the sorting of doctors by name, address, phone, or doctor type
-
respond_to do |format|
-
format.html # returns the html of that page
-
format.csv { render text: @doctors.to_csv } # allows doctors to be downloaded as a CSV file
-
end
-
end
-
-
# GET /doctors/1
-
# GET /doctors/1.json
-
# shows the information with regard to specific doctor
-
-
def show
-
end
-
-
# GET /doctors/new
-
# populate each field for the creation of a new doctor
-
-
def new
-
@doctor = Doctor.new #create a new doctor
-
end
-
-
# GET /doctors/1/edit
-
# allows you to edit each doctor's information
-
def edit
-
end
-
-
# POST /doctors
-
# POST /doctors.json
-
# allows you to create a new doctor after you fill out fields for new doctors
-
#
-
-
def create
-
@doctor = Doctor.new(doctor_params) # use fields of
-
-
respond_to do |format|
-
if @doctor.save # if there are no errors in the doctor data
-
format.html { redirect_to new_doctor_path, notice: 'Doctor (' + @doctor.name + ') was successfully created.' } # redirect browser to that specific doctor's page and show "sucessful" message
-
format.json { render :show, status: :created, location: @doctor }
-
else # if there are errors when creading the doctor
-
format.html { render :new }
-
format.json { render json: @doctor.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# PATCH/PUT /doctors/1
-
# PATCH/PUT /doctors/1.json
-
# update the information with regard to each doctor
-
-
def update
-
respond_to do |format|
-
if @doctor.update(doctor_params)
-
format.html { redirect_to @doctor, notice: 'Doctor (' + @doctor.name + ') was successfully updated.' } # redirect browser to that doctor's page and show "successful" message
-
format.json { render :show, status: :ok, location: @doctor }
-
else # if there are errors when editing the doctors, tell the user where is wrong
-
format.html { render :edit }
-
format.json { render json: @doctor.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# DELETE /doctors/1
-
# DELETE /doctors/1.json
-
# delete the doctor and redirect user to main doctor page after each deletion
-
-
def destroy
-
@doctor.destroy
-
respond_to do |format|
-
format.html { redirect_to doctors_url, notice: 'Doctor (' + @doctor.name + ') was successfully deleted.' } # redirect browser to main doctor page and show "successful" message
-
format.json { head :no_content }
-
end
-
end
-
-
private
-
# Use callbacks to share common setup or constraints between actions.
-
def set_doctor
-
@doctor = Doctor.find(params[:id])
-
end
-
-
# order the doctors by the most recent creation time
-
def set_most_recent
-
@recent = Doctor.order("created_at").last
-
end
-
-
# Never trust parameters from the scary internet, only allow the white list through.
-
def doctor_params
-
params.require(:doctor).permit(:name, :address, :phone, :doctor_type)
-
end
-
-
# helps to sort the doctors by each field, each field that will be sorted should appear here
-
def sort_column
-
Doctor.column_names.include?(params[:sort]) ? params[:sort] : "name"
-
Doctor.column_names.include?(params[:sort]) ? params[:sort] : "address"
-
Doctor.column_names.include?(params[:sort]) ? params[:sort] : "phone"
-
Doctor.column_names.include?(params[:sort]) ? params[:sort] : "doctor_type"
-
end
-
-
# defines the direction of sorting
-
def sort_direction
-
%w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
-
end
-
-
# check if the user had admin privileges to the system
-
def check_admin
-
redirect_to root_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
end
-
class HousesController < ApplicationController
-
before_action :set_house, only: [:show, :edit, :update, :destroy]
-
before_action :check_admin, except: [:index, :show, :edit, :update]
-
before_action :check_privileges, only: [:edit, :update]
-
before_action :set_most_recent, ony: [:new]
-
-
# GET /houses
-
# GET /houses.json
-
def index
-
houses = House.all.map
-
houses = houses.sort_by{|u| [u.name]}
-
@houses = houses
-
respond_to do |format|
-
format.html
-
format.csv { render text: @houses.to_csv }
-
end
-
end
-
-
# Displays an individual house page
-
def show
-
end
-
-
# Gets a new house to be filled in
-
def new
-
@house = House.new
-
end
-
-
# Opens a house for changes
-
def edit
-
end
-
-
# Adds the new house to the database, relating success or error to the user
-
def create
-
@house = House.new(house_params)
-
-
respond_to do |format|
-
if @house.save
-
format.html { redirect_to new_house_path, notice: 'House (' + @house.name + ') was successfully created.' }
-
format.json { render :show, status: :created, location: @house }
-
else
-
format.html { render :new }
-
format.json { render json: @house.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# Changes a house based on edits, relating success or error back to the user
-
def update
-
respond_to do |format|
-
if @house.update(house_params)
-
format.html { redirect_to @house, notice: 'House (' + @house.name + ') was successfully updated.' }
-
format.json { render :show, status: :ok, location: @house }
-
else
-
format.html { render :edit }
-
format.json { render json: @house.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# Deletes a house from the database, notifying the user as to what was deleted
-
def destroy
-
@house.destroy
-
respond_to do |format|
-
format.html { redirect_to houses_url, notice: 'House (' + @house.name + ') was successfully deleted.' }
-
format.json { head :no_content }
-
end
-
end
-
-
private
-
# Check to see if the user is an admin or if they are in a house that gives them access
-
def check_privileges
-
redirect_to houses_path, alert: "You do not have admin privileges." unless current_user.admin || current_user.house == @house
-
end
-
# Check to see if the user is an admin
-
def check_admin
-
redirect_to houses_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
# Use callbacks to share common setup or constraints between actions
-
def set_house
-
@house = House.find(params[:id])
-
end
-
-
#Finds the most recently created house (for use in navigation)
-
def set_most_recent
-
@recent = House.order("created_at").last
-
end
-
-
# Never trust parameters from the scary internet, only allow the white list through
-
def house_params
-
params.require(:house).permit(:name, :phone)
-
end
-
end
-
-
class ReportsController < ApplicationController
-
-
before_filter :check_admin
-
-
# GET /appointments
-
# GET /appointments.json
-
# index page shows all the fields where users can customize their report
-
def index
-
@residents = Resident.all
-
@houses = House.all
-
@doctors = Doctor.all
-
@appointment_types = AptType.all
-
end
-
-
-
# generate the report according to usres' preferences
-
def generate
-
@appointments = Appointment.all
-
if params[:doctor_id] != ''
-
@appointments = @appointments.where('doctor_id = ?', params[:doctor_id]) # generate report with regard to specific doctor
-
end
-
-
if params[:resident_id] != ''
-
@appointments = @appointments.where('resident_id = ?', params[:resident_id]) # generate the report with regard to specific resident
-
elsif params[:house_id] != ''
-
@appointments = @appointments.joins('LEFT OUTER JOIN residents ON resident_id = residents.id').where('house_id = ?', params[:house_id]) # generate the report with regard to specific house
-
end
-
-
if params[:date] != ''
-
@appointments = @appointments.where('date >= ?', Date.strptime(params[:date], "%m/%d/%Y")) # select a starting date
-
end
-
if params[:date2] != ''
-
@appointments = @appointments.where('date <= ?', Date.strptime(params[:date2], "%m/%d/%Y")) # select an ending date
-
end
-
if params[:apt_type] != ''
-
@appointments = @appointments.where('apt_type = ?', params[:apt_type]) # generate the report with regard to specific appointment type
-
end
-
if params[:format] == 'PDF' # if the user choose to generate a PDF report
-
pdf = Prawn::Document.new(:page_layout => :landscape) # create a new pdf with predefined layout
-
pdf.image "#{Rails.root}/app/assets/images/pdf_header.png", width: 400, height: 110, :position => :center # insert InnIsfree header image
-
pdf.move_down 25
-
printTable(pdf, @appointments)
-
send_data pdf.render, filename: 'Report-'+ Time.now.strftime("%m/%d/%Y") +'.pdf', type: 'application/pdf' # define the name of the pdf file
-
else
-
Gen_CSV(@appointments) # if the user choose to generate s CSV report
-
end
-
end
-
-
# POST /reports
-
# POST /reports.json
-
# allow users to create new reports
-
def create
-
end
-
-
-
private
-
-
# check if currently user is an admin or not
-
def check_admin
-
redirect_to root_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
# Never trust parameters from the scary internet, only allow the white list through.
-
def report_params
-
params.require(:report).permit(:resident_id, :doctor_id, :date,:house_id, :date2)
-
end
-
-
# populate the pdf report with data
-
def printTable(pdf, appointments)
-
table_data = [["<b>Date</b>", "<b>Time<b>","<b>Resident<b>", "<b>House<b>", "<b>Volunteer<b>", "<b>Doctor<b>", "<b>Type<b>" ]] # header for each field
-
test = appointments.map
-
test = test.sort_by {|u| [u.date, u.time]} # sort the appointments by time and date and add them into the report
-
#test = test.sort_by {|u| u.time}
-
test.each do |appointment|
-
if appointment.cancel != true #if the appointment is not cancelled
-
table_data += # add each entry into the report
-
[[
-
-
appointment.date.to_formatted_s(:long_ordinal),
-
appointment.time.strftime("%l:%M %p"),
-
if not Resident.where('id = ?', appointment.resident_id).blank? # if the resident exists
-
Resident.where('id = ?', appointment.resident_id).first.name
-
end,
-
if not Resident.where('id = ?', appointment.resident_id).blank?
-
id = Resident.where('id = ?', appointment.resident_id).first.house_id
-
if not House.where('id = ?', id).blank? # if the house exists
-
House.where('id = ?', id).first.name
-
end
-
end,
-
if not User.where('id = ?', appointment.user_id).blank? # if the user exists
-
User.where('id = ?', appointment.user_id).first.name
-
end,
-
if not Doctor.where('id = ?', appointment.doctor_id).blank? # if the doctor exists
-
Doctor.where('id = ?', appointment.doctor_id).first.name
-
end,
-
appointment.apt_type # insert appointment type
-
-
]]
-
end
-
end
-
pdf.table(table_data, :header => true, :cell_style => { :inline_format => true }, \
-
:column_widths => {0 => 140, 1 => 70, 2 => 100, 3 => 100, 4 => 100, 5 => 100, 6 => 100}, \
-
:position => :center, :row_colors => ['DDDDDD', 'FFFFFF']) # define the format of the PDF report
-
end
-
-
def Gen_CSV(appointments)
-
csv_string = CSV.generate do |csv|
-
cols = ["Date", "Time", "Resident", "Volunteer", "Doctor", "Type", "Notes"] # define the header for each field
-
csv << cols # for each column
-
app = appointments.map
-
app = app.sort_by {|u| [u.date, u.time]} # sort all appointments by date and time
-
app.each do |appointment|
-
if appointment.cancel != true # if the appointment is not cancelled
-
csv << [appointment.date.to_formatted_s(:long_ordinal),
-
appointment.time.strftime("%l:%M %p"),
-
if not Resident.where('id = ?', appointment.resident_id).blank? # if the resident exists
-
Resident.where('id = ?', appointment.resident_id).first.name
-
end,
-
-
if not User.where('id = ?', appointment.user_id).blank? # if the user exists
-
User.where('id = ?', appointment.user_id).first.name
-
end,
-
-
if not Doctor.where('id = ?', appointment.doctor_id).blank? # if the doctor exists
-
Doctor.where('id = ?', appointment.doctor_id).first.name
-
end,
-
appointment.apt_type, # insert appointment type
-
appointment.notes # insert notes for that appointment
-
]
-
end
-
end
-
end
-
filename = "Report-#{Time.now.to_date.to_s}.csv" # define CSV filename
-
send_data(csv_string, :type => 'text/csv; charset=utf-8; header=present', :filename => filename) # generate the cSV file
-
end
-
end
-
# The resident controller manages resident data, and serves as the controller to both access and modify data regarding residents. It also verifies privileges for each call when appropriate.
-
-
class ResidentsController < ApplicationController
-
before_action :set_resident, only: [:show, :edit, :update, :destroy] # loads the specified resident before showing, editing, or deleting
-
before_action :check_admin, only: [:new, :create, :index, :destroy] # makes sure that the user is an admin before creating, destroying, or viewing the management page
-
before_action :check_house, only: [:edit, :update] # makes sure that the user is in the resident's house or an admin before editing
-
before_action :set_most_recent, only: [:new] # loads the most recently created resident if creating
-
helper_method :sort_column # helper method for sorting
-
-
# GET /residents
-
# GET /residents.json
-
# index - the main page for resident management for admins, lists all the resident and shows links for details, edit, and delete
-
def index
-
@residents = Resident.all
-
respond_to do |format|
-
format.html
-
format.csv { render text: @residents.to_csv }
-
end
-
end
-
-
# GET /residents/1
-
# GET /residents/1.json
-
# show - shows the resident and upcoming appointments for resident
-
def show
-
@upcoming_appointments = Appointment.where('resident_id = ?', @resident.id)
-
end
-
-
# GET /residents/new
-
# new - creates a new resident object
-
def new
-
@resident = Resident.new
-
end
-
-
# GET /residents/1/edit
-
# edit - opens a resident for changes
-
def edit
-
end
-
-
# POST /residents
-
# POST /residents.json
-
# create - saves the new resident to database, and shows resident page, or an error if unsuccessful
-
def create
-
@resident = Resident.new(resident_params)
-
respond_to do |format|
-
if @resident.save
-
format.html { redirect_to new_resident_path, notice: 'Resident (' + @resident.name + ') was successfully created.' }
-
format.json { render :show, status: :created, location: @resident }
-
else
-
format.html { render :new }
-
format.json { render json: @resident.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# PATCH/PUT /residents/1
-
# PATCH/PUT /residents/1.json
-
# update - saves the edited resident data to database, and shows resident page, or an error if unsuccessful
-
def update
-
respond_to do |format|
-
if @resident.update(resident_params)
-
format.html { redirect_to @resident, notice: 'Resident (' + @resident.name + ') was successfully updated.' }
-
format.json { render :show, status: :ok, location: @resident }
-
else
-
format.html { render :edit }
-
format.json { render json: @resident.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# DELETE /residents/1
-
# DELETE /residents/1.json
-
# destroy - removes the resident from database, and shows a success message
-
def destroy
-
@resident.destroy
-
respond_to do |format|
-
format.html { redirect_to residents_url, notice: 'Resident (' + @resident.name + ') was successfully deleted.' }
-
format.json { head :no_content }
-
end
-
end
-
-
private
-
# check_admin - checks to see if the user is an admin (staff)
-
def check_admin
-
redirect_to houses_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
# check_house - checks to see if the user is in the same house as resident or an admin
-
def check_house
-
redirect_to houses_path, alert: "You do not have access to this house." unless current_user.admin or current_user.house_id == @resident.house_id
-
end
-
-
# set_resident - finds the resident with the specified id parameter
-
# Use callbacks to share common setup or constraints between actions.
-
def set_resident
-
@resident = Resident.find(params[:id])
-
end
-
-
# set_most_recent - sets the most recently created resident
-
def set_most_recent
-
@recent = Resident.order("created_at").last
-
end
-
-
# resident_params - defines what specific parameters are allowed for a resident
-
# Never trust parameters from the scary internet, only allow the white list through.
-
def resident_params
-
params.require(:resident).permit(:name, :house_id, :notes)
-
end
-
end
-
-
# sort_column - defines how the columns for upcoming appointments are sorted
-
def sort_column
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "resident_id"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "doctor_id"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "user_id"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "date"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "time"
-
Appointment.column_names.include?(params[:sort]) ? params[:sort] : "apt_type"
-
end
-
class SettingsController < ApplicationController
-
before_filter :check_admin
-
before_filter :set_user, only: [:toggle_user_permission, :toggle_user_approval, :toggle_user_email_preference, :toggle_user_medical_coordinator]
-
-
def index
-
@users = User.all
-
@houses = House.all
-
end
-
-
def create_user
-
@user = User.new(user_params)
-
@user.approved = true
-
if @user.save
-
redirect_to :back, notice: 'User (' + @user.name + ') was successfully created.'
-
elsif not @user.email =~ Devise::email_regexp
-
redirect_to :back, alert: "Error: Please enter a valid email!"
-
else
-
redirect_to :back, alert: "There were errors present! Please make sure that your passwords match and are at least 8 characters."
-
end
-
end
-
-
def toggle_user_permission
-
@user.toggle!(:admin)
-
redirect_to :back, notice: "User (" + @user.name + ") admin status changed."
-
end
-
-
def toggle_user_email_preference
-
@user.toggle!(:email_pref)
-
redirect_to :back, notice: "User (" + @user.name + ") email preference changed."
-
end
-
-
def toggle_user_medical_coordinator
-
@user.toggle!(:medical_coordinator)
-
redirect_to :back, notice: "User (" + @user.name + ") medical coordinator status changed."
-
end
-
-
def toggle_user_approval
-
@user.toggle!(:approved)
-
if<EMAIL_ADDRESS>-
@user.admin = false
-
@user.save
-
end
-
redirect_to :back, notice: "User (" + @user.name + ") approval staus changed."
-
end
-
-
private
-
-
def check_admin
-
redirect_to root_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
def set_user
-
@user = User.find(params[:id])
-
end
-
-
def user_params
-
params.permit(:name, :email, :phone, :password, :password_confirmation, :house_id)
-
end
-
end
-
class Users::RegistrationsController < Devise::RegistrationsController
-
-
def new
-
@houses = House.all
-
super
-
end
-
-
def update
-
@houses = House.all
-
super
-
end
-
-
def edit
-
@houses = House.all
-
super
-
end
-
-
private
-
-
# Defines the parameters needed to create a user
-
def sign_up_params
-
params.require(:user).permit(:name, :email, :password, :password_confirmation, :house_id, :phone)
-
end
-
-
# Defines the parameters permitted to update a user
-
def account_update_params
-
params.require(:user).permit(:name, :email, :password, :password_confirmation, :current_password, :house_id, :phone)
-
end
-
-
end
-
class UsersController < ApplicationController
-
-
before_filter :check_admin, only: [:destroy, :new, :create]
-
before_filter :check_admin_or_self, only:[:edit, :update]
-
before_action :set_user, only: [:show, :edit, :update, :destroy, :test_email]
-
before_action :set_most_recent, ony: [:new]
-
helper_method :sort_column, :sort_direction
-
-
# GET /houses
-
# GET /houses.json
-
# index - the list view of all users when formatted in html
-
# In addition, this function is called when a report or csv of users is generated
-
def index
-
@user = current_user.id
-
@users = User.order(sort_column + " " + sort_direction)
-
respond_to do |format|
-
format.html
-
format.csv { render text: @users.to_csv }
-
format.pdf do
-
pdf = ReportPdf.new(@users)
-
send_data pdf.render, filename: 'Report-'+ Time.now.strftime("%d/%m/%Y") +'.pdf', type: 'application/pdf'
-
end
-
end
-
end
-
-
# Makes a call to the send_reminders method in the User model
-
def send_reminders
-
User.send_reminders
-
redirect_to :back, notice: "Email reminders sent."
-
end
-
-
# Sets a houses variable to equal all houses currently stored in the database
-
def show
-
@houses = House.all
-
end
-
-
# Sets a houses variable to equal all houses currently stored in the database
-
# Sets a user variable to the current user being edited
-
def edit
-
@user = User.find(params[:id])
-
@houses = House.all
-
end
-
-
# Sets a user variable to a new User which will be created if create is called
-
# Sets a houses variable to equal all houses currently stored in the database
-
def new
-
@user = User.new
-
@houses = House.all
-
respond_to do |format|
-
format.html { render :new }
-
format.json { render json: @user.errors, status: :unprocessable_entity }
-
end
-
-
end
-
-
# Updates the user set in the edit method
-
# Calls an update method in the User model based on whether a password was provided and whether the user being updated is the current user
-
def update
-
@houses = House.all
-
-
if user_params[:password].blank?
-
result = @user.update_without_password(user_params)
-
else
-
if current_user.id == @user.id
-
result = @user.update_with_password(user_params)
-
else
-
result = @user.update_attributes(user_params)
-
end
-
end
-
-
-
respond_to do |format|
-
if result
-
format.html { redirect_to @user, notice: 'User (' + @user.name + ') was successfully updated.' }
-
format.json { render :show, status: :ok, location: @user }
-
else
-
format.html { render :edit }
-
format.json { render json: @user.errors, status: :unprocessable_entity }
-
end
-
end
-
-
end
-
-
# Destroys a user entry from the database
-
def destroy
-
@user.destroy
-
respond_to do |format|
-
format.html { redirect_to users_url, notice: 'User (' + @user.name + ') was successfully deleted.' }
-
format.json { head :no_content }
-
end
-
end
-
-
private
-
# Sets a user variable based on the given id
-
def set_user
-
@user = User.find(params[:id])
-
end
-
-
# Sets a recent variable to be the most recently created user
-
def set_most_recent
-
@recent = User.order("created_at").last
-
end
-
-
# Defines what parameters can be passed when created a new user
-
def user_params
-
params.require(:user).permit(:name, :email, :password, :password_confirmation, :current_password, :house_id, :phone, :email_pref, :admin)
-
end
-
-
# The next two method define sorting
-
# Sort_column defines which column to sort by
-
def sort_column
-
@houses =
-
User.column_names.include?(params[:sort]) ? params[:sort] : "name"
-
User.column_names.include?(params[:sort]) ? params[:sort] : "email"
-
User.column_names.include?(params[:sort]) ? params[:sort] : "phone"
-
User.column_names.include?(params[:sort]) ? params[:sort] : "house_id"
-
User.column_names.include?(params[:sort]) ? params[:sort] : "NOT(admin)"
-
end
-
-
# Sort_direction defines which direction to sort by
-
def sort_direction
-
%w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
-
end
-
-
# Checks whether the current user is an admin. If they are not, redirects to where they came from
-
def check_admin
-
redirect_to root_path, alert: "You do not have admin privileges." unless current_user.admin
-
end
-
-
def check_admin_or_self
-
@user = User.find(params[:id])
-
redirect_to root_path, alert: "You do not have admin privileges." unless current_user.admin || current_user.id == @user.id
-
end
-
-
end
-
module ApplicationHelper
-
#Helps with getting Google map for doctors to be displayed on appointments
-
def map_link(address)
-
"https://www.google.com/maps/preview?q="+address
-
end
-
end
-
module AppointmentsHelper
-
end
-
module CarsHelper
-
#Determines if a car reservation's start and end time are acceptable
-
def valid_times?(start, finish)
-
if start > finish || start < Time.now
-
return false
-
else
-
return true
-
end
-
end
-
-
#Converts time into a readable format
-
def parse_time(date, time)
-
fix_dst(Time.zone.parse("#{date} #{time.values.join(":")}#{Time.zone.formatted_offset.to_s.tr(':','')}"))
-
end
-
-
#Determines daylight savings time
-
def fix_dst(time)
-
if time.dst?
-
return time - 1.hour
-
else
-
return time
-
end
-
end
-
-
#Determines if car reservations overlap each other
-
def overlap?(existing_reservation, start, finish)
-
return (start <= existing_reservation.start && finish > existing_reservation.start) || (existing_reservation.start <= start && existing_reservation.finish > start) || (existing_reservation.start == start && existing_reservation.finish == finish)
-
end
-
-
#Determines if a car is available during a reservation time
-
def car_available?(car, start, finish)
-
car.reservations.each do |reservation|
-
if overlap?(reservation, start, finish)
-
return false
-
end
-
end
-
return true
-
end
-
end
-
module DoctorsHelper
-
#Assists with sorting the columns for the doctors page
-
def sortable(column, title = nil)
-
title ||= column.titleize
-
css_class = column == sort_column ? "current #{sort_direction}" : nil
-
direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
-
link_to title, {:sort => column}, {:class => css_class}
-
end
-
end
-
module ResidentsHelper
-
end
-
module SettingsHelper
-
end
-
class NotificationMailer < ActionMailer::Base
-
helper :application
-
default :from => 'noreply<EMAIL_ADDRESS>-
-
# Parameter: user to send email to
-
# appointment_digest - sends a digest of the day's appointments to the specified user
-
def appointment_digest(user)
-
@user = user
-
@appointments = Appointment.where('date = ?', Date.today)
-
mail(to: user.email, subject: 'Today\'s Innisfree Appointments')
-
end
-
-
# Parameter: user to send email to
-
# weekly_digest - sends a digest of the next week's appointments to the specified user
-
def weekly_digest(user)
-
@user = user
-
@appointments = Appointment.where('date >= ?', Date.tomorrow).where('date <= ?', Date.tomorrow+7)
-
mail(to: user.email, subject: 'This week\'s Innisfree Appointments')
-
end
-
-
# Parameter: appointment to send a reminder about
-
# appointment_reminder - sends a reminder to the assigned volunteer about the specified appointment
-
def appointment_reminder(appointment)
-
@appointment = appointment
-
mail(to: @appointment.user.email, subject: 'Upcoming appointment today')
-
end
-
-
# Parameter: appointment to send a reminder about
-
# appointment_assignment-reminder - sends an email to the appointment's volunteer that they have been assigned to an appointment
-
def appointment_assignment_notification(appointment)
-
@appointment = appointment
-
mail(to: @appointment.user.email, subject: 'Appointment Assignment Notification')
-
end
-
-
# Parameter: appointment to send a reminder about
-
# recurring_appointment_reminder - sends a reminder to schedule a follow up appointment to the given appointment
-
def recurring_appointment_reminder(appointment)
-
@appointment = appointment
-
user = User.where('id = ?', @appointment.user_id)[0];
-
mail(to: user.email, subject: 'Schedule Follow-up Appointment')
-
end
-
-
# Parameter: appointment to send a reminder about
-
# Parameter: user to send a reminder to
-
# new_appointment_notification - sends an email notifying the given user they have been assigned an appointment
-
def new_appointment_notification(appointment, user)
-
@appointment = appointment
-
@user = user
-
mail(to: @user.email, subject: 'New Appointment Scheduled')
-
end
-
-
# Parameter: appointment to send a reminder about
-
# Parameter: user to send a reminder to
-
# house_reminder - sends an email to the house to remind them of an appointment
-
def house_reminder(appointment, user)
-
@appointment = appointment
-
@user = user
-
mail(to: @user.email, subject: 'Appointment Reminder')
-
end
-
end
-
# == Schema Information
-
#
-
# Table name: appointments
-
#
-
# id :integer not null, primary key
-
# resident_id :integer
-
# doctor_id :integer
-
# user_id :integer
-
# date :date
-
# time :time
-
# notes :text
-
# created_at :datetime
-
# updated_at :datetime
-
# apt_type :string(255)
-
#
-
-
class Appointment < ActiveRecord::Base
-
-
has_paper_trail # allows changes to appointments to be tracked with the paper_trail gem
-
-
# The following lines establish a one-to-one relationship between that data_type and appointments. This means that these fields are checked and the values input for the appointment must exist in that fields table of the database, ensuring that appoinments are not created for non-existant residents, doctors, or users.
-
belongs_to :resident
-
belongs_to :doctor
-
belongs_to :user
-
-
# Data validators to ensure that necessary fields are filled out when an appointment is created or updated
-
validates :doctor_id, presence: true
-
validates :resident_id, presence: true
-
validates :date, presence: true
-
validates :time, presence: true
-
validates :apt_type, presence: true
-
-
# Allows all the appointments to be exported into a CSV file
-
def self.to_csv
-
CSV.generate do |csv|
-
csv << column_names # writes the database column names to the CSV file as headers
-
all.each do |appointments| # writes each appointment to the CSV
-
csv << appointments.attributes.values_at(*column_names)
-
end
-
end
-
end
-
end
-
# == Schema Information
-
#
-
# Table name: apt_types
-
#
-
# id :integer not null, primary key
-
# apt_type :string(255)
-
# created_at :datetime
-
# updated_at :datetime
-
#
-
-
class AptType < ActiveRecord::Base
-
end
-
# == Schema Information
-
#
-
# Table name: cars
-
#
-
# id :integer not null, primary key
-
# name :string(255)
-
# user_id :integer
-
# for :string(255)
-
# created_at :datetime
-
# updated_at :datetime
-
#
-
-
class Car < ActiveRecord::Base
-
validates :name, presence: true
-
belongs_to :user
-
has_many :reservations, dependent: :destroy
-
end
-
# == Schema Information
-
#
-
# Table name: doctors
-
#
-
# id :integer not null, primary key
-
# name :string(255)
-
# address :string(255)
-
# phone :string(255)
-
# created_at :datetime
-
# updated_at :datetime
-
# doctor_type :string(255)
-
#
-
-
include ActionView::Helpers::NumberHelper
-
-
class Doctor < ActiveRecord::Base
-
# each doctor can have multiple appointments
-
has_many :appointments
-
-
validates :name, presence: true
-
# defines what a CSV list of doctors will look like
-
def self.to_csv
-
CSV.generate do |csv|
-
csv << column_names
-
all.each do |doctors|
-
csv << doctors.attributes.values_at(*column_names)
-
end
-
end
-
end
-
end
-
# == Schema Information
-
#
-
# Table name: houses
-
#
-
# id :integer not null, primary key
-
# name :string(255)
-
# created_at :datetime
-
# updated_at :datetime
-
# phone :string(255)
-
#
-
-
1
class House < ActiveRecord::Base
-
-
#Each house contains multiple users (the volunteers) and multiple residents (the coworkers)
-
1
has_many :users
-
1
has_many :residents
-
-
#Ensures that houses have names when they are created
-
1
validates :name, presence: true
-
-
#Defines what a CSV list of the houses will look like
-
1
def self.to_csv
-
CSV.generate do |csv|
-
csv << column_names
-
all.each do |houses|
-
csv << houses.attributes.values_at(*column_names)
-
end
-
end
-
end
-
end
-
# == Schema Information
-
#
-
# Table name: posts
-
#
-
# id :integer not null, primary key
-
# title :string(255)
-
# body :text
-
# created_at :datetime
-
# updated_at :datetime
-
#
-
-
class Post < ActiveRecord::Base
-
validates :title, presence: true
-
end
-
# == Schema Information
-
#
-
# Table name: recurring_reminders
-
#
-
# id :integer not null, primary key
-
# appointment_id :integer
-
# notification_date :date
-
# created_at :datetime
-
# updated_at :datetime
-
#
-
-
class RecurringReminder < ActiveRecord::Base
-
end
-
class Report < ActiveRecord::Base
-
-
has_paper_trail
-
# a one-to-one relationship with appointment, valid appointments must exist in database
-
belongs_to :appointment
-
-
# defines the content for CSV list
-
def self.to_csv
-
CSV.generate do |csv|
-
csv << column_names
-
all.each do |appointments|
-
csv << appointments.attributes.values_at(*column_names)
-
end
-
end
-
end
-
end
-
# == Schema Information
-
#
-
# Table name: reservations
-
#
-
# id :integer not null, primary key
-
# start :datetime
-
# end :datetime
-
# user_id :integer
-
# car_id :integer
-
# created_at :datetime
-
# updated_at :datetime
-
# note :text
-
#
-
-
class Reservation < ActiveRecord::Base
-
belongs_to :car
-
belongs_to :user
-
-
validates :start, presence: true
-
validates :finish, presence: true
-
validates :user_id, presence: true
-
validates :car_id, presence: true
-
end
-
# == Schema Information
-
#
-
# Table name: residents
-
#
-
# id :integer not null, primary key
-
# name :string(255)
-
# house_id :integer
-
# notes :text
-
# created_at :datetime
-
# updated_at :datetime
-
#
-
-
class Resident < ActiveRecord::Base
-
-
# Establishes a one-to-many relationship between houses and residents. Each resident has a house where they reside.
-
belongs_to :house
-
-
# Validates that each resident has a name as a requirement for creating a resident object
-
validates :name, presence: true
-
-
# Specifies what the generated CSV list of residents will look like
-
def self.to_csv
-
CSV.generate do |csv|
-
csv << column_names # headers for the CSV report
-
all.each do |residents| # for each resident, populate the fields specified in column_names
-
csv << residents.attributes.values_at(*column_names)
-
end
-
end
-
end
-
-
def name
-
super || "No Name"
-
end
-
-
end
-
# == Schema Information
-
#
-
# Table name: users
-
#
-
# id :integer not null, primary key
-
# email :string(255) default(""), not null
-
# encrypted_password :string(255) default(""), not null
-
# reset_password_token :string(255)
-
# reset_password_sent_at :datetime
-
# remember_created_at :datetime
-
# sign_in_count :integer default(0), not null
-
# current_sign_in_at :datetime
-
# last_sign_in_at :datetime
-
# current_sign_in_ip :string(255)
-
# last_sign_in_ip :string(255)
-
# created_at :datetime
-
# updated_at :datetime
-
# admin :boolean default(FALSE)
-
# volunteer_id :integer
-
# approved :boolean
-
# phone :string(255)
-
# house_id :integer
-
# name :string(255)
-
# email_pref :boolean default(FALSE)
-
# medical_coordinator :boolean default(FALSE)
-
#
-
-
1
class User < ActiveRecord::Base
-
# Include default devise modules. Others available are:
-
# :confirmable, :lockable, :timeoutable and :omniauthable
-
1
devise :database_authenticatable, :registerable,
-
:recoverable, :rememberable, :trackable, :validatable
-
-
1
belongs_to :house
-
1
has_many :cars
-
1
has_many :reservations
-
1
has_many :appointments
-
-
1
validates :name, presence: true
-
1
validates :email, presence: true
-
-
-
# Sends emails to remind users of the schedule for the day and any reminders set for recurring appointments
-
# If the user is an admin, then they receive all the appointments
-
# If the user is a volunteer, they only receive reminders for the appointments they were assigned
-
1
def self.send_reminders
-
# email all the admins a full schedule for the day
-
if !Appointment.where('date = ?', Date.today).empty?
-
admins = User.where(admin: true).where(email_pref: true)
-
admins.each do |admin|
-
NotificationMailer.appointment_digest(admin).deliver
-
end
-
end
-
# email all volunteers a reminder
-
todays_appointments = Appointment.where('date = ?', Date.today)
-
todays_appointments.each do |appointment|
-
if !appointment.user.nil? && appointment.user.email_pref
-
NotificationMailer.appointment_reminder(appointment).deliver
-
end
-
end
-
todays_reminders = RecurringReminder.where('notification_date = ?', Date.today)
-
todays_reminders.each do |recur|
-
original_apt = Appointment.where('id = ?', recur.appointment_id)[0]
-
user = User.where('id = ?', original_apt.user_id)[0]
-
if !user.nil? && user.email_pref
-
NotificationMailer.recurring_appointment_reminder(original_apt).deliver
-
end
-
end
-
end
-
-
# Sends a reminder of the week's appointments to the medical coordinator
-
1
def self.send_weekly_digest
-
if !Appointment.where('date >= ?', Date.tomorrow).where('date <= ?', Date.tomorrow+7).empty?
-
coordinators = User.where(medical_coordinator: true).where(email_pref: true)
-
coordinators.each do |coordinator|
-
NotificationMailer.weekly_digest(coordinator).deliver
-
end
-
end
-
end
-
-
1
attr_accessor :current_password
-
# If the user does not have a name, provide the email in case
-
1
def name
-
super || email
-
end
-
-
end
-
class AppointmentsReportPdf < Prawn::Document
-
def initialize(data)
-
super()
-
@users = data
-
header
-
text_content
-
table_content
-
end
-
-
def header
-
#This inserts an image in the pdf file and sets the size of the image
-
image "#{Rails.root}/app/assets/images/pdf_header.png", width: 400, height: 110, :position => :center
-
move_down 25
-
end
-
-
def text_content
-
#text "Hello, World!"
-
end
-
-
def table_content
-
-
table product_rows do
-
row(0).font_style = :bold
-
self.header = true
-
self.row_colors = ['DDDDDD', 'FFFFFF']
-
self.column_widths = [150, 150, 110, 100]
-
end
-
-
end
-
-
def product_rows
-
[['Name', 'Email', 'Phone', 'House']] +
-
@users.map do |data|
-
[data.date, data.time, data.resident_id, data.doctor_id]
-
end
-
end
-
-
-
-
end
-
class ReportPdf < Prawn::Document
-
def initialize(data)
-
super()
-
@users = data
-
header
-
text_content
-
table_content
-
end
-
-
def header
-
#This inserts an image in the pdf file and sets the size of the image
-
image "#{Rails.root}/app/assets/images/pdf_header.png", width: 400, height: 110, :position => :center
-
move_down 25
-
end
-
-
def text_content
-
#text "Hello, World!"
-
end
-
-
def table_content
-
-
table product_rows do
-
row(0).font_style = :bold
-
self.header = true
-
self.row_colors = ['DDDDDD', 'FFFFFF']
-
self.column_widths = [150, 150, 110, 100]
-
end
-
-
end
-
-
def product_rows
-
[['Name', 'Email', 'Phone', 'House']] +
-
@users.map do |data|
-
-
@name = data.name # required
-
-
if data.phone != nil
-
@phone = data.phone
-
else
-
@phone = ""
-
end
-
-
@email = data.email # required
-
-
if data.house_id != nil
-
@house = House.where('id = ?', data.house_id).first.name
-
else
-
@house = ""
-
end
-
-
[@name,
-
@email,
-
@phone,
-
@house]
-
end
-
end
-
-
-
-
end


When using BIBINPUTS in the bibliography run configuration, you cannot use a path containing ../ in the \bibliography command.


Videos -- Raw Data vs Aligned Data (using Generalized Procrustes Analysis) Your browser does not support the video tag. Your browser does not support the video tag.


Encore
The Encore management team is comprised of a group of IT veterans with years of experience developing solutions for their customers.
John Burns began his career in 1984 with Computerland. He left in 1987 to become part owner of Entre Computer Center which later was acquired by the Future Now and ultimately Xerox Connect in 1998. John left Xerox in 1999 to build a sales and delivery organization for Cincinnati Bell (CBTS) which grew from under $2 Million in 1998 to over $400 Million in 2014.
Jay Vollmer began his IT career in 1996 as an account manager for some of the most well known names in the IT industry. Jay has always felt very comfortable understanding technology, and more importantly showing customers how to use it as a business enabler. Jay has a very broad experience working with customers in government, healthcare, Fortune 500 and small and medium businesses.
Jay and John began their relationship by partnering to deliver Cisco networking solutions to joint customers in the healthcare industry. When Jay left Cisco for VMware, he enlisted John’s help to deliver virtual data center services to the Fortune 500. Jay and John both recognized they had a similar work ethic and values.
Jay put together an investment group in 2011 to purchase élan Technologies, an Apple focused IT services provider. Jay enlisted John’s guidance as a board member and mentor. Under John’s guidance, Jay grew élan into one of the largest Apple service providers in the Midwest. Jay expanded élan’s services to include managed services, professional services and cloud services.
John Burns acquired élan Technologies in 2016 to become the foundation for the managed services, professional services and hardware services divisions of Encore Technologies. Élan Technologies brings a highly skilled support organization and hundreds of customers from the Fortune 50 to the SMB. Encore Technologies brings a team of technology leaders with the experience to deliver complex solutions. Together, Encore Technologies is uniquely positioned to deliver the comprehensive service offerings our customers expect.
This is our Encore…
DevOps Team
The Encore DevOps team was founded in early 2016 by Eric Sarakaitis with a vision of accelerating and automating IT opreations for Encore’s customers. Eric has years of experience in both modern and legacy IT environments resulting in incredible vision and direction.
While Eric has incredible experiences in IT and Ops, he quickly realized he had a gap on the Dev side. In mid-2016 he hired Nick Maludy to manage the DevOps team. Nick, a graduate of University of Toledo, comes from a diverse Software Engineering background allowing him to apply best practices from the Software Engineering discipline to the DevOps parctices at Encore.
Behind Eric and Nick are a team of great DevOps Engineers including:
Brad Bishop - A graduate of University of Cincinnati, Brad has several years of experience working in traditional Windows IT environments. Brad’s quickly come up to speed in a mixed OS environment and provides unique perspectives to the solutions we deliver to customers.
John Schoewe - A graduate of University of Cincinnati, John started his DevOps career as a Co-op underneath Eric at a previous company. Once John graduated UC, he was offered a job at Encore to continue his excellent work.
Mike Flora - Our ServiceNow guru and former IT manager for 14 years. Mike is a ServiceNow Sr Technical Consultant with a knack for implementing integrations and automation processes.


Guy Ritchie
British film Director, screenwriter, producer, most often working in the genre of crime Comedy.


This website is blocked by your network operator.
If you feel you have received this message in error, please contact your network operator with the following information:
URL:
http://www.samesexmarriage.ca/
Category:
Gambling
Server:
<IP_ADDRESS>:80


Student in fourth and final year studying a Bachelor of Science (Honours) in Computing in the Institute of Technology Tallaght. Interested in anything to do with the Software Development aspect of the computing industry. Designed and completed multiple projects throughout my college career and professional career. Proven record of completing projects on-time.
NFQ Level 5 award certification having practical knowledge in Care for the elderly, manual handling with experience in care provision and practice
Leaving Certificate,Irish State Examination Commission 290 Points
Team Leader
International Data Group
Client Services Manager
Contact Care Ltd
Lead Developer
Destination Software Solutions
References are available to be contacted at anytime.
https://startbootstrap.com/template-overviews/agency/ I ran out of time to finish the report i will send an email.
My web page is hosted at


Here are the clips in your playlist. You can change the order of the clips you would like to see first by dragging the titles up and down. If you are ready watching just click the play button next to each title. Please try to watch as many as you can from your list.