This document provide note and summary of RFC 2046, Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples
1. MIME Conformance
The concept of "MIME-conformance" is to define a certain level of implementation that allows the useful interworking of messages with content that differs from US-ASCII text.
A MUA that is MIME-conformant MUST:
-
Always generate "MIME-Version: 1.0" in header field
-
Enable to decode using quoted-printable or base64. Sending non-7bit data without encoding MUST use content-transfer-encoding 8bit or binary, as appropriate. If the underlying transport does not support 8bit or binary, sender must encode and label data using quoted-printable or base64.
-
Treat unrecognized Content-Transfer-Encoding as Content-Type of "application/octet-stream", regardless their actual type.
-
Avoid showing users raw data when a Content-Type field other than text.
-
Ignore any content-type parameters whose names they do not recognize.
-
Explicitly handle the following media type values,
-
Text
-
Recognize and display "text" with "US-ASCII"
-
Recognize other charset, at least being able to inform the user about charset the message uses
-
For unrecognized subtypes in a known charset, offer to show the user the "raw" version of data after conversion from canonical to local form
-
Treat material in an unknown charset as "application/octet-stream"
-
-
Image, audio, and video
-
Treat any unrecognized subtypes as "application/octet-stream"
-
-
Application
-
Offer the ability to remove encodings and put the resulting information in a user file
-
-
Multipart
-
Recognize the mixed subtype
-
Recognize the "alternative" subtype, and avoid showing the user redundant parts.
-
Recognize the "digest" subtype, specifically using "message/rfc822" rather than "text/plain" as the default media type for body parts
-
Treat unrecognized subtypes as "mixed"
-
-
Message
-
Recognize and display RFC822 message encapsulation (message/rfc822)
-
Treat unrecognized subtypes as "application/octet-stream"
-
-
-
Treat unrecognized Content-Type as "application/octet-stream"
-
Using non-US-ASCII without a MIME-Version field is strongly discouraged.
-
Ensure that any string that begins with "=?" and ends with "?=" in field body to be valid encoded-word.
-
Able to distinguish encoded-words from "text", "ctext", or "word"s
2. Guidelines for Sending Email Data
The list is NOT recommended practices for MTAs.
3. Canonical Encoding Model
Conversion steps from local to canonical form,
-
Creation of local form The body to be transmitted is created in the system’s native format.
-
Conversion to canonical form. The entire body, including "out-of-band" information such as record lengths and possibly file attribute information, is converted to a universal canonical form. For example, in case of "text/plain", the text MUST be converted to a supported charset and lines MUST be delimited with CRLF.
-
Apply transfer encoding. It may be appropriate to base the choice of base64 or quoted-printable on character frequency counts.
-
Insertion into entity. The encoded body then inserted into MIME entity with appropriate headers. The entity is then inserted into the body of higher-level entity (message or multipart).
Conversion from canonical form to local form is accomplished by reversing these steps.
For example, a message with the following header fields,
Content-type: text/foo; charset=bar Content-Transfer-Encoding: base64
MUST be first represented in the "text/foo" form, then represented in the "bar" character set, and finally transformed via the base64 algorithm into mail-safe form.


Preparation time
less than 30 mins
Cooking time
30 mins to 1 hour
Serves
Serves 4
Dietary
This take on an Indian potato and cauliflower curry is a brilliant meal to make on the cheap.
Each serving provides 342kcal, 11g protein, 41g carbohydrate (of which 11g sugars), 13g fat (of which 4g saturates), 9g fibre and 0.7g salt.
Preheat the oven to 180C/350F/Gas 4.
For the cauliflower, break the two cauliflowers into bite-sized florets and place into a baking tray. Drizzle with olive oil and season with salt and freshly ground black pepper, mixing until well combined. Roast for 20 minutes, or until golden-brown and tender.
For the vegetable curry, heat the ghee, or oil, in a large saucepan over a medium heat and fry the onion for 2-3 minutes, or until translucent.
Add the ginger, mustard seeds, curry leaves, turmeric, fenugreek, whole green chillies and chilli powder. Cook for 2-3 minutes, stirring frequently, until the mustard seeds pop and become aromatic. Add the potatoes and stir to coat in the spices.
Add the tomatoes, spinach leaves, sugar and 55ml/2fl oz water. Bring to a simmer and cook for 20 minutes, stirring occasionally.
Stir the roasted cauliflower florets into the curry and season to taste with salt and freshly ground black pepper. Add a squeeze of lemon juice to taste.
To serve, remove and discard the whole green chillies. Serve the curry alongside steamed basmati rice.


insight:type=cxr&dcm=https%3A%2F%2Flunit-io.github.io%2Ffrontend-fixtures%2Fdcm-files%2Fseries%2FCT000010.dcm


I'm a second-year computer science and Mathematics double major at the University of
North Carolina at Chapel Hill. I currently work with Professor Kris Jordan as a
learning assist for the introductory level computer science class, COMP 110, and have
for the past two semesters. I enjoy using the resources and freedom offered to me by
my school and skills to build tools and projects that are fun and useful.
See the links on the top bar for more information about my work and I, as well as
learning about means with which to contact me!


Enterprise Serial Bus 1.1 Usable User is now available in the Alpha version.
Enterprie Serial Bus 1.1 Usable User video tutorials
CompanyApi ESB v.1.1 Usable Users Company api
While working on our api, we assumed that to create a user, you have to create at least one company. Therefore, as the first element we explain activities on companies.
ESB 1.1 Usable Users User Api
User management is the second part of the api. It allows you to quickly create, edit, find and delete users.
ESB 1.1 Usable User Account Api
User accounts are the last element. It contains some very simple operations. I already explain.
What's next?
As I have already mentioned, we will reach the full Fast Data if the amount of your shares exceeds 5,000 usd. Then we'll break into Apache Kafka and Cassandra's base.
Additionally, remember that you can already post orders related to FastData, I am more interested in freelancing than full-time job. Calculations using artificial intelligence? There is no welding. Rewriting the existing application interface to something deadly fast is also not a problem.
What's next with this project? First of all, I want to stabilize all available api this week. And then I want to write files management with the OCR system, so I can not do without Tesserac and Elastic Search. Greetings and look forward to the news.


US judge rebukes Epstein estate for keeping accusers in the dark about settlement
NEW YORK: A US judge on Thursday (Nov 21) rebuked Jeffrey Epstein's estate for keeping the late financier's alleged victims in the dark about a fund that would compensate them for claims of sexual abuse.
The estate, facing at least 14 lawsuits from women, has proposed creating a fund to resolve the allegations out of court.
READ: Late financier Epstein's estate faces lawsuit from new accuser
Epstein, 66, hanged himself in a Manhattan jail in August while awaiting trial on federal sex trafficking charges.
Bennet Moskowitz, a lawyer for the estate, told Magistrate Judge Debra Freeman on Thursday that the fund was an "extraordinary opportunity" for the alleged victims, though he could not say how much money would be available.
Roberta Kaplan, one of the attorneys for the women, said she was met with "radio silence" when she had tried to discuss a settlement with the estate. She said it was "incredibly disrespectful" to propose the fund without hearing from the alleged victims.
Judge Freeman agreed the women must have more to say about any settlement process, adding it could not be "unilateral."
"For cases to settle, there has to be not just interest on both sides, there have to be seats at the table on both sides," the judge said. Freeman ordered both sides to confer and report on their progress by Jan 10.
One of the women's lawyers, Brad Edwards, said he may file "dozens" more lawsuits against the estate.
Epstein had pleaded not guilty to sex trafficking charges involving dozens of underage girls at his mansions on Manhattan's Upper East Side and in Palm Beach, Florida, over several years.
He previously escaped federal prosecution by pleading guilty in 2008 to Florida state prostitution charges, an agreement now widely considered too lenient.
Epstein's friends once included US President Donald Trump, former president Bill Clinton and Britain's Prince Andrew, none of whom has been criminally accused of wrongdoing.
The prince stepped down from public duties on Wednesday after an interview he gave about his association with Epstein drew widespread criticism.


Role Manager
Add a Role
Role ID
Role Title
Role Access Level
Role Description
Actions
Role ID
Role Title
Role Access Level
Role Description
Edit
Delete
Return to Administration Menu


Foreign
Leader
25th Prime Minister
of Australia
Born: 07-26-1939
Hometown: Earlwood, New South
Wales, Australia
Education: University of Sydney
"The prime minister is not only a man of steel, he's showed the world he's a man of heart," said Bush. Bush admired Howard for his resilience and composure when dealing with tough decisions.


