Notifications
- Introduction
- Generating Notifications
- Sending Notifications
- Mail Notifications
- Markdown Mail Notifications
- Database Notifications
- Broadcast Notifications
- SMS Notifications
- Slack Notifications
- Localizing Notifications
- Notification Events
- Custom Channels
Introduction
In addition to support for sending email, Laravel provides support for sending notifications across a variety of delivery channels, including email, SMS (via Vonage, formerly known as Nexmo), and Slack. In addition, a variety of community built notification channels have been created to send notification over dozens of different channels! Notifications may also be stored in a database so they may be displayed in your web interface.
Typically, notifications should be short, informational messages that notify users of something that occurred in your application. For example, if you are writing a billing application, you might send an "Invoice Paid" notification to your users via the email and SMS channels.
Generating Notifications
In Laravel, each notification is represented by a single class that is typically stored in the app/Notifications
directory. Don't worry if you don't see this directory in your application - it will be created for you when you run the make:notification
Artisan command:
php artisan make:notification InvoicePaid
This command will place a fresh notification class in your app/Notifications
directory. Each notification class contains a via
method and a variable number of message building methods, such as toMail
or toDatabase
, that convert the notification to a message tailored for that particular channel.
Sending Notifications
Using The Notifiable Trait
Notifications may be sent in two ways: using the notify
method of the Notifiable
trait or using the Notification
facade. The Notifiable
trait is included on your application's App\Models\User
model by default:
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
}
The notify
method that is provided by this trait expects to receive a notification instance:
use App\Notifications\InvoicePaid;
$user->notify(new InvoicePaid($invoice));
{tip} Remember, you may use the
Notifiable
trait on any of your models. You are not limited to only including it on yourUser
model.
Using The Notification Facade
Alternatively, you may send notifications via the Notification
facade. This approach is useful when you need to send a notification to multiple notifiable entities such as a collection of users. To send notifications using the facade, pass all of the notifiable entities and the notification instance to the send
method:
use Illuminate\Support\Facades\Notification;
Notification::send($users, new InvoicePaid($invoice));
Specifying Delivery Channels
Every notification class has a via
method that determines on which channels the notification will be delivered. Notifications may be sent on the mail
, database
, broadcast
, nexmo
, and slack
channels.
{tip} If you would like to use other delivery channels such as Telegram or Pusher, check out the community driven Laravel Notification Channels website.
The via
method receives a $notifiable
instance, which will be an instance of the class to which the notification is being sent. You may use $notifiable
to determine which channels the notification should be delivered on:
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return $notifiable->prefers_sms ? ['nexmo'] : ['mail', 'database'];
}
Queueing Notifications
{note} Before queueing notifications you should configure your queue and start a worker.
Sending notifications can take time, especially if the channel needs to make an external API call to deliver the notification. To speed up your application's response time, let your notification be queued by adding the ShouldQueue
interface and Queueable
trait to your class. The interface and trait are already imported for all notifications generated using the make:notification
command, so you may immediately add them to your notification class:
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification implements ShouldQueue
{
use Queueable;
// ...
}
Once the ShouldQueue
interface has been added to your notification, you may send the notification like normal. Laravel will detect the ShouldQueue
interface on the class and automatically queue the delivery of the notification:
$user->notify(new InvoicePaid($invoice));
If you would like to delay the delivery of the notification, you may chain the delay
method onto your notification instantiation:
$delay = now()->addMinutes(10);
$user->notify((new InvoicePaid($invoice))->delay($delay));
You may pass an array to the delay
method to specify the delay amount for specific channels:
$user->notify((new InvoicePaid($invoice))->delay([
'mail' => now()->addMinutes(5),
'sms' => now()->addMinutes(10),
]));
When queueing notifications, a queued job will be created for each recipient and channel combination. For example, six jobs will be dispatched to the queue if your notification has three recipients and two channels.
Customizing The Notification Queue Connection
By default, queued notifications will be queued using your application's default queue connection. If you would like to specify a different connection that should be used for a particular notification, you may define a $connection
property on the notification class:
/**
* The name of the queue connection to use when queueing the notification.
*
* @var string
*/
public $connection = 'redis';
Customizing Notification Channel Queues
If you would like to specify a specific queue that should be used for each notification channel supported by the notification, you may define a viaQueues
method on your notification. This method should return an array of channel name / queue name pairs:
/**
* Determine which queues should be used for each notification channel.
*
* @return array
*/
public function viaQueues()
{
return [
'mail' => 'mail-queue',
'slack' => 'slack-queue',
];
}
Queued Notifications & Database Transactions
When queued notifications are dispatched within database transactions, they may be processed by the queue before the database transaction has committed. When this happens, any updates you have made to models or database records during the database transaction may not yet be reflected in the database. In addition, any models or database records created within the transaction may not exist in the database. If your notification depends on these models, unexpected errors can occur when the job that sends the queued notification is processed.
If your queue connection's after_commit
configuration option is set to false
, you may still indicate that a particular queued notification should be dispatched after all open database transactions have been committed by defining an $afterCommit
property on the notification class:
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification implements ShouldQueue
{
use Queueable;
public $afterCommit = true;
}
{tip} To learn more about working around these issues, please review the documentation regarding queued jobs and database transactions.
On-Demand Notifications
Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification
facade's route
method, you may specify ad-hoc notification routing information before sending the notification:
Notification::route('mail'<EMAIL_ADDRESS>->route('nexmo', '5555555555')
->route('slack', 'https://hooks.slack.com/services/...')
->notify(new InvoicePaid($invoice));
Mail Notifications
Formatting Mail Messages
If a notification supports being sent as an email, you should define a toMail
method on the notification class. This method will receive a $notifiable
entity and should return an Illuminate\Notifications\Messages\MailMessage
instance.
The MailMessage
class contains a few simple methods to help you build transactional email messages. Mail messages may contain lines of text as well as a "call to action". Let's take a look at an example toMail
method:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$url = url('/invoice/'.$this->invoice->id);
return (new MailMessage)
->greeting('Hello!')
->line('One of your invoices has been paid!')
->action('View Invoice', $url)
->line('Thank you for using our application!');
}
{tip} Note we are using
$this->invoice->id
in ourtoMail
method. You may pass any data your notification needs to generate its message into the notification's constructor.
In this example, we register a greeting, a line of text, a call to action, and then another line of text. These methods provided by the MailMessage
object make it simple and fast to format small transactional emails. The mail channel will then translate the message components into a beautiful, responsive HTML email template with a plain-text counterpart. Here is an example of an email generated by the mail
channel:
{tip} When sending mail notifications, be sure to set the
name
configuration option in yourconfig/app.php
configuration file. This value will be used in the header and footer of your mail notification messages.
Other Mail Notification Formatting Options
Instead of defining the "lines" of text in the notification class, you may use the view
method to specify a custom template that should be used to render the notification email:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)->view(
'emails.name', ['invoice' => $this->invoice]
);
}
You may specify a plain-text view for the mail message by passing the view name as the second element of an array that is given to the view
method:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)->view(
['emails.name.html', 'emails.name.plain'],
['invoice' => $this->invoice]
);
}
In addition, you may return a full mailable object from the toMail
method:
use App\Mail\InvoicePaid as InvoicePaidMailable;
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return Mailable
*/
public function toMail($notifiable)
{
return (new InvoicePaidMailable($this->invoice))
->to($notifiable->email);
}
Error Messages
Some notifications inform users of errors, such as a failed invoice payment. You may indicate that a mail message is regarding an error by calling the error
method when building your message. When using the error
method on a mail message, the call to action button will be red instead of black:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Message
*/
public function toMail($notifiable)
{
return (new MailMessage)
->error()
->subject('Notification Subject')
->line('...');
}
Customizing The Sender
By default, the email's sender / from address is defined in the config/mail.php
configuration file. However, you may specify the from address for a specific notification using the from
method:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
<EMAIL_ADDRESS>'Barrett Blair')
->line('...');
}
Customizing The Recipient
When sending notifications via the mail
channel, the notification system will automatically look for an email
property on your notifiable entity. You may customize which email address is used to deliver the notification by defining a routeNotificationForMail
method on the notifiable entity:
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the mail channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return array|string
*/
public function routeNotificationForMail($notification)
{
// Return email address only...
return $this->email_address;
// Return email address and name...
return [$this->email_address => $this->name];
}
}
Customizing The Subject
By default, the email's subject is the class name of the notification formatted to "Title Case". So, if your notification class is named InvoicePaid
, the email's subject will be Invoice Paid
. If you would like to specify an different subject for the message, you may call the subject
method when building your message:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Notification Subject')
->line('...');
}
Customizing The Mailer
By default, the email notification will be sent using the default mailer defined in the config/mail.php
configuration file. However, you may specify a different mailer at runtime by calling the mailer
method when building your message:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->mailer('postmark')
->line('...');
}
Customizing The Templates
You can modify the HTML and plain-text template used by mail notifications by publishing the notification package's resources. After running this command, the mail notification templates will be located in the resources/views/vendor/notifications
directory:
php artisan vendor:publish --tag=laravel-notifications
Attachments
To add attachments to an email notification, use the attach
method while building your message. The attach
method accepts the absolute path to the file as its first argument:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->greeting('Hello!')
->attach('/path/to/file');
}
When attaching files to a message, you may also specify the display name and / or MIME type by passing an array
as the second argument to the attach
method:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->greeting('Hello!')
->attach('/path/to/file', [
'as' => 'name.pdf',
'mime' => 'application/pdf',
]);
}
Unlike attaching files in mailable objects, you may not attach a file directly from a storage disk using attachFromStorage
. You should rather use the attach
method with an absolute path to the file on the storage disk. Alternatively, you could return a mailable from the toMail
method:
use App\Mail\InvoicePaid as InvoicePaidMailable;
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return Mailable
*/
public function toMail($notifiable)
{
return (new InvoicePaidMailable($this->invoice))
->to($notifiable->email)
->attachFromStorage('/path/to/file');
}
Raw Data Attachments
The attachData
method may be used to attach a raw string of bytes as an attachment. When calling the attachData
method, you should provide the filename that should be assigned to the attachment:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->greeting('Hello!')
->attachData($this->pdf, 'name.pdf', [
'mime' => 'application/pdf',
]);
}
Previewing Mail Notifications
When designing a mail notification template, it is convenient to quickly preview the rendered mail message in your browser like a typical Blade template. For this reason, Laravel allows you to return any mail message generated by a mail notification directly from a route closure or controller. When a MailMessage
is returned, it will be rendered and displayed in the browser, allowing you to quickly preview its design without needing to send it to an actual email address:
use App\Models\Invoice;
use App\Notifications\InvoicePaid;
Route::get('/notification', function () {
$invoice = Invoice::find(1);
return (new InvoicePaid($invoice))
->toMail($invoice->user);
});
Markdown Mail Notifications
Markdown mail notifications allow you to take advantage of the pre-built templates of mail notifications, while giving you more freedom to write longer, customized messages. Since the messages are written in Markdown, Laravel is able to render beautiful, responsive HTML templates for the messages while also automatically generating a plain-text counterpart.
Generating The Message
To generate a notification with a corresponding Markdown template, you may use the --markdown
option of the make:notification
Artisan command:
php artisan make:notification InvoicePaid --markdown=mail.invoice.paid
Like all other mail notifications, notifications that use Markdown templates should define a toMail
method on their notification class. However, instead of using the line
and action
methods to construct the notification, use the markdown
method to specify the name of the Markdown template that should be used. An array of data you wish to make available to the template may be passed as the method's second argument:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$url = url('/invoice/'.$this->invoice->id);
return (new MailMessage)
->subject('Invoice Paid')
->markdown('mail.invoice.paid', ['url' => $url]);
}
Writing The Message
Markdown mail notifications use a combination of Blade components and Markdown syntax which allow you to easily construct notifications while leveraging Laravel's pre-crafted notification components:
@component('mail::message')
# Invoice Paid
Your invoice has been paid!
@component('mail::button', ['url' => $url])
View Invoice
@endcomponent
Thanks,<br>
{{ config('app.name') }}
@endcomponent
Button Component
The button component renders a centered button link. The component accepts two arguments, a url
and an optional color
. Supported colors are primary
, green
, and red
. You may add as many button components to a notification as you wish:
@component('mail::button', ['url' => $url, 'color' => 'green'])
View Invoice
@endcomponent
Panel Component
The panel component renders the given block of text in a panel that has a slightly different background color than the rest of the notification. This allows you to draw attention to a given block of text:
@component('mail::panel')
This is the panel content.
@endcomponent
Table Component
The table component allows you to transform a Markdown table into an HTML table. The component accepts the Markdown table as its content. Table column alignment is supported using the default Markdown table alignment syntax:
@component('mail::table')
| Laravel | Table | Example |
| ------------- |:-------------:| --------:|
| Col 2 is | Centered | $10 |
| Col 3 is | Right-Aligned | $20 |
@endcomponent
Customizing The Components
You may export all of the Markdown notification components to your own application for customization. To export the components, use the vendor:publish
Artisan command to publish the laravel-mail
asset tag:
php artisan vendor:publish --tag=laravel-mail
This command will publish the Markdown mail components to the resources/views/vendor/mail
directory. The mail
directory will contain an html
and a text
directory, each containing their respective representations of every available component. You are free to customize these components however you like.
Customizing The CSS
After exporting the components, the resources/views/vendor/mail/html/themes
directory will contain a default.css
file. You may customize the CSS in this file and your styles will automatically be in-lined within the HTML representations of your Markdown notifications.
If you would like to build an entirely new theme for Laravel's Markdown components, you may place a CSS file within the html/themes
directory. After naming and saving your CSS file, update the theme
option of the mail
configuration file to match the name of your new theme.
To customize the theme for an individual notification, you may call the theme
method while building the notification's mail message. The theme
method accepts the name of the theme that should be used when sending the notification:
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->theme('invoice')
->subject('Invoice Paid')
->markdown('mail.invoice.paid', ['url' => $url]);
}
Database Notifications
Prerequisites
The database
notification channel stores the notification information in a database table. This table will contain information such as the notification type as well as a JSON data structure that describes the notification.
You can query the table to display the notifications in your application's user interface. But, before you can do that, you will need to create a database table to hold your notifications. You may use the notifications:table
command to generate a migration with the proper table schema:
php artisan notifications:table
php artisan migrate
Formatting Database Notifications
If a notification supports being stored in a database table, you should define a toDatabase
or toArray
method on the notification class. This method will receive a $notifiable
entity and should return a plain PHP array. The returned array will be encoded as JSON and stored in the data
column of your notifications
table. Let's take a look at an example toArray
method:
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'invoice_id' => $this->invoice->id,
'amount' => $this->invoice->amount,
];
}
toDatabase
Vs. toArray
The toArray
method is also used by the broadcast
channel to determine which data to broadcast to your JavaScript powered frontend. If you would like to have two different array representations for the database
and broadcast
channels, you should define a toDatabase
method instead of a toArray
method.
Accessing The Notifications
Once notifications are stored in the database, you need a convenient way to access them from your notifiable entities. The Illuminate\Notifications\Notifiable
trait, which is included on Laravel's default App\Models\User
model, includes a notifications
Eloquent relationship that returns the notifications for the entity. To fetch notifications, you may access this method like any other Eloquent relationship. By default, notifications will be sorted by the created_at
timestamp with the most recent notifications at the beginning of the collection:
$user = App\Models\User::find(1);
foreach ($user->notifications as $notification) {
echo $notification->type;
}
If you want to retrieve only the "unread" notifications, you may use the unreadNotifications
relationship. Again, these notifications will be sorted by the created_at
timestamp with the most recent notifications at the beginning of the collection:
$user = App\Models\User::find(1);
foreach ($user->unreadNotifications as $notification) {
echo $notification->type;
}
{tip} To access your notifications from your JavaScript client, you should define a notification controller for your application which returns the notifications for a notifiable entity, such as the current user. You may then make an HTTP request to that controller's URL from your JavaScript client.
Marking Notifications As Read
Typically, you will want to mark a notification as "read" when a user views it. The Illuminate\Notifications\Notifiable
trait provides a markAsRead
method, which updates the read_at
column on the notification's database record:
$user = App\Models\User::find(1);
foreach ($user->unreadNotifications as $notification) {
$notification->markAsRead();
}
However, instead of looping through each notification, you may use the markAsRead
method directly on a collection of notifications:
$user->unreadNotifications->markAsRead();
You may also use a mass-update query to mark all of the notifications as read without retrieving them from the database:
$user = App\Models\User::find(1);
$user->unreadNotifications()->update(['read_at' => now()]);
You may delete
the notifications to remove them from the table entirely:
$user->notifications()->delete();
Broadcast Notifications
Prerequisites
Before broadcasting notifications, you should configure and be familiar with Laravel's event broadcasting services. Event broadcasting provides a way to react to server-side Laravel events from your JavaScript powered frontend.
Formatting Broadcast Notifications
The broadcast
channel broadcasts notifications using Laravel's event broadcasting services, allowing your JavaScript powered frontend to catch notifications in realtime. If a notification supports broadcasting, you can define a toBroadcast
method on the notification class. This method will receive a $notifiable
entity and should return a BroadcastMessage
instance. If the toBroadcast
method does not exist, the toArray
method will be used to gather the data that should be broadcast. The returned data will be encoded as JSON and broadcast to your JavaScript powered frontend. Let's take a look at an example toBroadcast
method:
use Illuminate\Notifications\Messages\BroadcastMessage;
/**
* Get the broadcastable representation of the notification.
*
* @param mixed $notifiable
* @return BroadcastMessage
*/
public function toBroadcast($notifiable)
{
return new BroadcastMessage([
'invoice_id' => $this->invoice->id,
'amount' => $this->invoice->amount,
]);
}
Broadcast Queue Configuration
All broadcast notifications are queued for broadcasting. If you would like to configure the queue connection or queue name that is used to queue the broadcast operation, you may use the onConnection
and onQueue
methods of the BroadcastMessage
:
return (new BroadcastMessage($data))
->onConnection('sqs')
->onQueue('broadcasts');
Customizing The Notification Type
In addition to the data you specify, all broadcast notifications also have a type
field containing the full class name of the notification. If you would like to customize the notification type
, you may define a broadcastType
method on the notification class:
use Illuminate\Notifications\Messages\BroadcastMessage;
/**
* Get the type of the notification being broadcast.
*
* @return string
*/
public function broadcastType()
{
return 'broadcast.message';
}
Listening For Notifications
Notifications will broadcast on a private channel formatted using a {notifiable}.{id}
convention. So, if you are sending a notification to an App\Models\User
instance with an ID of 1
, the notification will be broadcast on the App.Models.User.1
private channel. When using Laravel Echo, you may easily listen for notifications on a channel using the notification
method:
Echo.private('App.Models.User.' + userId)
.notification((notification) => {
console.log(notification.type);
});
Customizing The Notification Channel
If you would like to customize which channel that an entity's broadcast notifications are broadcast on, you may define a receivesBroadcastNotificationsOn
method on the notifiable entity:
<?php
namespace App\Models;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* The channels the user receives notification broadcasts on.
*
* @return string
*/
public function receivesBroadcastNotificationsOn()
{
return 'users.'.$this->id;
}
}
SMS Notifications
Prerequisites
Sending SMS notifications in Laravel is powered by Vonage (formerly known as Nexmo). Before you can send notifications via Vonage, you need to install the laravel/nexmo-notification-channel
and nexmo/laravel
Composer packages
composer require laravel/nexmo-notification-channel nexmo/laravel
The nexmo/laravel
package includes its own configuration file. However, you are not required to export this configuration file to your own application. You can simply use the NEXMO_KEY
and NEXMO_SECRET
environment variables to set your Vonage public and secret key.
Next, you will need to add a nexmo
configuration entry to your config/services.php
configuration file. You may copy the example configuration below to get started:
'nexmo' => [
'sms_from' => '15556666666',
],
The sms_from
option is the phone number that your SMS messages will be sent from. You should generate a phone number for your application in the Vonage control panel.
Formatting SMS Notifications
If a notification supports being sent as an SMS, you should define a toNexmo
method on the notification class. This method will receive a $notifiable
entity and should return an Illuminate\Notifications\Messages\NexmoMessage
instance:
/**
* Get the Vonage / SMS representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\NexmoMessage
*/
public function toNexmo($notifiable)
{
return (new NexmoMessage)
->content('Your SMS message content');
}
Unicode Content
If your SMS message will contain unicode characters, you should call the unicode
method when constructing the NexmoMessage
instance:
/**
* Get the Vonage / SMS representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\NexmoMessage
*/
public function toNexmo($notifiable)
{
return (new NexmoMessage)
->content('Your unicode message')
->unicode();
}
Formatting Shortcode Notifications
Laravel also supports sending shortcode notifications, which are pre-defined message templates in your Vonage account. To send a shortcode SMS notification, you should define a toShortcode
method on your notification class. From within this method, you may return an array specifying the type of notification (alert
, 2fa
, or marketing
) as well as the custom values that will populate the template:
/**
* Get the Vonage / Shortcode representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toShortcode($notifiable)
{
return [
'type' => 'alert',
'custom' => [
'code' => 'ABC123',
];
];
}
{tip} Like routing SMS Notifications, you should implement the
routeNotificationForShortcode
method on your notifiable model.
Customizing The "From" Number
If you would like to send some notifications from a phone number that is different from the phone number specified in your config/services.php
file, you may call the from
method on a NexmoMessage
instance:
/**
* Get the Vonage / SMS representation of the notification.
*
* @param mixed $notifiable
* @return NexmoMessage
*/
public function toNexmo($notifiable)
{
return (new NexmoMessage)
->content('Your SMS message content')
->from('15554443333');
}
Routing SMS Notifications
To route Vonage notifications to the proper phone number, define a routeNotificationForNexmo
method on your notifiable entity:
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Nexmo channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForNexmo($notification)
{
return $this->phone_number;
}
}
Slack Notifications
Prerequisites
Before you can send notifications via Slack, you must install the Slack notification channel via Composer:
composer require laravel/slack-notification-channel
You will also need to configure an "Incoming Webhook" integration for your Slack team. This integration will provide you with a URL you may use when routing Slack notifications.
Formatting Slack Notifications
If a notification supports being sent as a Slack message, you should define a toSlack
method on the notification class. This method will receive a $notifiable
entity and should return an Illuminate\Notifications\Messages\SlackMessage
instance. Slack messages may contain text content as well as an "attachment" that formats additional text or an array of fields. Let's take a look at a basic toSlack
example:
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Message\SlackMessage
*/
public function toSlack($notifiable)
{
return (new SlackMessage)
->content('One of your invoices has been paid!');
}
Customizing The Sender & Recipient
You may use the from
and to
methods to customize the sender and recipient. The from
method accepts a username and emoji identifier, while the to
method accepts a channel or username:
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\SlackMessage
*/
public function toSlack($notifiable)
{
return (new SlackMessage)
->from('Ghost', ':ghost:')
->to('#bots')
->content('This will be sent to #bots');
}
You may also use an image as your from "logo" instead of an emoji:
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\SlackMessage
*/
public function toSlack($notifiable)
{
return (new SlackMessage)
->from('Laravel')
->image('https://laravel.com/img/favicon/favicon.ico')
->content('This will display the Laravel logo next to the message');
}
Slack Attachments
You may also add "attachments" to Slack messages. Attachments provide richer formatting options than simple text messages. In this example, we will send an error notification about an exception that occurred in an application, including a link to view more details about the exception:
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\SlackMessage
*/
public function toSlack($notifiable)
{
$url = url('/exceptions/'.$this->exception->id);
return (new SlackMessage)
->error()
->content('Whoops! Something went wrong.')
->attachment(function ($attachment) use ($url) {
$attachment->title('Exception: File Not Found', $url)
->content('File [background.jpg] was not found.');
});
}
Attachments also allow you to specify an array of data that should be presented to the user. The given data will be presented in a table-style format for easy reading:
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return SlackMessage
*/
public function toSlack($notifiable)
{
$url = url('/invoices/'.$this->invoice->id);
return (new SlackMessage)
->success()
->content('One of your invoices has been paid!')
->attachment(function ($attachment) use ($url) {
$attachment->title('Invoice 1322', $url)
->fields([
'Title' => 'Server Expenses',
'Amount' => '$1,234',
'Via' => 'American Express',
'Was Overdue' => ':-1:',
]);
});
}
Markdown Attachment Content
If some of your attachment fields contain Markdown, you may use the markdown
method to instruct Slack to parse and display the given attachment fields as Markdown formatted text. The values accepted by this method are: pretext
, text
, and / or fields
. For more information about Slack attachment formatting, check out the Slack API documentation:
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
* @return SlackMessage
*/
public function toSlack($notifiable)
{
$url = url('/exceptions/'.$this->exception->id);
return (new SlackMessage)
->error()
->content('Whoops! Something went wrong.')
->attachment(function ($attachment) use ($url) {
$attachment->title('Exception: File Not Found', $url)
->content('File [background.jpg] was *not found*.')
->markdown(['text']);
});
}
Routing Slack Notifications
To route Slack notifications to the proper Slack team and channel, define a routeNotificationForSlack
method on your notifiable entity. This should return the webhook URL to which the notification should be delivered. Webhook URLs may be generated by adding an "Incoming Webhook" service to your Slack team:
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Slack channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForSlack($notification)
{
return 'https://hooks.slack.com/services/...';
}
}
Localizing Notifications
Laravel allows you to send notifications in a locale other than the HTTP request's current locale, and will even remember this locale if the notification is queued.
To accomplish this, the Illuminate\Notifications\Notification
class offers a locale
method to set the desired language. The application will change into this locale when the notification is being evaluated and then revert back to the previous locale when evaluation is complete:
$user->notify((new InvoicePaid($invoice))->locale('es'));
Localization of multiple notifiable entries may also be achieved via the Notification
facade:
Notification::locale('es')->send(
$users, new InvoicePaid($invoice)
);
User Preferred Locales
Sometimes, applications store each user's preferred locale. By implementing the HasLocalePreference
contract on your notifiable model, you may instruct Laravel to use this stored locale when sending a notification:
use Illuminate\Contracts\Translation\HasLocalePreference;
class User extends Model implements HasLocalePreference
{
/**
* Get the user's preferred locale.
*
* @return string
*/
public function preferredLocale()
{
return $this->locale;
}
}
Once you have implemented the interface, Laravel will automatically use the preferred locale when sending notifications and mailables to the model. Therefore, there is no need to call the locale
method when using this interface:
$user->notify(new InvoicePaid($invoice));
Notification Events
When a notification is sent, the Illuminate\Notifications\Events\NotificationSent
event is fired by the notification system. This contains the "notifiable" entity and the notification instance itself. You may register listeners for this event in your EventServiceProvider
:
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'Illuminate\Notifications\Events\NotificationSent' => [
'App\Listeners\LogNotification',
],
];
{tip} After registering listeners in your
EventServiceProvider
, use theevent:generate
Artisan command to quickly generate listener classes.
Within an event listener, you may access the notifiable
, notification
, and channel
properties on the event to learn more about the notification recipient or the notification itself:
/**
* Handle the event.
*
* @param \Illuminate\Notifications\Events\NotificationSent $event
* @return void
*/
public function handle(NotificationSent $event)
{
// $event->channel
// $event->notifiable
// $event->notification
// $event->response
}
Custom Channels
Laravel ships with a handful of notification channels, but you may want to write your own drivers to deliver notifications via other channels. Laravel makes it simple. To get started, define a class that contains a send
method. The method should receive two arguments: a $notifiable
and a $notification
.
Within the send
method, you may call methods on the notification to retrieve a message object understood by your channel and then send the notification to the $notifiable
instance however you wish:
<?php
namespace App\Channels;
use Illuminate\Notifications\Notification;
class VoiceChannel
{
/**
* Send the given notification.
*
* @param mixed $notifiable
* @param \Illuminate\Notifications\Notification $notification
* @return void
*/
public function send($notifiable, Notification $notification)
{
$message = $notification->toVoice($notifiable);
// Send notification to the $notifiable instance...
}
}
Once your notification channel class has been defined, you may return the class name from the via
method of any of your notifications. In this example, the toVoice
method of your notification can return whatever object you choose to represent voice messages. For example, you might define your own VoiceMessage
class to represent these messages:
<?php
namespace App\Notifications;
use App\Channels\Messages\VoiceMessage;
use App\Channels\VoiceChannel;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification
{
use Queueable;
/**
* Get the notification channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return [VoiceChannel::class];
}
/**
* Get the voice representation of the notification.
*
* @param mixed $notifiable
* @return VoiceMessage
*/
public function toVoice($notifiable)
{
// ...
}
}


Who will be responsible for the purchasing of goods?
Select Supplier
{{ selectedSupplierItem?.name }}
Supplier Support Notes
These notes are for the supplier and will be visible on the referral PDF.


That one was a quite incredible opportunity. Why? Let me explain.
C-c-combo breaker in the form of well, Parsons unit of study, yet in collaboration with students from different departments and a project in collaboration with... I think either primary or middle school kids from New Jersey. A project that was worked on had a strongly environmental outline and execution happened in a... New Jersey park for people to interact with during a specific fair. You think that's it? Well, let's keep going..
The project in the end was a 360 experience positioned in a dome executed from a single projector, a Unity environment and was to be experienced with 3D glasses to experience different spectra of the polluted world. We had to build the dome ourselves from pre-fabricated items. There was lots of hoops to jump through and working on this was very extensive by the end of the semester as I had to spend a massive amount tweaking lots of different assets and making sure it all works and that if I dropped out for some reason, sickness or armaggeddon or whatever, that it all went smoothly.
And holy guacamole it did all turn out quite great in the end. One may say and I could say that hey, this was a bit low-fi experience but having had experience with projection mappings and such + the other work I was involved with and a lot of other things going on and my eyes and brains being dead by the end of the semester... I still think it all turned out quite surprisingly well.
And it was work on something one-of-a-kind with great teachers.