CodeMirror nginx-renewed mode
This is a CodeMirror mode that brings
syntax highlighting for nginx configuration files.
Features:
- recognize more than 870 nginx directives, including those from OpenResty and nginx-plus;
- unrecognized directives remain accepted (they are shown in italic)
- highlight directives that are recognized but should not occur in the current scope;
- highlight regular expressions -- requires codemirror-mode-pcre
supported in: locations, maps, if conditions, rewrite statements and some proxy_* directives
- highlight variables in strings -- requires codemirror-mode-variables;
- highlight IP addresses -- requires codemirror-mode-ipaddr;
supported in: geo, set_real_ip_from
-
highlight Lua code -- requires CodeMirror's Lua mode; without it, strings and comments are still highlighted;
supported in: blocks (*_by_lua_block
)
not supported in: strings (*_by_lua
)
MIME types defined:
Options:
- initial_scope: string; default value: "main"
- check_directive_scope: boolean; default value: true
MIME types used to invoke nested modes:
- text/x-regex
- text/x-variables
- text/x-ip-address
- text/x-lua
Direct use
By default, codemirror-mode-nginx-renewed:
- assumes the textarea reflects nginx's main scope (i.e. the same scope as nginx.conf);
- checks whether each directive is allowed in the current scope.
The textareas below showcase codemirror-mode-nginx-renewed's capabilities.
Useful commands:
- Ctrl+d: toggle comments
- Ctrl+]: indent
- Ctrl+[: unindent
- Tab: auto-indent the current line or selection
- Shift+Tab: if something is selected, indent it by one indent unit; otherwise, insert a tab character
This textarea is a copy of lua-nginx-module's synopsis:
Custom use without a specific scope
Sometimes, it is hard, if not impossible, to predict the scope of an nginx snippet.
Typical cases:
- include files, which may contain directives suited for various scopes;
- the output of "nginx -T", which may combine many files and thus many scopes.
To deal with these situations, state "check_directive_scope: false" when configuring codemirror-mode-nginx-renewed.
Custom use with specific scopes
By playing with the "initial_scope" setting, it is possible to change the nginx scope of the textarea.
initial_scope defaults to "main" and can take various values reflecting the desired scope.
Examples:
- main/events
- main/http/server/location/limit_except
- main/http/server/location/if
- main/http/server/location/types
- main/http/server/if
- main/mail/server
- main/stream/upstream
Other examples and demonstrations follow.
main/http/map
main/http/geo
main/http/types
main/http/server
main/http/server/location
main/http/upstream


Wrong Order
Somehow whenever it comes to Trump, things start to get weird.
- Trump talks about the migration in Sweden. Even though nothing happened the night before there.
You look at what’s happening in Germany, you look at what’s happening last night in Sweden. Sweden, who would believe this?
-
Then he explains his comment, saying it didn’t point to a specific event, but rather something Fox News broadcasted earlier. (Which kinda doesn’t make it any better at all)
- Riots break out and cars burn.
Source: Aftonbladet
Source: Twitter following this article
It really is all jumbled up. Or maybe it’s just that we live in a post facto time. First the facts, then the evidence.
The pictures make it look worse than it actually is. Articles talk about 40 rioters.
Written on February 21, 2017


Euler
Euler angles.
Static Member Summary
| Static Public Members | ||
| public static get |
The default rotation order. |
Constructor Summary
| Public Constructor | ||
| public |
constructor(x: Number, y: Number, z: Number) Constructs a new set of Euler angles. |
Member Summary
| Public Members | ||
| public |
The rotation order. |
|
| public |
The rotation around the X-axis. |
|
| public |
The rotation around the Y-axis. |
|
| public |
The rotation around the Z-axis. |
Method Summary
| Public Methods | ||
| public |
Clones this set of Euler angles. |
|
| public |
Copies the values of another set of Euler angles. |
|
| public |
Checks if this set of Euler angles equals the given one. |
|
| public |
Copies angles and the rotation order from an array. |
|
| public |
reorder(newOrder: RotationOrder): Euler Reorder the rotation angles. |
|
| public |
Sets the Euler angles and rotation order. |
|
| public |
setFromQuaternion(q: Matrix4, order: RotationOrder): Euler Copies the rotation from a given quaternion. |
|
| public |
setFromRotationMatrix(m: Matrix4, order: RotationOrder): Euler Copies the rotation from a given matrix. |
|
| public |
setFromVector3(v: Matrix4, order: RotationOrder): Euler Copies the rotation from a given vector. |
|
| public |
Stores this set of Euler angles and the rotation order in an array. |
|
| public |
Stores this set of Euler angles in a vector. |
Static Public Members
Public Constructors
Public Members
Public Methods
public copy(e: Euler): Euler source
Copies the values of another set of Euler angles.
Params:
| Name | Type | Attribute | Description |
| e | Euler | A set of Euler angles. |
public equals(e: Euler): Boolean source
Checks if this set of Euler angles equals the given one.
Params:
| Name | Type | Attribute | Description |
| e | Euler | Euler angles. |
public fromArray(array: Number[], offset: Number): Euler source
Copies angles and the rotation order from an array.
public reorder(newOrder: RotationOrder): Euler source
Reorder the rotation angles.
WARNING: this operation discards revolution information!
Params:
| Name | Type | Attribute | Description |
| newOrder | RotationOrder | The new rotation order. |
public set(x: Number, y: Number, z: Number, order: Number): Euler source
Sets the Euler angles and rotation order.
public setFromQuaternion(q: Matrix4, order: RotationOrder): Euler source
Copies the rotation from a given quaternion.
Params:
| Name | Type | Attribute | Description |
| q | Matrix4 | A quaternion. |
|
| order | RotationOrder |
|
An override rotation order. |
public setFromRotationMatrix(m: Matrix4, order: RotationOrder): Euler source
Copies the rotation from a given matrix.
Params:
| Name | Type | Attribute | Description |
| m | Matrix4 | A rotation matrix. The upper 3x3 is assumed to be a pure rotation matrix (i.e. unscaled). |
|
| order | RotationOrder |
|
An override rotation order. |
public setFromVector3(v: Matrix4, order: RotationOrder): Euler source
Copies the rotation from a given vector.
Params:
| Name | Type | Attribute | Description |
| v | Matrix4 | A vector. |
|
| order | RotationOrder |
|
A rotation order. |


BJP, AAP clash in RS over Capital’s water quality
Trouble started when Sanjay Singh countered Vijay Goel’s submission during Zero Hour and it prompted Naidu to ask members to maintain decorum
by PRESS TRUST OF INDIAThe BJP and Aam Aadmi Party (AAP) members clashed in Rajya Sabha on Friday over the quality of water being piped to households in Delhi, prompting an angry response from Chairman M. Venkaiah Naidu who asked members to maintain decorum.
Trouble started when BJP’s Vijay Goel was called to make his Zero Hour submission on the quality of water in Delhi. As Mr. Goel began speaking on the “poor quality and unsafe water” in Delhi, AAP’s Sanjay Singh started countering him in a loud voice.
Mr. Naidu ordered that Mr. Singh’s comments would not go on record and should not be reported. He asked him to sit down as no allegation against any person or government has been made. But Singh continued, angering Mr. Naidu.
“Are you the Minister to correct it,” he asked Mr. Singh. Mr. Naidu also told Mr. Goel that any display of articles published in newspapers, or any other items such as air purifiers or pollution masks is not allowed in the House.


1. Naturalness : Naturalness of synthesized wave on 5 point scale. (Bad->Excellent)
2. Similarity : Similarity of synthesized wave with target wave on 5 point scale (Completely Different->Very Similar)
* If you want to know more about MOS and how to perform test please read the instructions below.
Every dataset below contains 30 waveforms, so each one will take about 5 minutes to complete. Please use headphones while listening to the waveforms. Rate these according to your time avaibility. Thank you for the help.
High Quality Headphones are used when listening to the waveforms to clearly distinquish between synthesized and target wave.


GO AWAY
Is this, uh, appropriate for a lightning talk? it's okay. mention bathroom breaks. Stretch legs. Come see me after!
Why develop with virtual machines?
This is my messy desk. Wouldn't it be great if each time you started a new project you could stow your messy desk away and have a new clean desk?
by making clones! Sort of like this!
This is supposed to be my "fast" slide, but while I was out in beautiful Hamilton, Ontario last week at a swap meet I saw this parked in the parking lot, and every time I see a Chevette I get really excited because, geez, how is it still running?
What is Vagrant?
vagrantup.com
Ask if anybody in the room uses Virtualbox. Ask if anyone is *completely* mystified as to what virtual machining is. Basically it's making a new machine -- not necessarily of the same operating system or even processor type -- in your existing machine.
Vagrant is used most often with the Virtualbox VM engine, but recent versions have been abstracted to use pretty much any VM. Virtualbox is very popular though because it runs on Windows, OSX and Linux, is open source, and doesn't need special hardware to run. I run it on my 6 year old desktop at work and it runs ok.
Basically all this is is Virtualbox in a headless mode -- so it can be worked with programmatically -- plus a Ruby layer on top to define things like open ports, what sort of "base box" to use, and etc.
A PLUG FOR RUBY
I know this is not really about Ruby, but if you're thinking about starting to learn programming it's really the only language that I've ever gelled to, and I'm an English major, so.
What is Chef?
opscode.com
Usually when you make a new Vagrant machine, it comes pretty bare -- you can log into it but it doesn't have apache or gcc or php or ruby or whatever sort of dev environment you want. Chef is a way to define "recipes" or groups of recipes to make machines have different tasks. You could, say, have one recipe for apache, one for mysql, and one for php, and then after bringing up a Vagrant virtual machine, tell it install those three recipes and have a fully functioning php development machine.
package "apache2" do
package_name node['apache']['package']
end
service "apache2" do
case node['platform_family']
when "rhel", "fedora", "suse"
service_name "httpd"
# If restarted/reloaded too quickly httpd has a habit of failing.
# This may happen with multiple recipes notifying apache to restart - like
# during the initial bootstrap.
restart_command "/sbin/service httpd restart && sleep 1"
reload_command "/sbin/service httpd reload && sleep 1"


Drywall, Our Apologies. Take 40% Off Everything!
CVSphoto.com
Take 40% Off The Entire Site Now! >
Download Mobile App


Copyright 2011 Farzad FARID / Pragmatic Source. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Pragmatic Source.
OTHER LICENSES COVERING PORTIONS OF CODE
==================================
Portions of code in "Zabbix::Running" were inspired by Rush (https://github.com/adamwiggins/rush):
Copyright © 2010 Adam Wiggins
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


2 Dead, 14 Injured During Navajo Religious Ceremony in New Mexico
by Associated Press(ALAMO, N.M.) — Navajo authorities have confirmed two people died and 14 others were injured during a traditional religious ceremony.
KOAT-TV reports Christina Tsosie with the Navajo Police Department says the 14 injured people were treated for smoke inhalation. Tsosie says the ceremony lasts throughout the night and involves an open fire pit burning inside a hogan, a traditional Navajo structure typically built out of logs and earth.
Tsosie says Alamo first responders performed CPR on the two people, but attempts were unsuccessful. Their causes of death have not been determined.
Police say the ceremony began Saturday in a hogan on the Alamo Navajo Reservation in Socorro County.
Police say a woman reported finding an unresponsive man and woman Sunday on the floor inside the hogan.


--- layout: post title: Garden date: '2016-07-08T18:30:22+02:00' categories: - Architecture - Sketches picture_url: https://film-Storyboards.tumblr.com/post/147114213669 ---


How much attachments are on your servers?
In a recent discussion a customer asked how much space could they save on their mail servers if they move all attachments to Lotus Quickr or an content management solution like IBM DB/2 CommonStore for Domino. While you can inspect a database easily for size and number of documents it doesn't tell you how much of this size is attributed to attachments. Since altering the mail template to add an attachment view was out of the picture I whipped up a little script, that will scan an entire server and report back the size figures into a database:
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.
The meat is in the class:
You can download the sample database.
YMMV
'ScanForSize: Option Public Option Declare Use "SizeTools" Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim curDB As NotesDatabase Dim dbDir As NotesDbDirectory Dim serverName As String Set db = s .CurrentDatabase If db .Server = "" Then serverName = "(local)" Else serverName = db .Server End If serverName = Inputbox ( "Please select the server to scan (local) for local" , "Server Scan" ,serverName ) If serverName = "" Then Exit Sub End If If servername = "(local)" Then Set dbDir = New NotesDbDirectory ( "" ) Else Set dbDir = New NotesDbDirectory (serverName ) End If Set curDB = dbdir .GetFirstDatabase ( TEMPLATE_CANDIDATE ) Do Until curDB Is Nothing Print "Working on " & curDB .FilePath Call countThis (curDB , db ) Set curDB = dbDir .GetNextDatabase Loop Msgbox "Run completed" End Sub Sub countThis (curDB As NotesDatabase , reportDB As NotesDatabase ) Dim curSize As DBSizeInfo On Error Resume Next Set curSize = New DBSizeInfo (curDB ) Call curSize .count 'We save only database information that has an attachment If curSize .AttachmentCount > 0 Then Call curSize .save (reportDB ) End If End Sub
provided by Julian Robichaux at nsftools.com.
The meat is in the class:
'SizeTools: Option Public Option Declare Public Class DBSizeInfo Private db As NotesDatabase 'The database to be counted Public DBSize As Variant 'Size of the database Public AttachmentSize As Variant Public AttachmentCount As Variant Public DocumentCount As Variant Public hasError As Boolean Sub new (curDB As NotesDatabase) Set db = curDB hasError = False End Sub Public Function Count As Boolean Dim doc As NotesDocument Dim dc As NotesDocumentCollection Dim countResult As Variant Dim sizeResult As Variant On Error Goto Err_Count If Not db.IsOpen Then Call db.Open("","") If Not db.IsOpen Then 'We could not open it Print "Can't open " & db.FilePath Count = False Goto Exit_Count End If End If DBSize = db.Size AttachmentCount = 0 AttachmentSize = 0 DocumentCount = 0 Set dc = db.AllDocuments Set doc = dc.GetFirstDocument Do Until doc Is Nothing If doc.HasEmbedded Then Call getAttachmentSizes(doc) End If DocumentCount = DocumentCount + 1 Set doc = dc.GetNextDocument(doc) Loop Count = True 'If we got here it worked Exit_Count: Exit Function Err_Count: Print Error$ & " in Count in " & db.FilePath & " in line " & Cstr(Erl) Count = False hasError = True Resume Exit_Count End Function Public Sub Save(reportDB As NotesDatabase) Dim doc As NotesDocument Dim v As NotesView Dim searchkey(0 To 1) As String On Error Goto Err_Save Set v = reportDB.GetView("(LookupByServerAndPath)") If v Is Nothing Then Set doc = New NotesDocument(reportDB) Else If db.Server = "" Then searchkey(0) = "(local)" Else searchkey(0) = db.Server End If searchkey(1) = Lcase(db.FilePath) Set doc = v.GetDocumentByKey(searchkey,True) If doc Is Nothing Then Set doc = New NotesDocument(reportDB) End If End If Call doc.ReplaceItemValue("Form","SizeReport") Call doc.ReplaceItemValue("DBSize",Me.DBSize) Call doc.ReplaceItemValue("AttachmentSize",Me.AttachmentSize) Call doc.ReplaceItemValue("AttachmentCount",Me.AttachmentCount) Call doc.ReplaceItemValue("DocumentCount",Me.DocumentCount) If hasError Then Call doc.ReplaceItemValue("ErrorFlag",1) Elseif doc.HasItem("hasError") Then Call doc.RemoveItem("ErrorFlag") End If If db.Server = "" Then Call doc.ReplaceItemValue("ServerName","(local)") Else Call doc.ReplaceItemValue("ServerName",db.Server ) End If Call doc.ReplaceItemValue("FilePath",Lcase(db.FilePath)) Call doc.Save(True,True) Exit_Save: Exit Sub Err_Save: Print Error$ & " in " & db.FilePath Resume Exit_Save End Sub Private Sub getAttachmentSizes(doc As NotesDocument) Dim attNames As Variant Dim att As NotesEmbeddedObject Dim result As Variant result = 0 On Error Goto Err_getAttachmentSizes attNames = Evaluate(|@Attachmentnames|, doc) If attNames(0) <> "" Then Forall an In attNames Print "Checking Attachment " & an Set att = doc.GetAttachment(an) result = result + att.FileSize Me.AttachmentCount = Me.AttachmentCount + 1 End Forall End If Exit_getAttachmentSizes: Me.AttachmentSize = Me.AttachmentSize + result Exit Sub Err_getAttachmentSizes: Print Error$ & " in getAttachmentSizes doc: " & doc.UniversalID Resume Exit_getAttachmentSizes End Sub End Class
You can download the sample database.
YMMV
Posted by Stephan H Wissel on 29 October 2007 | Comments (7) | categories: Show-N-Tell Thursday


|
TFKaldi
|
contains the signal processing functionality More...
Functions | |
| def | processing.sigproc.framesig (sig, frame_len, frame_step, winfunc=lambda x:numpy.ones((x,))) |
| Frame a signal into overlapping frames. More... | |
| def | processing.sigproc.deframesig (frames, siglen, frame_len, frame_step, winfunc=lambda x:numpy.ones((x,))) |
| Does overlap-add procedure to undo the action of framesig. More... | |
| def | processing.sigproc.magspec (frames, nfft) |
| Compute the magnitude spectrum of each frame in frames. More... | |
| def | processing.sigproc.powspec (frames, nfft) |
| Compute the power spectrum of each frame in frames. More... | |
| def | processing.sigproc.logpowspec (frames, nfft, norm=1) |
| Compute the log power spectrum of each frame in frames. More... | |
| def | processing.sigproc.preemphasis (signal, coeff=0.95) |
| perform preemphasis on the input signal. More... | |
contains the signal processing functionality
The MIT License (MIT)
Copyright (c) 2013 James Lyons
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This file includes routines for basic signal processing including framing and computing power spectra.
| def processing.sigproc.deframesig | ( | frames, | |
| siglen, | |||
| frame_len, | |||
| frame_step, | |||
winfunc = lambda x: numpy.ones((x, )) |
|||
| ) |
Does overlap-add procedure to undo the action of framesig.
| frames | array of frames. |
| siglen | length of the desired signal, use 0 if unknown. Output will be truncated to siglen samples. |
| frame_len | length of each frame measured in samples. |
| frame_step | number of samples after the start of the previous frame that the next frame should begin. |
| winfunc | the analysis window to apply to each frame. By default no window is applied. |
| def processing.sigproc.framesig | ( | sig, | |
| frame_len, | |||
| frame_step, | |||
winfunc = lambda x: numpy.ones((x, )) |
|||
| ) |
Frame a signal into overlapping frames.
| sig | the audio signal to frame. |
| frame_len | length of each frame measured in samples. |
| frame_step | number of samples after the start of the previous frame that the next frame should begin. |
| winfunc | the analysis window to apply to each frame. By default no window is applied. |
| def processing.sigproc.logpowspec | ( | frames, | |
| nfft, | |||
norm = 1 |
|||
| ) |
Compute the log power spectrum of each frame in frames.
If frames is an NxD matrix, output will be NxNFFT.
| frames | the array of frames. Each row is a frame. |
| nfft | the FFT length to use. If NFFT > frame_len, the frames are zero-padded. |
| norm | If norm=1, the log power spectrum is normalised so that the max value (across all frames) is 1. |
| def processing.sigproc.magspec | ( | frames, | |
| nfft | |||
| ) |
Compute the magnitude spectrum of each frame in frames.
If frames is an NxD matrix, output will be NxNFFT.
| frames | the array of frames. Each row is a frame. |
| nfft | the FFT length to use. If NFFT > frame_len, the frames are zero-padded. |
| def processing.sigproc.powspec | ( | frames, | |
| nfft | |||
| ) |
Compute the power spectrum of each frame in frames.
If frames is an NxD matrix, output will be NxNFFT.
| frames | the array of frames. Each row is a frame. |
| nfft | the FFT length to use. If NFFT > frame_len, the frames are zero-padded. |
| def processing.sigproc.preemphasis | ( | signal, | |
coeff = 0.95 |
|||
| ) |
perform preemphasis on the input signal.
| signal | The signal to filter. |
| coeff | The preemphasis coefficient. 0 is no filter, default is 0.95. |


--- layout: page title: In development ---
{{ post.content | strip_html | truncatewords: 50 }}
Read more . . .


Liga Bola
arrow_back
Back to Home
HOME
MATCH
AWAY
Loading Home Team Data..
Loading Match Data..
Loading Away Team Data..
save


On the right hand side there is a form with Tigra Calendars attached to the fields. Note, that you can have multiple calendars on the same page independently configurable.
Advantages
Easy date input - With Tigra Calendar date input is simple and intuitive. Visitors can select any date from unlimited range with few clicks.
Cost Saving Component - Don't waste your time coding date conversion and validation all over again for each new project. Get the dates on server side ready for further processing.
Professional Look - Simple great looking improvement to the user interface of your web application.


One amazing fact of our shopping solution lies not just in the idea of you coming online and seeing categories of products but in the extraordinary idea of you actually specifying and describing your ideal product(s) and having it shipped and delivered when you.
We have a passion to democratize the African retail system with a goal to power a whole generation of retailers to meet the needs of their ideal customers.
One amazing fact of our shopping solution lies not just in the idea of you coming online and seeing categories of products but in the extraordinary idea of you actually specifying and describing your ideal product(s) and having it shipped and delivered when you.
My shoppemart is your non-traditional online and offline shopping, retail and logistics experience and platform that's transforming the way you buy/shop for anything, from anywhere and at anytime, removing the constraints of time and the hassle of distance. we make your shopping, retail and logistics easy.
Our mission is to enable and give you total control over how you buy/shop for anything, from anytime and at anytime, enabling you explore new possibilities to the marketplace everyplace and power a whole generation of retailers.
Our vision is to create and lead the next generation and non-traditional(Online and Offline) shopping and logistics experience that takes you away from the hustle and bustle of the marketplace, takes the marketplace to them whilst saving your energy, time and cost.


{% extends 'base.html' %} {% load input_field %} {% load step_order %} {% block title %}{{ block.super }}: Prequalification{% endblock %} {% block progress %} {% if not intercepted %}{% include "partials/progress.html" %}{% endif %} {% endblock %} {% block content %}
Please select what you are asking for. Later on you will be asked to provide details for each request.
Divorce is the end of a legal marriage. To get a divorce, you must go through a legal process and get a court order that says the marriage has ended.
When a couple separates, one spouse may be eligible to receive financial support from the other. This is called spousal support. Spousal support is separate and distinct from child support. Unlike child support, spousal support is not a right in every case. You are entitled to spousal support in certain situations.
The objectives of spousal support are to:
For more information, please refer to the Spousal Support fact sheet on the Family Law in B.C. website.
If you have a Separation Agreement or court order that deals with Spousal Support that you and your spouse do not wish changed, you may choose NOT to select this option.
Anything you own including real estate, bank accounts, cars and RRSPs. For more information, please refer to the Dealing with Debts After Separation fact sheet on the Family Law in B.C. website.
If you have a Separation Agreement or court order that deals with Division of Property and Debts that you and your spouse do not wish changed, you may choose NOT to select this option.
This may include child support , parental responsibilities (guardianship), parenting time (access, contact with a child) and custody .
NOTE: Just because you have children does not mean you have to select this option. Only select if you want a Judge to make an order about these items.
Use our Get Help page to find people who can help you with filling out this section.
If your Separation Agreement is 'filed' at a Court Registry and you do not wish it changed, you may choose NOT to select this option. If you do wish to change what was agreed upon in your Separation Agreement, you must go to the Registry where it is filed.
If you already have a Court Order pertaining to Children, you must go to the Court Registry where it is filed to apply to change or cancel terms.
For example, a name change.
An order is the record of the judge's decision. It is filed at the court registry. In Supreme Court, the parties involved in a case (or their lawyers) are responsible for telling the court the order(s) they want. This is done by putting the details in writing in their application and in a draft of the order to be signed by the judge or master. The judge or master who reviews the application will sign the order, if they approve it.
More information on Court Orders can be found on the Family Law in B.C. website.
{% endblock %}


The default visualizers are generic predicates to display FDBG
events (see FDBG Events) in a well readable form. These visualizers
naturally don't exploit any problem specific information—to have more
“fancy” output, you have to write your own visualizers; see FDBG Writing Visualizers. To use these visualizers, pass them in the
appropriate argument to fdbg_on/1
; see FDBG Options, or
call them directly from user defined visualizers.
fdbg_show(
+Constraint,
+Actions)
<fdvar_1>#=0 fdvar_1 = {0} Constraint exited.
Here, we can see an arithmetical constraint being woken. It narrows `fdvar_1' to a domain consisting of the singleton value 0, and since this is the narrowest domain possible, the constraint doesn't have anything more to do: it exits.
Note that when you pass fdbg_show/2
as an option, you should omit
the two arguments, like in
fdbg_on([..., constraint_hook(fdbg_show), ...]).
fdbg_label_show(
+Event,
+LabelID,
+Variable)
fdbg_show/2
. Each
labeling event produces a single line of output, some of them are
followed by an empty line, some others are always followed by another
labeling action and therefore the empty line is omitted. Here is a
sample output of fdbg_label_show/3
:
Labeling [9, <list_1>]: starting in range 0..3. Labeling [9, <list_1>]: step: <list_1> = 0
What we see here is the following:
<list_1>
) identifies the variable
currently being labeled. Note that several identification numbers might
belong to the same variable, depending on the mode of labeling.
step
step
mode labeling
indomain_up
enum
mode labeling or a direct call to indomain/1
indomain_down
enum,down
mode labeling
bisect
bisect
mode labeling
dual
Note that when you pass fdbg_label_show/3
as an option, you
should omit the three arguments, like in
fdbg_on([..., labeling_hook(fdbg_label_show), ...]).


‘Boris ko humein jitaana hai’: This Hindi song is asking British Indians to vote for Boris Johnson
by Scroll Staff‘Britain ke PM banenge Boris Johnson Boris Johnson.’
As current UK Prime Minister Boris Johnson visited the Swaminarayan Temple and vowed to support Narendra Modi comes a video encouraging Indian-origin British citizens to vote for Boris Johnson and make him Prime Minister again.
This advertisement is not the only one with this objective, as a recent video also showed a Hindu temple in Britain hosting a pro Boris Johnson speech, terming the Labour Party and Jeremy Corbyn “anti-Modi.”
The video appears to reflect India’s official view, which, of course, does not reflect reality.
Not that Hindi songs asking for votes in Britain are new. Here are advertisements from 2017, aimed at acquiring British-Indian votes for Theresa May, and similarly for David Cameron in 2015.
Both Cameron and May were presidential candidates from the Conservative party, as is Johnson, who once described himself as “India’s son-in-law.”
While the source of the video above is unknown, it has generated a lot of amusement on social media. With many people mocking the video’s awkward Hindi lyrics and musicality, there are comparisons to Doordarshan in the 1980s.
Also watch
Hindu temple in Britain hosts politically motivated speech, calling Labour Party ‘anti-Modi’
Also read
BJP is leveraging its impressive Hindu diaspora network to influence politics in UK, US and Canada
Read Comments


| Opcode | Instruction | Op/En | 64-bit Mode | Compat/Leg Mode | Description |
| D5 0A | AAD | NP | Invalid | Valid | ASCII adjust AX before division. |
| D5 ib | AAD imm8 | NP | Invalid | Valid | Adjust AX before division to number base imm8. |
| Op/En | Operand 1 | Operand 2 | Operand 3 | Operand 4 |
| NP | NA | NA | NA | NA |
Adjusts two unpacked BCD digits (the least-significant digit in the AL register and the most-significant digit in the AH register) so that a division operation performed on the result will yield a correct unpacked BCD value. The AAD instruction is only useful when it precedes a DIV instruction that divides (binary division) the adjusted value in the AX register by an unpacked BCD value.
The AAD instruction sets the value in the AL register to (AL + (10 * AH)), and then clears the AH register to 00H. The value in the AX register is then equal to the binary equivalent of the original unpacked two-digit (base 10) number in registers AH and AL.
The generalized version of this instruction allows adjustment of two unpacked digits of any number base (see the “Operation” section below), by setting the imm8 byte to the selected number base (for example, 08H for octal, 0AH for decimal, or 0CH for base 12 numbers). The AAD mnemonic is interpreted by all assemblers to mean adjust ASCII (base 10) values. To adjust values in another number base, the instruction must be hand coded in machine code (D5 imm8).
This instruction executes as described in compatibility mode and legacy mode. It is not valid in 64-bit mode.
IF 64-Bit Mode THEN #UD; ELSE tempAL ← AL; tempAH ← AH; AL ← (tempAL + (tempAH ∗ imm8)) AND FFH; (* imm8 is set to 0AH for the AAD mnemonic.*) AH ← 0; FI; The immediate value (imm8) is taken from the second byte of the instruction.
The SF, ZF, and PF flags are set according to the resulting binary value in the AL register; the OF, AF, and CF flags are undefined.
| #UD | If the LOCK prefix is used. |
Same exceptions as protected mode.
Same exceptions as protected mode.
Same exceptions as protected mode.
| #UD | If in 64-bit mode. |


|
The
Calling
|
|
|
Camino
Palmero
|
1.
Unstoppable
2. Nothing's Changed 3. Wherever You Will Go 4. Could It Be Any Harder 5. Final Answer 6. Adrienne 7. We're Forgiven 8. Things Don't Always Turn Out That Way 9. Just That Good 10. Thank You 11. Stigmatized |


Post-doctoral Researchers
Positions are currently available and enquiries are welcome. These positions will be funded by the MINECO. If you are interested in the questions that we are asking and have experience in one or more of the techniques that we use, please contact Félix Viana or Ana Gomis with a CV and a short description of your experience in research. Please go to the link below and have a look to the details and contact information.
Requirements: we seek a highly motivated person interested in sensory research and with experience in one or more of the following techniques: electrophysiology, molecular genetics, molecular biology, behavioural assays.


Tell us where you would like to visit, when you will arrive, and when you will depart. We will advise of availability.

Tell us where you would like to visit, when you will arrive, and when you will depart. We will advise of availability.
Thank you for visiting our site!
We hope this site has been helpful. Please email us at<EMAIL_ADDRESS>with any suggestions, comments, or complaints. We would appreciate hearing from you.


CURLOPT_HEADERFUNCTION explained
NAME
CURLOPT_HEADERFUNCTION - callback that receives header data
SYNOPSIS
#include <curl/curl.h>
size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata);
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HEADERFUNCTION, header_callback);
DESCRIPTION
Pass a pointer to your callback function, which should match the prototype shown above.
This function gets called by libcurl as soon as it has received header data. The header callback will be called once for each header and only complete header lines are passed on to the callback. Parsing headers is very easy using this. The size of the data pointed to by buffer is size multiplied with nmemb. Do not assume that the header line is zero terminated!
The pointer named userdata is the one you set with the CURLOPT_HEADERDATA option.
This callback function must return the number of bytes actually taken care of. If that amount differs from the amount passed in to your function, it'll signal an error to the library. This will cause the transfer to get aborted and the libcurl function in progress will return CURLE_WRITE_ERROR.
A complete HTTP header that is passed to this function can be up to CURL_MAX_HTTP_HEADER (100K) bytes.
If this option is not set, or if it is set to NULL, but CURLOPT_HEADERDATA is set to anything but NULL, the function used to accept response data will be used instead. That is, it will be the function specified with CURLOPT_WRITEFUNCTION, or if it is not specified or NULL - the default, stream-writing function.
It's important to note that the callback will be invoked for the headers of all responses received after initiating a request and not just the final response. This includes all responses which occur during authentication negotiation. If you need to operate on only the headers from the final response, you will need to collect headers in the callback yourself and use HTTP status lines, for example, to delimit response boundaries.
When a server sends a chunked encoded transfer, it may contain a trailer. That trailer is identical to an HTTP header and if such a trailer is received it is passed to the application using this callback as well. There are several ways to detect it being a trailer and not an ordinary header: 1) it comes after the response-body. 2) it comes after the final header line (CR LF) 3) a Trailer: header among the regular response-headers mention what header(s) to expect in the trailer.
For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will get called with the server responses to the commands that libcurl sends.
LIMITATIONS
libcurl does not unfold HTTP "folded headers" (deprecated since RFC 7230). A folded header is a header that continues on a subsequent line and starts with a whitespace. Such folds will be passed to the header callback as a separate one, although strictly it is just a continuation of the previous line.
DEFAULT
PROTOCOLS
Used for all protocols with headers or meta-data concept: HTTP, FTP, POP3, IMAP, SMTP and more.
EXAMPLE
static size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata) { /* received header is nitems * size long in 'buffer' NOT ZERO TERMINATED */ /* 'userdata' is set with CURLOPT_HEADERDATA */ return nitems * size; } CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback); curl_easy_perform(curl); }
AVAILABILITY
RETURN VALUE
Returns CURLE_OK
SEE ALSO
CURLOPT_HEADERDATA, CURLOPT_WRITEFUNCTION
This HTML page was made with roffit.


Class: Aws::Resources::Documenter::WaiterOperationDocumenter
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
BaseOperationDocumenter
|
|
|
Instance Chain:
self,
BaseOperationDocumenter,
::Aws::Api::Docs::Utils,
::Seahorse::Model::Shapes,
::Seahorse::Model
|
|
| Inherits: |
Aws::Resources::Documenter::BaseOperationDocumenter
|
| Defined in: | aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb |
Class Method Summary
BaseOperationDocumenter - Inherited
Instance Attribute Summary
BaseOperationDocumenter - Inherited
Instance Method Summary
- #api_request
- #api_request_name
- #docstring
- #example_tags
- #option_tags
- #return_message
- #return_tag
- #state
- #waiter
BaseOperationDocumenter - Inherited
| #method_object | Constructs and returns a new YARD method object for this operation. |
Constructor Details
This class inherits a constructor from Aws::Resources::Documenter::BaseOperationDocumenter
Instance Method Details
#api_request
[ GitHub ]46 47 48
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 46
def api_request @resource_class.client_class.api.operation(api_request_name) end
#api_request_name
[ GitHub ]50 51 52
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 50
def api_request_name waiter.poller.operation_name end
#docstring
[ GitHub ]6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 6
def docstring super + ' ' + <<-DOCSTRING.lstrip Waits until this #{resource_class_name} is #{state}. This method waits by polling {Client##{api_request_name}} until successful. An error is raised after a configurable number of failed checks. This waiter uses the following defaults: | Configuration | Default | |-----------------|------------------------| | `#delay` | #{waiter.delay} | | `#max_attempts` | #{waiter.max_attempts} | You can modify defaults and register callbacks by passing a block argument. @yieldparam [Waiters::Waiter] waiter @raise [Waiters::Errors::WaiterFailed] @see Client#wait_until DOCSTRING end
#example_tags
[ GitHub ]58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 58
def example = <<-EXAMPLE.strip @example Basic usage #{variable_name}.#{operation_name} @example Modify default configuration #{variable_name}.#{operation_name} do |w| w.interval = 10 w.max_attempts = 100 w.before_attempt { |count| ... } w.before_wait do { |count, prev_resp| ... } end EXAMPLE [tag(example)] end
#option_tags
[ GitHub ]54 55 56
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 54
def [] end
#return_message
[ GitHub ]30 31 32 33 34 35 36
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 30
def if @operation.path "Returns a copy of this #{resource_class_name} with loaded data." else "Returns a copy of this #{resource_class_name} that is not loaded." end end
#return_tag
[ GitHub ]26 27 28
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 26
def return_tag tag("@return [#{resource_class_name}] #{}") end
#state
[ GitHub ]38 39 40
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 38
def state operation_name.to_s.sub('wait_until_', '') end
#waiter
[ GitHub ]42 43 44
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 42
def waiter<EMAIL_ADDRESS>end


I'm willing talk about anyyyything! Let's share about everything
Diversity in culture. Travel and work experiences. Thoughts about current global issues.


We got lots of features you can use!
Update example
Update example
Update example
Update example
Update example
Update example
Update example
Update example
Text example
And much more!
Example
if you have bug, feel free to contact us at discord!
Growmagic Growtopia Private server 2021
Created by purge


4(yon)cyclopedia
四字熟語(4 character kanji idioms)
You can check and enjoy with 四字熟語 "yo-ji-jyuku-go"
check out today's one


---
layout: talk_reveal4
title: SARS-CoV-2 evolutionary dynamics
venue: HVTN/CoVPN Conference
author: Trevor Bedford
widescreen: true
---
SARS-CoV-2 variants and
evolutionary dynamics
Trevor Bedford (@trvrb)
Associate Professor
Fred Hutchinson Cancer Research Center
{{ page.date | date: "%-d %b %Y" }}
1. Emergence and spread of variants of concern
2. Assessing adaptive evolution
3. Variant transmission dynamics
Emergence and spread of variants of concern
Over 3.4M SARS-CoV-2 genomes shared to GISAID and evolution tracked in real-time at nextstrain.org
Richard Neher,
Emma Hodcroft,
James Hadfield,
Thomas Sibley,
John Huddleston,
Ivan Aksamentov,
Moira Zuber,
Eli Harkins,
Jover Lee,
Cassia Wagner,
Louise Moncla,
Misja Ilcisin,
Kairsten Fay,
Allison Black,
Miguel Paredes,
Sidney Bell,
Denisse Sequeira
SARS-CoV-2 lineages establish globally in Feb and Mar 2020
Limited early mutations like spike D614G spread globally during initial wave
After initial wave, with mitigation
efforts and decreased travel,
regional clades emerge
Mutations in summer and fall 2020 were confined to regional dominance
Repeated emergence of 484K and 501Y across the world
Spread of VOC / VOI lineages across the world
Delta is outcompeting other variants and is on track to sweep
Variants show excess mutations across the genome
But show most substantial excess in the S1 domain of spike
Assessing adaptive evolution
Rapid and parallel adaptive mutations in spike S1 drive clade success in SARS-CoV-2
Katie Kistler,
John Huddleston
Phylogeny of 10k genomes equitably sampled in space and time
Measure clade growth as a proxy for viral fitness
Clades with more S1 nonsynonymous mutations grow faster
This correlation is absent in control regions
This correlation is stronger in S1 than other genes
S1 is quickly evolving and highly correlated with clade growth
dN/dS through time further highlights adaptive evolution
Rapid pace of adaptive evolution relative to H3N2 influenza
S1 mutations cluster phylogenetically, suggesting bursts of evolution
Many S1 mutations show strong convergent evolution
Mutations in S1 arising via within-host pressures result increase viral fitness and are enriched in the viral population by natural selection
Although selection has not been primarily for antigenic drift, observed level of adaptability suggests its potential
Variant transmission dynamics
Multiple approaches to modeling fitness differences between circulating variants
Multinomial logistic regression models work well on frequencies
However, frequency of a variant may rise while cases fall
SARS-CoV-2 variant dynamics across US states show consistent differences in transmission rates
Marlin Figgins
Estimation of variant-specific Rt through time using state-level data
State-level case counts are partitioned based on frequencies of sequenced cases
Partitioned case counts used to estimate variant-specific Rt through time
Figgins and Bedford. Unpublished.
Differences in intrinsic Rt across variants, but all trending downwards
Figgins and Bedford. Unpublished.
Consistent differences in variant-specific transmission rate across states
Figgins and Bedford. Unpublished.
Consistent reductions in variant-specific Rt from vaccination
Figgins and Bedford. Unpublished.
Future work would ideally tie together granular empirical estimates of viral fitness from frequency data
together with mutational and phenotypic predictors to learn what is driving variant success
Generally expect a transition from evolution being driven by selection for increased transmission to sustained
selection for antigenic drift
Acknowledgements
SARS-CoV-2 genomic epi: Data producers from all over the world, GISAID and the Nextstrain team
Bedford Lab:
John Huddleston,
James Hadfield,
Katie Kistler,
Louise Moncla,
Maya Lewinsohn,
Thomas Sibley,
Jover Lee,
Cassia Wagner,
Miguel Paredes,
Nicola Müller,
Marlin Figgins,
Eli Harkins,
Denisse Sequeira


package code.rules import code.model.Application; import code.model.Approval; rule "Applications with a credit score between 300 and 600 get the standard credit limit" when Application( creditScore >= 300, creditScore < 600 ) then insert( new Approval( "You received the standard credit limit", true ) ); end rule "Applications with a credit score above 500 get an extended credit limit" when Application( creditScore >= 600 ) then insert( new Approval( "Congratulations!!! You received an extended line of credit", true ) ); end rule "Applications with credit score less than 300 get rejected" when Application( creditScore < 300 ) then insert( new Approval( "Sorry, you were not approved", false ) ); end


--- layout: post title: "Monads" description: "A monad is a common abstraction. While typically associated with Haskell, monads also exist in C# and other languages." date: 2022-03-28 6:12 UTC tags: [Software Design, Functional Programming] image: "/content/binary/functors-applicatives-monads.png" image_alt: "Set diagram with monads shown as a subset of applicatives, which is shown as a subset of functors, again a subset of generic types." --- {% include JB/setup %}
{{ page.description }}
This article series is part of a larger series of articles about functors, applicatives, and other mappable containers.
If you understand what a functor is, it should be easy to grasp the idea of a monad. It's a functor you can flatten.
There's a little more to it than that, and you also need to learn what I mean by flatten, but that's the essence of it.
In this article-series-within-an-article series, I'll explain this disproportionally dreaded concept, giving you plenty of examples as well as a more formal definition. Examples will be in both C#, F#, and Haskell, although I plan to emphasise C#. I expect that there's little need of explaining monads to people already familiar with Haskell. I'll show examples as separate articles in this series. These articles are mostly aimed at object-oriented programmers curious about monads.
This list is far from exhaustive; more monads exist.
All monads are applicative functors, but not all applicative functors are monads. As the set diagram reiterates, applicative functors are functors, but again: not necessarily the other way around.
A monad is a functor you can flatten. What do I mean by flatten?
As in the article that introduces functors, imagine that you have some Functor<T>
container. More concretely, this could be IEnumerable<T>
, Maybe<T>
, Task<T>
, etcetera.
When working with functors, you sometimes run into situations where the containers nest inside each other. Instead of a Functor<decimal>
, you may find yourself with a Functor<Functor<decimal>>
, or maybe even an object that's thrice or quadruply nested.
If you can flatten such nested functor objects to just Functor<T>
, then that functor also forms a monad.
In C#, you need a method with this kind of signature:
public static Functor<T> Flatten<T>(this Functor<Functor<T>> source)
Notice that this method takes a Functor<Functor<T>>
as input and returns a Functor<T>
as output. I'm not showing the actual implementation, since Functor<T>
is really just a 'pretend' functor (and monad). In the example articles that follow, you'll see actual implementation code.
With Flatten
you can write code like this:
Functor<decimal> dest = source.Flatten();
Here, source
is a Functor<Functor<decimal>>
.
This function also exists in Haskell, although there, it's called join:
join :: Monad m => m (m a) -> m a
For any Monad m
you can flatten or join a nested monad m (m a)
to a 'normal' monad m a
.
This is the same function as Flatten
, so in C# we could define an alias like this:
public static Functor<T> Join<T>(this Functor<Functor<T>> source) { return source.Flatten(); }
Usually, however, you don't see monads introduced via join
or Flatten
. It's a shame, really, because it's the most straightforward description.
Most languages that come with a notion of monads define them via a function colloquially referred to as monadic bind or just bind. In C# it's called SelectMany
, F# computation expressions call it Bind
, and Scala calls it flatMap
(with a vestige of the concept of flattening). Haskell just defines it as an operator:
(>>=) :: Monad m => m a -> (a -> m b) -> m b
When talking about it, I tend to call the >>=
operator bind.
Translated to C# it has this kind of signature:
public static Functor<TResult> SelectMany<T, TResult>( this Functor<T> source, Func<T, Functor<TResult>> selector)
It looks almost like a functor's Select
method (AKA map
or fmap
function). The difference is that this selector
returns a functor value (Functor<TResult>
) rather than a 'naked' TResult
value.
When a Flatten
(or Join
) method already exists, you can always implement SelectMany
like this:
public static Functor<TResult> SelectMany<T, TResult>( this Functor<T> source, Func<T, Functor<TResult>> selector) { Functor<Functor<TResult>> nest = source.Select(selector); return nest.Flatten(); }
I've split the implementation over two lines of code to make it clearer what's going on. That's also the reason I've used an explicit type declaration rather than var
.
The Select
method exists because the type is already a functor. When you call Select
with selector
you get a Functor<Functor<TResult>>
because selector
itself returns a Functor<TResult>
. That's a nested functor, which you can Flatten
.
You can use SelectMany
like this:
Functor<TimeSpan> source = Functor.Return(TimeSpan.FromMinutes(32)); Functor<double> dest = source.SelectMany(x => Functor.Return(x.TotalSeconds + 192));
The lambda expression returns a Functor<double>
. Had you called Select
with this lambda expression, the result would have been a nested functor. SelectMany
, however, flattens while it maps (it flatMaps). (This example is rather inane, since it would be simpler to use Select
and omit wrapping the output of the lambda in the functor. The later articles in this series will show some more compelling examples.)
If you already have Flatten
(or Join
) you can always implement SelectMany
like this. Usually, however, languages use monadic bind (e.g. SelectMany
) as the foundation. Both C#, Haskell, and F# do that. In that case, it's also possible to go the other way and implement Flatten
with SelectMany
. You'll see examples of that in the subsequent articles.
Several languages understand monads well enough to provide some degree of syntactic sugar. While you can always use SelectMany
in C# by simply calling the method, there are situations where that becomes awkward. The same is true with bind
functions in F# and >>=
in Haskell.
In C# you can use query syntax:
Functor<DateTime> fdt = Functor.Return(new DateTime(2001, 8, 3)); Functor<TimeSpan> fts = Functor.Return(TimeSpan.FromDays(4)); Functor<DateTime> dest = from dt in fdt from ts in fts select dt - ts;
In order to support more than a single from
expression, however, you must supply a special SelectMany
overload, or the code doesn't compile:
public static Functor<TResult> SelectMany<T, U, TResult>( this Functor<T> source, Func<T, Functor<U>> k, Func<T, U, TResult> s) { return source.SelectMany(x => k(x).Select(y => s(x, y))); }
This is an odd quirk of C# that I've yet to encounter in other languages, and I consider it ceremony that I have to perform to satiate the C# compiler. It's not part of the concept of what a monad is. As far as I can tell, you can always implement it like shown here.
Haskell's syntactic sugar is called do notation and works for all monads:
example :: (Monad m, Num a) => m a -> m a -> m a example fdt fts = do dt <- fdt ts <- fts return $ dt - ts
In F#, computation expressions drive syntactic sugar, but still based (among other things) on the concept of a monad:
let example (fdt : Monad<DateTime>) (fts : Monad<TimeSpan>) = monad { let! dt = fdt let! ts = fts return dt - ts }
Here, we again have to pretend that a Monad<'a>
type exists, with a companion monad
computation expression.
The ability to flatten nested functors is the essence of what a monad is. There are, however, also some formal requirements. As is the case with functors, there are laws that a monad should obey. I'll dedicate a separate article for those, so we'll skip them for now.
Another requirement is that in addition to SelectMany
/bind
/flatMap
/>>=
a monad must also provide a method to 'elevate' a value to the monad. This function is usually called return. It should have a type like this:
public static Functor<T> Return<T>(T x)
You can see it in use in the above code snippet, and with the relevant parts repeated here:
Functor<DateTime> fdt = Functor.Return(new DateTime(2001, 8, 3)); Functor<TimeSpan> fts = Functor.Return(TimeSpan.FromDays(4));
This code example lifts the value DateTime(2001, 8, 3)
to a Functor<DateTime>
value, and the value TimeSpan.FromDays(4)
to a Functor<TimeSpan>
value.
Usually, in a language like C# a concrete monad type may either afford a constructor or factory method for this purpose. You'll see examples in the articles that give specific monad examples.
A monad is a functor you can flatten. That's the simplest way I can put it.
In this article you learned what flattening means. You also learned that a monad must obey some laws and have a return function. The essence, however, is flattening. The laws just ensure that the flattening is well-behaved.
It may not yet be clear to you why some functors would need flattening in the first place, but subsequent articles will show examples.
The word monad has its own mystique in software development culture. If you've ever encountered some abstruse nomenclature about monads, then try to forget about it. The concept is really not hard to grasp, and it usually clicks once you've seen enough examples, and perhaps done some exercises.
Next: Kleisli composition.
Comments
Quoting image in words:
As your aricle about Monomorphic functors shows, not every functor is a generic type. However, it is true that every applicative functor is a generic (or polymorphic) functor.
True, the illustration is a simplification.
I guess you might know that already but the reason for the strange
SelectMany
ceremonial version is compiler performance. The complicated form is needed so that the overload resolution does not take exponential amount of time. See a 2013 article by Eric Lippert covering this.Petr, thank you for writing. I remember reading about it before, but it's good to have a proper source.
If I understand the article correctly, the problem seems to originate from overload resolution. This would, at least, explain why neither F# nor Haskell needs that extra overload. I wonder if a language like Java would have a similar problem, but I don't think that Java has syntactic sugar for monads.
It still seems a little strange that the C# compiler requires the presence of that overload. Eric Lippert seems to strongly imply that it's always possible to derive that extra overload from any monad's fundamental functions (as is also my conjecture). If this is so, the C# compiler should be able to do that work by itself. Monads that wish to supply a more efficient implement (e.g.
IEnumerable<T>
) could still do so: The C# compiler could look for the overload and use it if it finds it, and still fall back to the default implementation if none is available.But I suppose that since the query syntax feature only really exists to support
IEnumerable<T>
this degree of sophistication wasn't warranted.


prelims | root_dir<-"/Users/tom/Documents/Programming/Restaurant kaggle"
require(foreign)
require(caret)
require(caretEnsemble)
#require(h2o)
require(doSNOW)
require(parallel)
require(knitr)
opts_chunk$set(eval=F,echo=T,purl=F)
|
|
get the requisite training data. convert into epoch time. that's seconds since jan 1 1970. it's a number, so who cares what it is. | train<-read.csv("train.csv")
test<-read.csv("test.csv")
train$Open.Date<-as.integer(
as.POSIXct(as.Date(train$Open.Date,format="%m/%d/%Y"),tz = "GMT"))
test$Open.Date<-as.integer(
as.POSIXct(as.Date(test$Open.Date,format="%m/%d/%Y"),tz = "GMT"))
levels(train$Type)<-c(levels(train$Type),"MB")
partition<-createDataPartition(train$revenue,2)
|
|
I tried to mess with this as factors, but it didn't pan out.  I ran this with oblimax rotations too. still little to no improvement. | require("psych")
x<-fa(train[,grepl(names(train),pattern="P")],nfactors = 6,rotate = "varimax")
trainfa<-cbind(
train[grepl(names(train),pattern=".*(rev|Open|Type|City|Group).*")],x$scores)
testfa<-fa(
test[,grepl(names(test),pattern="P")],nfactors = 6,rotate = "varimax")
test<-cbind(test[,],testfa$scores)
train<-cbind(train,x$scores)
|
|
setup for parallel processing | cl<-makeCluster(8)
registerDoSNOW(cl)
|
|
I am abundantly aware that using this many folds will overfit the data, esp. when using gbm. but it has yeilded a decent score so far. | tc<-trainControl(method = 'cv',number = 70,repeats = 100)
|
|
i've been looking at this to try to get more diversity in the algorithms I use.
methods tried: ANFIS (high rmse), bsTree(high rmse, correlates with gbm), rpart and rf (both correlate strongly with gbm but are slower) | tl=list(
gbm=caretModelSpec(
method='gbm',
tuneGrid=expand.grid(interaction.depth = c(3:5),
n.trees = seq(500,5000,500), shrinkage = c(0.01,.1,.001) ) )
,dnn=caretModelSpec(method='dnn',
tuneGrid=expand.grid(layer1=c(3),layer2=c(5),layer3=c(2),
hidden_dropout=c(.1,.2,.3),visible_dropout=c(.1,.2,.3)))
,glmboost=caretModelSpec(
method='glmboost',tuneGrid=expand.grid(prune=T,mstop=c(100,200,300)) )
)
model_list <- caretList(
revenue~., data=train[,c(2,4,6:19,24:29,33,34,43)],
tuneList=tl,
trControl = tc
,methodList=c('cubist')
)
modelCor(resamples(model_list))
|
|
Running a greedy ensemble like this produces shitty rmse
again, way overfitting here. I know. but it has been good for the score. low RMSE, even with high variance seems to pay off a bit here.
I've run the stacked model using both glmboost, straight glm and rf. glmboost has performed the best (w.r.t. lowest rmse) | greedy_ensemble <- caretEnsemble(model_list)
summary(greedy_ensemble)
glmensemble<-caretStack(
model_list,
method='gbm'
,tuneGrid = expand.grid(
interaction.depth = c(3:5),n.trees=seq(500,5000,500),shrinkage=.001)
,trControl=trainControl(method='cv',number=110,repeats = 10)
)
glmensemble
|
|
pulling in the sample submission and writing the results to a file called submit.csv. | sample<-read.csv(file.path("sampleSubmission.csv"))
submit<-predict(glmensemble,test)
sample$Prediction<-submit
write.csv(sample,file="submit.csv",row.names=F,col.names=F)
|
|
this can be used to see what other models (that don't correlate) | tag <- read.csv("http://topepo.github.io/caret/tag_data.csv", row.names = 1)
tag <- as.matrix(tag)
## Select only models for regression
regModels <- tag[tag[,"Regression"] == 1,]
all <- 1:nrow(regModels)
## Seed the analysis with the SVM model
start <- grep("(gbm)", rownames(regModels), fixed = TRUE)
pool <- all[all != start]
## Select 4 model models by maximizing the Jaccard
## dissimilarity between sets of models
nextMods <- maxDissim(regModels[start,,drop = FALSE],
regModels[pool, ],
method = "Jaccard",
n = 4)
rownames(regModels)[c(start, nextMods)]
|
|
| |


- causes - Variable in class model.ReactiveRule
-
- child - Variable in class model.SimpleSentenceSolutionNode
-
- clause - Variable in class model.AbstractSolutionNode
-
- Clause - Interface in model
-
This interface represents a subdivision among the predicate expressions.
- clear() - Method in class model.SubstitutionSet
-
Deletes all the bindings.
- COMMENT - Static variable in class controller.syntax.JLPSSyntaxLexer
-
- COMMENT - Static variable in class controller.syntax.JLPSSyntaxParser
-
- COMMENT_LINE - Static variable in class controller.syntax.JLPSSyntaxLexer
-
- COMMENT_LINE - Static variable in class controller.syntax.JLPSSyntaxParser
-
- conditions - Variable in class controller.syntax.JLPSSyntaxParser.preconditions_return
-
- conditions - Variable in class model.Action
-
- conflicts - Variable in class controller.syntax.JLPSSyntaxParser.preconditions_return
-
- conflicts - Variable in class model.Action
-
- CONSTANT - Static variable in class controller.syntax.JLPSSyntaxLexer
-
- CONSTANT - Static variable in class controller.syntax.JLPSSyntaxParser
-
- constant() - Method in class controller.syntax.JLPSSyntaxParser
-
- Constant - Class in model
-
This class represents constants or values.
- Constant() - Constructor for class model.Constant
-
Constructor of the class.
- Constant(String) - Constructor for class model.Constant
-
Constructor of the class.
- controller - package controller
-
This package is the controller package of the model-view-controller
(MVC) pattern.
- controller.syntax - package controller.syntax
-
This package is the syntax package of the controller package.
- create(List<Clause>) - Method in class model.AbstractOperator
-
Generic constructor of sub-objects.
- create(List<Clause>) - Method in class model.And
-
Generic constructor of the object.
- create(List<Clause>) - Method in class model.Not
-
Generic constructor of the object.
- currentRule - Variable in class model.AbstractSolutionNode
-
- currentRuleCount() - Method in class model.AbstractSolutionNode
-
Gets the number of the current rule.
- CycleHandler - Class in model
-
Singleton class that handle the cycles of an LPS framework.
- CycleHandler() - Constructor for class model.CycleHandler
-
Constructor of the class.
- CycleState - Interface in model
-
This is the interface to implement in order to add steps to the cycle.


Built a "freewriting" text editor: type what's on your mind and have your thoughts organized in real time
Node.js, D3.jsAn analytics platform for privacy-preserving personal data analysis
Node.js, AngularJS, MongoDB, Express, PythonTraining a deep neural network to count the number of cars in an image of a parking lot
TensorFlow, PythonPorting healthcare data from legacy applications to the cloud
SQL, Python


Fakes and Stubbing and Mocks, Oh My!
This page seeks to provide an overview on mocking and a related task: redirecting function calls to test-only code. Note: many people use the term “mocking” to refer to the latter (and that’s fine!), but we’ll try and keep the concepts separate in this doc.
KUnit currently lacks specific support for either of these, in part due to the fact there’s enough trade-offs that it’s hard to come up with a generic solution.
Why do we need this?
First, let’s consider what the goal is. We want unit tests to be as lightweight and hermetic as possible, and only test the code we care about.
A canonical example in userspace testing to consider is a database. We’d want to verify that our code behaves properly (inserts the right rows to the database, etc.), but we don’t want to bring up a test database every time we run our tests.
Not only will this make the test take longer to run, it also adds more opportunities for the test to break in uninteresting ways, e.g. if writes to the database fail due to transient network issues.
If we can construct a “fake” database that implements the same interface, which is simply an in-memory hashtable or array, then we can have much faster and more reliable tests. Unit tests simply don’t need the scability and features of a real database.
Fakes versus mocks
We’ll be using terminology roughly as defined in https://martinfowler.com/bliki/TestDouble.html, namely:
a “test double” is the more generic term for any kind of test-only replacement.
a “mock” is a test double that specifically can make assertions about how its called and can return different values based on its inputs.
a “fake” is a test double that mimics the semantics of the code it’s replacing but with less overhead and dependencies, e.g. a fake database might just use a hash table, or a fake IO device which is just a
char buffer[MAX_SIZE]
, or UML itself (in a sense).
Downsides of mocking
Very briefly, using mocks in tests can make tests more fragile since they test “behavior” rather than “state.”
What do we mean by that? Let’s imagine we’re testing some userspace program with gMock-like syntax (a C++ mocking framework):
void send_data(struct data_sink *sink)
{
/* do some fancy calculation to figure out what to write */
sink->write("hello, ");
sink->write("world");
}
void test_send_data(struct test *test)
{
struct data_sink *sink = make_mock_datasink();
EXPECT_CALL(data_sink, write("hello, "))
.WillOnce(Return(7));
EXPECT_CALL(data_sink, write("world"))
.WillOnce(Return(5));
send_data(sink);
}
And now let’s say we’ve realized we can make our code twice as fast with more buffering, effectively changing it to:
void send_data(struct data_sink *sink)
{
sink->write("hello, world");
}
write()
!write()
might just append to some char buffer[MAX_SIZE]
. In that case, we can validate send_data()
worked by just using KUNIT_EXPECT_STREQ(test, buffer, "hello, world")
and it would work for either implementation.A further downside is that the test author has to mimic the behavior
themselves, i.e. the return values for each write()
call. This means if
the test author makes a mistake or tests just don’t get updated after a
refactor, the mock can behave in unrealistic fashion.
This can and will eventually lead to bugs.
Upsides of mocking
write()
once since each call is super-expensive.prefetchw()
is called to pull a specific data structure into cache.write()
call fail so we can test an error path.data_sink
example above, it’s hard for an append into a char buffer[MAX_SIZE]
to fail until we hit MAX_SIZE
, but for real code that might be writing to disk or sending data over the network, failure could happen for ~any call. And it’s valuable to test that our code is robust against such failures.Function redirection
real_function()
go to my fake_function()
?The problem boils down to adding another layer of indirection and we have various options to choose from, which we’ll describe below.
For each of these, let’s consider the following code:
static void func_under_test(void)
{
/* unsafe to call this function directly in a test! */
send_data_to_hardware("hello, world\n");
}
Note
This RFC patch series here is the KUnit team’s attempt at implementing a solution here. Feedback there is welcome! The rest of this doc is mainly useful if you don’t want to wait on that or it doesn’t work for you use case.
Run time (ops structs, “class mocking”)
This is the most straightforward approach and fundamentally boils down to doing this:
static void func_under_test(void (*send_data_func)(const char *str))
{
send_data_func("hello, world\n");
}
Being a bit more sophisticated, we can introduce a struct to hold the functions:
struct send_ops {
void (*send)(const char *str);
/* maybe more functions here in real code */
};
TODO(dlatypov@google.com): write about “class mocking”, RFC here
Pros:
Simplest implementation: “it’s just code.”
This is the only approach here where we can limit the scope of the redirection.
The subsequent approaches globally redirect all calls to
send_data_to_hardware()
, potentially in code not-under-test we don’t want to mess with.
There are plenty of such structs throughout the kernel.
And users don’t need any special support from KUnit.
Cons:
~Everyone knows about this convention but still want “mocking.” It’s not seen as sufficient by itself.
Requires the most invasive code changes if the code isn’t already using this pattern.
Introduces runtime overhead (an indirect call, another function argument, etc.)
If
func_under_test()
is publicly exposed, butsend_data_func()
is not (most likely the case), users need to workaround this.The RFC for “class mocking” requires a lot of boilerplate, even after providing macros to take care of most of it.
This is fundamentally a limitation of C (as opposed to C++ where classes have language support). It’s unlikely we can improve much here.
Compile time
This involves using compiler directive, macros, etc. to change the code when compiling KUnit tests, or for your specific test. E.g. a straightforward approach could be
void send_data_to_hardware(const char *str)
{
#ifdef CONFIG_MY_KUNIT_TEST /* or some other, more generic check */
test_send_data(str);
return;
#endif
/* real implementation */
}
This pattern is generally useful and recommended here for injecting other kinds of test-only code.
Note
This example makes it so that send_data_to_hardware()
no longer
works for the whole kernel, including other tests if they happen to
compiled along with CONFIG_MY_KUNIT
, even if it’s set as
CONFIG_MY_KUNIT_TEST=m
(!). See the code below or
Hybrid approaches (limiting scope) for a
discussion on how to mitigate that.
We’ve also sent out an RFC patch to try and standardize this approach behind a nice shiny API.
Unlike the example above, this API also ensures that the redirection only applies to the kthread that’s running the test and is undone when the test exits.
Using the API from that patch, our example above becomes:
void send_data_to_hardware(const char *str)
{
KUNIT_STATIC_STUB_REDIRECT(send_data_to_hardware, str);
/* real implementation */
}
/* In test file */
int times_called = 0;
void fake_send_data_to_hardware(const char *str)
{
/* fake implementation */
times_called++;
}
...
/* In the test case, redirect calls for the duration of the test */
kunit_activate_static_stub(test, send_data_to_hardware, fake_send_data_to_hardware);
send_data_to_hardware("hello");
KUNIT_EXPECT_EQ(test, times_called, 1);
/* Can also deactivate the stub early, if wanted */
kunit_deactivate_static_stub(test, send_data_to_hardware);
send_data_to_hardware("hello again");
KUNIT_EXPECT_EQ(test, times_called, 1);
Pros:
Also easy to understand.
No runtime overhead, unlike the option above.
Cons:
Requires invasive changes to the function we’re trying to stub as opposed to the coder-under-test itself.
So it’s not suitable if you don’t own
send_data_to_hardware()
.
We don’t want to pollute normal code by doing this at a large scale.
So it probably should only be used sparingly in narrow contexts, e.g. in static functions.
Link time (__weak symbols)
We can avoid refactoring to the code-under-test and only have minimal changes
to send_data_to_hardware()
by pushing the indirection into the linker.
More specifically, we can make use of “weak symbols”, which would allow tests
to define their own definitions and override the original
send_data_to_hardware()
, e.g.
void __weak send_data_to_hardware(const char *str)
{
/* real implementation */
}
/* In test file */
/* Since the real function is __weak, we can override it here. */
void send_data_to_hardware(const char *str)
{
/* fake implementation */
}
We can minimize the risk of accidentally overriding functions by using a macro like
/* Now we can mark functions __weak only while building tests */
#ifdef CONFIG_KUNIT
#define __mockable __weak
#else
#define __mockable
#endif
Pros:
No runtime overhead.
No changes needed to the code-under-test,
func_under_test()
.And overall, very minimal changes needed to non-test code.
Cons:
Initial feedback when something similar was included in the initial KUnit RFC is that this is adding more complexity.
ftrace
and friends exist and allow for patching binaries.Note that this is a much more stripped-down version of what the KUnit RFC called “function mocking,” so it’s not as big of a concern.
Not possible to limit the scope of the redirection. The real definition is discarded by the linker.
Can also only have one fake definition at any time.
Won’t work with tests built as modules.

E.g. if you forgot to include the replacement definition in the compilation unit, the code will happily call the original one without any warning or indication.
Your test might want the real function to be called, so building your test together with someone else’s might cause failures if they redirected it.
Hybrid approaches (limiting scope)
Summarizing, the main issue with the two approaches above is that they have effects globally and for the full life of the kernel, not just during tests.
How can we get around this? Why, of course, by adding another layer of indirection. Using some cleverness, we can use runtime indirection while building tests, but not pay the cost for normal builds.
Say we want to redirect/intercept calls to kmalloc()
. Too many callsites
need to use it so that stubbing it out is unwise (and would break KUnit
itself). So we can introduce a __weak
wrapper around it like so:
#ifdef CONFIG_KUNIT
#define __mockable_wrapper __weak
#else /* avoid the performance overhead for real builds */
#define __mockable_wrapper __always_inline
#endif
void __mockable_wrapper kmalloc_wrapper(size_t n, gfp_t gfp)
{
return kmalloc(n, gfp);
}
This adds more boilerplate, but lets us manage the scope of the code affected by the redirection. We can also limit the temporal scope of the redirection if our replacement is defined like:
/* In the test file. This is the definition that overrides the __weak version */
static void* (*kmalloc_ptr)(size_t n, gfp_t gfp) = kmalloc;
void* kmalloc_wrapper(size_t n, gfp_t gfp) {
return kmalloc_ptr(n, gfp);
}
/* elsewhere in test case: use a fake implementation and then revert back */
kmalloc_ptr = my_fake_kmalloc;
KUNIT_EXPECT_EQ(some_test_function(), 42);
kmalloc_ptr = kmalloc;
Note that we can do the same thing using compile-time indirection
#ifdef CONFIG_MY_KUNIT_TEST /* or some other, more generic check */
static void* (*kmalloc_ptr)(size_t n, gfp_t gfp) = kmalloc;
#endif
void* kmalloc_wrapper(size_t n, gfp_t gfp) {
#ifdef CONFIG_MY_KUNIT_TEST
return kmalloc_ptr(n, gfp);
#endif
return kmalloc(n, gfp);
}
/* in test file, use the fake for one call */
kmalloc_ptr = my_fake_kmalloc;
KUNIT_EXPECT_EQ(some_test_function(), 42);
kmalloc_ptr = kmalloc;
See Storing and accessing state for fakes/mocks for more details on cleanly handling state in test
doubles. In particular, one could use “named resources” instead of global
variables like kmalloc_ptr
. That approach would also be thread-safe, unlike
this example.
Pros:
No runtime overhead outside of tests.
For the link-time based approach
__always_inline
should eliminate the potential function call overhead.With the compile-time approach, the code is unchanged unless the relevant tests are being built.
Able to limit the scope of the redirection to code we care about.
Are also able to limit how long the redirection is in place.
Cons:
The code-under-test (
func_under_test()
) needs to be changed to use this new wrapper, somewhat hurting legibility.Requires a decent amount of boilerplate for every single function we might want to stub.
Probably best reserved for only a few key functions. We could have shared implementations for some, e.g.
kmalloc()
, if they’re flexible enough (e.g. allow assigning arbitrary function pointers like in the second example).
Inherits issues of the other approach, e.g.
__weak
won’t work with modules, etc.
Binary-level (ftrace et. al)
Similar to link-time approaches, we can avoid invasive changes by doing the indirection at runtime.
Using ftrace and kernel livepatch, we can redirect calls to arbitrary functions (as long as they don’t get inlined!) and undo it when we’re done.
This RFC patch implements this approach, so see that for the exact specifics on how this works. We’ll be using the API from that RFC patch in the example below.
/* Note: marks the function as noinline if stubs are enabled, otherwise does nothing */
void KUNIT_STUBBABLE send_data_to_hardware(const char *str)
{
/* real implementation */
}
/* In test file */
int times_called = 0;
void fake_send_data_to_hardware(const char *str)
{
/* fake implementation */
times_called++;
}
...
/* In the test case, redirect calls for the duration of the test */
kunit_activate_ftrace_stub(test, send_data_to_hardware, fake_send_data_to_hardware);
send_data_to_hardware("hello");
KUNIT_EXPECT_EQ(test, times_called, 1);
/* Can also deactivate the stub early, if wanted */
kunit_deactivate_ftrace_stub(test, send_data_to_hardware);
send_data_to_hardware("hello again");
KUNIT_EXPECT_EQ(test, times_called, 1);
Pros:
This is the least invasive change to the code-under-test.
You just have to ensure that the function isn’t inlined when compiling the kernel for testing, which you can do via
KUNIT_STUBBABLE
.
Unlike the link-time approach above, the redirection is reversible and is localized to the test.
Cons:
Has a number of Kconfig dependencies that don’t work on all architectures (including UML).
Relies on a level of “magic”, so fully understanding how it works is much harder than e.g. compile-time approaches.
Storing and accessing state for fakes/mocks
One of the challenges of implementing both mocks and fakes is how to track state. We can’t pass in additional parameters since that’ll change the function signature, so we need some way of stashing state somewhere.
Below, we have two examples of how you can do so fairly cleanly.
Using named resources
We can use current->kunit_test
with kunit_add_named_resource
to store
and retrieve test-specific data, e.g.
/* in some shared file, mock_write.h/c */
/* Store some data per-test and have a kunit_resource handle for it. */
struct mock_write_data {
int times_called;
bool should_return_error;
};
static struct kunit_resource mock_write_data_resource;
int mock_write_init(struct kunit *test, struct mock_write_data *data) {
data->times_called = 0;
data->should_return_error = false;
return kunit_add_named_resource(test, NULL, NULL, &mock_write_data_resource,
"mock_write_data", data);
};
int mock_write(const char *data)
{
struct kunit_resource *resource;
struct mock_write_data *mock;
if (!current->kunit_test)
return -1;
resource = kunit_find_named_resource(current->kunit_test, "mock_write_data");
if (!resource) {
KUNIT_FAIL(current->kunit_test, "mock_write called before mock_write_init()!");
return -1;
}
mock = resource->data;
mock->times_called++;
return mock->should_return_error ? -1 : 0;
}
/* Then in the test file, can use the mock like so */
static void example_write_test(struct kunit *test)
{
struct mock_write_data mock;
mock_write_init(test, &mock);
mock.should_return_error = true;
KUNIT_EXPECT_LT(test, mock_write("hi"), 0);
mock.should_return_error = false;
KUNIT_EXPECT_EQ(test, mock_write("hi"), 0);
KUNIT_EXPECT_EQ(test, mock.times_called, 2);
}
Storing state without KUnit
The approach above is tied to KUnit, but it’s obviously possible to come up with ways to do it without that dependency.
For example, if you’re targeting an ops struct, we can employ some
container_of()
shenanigans.
To make the example a bit simpler, let’s assume our ops struct passes a pointer to itself for each operation.
struct writer {
int (*write)(struct writer *writer, const char *data);
};
/* in mock_writer.h/c */
struct mock_writer {
struct writer ops;
int times_called;
bool should_return_error;
};
static int mock_write(struct writer *writer, const char *data)
{
struct mock_writer *mock = container_of(writer, struct mock_writer, ops);
mock->times_called++;
return mock->should_return_error ? -1 : 0;
}
void init_mock_writer(struct mock_writer *mock) {
mock->ops.write = mock_write;
mock->times_called = 0;
mock->should_return_error = false;
}
/* Then in the test file */
static void example_simple_test(struct kunit *test)
{
struct mock_writer mock;
struct writer *writer = &mock.ops;
init_mock_writer(&mock);
mock.should_return_error = true;
KUNIT_EXPECT_LT(test, writer->write(writer, "hi"), 0);
mock.should_return_error = false;
KUNIT_EXPECT_EQ(test, writer->write(writer, "hi"), 0);
KUNIT_EXPECT_EQ(test, mock.times_called, 2);
}
If this seems unrealistic, that’s because it is, but it’s not too far from the
truth. E.g. struct inode
has a struct inode_operations *i_ops
member
and each operation takes a struct inode*
as an argument (or a struct
dentry
which we can easily convert over via d_inode()
).
So in that more realistic example, we’d have:
struct mock_inode {
struct inode real;
/* mock/fake state stuff */
int readlink_err;
int get_acl_err;
};
static struct posix_acl *mock_get_acl(struct inode *inode, int type)
{
struct mock_inode *mock = container_of(inode, struct mock_inode, real);
if (mock->get_acl_err)
return ERR_PTR(get_acl_err);
return posix_acl_alloc(3, GFP_KERNEL);
}
static int mock_readlink(struct dentry *dentry, char __user * buffer, int buflen)
{
/* get mock_inode indrectly */
struct inode *inode = d_inode(dentry);
struct mock_inode *mock = container_of(inode, struct mock_inode, real);
return mock->readlink_err;
}
struct inode_operations mock_inode_operations = {
.get_acl = mock_get_acl,
.readlink = mock_readlink,
/* ... */
};
void mock_inode_init(struct mock_inode *mock)
{
/* ... */
mock->real.i_ops = &mock_inode_operations;
}


Dang! Looks like no stats are available. I am sorry, but this should not have happened. Check the console output for an error message.


This is the prediction form, where you can provide the day's weather conditons and station number here. After clicking "Predict" button,
you will be able to get the predicted bike usage condition of that bike station in that day. You can also click the Markers which containing
the station numbers on above google map, by which it will pop up the details of that Bike Station.


Choose the columns that you want to display into your report. You can always go back to the default columns. Drag and drop columns from left to right to pick the ones to the report.
Newly added Recently edited Appointment confirmed Appointment cancelled


Monsters
Most monsters had already inhabited the material plane by the time Dwarves and Elves were created, however a few monsters were created or enhanced by the gods and demons. As a result, monsters that have the ability to think (i.e. Dragons, Aboleths, beholders) very, very rarely like or respect the gods and can become demons if left to their own devices for long enough.
Alternatively, some monsters can have tenuous relationships of respect with the gods and remain simply as powerful entities throughout the world.
-
Fiends [wiki] - disciples of demons who performed rituals to give them power, the power of the fiends depends on how many rituals their ‘master’ gave them, which usually depends on loyalty. (aka, the stronger the fiend, the more loyal to the cause of the demon)
-
Aberrations [wiki] - Strange creatures with seemingly no origin. No one knows where they came from, and the ones intelligent enough to ask about them would… rather not talk about it. All that is known is that they have been constantly popping up in seemingly random places all throughout history.
-
Beasts [wiki] -
-
Celestials [wiki] -
-
Monstrosities [wiki] - Types of monsters that originate from before the Gods initial presence, with varying levels of intelligence, usually not to powerfull of monsters, there are many of each kind
-
Plants [wiki] - Plant monsters are semi-common plants that can pose any kind of direct or intentional danger towards a sentient species of Pyrrhos. These could have had human tampering, or be completely natural.
-
Fey [wiki] - Those that originate from the Feywild
-
Undead [wiki] - A soul that has managed to escape from the Spirit Plane through one of the many holes out of the gaze of Nthanda. Some of these souls have come out themselves, some forced out (much to Nthanda’s chagrin). Some souls originated from the Spirit Plane, and some are normal people who have been twisted into something less than. Before Nthanda’s ascension, there were many more undead crawling on the Material Plane, however the barrier between the two is weak, and holes are often made. A great number of undead in an area can sometimes symbolize an area where the barriers of the Spirit Plane have one such hole, but they rarely stay that way for long.
-
Constructs [wiki] -
-
Elementals [wiki] - Beings born from the land of elementally touched areas, some are born stronger, and some are born with different moral persuasions. Many lack formal sentience and will as we know it, and those who are neutral can easily be persuaded to join the side of someone more powerful. There are four elder elementals in Pyrrhos, the oldest beings born from large elementally touched areas at their conception, one for each element. These beings have great knowledge, and great power, but are very careful who they give this knowledge to, and where they reside is often kept from public knowledge to the communities inside of the touched areas.
-
Unique Monsters [wiki] - Powerful beings that are created from a variety of circumstances, some may be man-made creatures gone berserk, or a nearly extinct race from a time before written history. Usually one of a kind beasts of great power, the kinds of monsters that folk tales are based on. I will be creating a variety of these so good luck, hehe. (note: demons are technically “unique monsters”)


Brands on discount
Best of fashion for everyone...
Women's Section
A woman's world. Go with the flow this season !
Men's Section
Sunny days and sizzling looks are here agin !
Kid's Section
Styles for your tiny tots !
Best of fashion for everyone...
A woman's world. Go with the flow this season !
Sunny days and sizzling looks are here agin !
Styles for your tiny tots !
Best of summer fragrances. Upto 50% off !
Shop from top brands. Easy returns and refunds.
To avail the offer sign in from the link given below..


View the source on GitHub, or just the model's source on Kaggle.
LendingClub is the world's largest peer-to-peer lending platform. Until recently (through the end of 2018), LendingClub published a public dataset of all loans issued since the company's launch in 2007.
I decided to
create a neural network
with this dataset to predict the fraction of an expected loan return
that a prospective borrower will pay back. Now, to share it, I've
created this API to serve the model. If you'd like to interface with
this API directly (rather than using the above web form), send a GET
request to
https://tywmick.pythonanywhere.com/api/predict
(just make
sure to include every parameter in your query string).
This API is written in Python with Flask. I also used TensorFlow/Keras to load and predict with the model I created, and pandas and scikit-learn to manipulate the incoming API data a bit before loading it into the model.
Please enjoy, and let me know if you have any questions!
Sincerely,