Please enter Username/Password
Schemes
CouponsPublished to Callhealth consumers, not tied with any pre-rule. e.g., Women-Care to offer substantial discount on Women's day
Gift CardsCCOs often find a need to resolve Consumer grievances. With a gift card, they have resolutions in hand
Schemes, or Add-OnsA long time, Complex healthcare product that covers every choice possible. |
Please enter Username/Password |


Web Developer Examples & Resources
by Nora
WEB110
BIG
Research
Accessibility
SMO
HTML Forms
Lightbox II Gallery
Google Tools
SEO
Calendar
Map
Contact
Lightbox II Gallery
Violet's Attic
The Champagne Widow
Hotel Nordo


HEAD ======= <<<<<<< HEAD >>>>>>> f57e6ae079db3192a5701f6dcbe3223465f12be8
New Dentist
First Name
Last Name
Treatment
Qualification
Experience
Contact Number
Email Id
Please fill the patient email id
This is not a valid email.
Speciality
Consultant
Admin Email Id
Rating
<<<<<<< HEAD ======= ======= >>>>>>> f57e6ae079db3192a5701f6dcbe3223465f12be8
>>>>>>> 3f230c6b331f02a2ca632f31379b0e1aa3612386
New Personal
First Name
Last Name
Contact Number
Email Id
Treatment
Consultant
Speciality
Experience
Rating


Jimenez keeps up hot streak as Wolves win at Bournemouth 2-1
by The Associated PressBOURNEMOUTH, England (AP) — Raul Jimenez continued his red-hot scoring streak as in-form Wolverhampton made it eight games unbeaten in the English Premier League with a 2-1 win at 10-man Bournemouth on Saturday.
The Mexico striker claimed his sixth goal in seven games to double Wolves’ lead after Joao Moutinho opened the scoring at Vitality Stadium with a superb free kick.
Bournemouth played 53 minutes a man down after captain Simon Francis was sent off in his first top-flight start for 11 months. His team pulled a goal back in the second half, though, through Steve Cook but was unable to salvage a point.
Victory for Nuno Espirito Santo’s visitors lifted them to fifth place in the table ahead of Thursday’s Europa League game at Braga.
Bournemouth dropped to 11th after just one win from seven league fixtures.
___
More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports
The Associated Press


Learn how to style images using CSS.
Use the border-radius
property to create rounded images:
Rounded Image:
img {
border-radius: 8px;
}
Circled Image:
img {
border-radius: 50%;
}
Use the border
property to create thumbnail images.
Thumbnail Image:
img {
border: 1px solid #ddd;
border-radius: 4px;
padding: 5px;
}
<img src="paris.jpg" alt="Paris">
Responsive images will automatically adjust to fit the size of the screen.
Resize the browser window to see the effect:
If you want an image to scale down if it has to, but never scale up to be larger than its original size, add the following:
img {
max-width: 100%;
height: auto;
}
How to position text in an image:
The Troll's tongue in Hardanger, Norway
Northern Lights in Norway
div.polaroid {
width: 80%;
background-color: white;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
img {width: 100%}
div.container {
text-align: center;
padding: 10px 20px;
}
The CSS filter
property adds visual effects (like blur and saturation) to an element.
Note: This property is not supported in Internet Explorer.
Change the color of all images to black and white (100% gray):
img {
-webkit-filter: grayscale(100%); /* Chrome, Safari, Opera */
filter: grayscale(100%);
}
Note: The filter property is not supported in Internet Explorer.
CSS can be used to create image galleries. This example use media queries to re-arrange the images on different screen sizes. Resize the browser window to see the effect:
.responsive {
padding: 0 6px;
float: left;
width: 24.99999%;
}
@media only screen and (max-width: 700px){
.responsive {
width: 49.99999%;
margin: 6px 0;
}
}
@media only screen and (max-width: 500px){
.responsive {
width: 100%;
}
}
This is an example to demonstrate how CSS and JavaScript can work together.
First, use CSS to create a modal window (dialog box), and hide it by default.
Then, use a JavaScript to show the modal window and to display the image inside the modal, when a user clicks on the image:
// Get the modal
var modal = document.getElementById('myModal');
// Get the image and insert it inside the modal - use its "alt" text as a caption
var img = document.getElementById('myImg');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
modalImg.alt = this.alt;
captionText.innerHTML = this.alt;
}
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}


My name is Bryce Payne. I have been learning to code via Codeup's full stack development course. This is a simple test and practice page. I am using this to test how my code and style functions and learn best practices.
My hobbies include:


network-admin(1) network-admin(1) NAME network-admin - Network Administration Tool SYNOPSIS network-admin [OPTION...] DESCRIPTION network-admin is part of the GNOME system tools, a set of tools to easily access and manage system configuration. network-admin allows you to specify the way your system connects to other computers and to the Internet. OPTIONS --display=DISPLAY X display to use network-admin also accepts the standard GNOME and GTK options. AUTHORS network-admin was written by Carlos Garnacho Parro <garnacho@tux‐ erver.net> and others. This manual page was written by Sven Arvidsson<EMAIL_ADDRESS>for the Debian project (but may be used by others). SEE ALSO services-admin(1), shares-admin(1), time-admin(1), users-admin(1), gtk- options(7), gnome-options(7) The online documentation available through the program's Help menu. GNOME 2007-05-08 network-admin(1)


This is a manual attendace entry interface
please click the "lastname" button first and then and olny then the "update" button


Members
artist
The artist of the song (can be unknown)
location
The physical location of the song
title
The title of the song (can be unknown)
type
Constant "song"
uri
The uri of this song
Methods
(static) fromUri()
Parses a song from a given uri


Hello and thank you for visiting my webpage.
I am a native Oregonian who grew up in the suburbs of Portland and I enjoy everything my beautifull state has to offer. For more about my hobbies as well as links to the projects I've worked on please scroll down.
I am currently a student at epicodus and in the process of learning the basics of computer coding. By the end of my first course I will have a basic understanding of the following applications:
Thank you for visiting my webpage.
Please check back frequently as I will be updating this webpage on a continual basis!


#{extends 'main.html' /} #{set title:'Online FAQs | details' /} #{if issue}
${issue.error}
${issue.solution}
Posted on ${issue.entry}
edit | delete
No FAQs exist. Create the first Online FAQ.


INDIAN INSTITUTE OF INFORMATION TECHNOLOGY KALYANI
Login
Home
Events
Sports
Singing
JobFair
TechFest
About
Facalty
Academics
Antiragging
Contacts
❮
❯
HOME
|
CONTACT US
2018 Indian Institute of Information Technology, Kalyani.All Rights Reserved.


Connector Pane
Remove Module
Removes a MLua module from the provided MLua instance. Before the removal, the "__remove" command is issued which provides it with the option to return a Lua script. This script gets executed before the module is removed from the module list.
Parameter(s)
-----------------
- MLua in: Reference to the MLua instance.
- Name: The name of the MLua module to be removed.
- ms timeout (-1): The time to wait for the MLua reference to become available. A value of '-1' specifies an infinite timeout.
- error in: Describes error conditions that occur before this VI runs. This input provides standard error in functionality.
- MLua out: Reference to the MLua instance.
- error out: Contains error information. This output provides standard error out functionality.


{include file="public/header-two" /} {include file="public/location-two" /}
Service mode
Environmental protection design
源于欧洲，为品质提供坚实的基础
High standard home
Speed quotation


TJC is a Tcl to Java converter and compiler. TJC accepts Tcl source
code and translates proc
declarations to Java source
code. Generated Java source is then compiled to Java bytecode.
The TJC compiler supports two operational modes, batch mode and runtime
mode.
In batch mode, a user invokes the tjc
executable
on the command line and passes a .tjc
module file name.
TJC scans a set of .tcl
files looking for proc declarations
and then converts the discovered Tcl procs to Java source code
that implements the equivalent operations. Generated Java source code is
compiled with javac
, then both the generated source code and
bytecode are stored in a JAR file.
Usage:
tjc module.tjc ?module.tjc ...?
The TJC compiler loads JDK configuration information from a file named
jdk.cfg
. This JDK configuration file must be saved in the
bin/
directory where tjc executable is installed.
See JDK Config File for more info about
the contents of a JDK config file.
Processing a module file generates a pair of JAR
files. The first JAR file contains compiled Java class files and
modified Tcl scripts. The second JAR file contains generated
Java source code and unmodified Tcl scripts.
For example, a module file xyz.tjc
will generate
xyzsrc.jar
and xyz.jar
. A TJC module
file indicates which Tcl source files will be read and compiled
by tjc
. See Module File
for more info about the contents of a module file.
A set of Tcl scripts and compiled proc implementations packaged inside
a JAR file is known as a tjc package. A tjc package is loaded into
Jacl by adding a generated JAR file to the CLASSPATH
and then invoking the TJC::package
Tcl command to load compiled commands
into the shell. See TJC package manual for more info.
The TJC compiler supports a runtime mode that makes it easy to
define a Tcl proc
in an interpreter and compile
directly to Java bytecode. The TJC compiler runs in a second
thread, waiting for compile requests from the TJC::compile
command. When a Tcl proc has been compiled, the original
proc is relaced with the compiled implementation.
TJC makes use of the excellent
Janino
embedded Java compiler to convert generated Java source code
to Java bytecode.
In most cases, runtime mode is easier to use
since one need not create a module file
or modify the CLASSPATH
. Batch
mode may be preferrable when a large number of
Tcl procs need to be compiled, since compiling
a lot of Tcl procs can take some time.
Users should note that Jacl does not compile
Tcl procs into Java bytecode by default, the user must
explicitly indicate which procs should be compiled.
See the TJC package manual
for more info.
See Simple Example for a step by step walk
through of using the TJC executable and TJC package to compile and load
a compiled Tcl proc
.
See Generated Code Example for examples of
Java source generated by the TJC compiler.
See Writing
Optimal Code for some general Tcl optimization tips and
preferred command usages.
See Future Improvements for a description
of features that could be implemented in a future release.


You must log into the database as Pat before proceeding with this page.
The exported data from the audit logs either can be reviewed as a plain text or loaded into database tables and then analyzed using the SQL statements. Before we can work with the audit data in database tables, we need to create the actual tables to hold the data.
From data security perspective, these tables should be created in a separate schema and access to these tables should be restricted only to authorized users, for example, users holding SYSADM or SECADM authorities.
The SECADM creates the audit tables to hold the audited data.


--- layout: paper title: Publications --- Improving the accuracy and Efficiency of MAP Inference for Markov Logic, , Proceedings of the 24th Annual Conference on Uncertainty in AI (UAI) 2008 [pdf]
@inproceedings{riedel08improving, pages={468--475}, year={2008}, author={Sebastian Riedel}, bdsk-url-1={http://citeseerx.ist.psu.edu/viewdoc/download?doi=<IP_ADDRESS>.7914&rep=rep1&type=pdf}, booktitle={Proceedings of the 24th Annual Conference on Uncertainty in AI (UAI)}, title={Improving the accuracy and Efficiency of MAP Inference for Markov Logic}, }


Do you like Chess, Go, Abalone, Words With Friends or QuizDuell? Then here's a game for you.
There are two simple rules: Push the red pieces off the board and capture both goals. Easy to learn but hard to master.
Stay sharp by competing with players from all over the world. Stay in touch with your friends by challenging them to play.
Position your purple pieces. Push the red pieces off the board. And capture the goals first. That's it. You’ll pick up the rules in seconds - especially if you have played Go, Checkers or Abalone.
Plan your moves in your own time and relax. You have up to 48 hours to decide on the best course of action. Just like in Correspondence Chess, Words with Friends or QuizDuell.
You can play dozens of games at the same time, whenever and wherever you find time to play. Play casual games with friends or compete with the best players in the world.
Make a plan and execute it - no streak of bad luck can interfere. Challenge your mind to get better. Practice your long-term planning, spatial orientation and memory.


{% extends '_layouts/layout.html' %} {% block page_title %} {% endblock %} {% block body_css_classes %}nhs-redesign{% endblock %} {% block content %}
Based on your answers we think you need medical help. Speaking to a nurse can help you decide what to do next. The nurse will tell you:
If you don't want a call from the nurse, we can show you places to go instead. This may mean a longer wait.


Quality Attribute Templates
Here are all quality attribute templates listed.
Each quality attribute template is automatically added to the Standard Catalog. Since these templates can also
be linked in catalogs, you have to keep in mind that when you change the template there are some checks:
-
when only options inside variables (ranges, options in dropdowns, default values) change, there will be
only a change in the Standard Catalog.
-
when the description itself changes, there will be a new version of the template. This means that every catalog
which has this template inside will get the new version of the template in it.
Projects which have been
already
created will not get the updated version of the template and remain the same.


100% Pure natural Honey
for all your healthy dietary needs, look no further
than KAY-BEE pure honey, straight out of the honeycomb
with pure natural honey produced and packaged by KAYLAI (NIG.) CO.
KAY-BEE pure honey is pure natural honey which has several incredible properties that set it apart from all other food products.
Even world reknowned Chefs swear by the distinctive taste of KAY-BEE pure honey with its appeal of organic chemical properties ideal for baking and responsible for the distinctive flavor when used as a sweetener.
It is great tasting goodness from Mother Nature's kitchen
KAY-BEE pure honey has been hygienically sourced from nature, to bring you all the nourishing goodness and healing properties only natural honey can bestow!
At KAYLAI, we are dedicated to a zero preservatives policy
Proudly made in Nigeria, KAYLAI stakes her impeccable integrity on bringing you dollops of golden heaven exactly as nature intended
KAY-BEE pure honey offers you the very best of what makes Honey the palate queen
pastries, beverages or as a seasoning, honey rocks for sweetening!
no chemical additives or preservatives necessary; it's just naturally amazing!
just like "black don't crack", honey stays golden!
from burns to bruises, you just cannot exhaust honey's uses!
If you know your way around the kitchen, Honey goes well with anything!
the uses of honey are inexhaustible, making it the ultimate consumable!
Reach out to us today and book your supply of 100% Pure Natural Honey


# -*- coding: utf-8 -*-
"""Python API object representation of the Tanium SOAP API.
Each of these objects is manually generated as the Tanium SOAP API WSDL does not document them.
* Last updated on: 2017-02-16 at 22:40:32 UTC
* Tanium Platform version: 7.0.314.6350
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
from . import models
IS_PY2 = sys.version_info[0] == 2
STR = unicode if IS_PY2 else str # noqa
[docs]class ResultSetList(models.ListObject):
"""Tanium SOAP XML element ``result_sets`` Python object.
This object type behaves like a Python list type, and uses ``_LIST_ATTR`` to store the actual list.
Attributes
----------
result_set : :obj:`list` of :obj:`ResultSet`
* Attribute that holds the Python list for this ListObject.
now : :obj:`STR`
* Simple attribute that holds a python internal object type.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
Example result_sets XML:
<result_sets>
<now>2017/02/16 01:27:13 GMT-0000</now>
<result_set>SEE ResultSet XML Example</result_set>
</result_sets>
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "result_sets"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self._LIST_ATTR = "result_set"
"""The attribute that stores the actual list object."""
self._LIST_TYPE = ResultSet
"""The type of members that should be found in _LIST_ATTR."""
self.result_set = []
"""List attribute for this object."""
self.now = None
"""Simple property that should contain a python object type :obj:`STR`."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
self._SIMPLE["now"] = STR
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ListObject.__init__(self, **kwargs)
[docs]class ResultInfoList(models.ListObject):
"""Tanium SOAP XML element ``result_infos`` Python object.
This object type behaves like a Python list type, and uses ``_LIST_ATTR`` to store the actual list.
Attributes
----------
result_info : :obj:`list` of :obj:`ResultInfo`
* Attribute that holds the Python list for this ListObject.
now : :obj:`STR`
* Simple attribute that holds a python internal object type.
max_available_age : :obj:`int`
* Simple attribute that holds a python internal object type.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
Example result_infos XML:
<result_infos>
<now>2017/02/16 02:27:09 GMT-0000</now>
<max_available_age>0</max_available_age>
<result_info>SEE ResultInfo XML Example</result_info>
</result_infos>
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "result_infos"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self._LIST_ATTR = "result_info"
"""The attribute that stores the actual list object."""
self._LIST_TYPE = ResultInfo
"""The type of members that should be found in _LIST_ATTR."""
self.result_info = []
"""List attribute for this object."""
self.now = None
"""Simple property that should contain a python object type :obj:`STR`."""
self.max_available_age = None
"""Simple property that should contain a python object type :obj:`int`."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
self._SIMPLE["now"] = int
self._SIMPLE["max_available_age"] = int
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ListObject.__init__(self, **kwargs)
[docs]class ColumnList(models.ListObject):
"""Tanium SOAP XML element ``cs`` Python object.
This object type behaves like a Python list type, and uses ``_LIST_ATTR`` to store the actual list.
Attributes
----------
columns : :obj:`list` of :obj:`Column`
* Attribute that holds the Python list for this ListObject.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "cs"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self._LIST_ATTR = "columns"
"""The attribute that stores the actual list object."""
self._LIST_TYPE = Column
"""The type of members that should be found in _LIST_ATTR."""
self.columns = []
"""List attribute for this object."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
# no simple properties defined for this object
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ListObject.__init__(self, **kwargs)
[docs]class RowList(models.ListObject):
"""Tanium SOAP XML element ``rs`` Python object.
This object type behaves like a Python list type, and uses ``_LIST_ATTR`` to store the actual list.
Attributes
----------
rows : :obj:`list` of :obj:`Row`
* Attribute that holds the Python list for this ListObject.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "rs"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self._LIST_ATTR = "rows"
"""The attribute that stores the actual list object."""
self._LIST_TYPE = Row
"""The type of members that should be found in _LIST_ATTR."""
self.rows = []
"""List attribute for this object."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
# no simple properties defined for this object
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ListObject.__init__(self, **kwargs)
[docs]class Row(models.ListObject):
"""Tanium SOAP XML element ``r`` Python object.
This object type behaves like a Python list type, and uses ``_LIST_ATTR`` to store the actual list.
Attributes
----------
columns : :obj:`list` of :obj:`Column`
* Attribute that holds the Python list for this ListObject.
id : :obj:`int`
* Simple attribute that holds a python internal object type.
cid : :obj:`int`
* Simple attribute that holds a python internal object type.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "r"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self._LIST_ATTR = "columns"
"""The attribute that stores the actual list object."""
self._LIST_TYPE = Column
"""The type of members that should be found in _LIST_ATTR."""
self.columns = []
"""List attribute for this object."""
self.id = None
"""Simple property that should contain a python object type :obj:`int`."""
self.cid = None
"""Simple property that should contain a python object type :obj:`int`."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
self._SIMPLE["id"] = int
self._SIMPLE["cid"] = int
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ListObject.__init__(self, **kwargs)
[docs]class RowColumn(models.ListObject):
"""Tanium SOAP XML element ``c`` Python object.
This object type behaves like a Python list type, and uses ``_LIST_ATTR`` to store the actual list.
Attributes
----------
values : :obj:`list` of :obj:`Value`
* Attribute that holds the Python list for this ListObject.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "c"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self._LIST_ATTR = "values"
"""The attribute that stores the actual list object."""
self._LIST_TYPE = Value
"""The type of members that should be found in _LIST_ATTR."""
self.values = []
"""List attribute for this object."""
self.wh = None
"""Simple property that should contain a python object type :obj:`int`."""
self.dn = None
"""Simple property that should contain a python object type :obj:`STR`."""
self.rt = None
"""Simple property that should contain a python object type :obj:`int`."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
self._SIMPLE["wh"] = int
self._SIMPLE["dn"] = STR
self._SIMPLE["rt"] = int
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ListObject.__init__(self, **kwargs)
[docs]class ResultInfo(models.BasicObject):
"""Tanium SOAP XML element ``result_info`` Python object.
This is a regular Python object.

Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.

This is a regular Python object.

Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.

This is a regular Python object.
Attributes
----------
wh : :obj:`int`
* Simple attribute that holds a python internal object type.
dn : :obj:`STR`
* Simple attribute that holds a python internal object type.
rt : :obj:`int`
* Simple attribute that holds a python internal object type.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
"""
CONSTANTS = [
{"name": "Hash", "value": 0, "value_type": int},
{"name": "String", "value": 1, "value_type": int},
{"name": "Version", "value": 2, "value_type": int},
{"name": "NumericDecimal", "value": 3, "value_type": int},
{"name": "BESDate", "value": 4, "value_type": int},
{"name": "IPAddress", "value": 5, "value_type": int},
{"name": "WMIDate", "value": 6, "value_type": int},
{"name": "TimeDiff", "value": 7, "value_type": int},
{"name": "DataSize", "value": 8, "value_type": int},
{"name": "NumericInteger", "value": 9, "value_type": int},
{"name": "VariousDate", "value": 10, "value_type": int},
{"name": "RegexMatch", "value": 11, "value_type": int},
{"name": "LastOperatorType", "value": 12, "value_type": int},
]
"""Constant values."""
_SOAP_TAG = "c"
"""XML tag to use when serializing/deserializing."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self.wh = None
"""Simple property that should contain a python object type :obj:`int`."""
self.dn = None
"""Simple property that should contain a python object type :obj:`STR`."""
self.rt = None
"""Simple property that should contain a python object type :obj:`int`."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
self._SIMPLE["wh"] = int
self._SIMPLE["dn"] = STR
self._SIMPLE["rt"] = int
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.BasicObject.__init__(self, **kwargs)
[docs]class Value(models.ValueObject):
"""Tanium SOAP XML element ``v`` Python object.
This is a regular Python object and represents the text and attributes for this element.
Attributes
----------
text : :obj:`STR`
* Simple attribute that holds the text for this element.
hash : :obj:`int`
* Simple attribute that holds the ``h`` attribute for this element.
Notes
-----
This element is not documented in the WSDL documentation, so this object is manually defined.
"""
CONSTANTS = [
# no constants defined for this object
]
"""Constant values."""
_SOAP_TAG = "v"
"""XML tag to use when serializing/deserializing."""
_SOAP_ATTR = {"h": "hash"}
"""List of element attributes to extract for this element."""
[docs] def __init__(self, **kwargs):
"""Constructor."""
self.text = None
"""Simple property that should contain a python object type :obj:`STR`."""
self.hash = None
"""Simple property that should contain a python object type :obj:`int`."""
self._SIMPLE = {}
"""Dict of simple properties that maps a class attribute to its expected type."""
self._SIMPLE["text"] = STR
self._SIMPLE["hash"] = int
self._COMPLEX = {}
"""Dict of complex properties that maps a class attribute to its expected type."""
# no complex properties defined for this object
models.ValueObject.__init__(self, **kwargs)
_RESULT_INFO_MAP = {"obj": ResultInfo, "children": []}
_VALUE_MAP = {"obj": Value, "children": []}
_ROW_COLUMN_MAP = {"obj": RowColumn, "children": [_VALUE_MAP]}
_ROW_MAP = {"obj": Row, "children": [_ROW_COLUMN_MAP]}
_ROWS_MAP = {"obj": RowList, "children": [_ROW_MAP]}
_COLUMN_MAP = {"obj": Column, "children": []}
_COLUMNS_MAP = {"obj": ColumnList, "children": [_COLUMN_MAP]}
_RESULT_SET_MAP = {"obj": ResultSet, "children": [_COLUMNS_MAP, _ROWS_MAP]}
API = {}
API["result_infos"] = {"obj": ResultInfoList, "children": [_RESULT_INFO_MAP]}
API["result_sets"] = {"obj": ResultSetList, "children": [_RESULT_SET_MAP]}
__all__ = [
"ResultSetList",
"ResultInfoList",
"ColumnList",
"RowList",
"Row",
"RowColumn",
"ResultInfo",
"ResultSet",
"Column",
"Value",
]


Main package for Nmote SMPP 5.0 API. This package contains all SMPP abstractions.
Session
represents a communication context for executing SMPP commands.
Link
transports SMPP PDUs between sessions.
Command
packs request and response PDUs in a single executable object.
*PDU
represents various SMPP PDUs (Protocol Data Units)
Processor
executes Commands
SMPPTime, SMPPDistributionList, SMPPAddress
represents various SMPP related values
For more information see Nmote SMPP 5.0.doc file


Bucket
public class Bucket
| Field Summary | |
|---|---|
| protected Client | Client |
| protected integer | DW-value |
| protected string | Bucket name |
| protected integer | R-Value |
| protected integer | W-value |
| Method Summary | |
|---|---|
| void | __construct(Client client, string name) Constructor |
| Object | get(string key, integer r) Retrieve a JSON-encoded object from Riak. |
| boolean | Retrieve the 'allow multiples' setting. |
| Object | getBinary(string key, integer r) Retrieve a binary/string object from Riak. |
| integer | getDW(integer dw) Get the DW-value for this bucket, if it is set, otherwise return the DW-value for the client. |
| array | getKeys() Retrieve an array of all keys in this bucket. |
| integer | getNVal() Retrieve the N-value for this bucket. |
| string | getName() Get name |
| array | Retrieve an associative array of all bucket properties. |
| mixed | getProperty(string key) Retrieve a bucket property. |
| integer | getR(integer r) Get the R-value for this bucket, if it is set, otherwise return the R-value for the client. |
| integer | getW(integer w) Get the W-value for this bucket, if it is set, otherwise return the W-value for the client. |
| Object | newBinary(string key, object data, string contentType) Create a new Riak object that will be stored as plain text/binary. |
| Object | newObject(string key, object data) Create a new Riak object that will be stored as JSON. |
| void | setAllowMultiples(boolean bool) If set to true, then writes with conflicting data will be stored and returned to the client. |
| Bucket | setDW(integer dw) Set the DW-value for this bucket. |
| void | setNVal(integer nval) Set the N-value for this bucket, which is the number of replicas that will be written of each object in the bucket. |
| void | setProperties(array props) Set multiple bucket properties in one call. |
| void | setProperty(string key, mixed value) Set a bucket property. |
| Bucket | setR(integer r) Set the R-value for this bucket. |
| Bucket | setW(integer w) Set the W-value for this bucket. |
protected Client $client
Client
protected integer $dw
DW-value
protected string $name
Bucket name
protected integer $r
R-Value
protected integer $w
W-value
public void __construct(Client client, string name)
Constructor
public Object get(string key, integer r)
Retrieve a JSON-encoded object from Riak.
public boolean getAllowMultiples()
Retrieve the 'allow multiples' setting.
public Object getBinary(string key, integer r)
Retrieve a binary/string object from Riak.
public integer getDW(integer dw)
Get the DW-value for this bucket, if it is set, otherwise return the DW-value for the client.
public array getKeys()
Retrieve an array of all keys in this bucket. Note: this operation is pretty slow.
public integer getNVal()
Retrieve the N-value for this bucket.
public string getName()
Get name
public array getProperties()
Retrieve an associative array of all bucket properties.
public mixed getProperty(string key)
Retrieve a bucket property.
public integer getR(integer r)
Get the R-value for this bucket, if it is set, otherwise return the R-value for the client.
public integer getW(integer w)
Get the W-value for this bucket, if it is set, otherwise return the W-value for the client.
public Object newBinary(string key, object data, string contentType)
Create a new Riak object that will be stored as plain text/binary.
public Object newObject(string key, object data)
Create a new Riak object that will be stored as JSON.
public void setAllowMultiples(boolean bool)
If set to true, then writes with conflicting data will be stored and returned to the client. This situation can be detected by calling hasSiblings() and getSiblings(). This should only be used if you know what you are doing.
public Bucket setDW(integer dw)
Set the DW-value for this bucket. get(...) and getBinary(...) operations that do not specify an DW-value will use this value.
public void setNVal(integer nval)
Set the N-value for this bucket, which is the number of replicas that will be written of each object in the bucket. Set this once before you write any data to the bucket, and never change it again, otherwise unpredictable things could happen. This should only be used if you know what you are doing.
public void setProperties(array props)
Set multiple bucket properties in one call. This should only be used if you know what you are doing.
public void setProperty(string key, mixed value)
Set a bucket property. This should only be used if you know what you are doing.
public Bucket setR(integer r)
Set the R-value for this bucket. get(...) and getBinary(...) operations that do not specify an R-value will use this value.
public Bucket setW(integer w)
Set the W-value for this bucket. get(...) and getBinary(...) operations that do not specify an W-value will use this value.
The \Riak\Bucket object allows you to access and change information about a Riak bucket, and provides methods to create or retrieve objects within the bucket.


 I was 16, pretty into ecstacy, had an eating disorder (hence the low weight at the time) and had recently left a psych unit. My friend who I will call S came across these seeds and said they were good, so I tried them as I felt like doing something new.
The first thing I have to say is they taste VILE. I chewed them with sultanas which disguised the taste pretty well but put me off sultanas for quite a long time afterwards. Although S was with me most of the time I was on the drug, I remember it as being on my own. S was not a part of my experience - in fact I'm not sure I said a single word to him.
When we had eaten them, we walked up to the main road to catch a bus. The first thing I remember was looking at the front of cars and thinking they looked like they had expressions. Most of them looked pretty menacing! This was maybe 40 mins after taking them. Then when we caught the bus, I remember looking at shop signs etc and hearing the words I read spoken to me in all different voices, crystal clear and full of expression. I began to really concentrate on what was going on inside my head. Usually, I couldn't hear myself think so clearly. I realised that I had been thinking so much in my life that all the voices of my thoughts were so jumbled I couldn't hear what they were saying. Now I could hear, as clear as day, the singular Voice Of My Thoughts.
I don't remember how I started thinking it, but I began to realise that everything goes in circles. That everything in life is connected. My thoughts were going in circles, and the starting point that connected the circles was the fact that everything goes in circles!
I don't remember what we did, I remember more about what I thought. I felt very confused and was so lost in my thoughts I couldn't speak to anyone. I think we went to someone called J's house but that may have been another time and another drug. I remember being on the bus later on, looking at the road ahead of me. Then it felt like the hand of God came out of the sky, reached into my brain, took out some files and showed them to me before rearranging them and putting them back.
Everything fell into place. 'I am at the centre of the circles' The voice of my thoughts said. 'My perspective creates my reality. I do not know anything. anything I now know could one day be proven false. There is no truth, what I call 'true' is only true because I believe that it is. Nothing really matters. things only matter because I choose to make them matter. I am too reactive to my surroundings. I am not nice enough to myself. I can choose to make myself happy if that is what I want. I am the most important thing in my life. I hold my reality together.'
I realised that I had been living my life not being true to myself. I was harming myself and other people. I was a different person depending on who I was with and how I felt. I did not know my true self. I had no stability of self. I felt as though I had stared myself in the face and looked at who I was for the first time. I was not who I had become. That was not the 'real' me. The real me was covered by layers of trying to be other things, and of trying to find answers outside of myself. I thought drugs could make me happy. I thought being thin could make me happy. I was looking for answers outside myself, when really they could only be found within myself. The 'real' me was the spirit that fueled the circles, something deeper than thought and opinions. I realised the circles of my thoughts were unneccessary. They were layers that hid my true self beneath them. All I needed to do was to live as myself, by my intuition/instinct, and everything would fall into place.
I envisioned my spirit as part of a whole. A whole that makes the heavens open, the tides change, the stars die, the wind blow and the birds sing. I call this energy Velouria (some call her/him God, or Allah, or the divine consciousness etc) When I abandoned the circles of my mind and lived as myself, I was part of this energy and nothing else. I was pure awareness (if that's the right word for it). I was aware of all the circles and breaths of the earth, instead of the unneccessary circles of my mind. I sensed and I felt, I didn't think. I used my thoughts only when my instincts told me it was neccessary. I could turn them on and off like a light switch. It was like being in permanent meditation, no effort required!
When the seeds started to wear off, I no longer felt confused. I felt calm and I knew exactly what I had to do to be happy. I had to follow one simple rule: love velouria. That meant love myself and every manifestation of velouria. I woke up in the morning and had breakfast for the first time since I could remember. I decided I was going to change my life - I was the only person who could do it.
I gave up drugs (although since started smoking weed again, and a few years later had a fling with pills and shrooms) as I felt I didn't need them to make me happy, and that they separated me from my true self. I started eating little and often, I stopped injuring myself, and I spent the next five days in this meditative state, picking things up, turning them around, appreciating their feel and the way the light shone on them, looking at them from different angles. People thought I was going mad, but it was the happiest 5 days of my life.
Of course the state didn't last, but the point is it completely changed the way I viewed myself and the world around me. There was no way I could have coped with the events of the last few years of my life if it hadn't have been for morning glory (and also my girlfriend!). Ever since I took MG I have been on a spiritual journey, and my ideas constantly evolve and grow. I won't go into that though as this is long enough already! I will always mark the beginning of February 2001 as the date I found myself. The beginning of an amazing journey of discovery that I am still traveling nearly 4 years later. If it wasn't for that day in February I'm not sure I would even be alive now, let alone happy.
I tried MG again about a year ago and it did nothing for me. I felt it had already taught me everything I needed to know from it. Other people I know who have taken it have not had it change their lives so dramatically, so I was lucky. I should also point out that I do not think morning glory can change everyones life, I know for some people it can be a disasterous or uneventful experience.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Flights
Departure at 06:00 h 16/10/2015 with EasyJet
Arrival at 20:30 on 20/10/2015 with Ryanair
Hotel
Hamburg Mitte
Check in 17/10/2015
Check out 17/10/2015
Cancellation policies:
Event
THack Hamburg 2015
From 17/10/2015
to 19/10/2015
Weather at destination


--- title: Shurgu.net - TO BETTER ME layout: default projects: [ {name: 'First tests', fileName: first-test-project, description: 'Some initial unit testing', tags: [test, code]}, {name: 'Second test project', fileName: second-test-project, description: 'Some initial arcade engine', tags: [test, code]} ] ---


"x" "1" "SOSNOVSKY,G, A CRITICAL EVALUATION OF THE PRESENT STATUS OF TOXICITYOF AMINOXYL RADICALS, J. PHARM. SCI. 81(6):496-499, 1992"


Empowering community, saving lives.
To expedite victim's treatment during emergency and work towards a more health-conscious society.
Twilio is a cloud communication company. It allows users to use its application program interface (API) to communicate with others through text messages, phone calls and even video calls. In LifeLine, Twilio enables the exchange of text messages between bystanders or victims with the nearby responders.
Development of LifeLine started in 2016 during our Social Entrepreneurship class. We were tasked to improve the communication system during an emergency with the help of Twilio as the cloud communication platform. After doing extensive market research and user validation, we unanimously agreed to target high-density cities because ambulances are more likely to be caught in traffic congestion and there is a higher chance of geting a nearby responder in the event of an emergency. Singapore has been chosen as our first target market.
We are a group of engineers of diverse skills from Nanyang Technological University, Singapore. In another three semesters, we are going to graduate with a Bachelor of Engineering and a Master of Science in Technology Management.


|
Simbody
3.5
|
Elliptic integrals arise occasionally in contexts relevant to us, particularly in geometric calculations involving ellipses or ellipsoids. More...
Functions | |
| std::pair< double, double > | SimTK::approxCompleteEllipticIntegralsKE (double m) |
| Given 0<=m<=1, return complete elliptic integrals of the first and second kinds, K(m) and E(m), approximated but with a maximum error of 2e-8 so at least 7 digits are correct (same in float or double precision). See Elliptic integrals for a discussion. More... | |
| std::pair< float, float > | SimTK::approxCompleteEllipticIntegralsKE (float m) |
| This is the single precision (float) version of the approximate calculation of elliptic integrals, still yielding about 7 digits of accuracy even though all calculations are done in float precision. More... | |
| std::pair< double, double > | SimTK::approxCompleteEllipticIntegralsKE (int m) |
| This integer overload is present to prevent ambiguity; it converts its argument to double precision and then calls approxCompleteEllipticIntegralsKE(double). More... | |
| std::pair< double, double > | SimTK::completeEllipticIntegralsKE (double m) |
| Given 0<=m<=1, return complete elliptic integrals of the first and second kinds, K(m) and E(m), calculated to (roughly) machine precision (float or double). See Elliptic integrals for a discussion. More... | |
| std::pair< float, float > | SimTK::completeEllipticIntegralsKE (float m) |
| This is the single precision (float) version of the machine-precision calculation of elliptic integrals, providing accuracy to float precision (about 7 digits) which is no better than you'll get with the much faster approximate version, so use that instead! More... | |
| std::pair< double, double > | SimTK::completeEllipticIntegralsKE (int m) |
| This integer overload is present to prevent ambiguity; it converts its argument to double precision and then calls completeEllipticIntegralsKE(double). More... | |
Elliptic integrals arise occasionally in contexts relevant to us, particularly in geometric calculations involving ellipses or ellipsoids.
Here we provide functions for calculating the complete elliptic integrals of the first and second kinds, which arise in Hertz contact theory for point contacts where the contact area is elliptical. We use the following definitions for these two integrals:
K(m) = integ[0,Pi/2] {1 / sqrt(1 - m sin^2(t)) dt} 1st kind E(m) = integ[0,Pi/2] { sqrt(1 - m sin^2(t)) dt} 2nd kind 0 <= m <= 1
Elliptic integrals are defined only for arguments in range [0,1] inclusive.
We provide a function that calculates K(m) and E(m) to machine precision (float or double) with a fast-converging iterative method adapted from ref. 1, which was in turn adapted from ref. 2. A much faster approximate version is also available, using the higher-precision approximation of the two provided in ref. 2. The approximate version provides a smooth function that gives at least 7 digits of accuracy (in either float or double precision) across the full range at about 1/4 the cost of the machine precision version. For many applications, including engineering- or scientific-quality contact, 7 digits is more than adequate and in float precision that's all you can expect anyway.
For an ellipse with semimajor axis a and semiminor axis b (so a >= b), the eccentricity e=sqrt(1-(b/a)^2). Our argument to the elliptic integrals in that case is m = e^2 = 1-(b/a)^2. In constrast, K.L. Johnson uses the mathematicians' definition in Chapter 4, pg. 95 of his book (ref. 4) where he writes K(e) and E(e), where e is eccentricity as defined above, that is e=sqrt(m), so we would call his K'(e)=K(e^2) and E'=E(e^2).
(1) Dyson, Evans, Snidle. "A simple accurate method for calculation of stresses and deformations in elliptical Hertzian contacts", J. Mech. Eng. Sci. Proc. IMechE part C 206:139-141, 1992.
(2) Abramovitz, Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, Dover, NY, 1972.
(3) Antoine, Visa, Sauvey, Abba. "Approximate analytical model for Hertzian Elliptical Contact Problems", ASME J. Tribology 128:660, 2006.
(4) Johnson, K.L. Contact Mechanics. Cambridge University Press 1987 (corrected edition).
|
inline |
Given 0<=m<=1, return complete elliptic integrals of the first and second kinds, K(m) and E(m), approximated but with a maximum error of 2e-8 so at least 7 digits are correct (same in float or double precision). See Elliptic integrals for a discussion.
Note that a full-precision computation of these integrals is also available; see completeEllipticIntegralsKE(). However, if you are using float precision there is no point in using the exact computation since this approximation is just as good and much faster.
| [in] | m | The argument to the elliptic integrals. Must be in range [0,1] although we allow for a very small amount of numerical error (see SignificantReal) that might put m outside that range. |
You can find the approximating formula we're using in ref. 2, sections 17.3.34 and 17.3.36, pp. 591-2, or you can look at the code for this function (in the header file). The formulas are accurate to 2e-8 over the full [0-1] argument range, according to the authors. I checked our implementation against Matlab's ellipke() function and the results are very good, providing at least 7 correct digits for a range of sample values.
The cost is about 90 flops.
(1) Antoine, Visa, Sauvey, Abba. "Approximate analytical model for Hertzian Elliptical Contact Problems", ASME J. Tribology 128:660, 2006.
(2) Abramovitz, Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, Dover, NY, 1972.
|
inline |
This is the single precision (float) version of the approximate calculation of elliptic integrals, still yielding about 7 digits of accuracy even though all calculations are done in float precision.
|
inline |
This integer overload is present to prevent ambiguity; it converts its argument to double precision and then calls approxCompleteEllipticIntegralsKE(double).
Note that the only legal values here are 0 and 1.
|
inline |
Given 0<=m<=1, return complete elliptic integrals of the first and second kinds, K(m) and E(m), calculated to (roughly) machine precision (float or double). See Elliptic integrals for a discussion.
Note that we also provide a faster approximate method for calculating these functions (see approxCompleteEllipticIntegralsKE()). The approximate method is good enough for many scientific and engineering applications and is always preferred if you are using float precision.
| [in] | m | The argument to the elliptic integrals. Must be in range [0,1] although we allow for a very small amount of numerical error (see SignificantReal) that might put m outside that range. |
Cost here is about 50 + 50*n flops, where n is the number of iterations required. The number of iterations n you can expect to get a double-precision result is 4 for a:b < 2, 5 for a:b < 20, 6 for a:b < 1000, 7 after that; for single-precision it will take one fewer iterations. In flops that's 250, 300, 350, 400 – 300 will be typical for double, 250 for float.
|
inline |
This is the single precision (float) version of the machine-precision calculation of elliptic integrals, providing accuracy to float precision (about 7 digits) which is no better than you'll get with the much faster approximate version, so use that instead!
|
inline |
This integer overload is present to prevent ambiguity; it converts its argument to double precision and then calls completeEllipticIntegralsKE(double).
Note that the only legal values here are 0 and 1.


--- title: Making sense of EU Parliament Plenary roll call vote PDFs keywords: fastai sidebar: home_sidebar summary: "Ever wondered if you could visualise the voting behavior of MEPs in the EU Plenary yourself somehow? Wonder no longer! With this repo this is now a thing, well perhaps ... mostly I think ... " description: "Ever wondered if you could visualise the voting behavior of MEPs in the EU Plenary yourself somehow? Wonder no longer! With this repo this is now a thing, well perhaps ... mostly I think ... " nb_path: "nbs/index.ipynb" ---
from eu_parliament import download
Currently this repo is using PyPDF2 to parse PDFs behind Result of roll call votes available. And the notebook already contains a dazzling Plotly visulisation!
Why?
After watching Nico Semsrott's video on Silent Minutes, Missing Votes, Shocking Colleagues, where he enthusiastically presented a typical call vote PDF, I got demotivated enough to try and ask my PC for help.
State of this
It somehow worked to parse the PDFs, although it was quite a pain. Some very basic insights can probably already be generated across PDF files, although the stability of the parsing was only tested for two PDFs before boredom won out. The parsing with PyPDF2 while convenient seems to have issues with special characters, dropping entire words (like names of MEPs). So some investigation of better practises would be next.
To dos
Collecting the links
%%time
rcv_pdfs, vot_pdfs = download.identify_links_for_pdfs(download.URL)
Downloading the roll call pdfs
%%time
download.collect_multiple_files(rcv_pdfs)
Downloading the other pdfs
%%time
download.collect_multiple_files(vot_pdfs)


Simple Location Sharing
Home
Site
created:
2020-03-08
modified:
2020-03-08
Location Test
Show my location
Share using peerjs
Create share link
Map