An extension function is invoked using a name such as prefix:localname()
.
The prefix must
be the prefix associated with a namespace declaration that is in scope.
Extension functions must be implemented in Java.
The command line option -TJ is useful for debugging the loading of Java extensions. It gives detailed information about the methods that are examined for a possible match.
These functions do not need to be declared. The URI for the
namespace identifies the Java class where the external function will be found.
The namespace URI should be "java:" followed by the fully-qualified class name
(for example xmlns:date="java:java.util.Date"
).
The class must be on the classpath.
For compatibility with other products and previous Saxon releases, Saxon (in XSLT only) supports
certain other formats of URI. The URI may be a string containing a "/",
in which the fully-qualified class name appears after the final "/".
(for example xmlns:date="http://www.jclark.com/xt/java/java.util.Date"
). The part of
the URI before the final "/" is immaterial.
The format xmlns:date="java.util.Date"
is also supported.
The Saxon namespace URI "http://saxon.sf.net/" is recognised as a special case, and causes the
function to be loaded from the class net.sf.saxon.functions.Extensions
.
This class name can be specified explicitly if you prefer.
There are three cases to consider: static methods, constructors, and instance-level methods. In addition, a public field in a class is treated as if it were a zero-argument method, so public static fields can be accessed in the same way as public static methods, and public instance-level fields in the same way as instance-level methods.
Static methods can be called directly.
The localname of the function must match the name of a public static method in this class. The names
match if they contain the same characters, excluding hyphens and forcing any character that follows
a hyphen to upper-case. For example the XPath function call to-string()
matches the Java method
toString()
; but the function call can also be written as toString()
if you prefer.
If there are several methods in the class that match the localname, and that have the correct number
of arguments, then the system attempts
to find the one that is the best fit to the types of the supplied arguments: for example if the
call is f(1,2)
then a method with two int
arguments will be preferred
to one with two String
arguments. The rules for deciding between methods are quite complex. Essentially, for each candidate method,
Saxon calculates the "distance" between the types of the supplied arguments and the Java class of the
corresponding method in the method's
signature, using a set of tables given below. For example, the distance between the XPath data type "boolean"
and the Java class "boolean" is very small, while the distance between an XPath string and a Java boolean
is much larger. If there is one candidate method where the distances of all arguments are less-than-or-equal-to
the distances computed for other candidate methods, and the distance of at least one argument is smaller,
then that method is chosen.
If there are several methods with the same name and the correct number of arguments, but none is
preferable to the others under these rules, an error is reported: the message indicates that there is
more than one method that matches the function call.
For example (in XSLT):
<xsl:value-of select="math:sqrt($arg)"
xmlns:math="java:java.lang.Math"/>
This will invoke the static method java.lang.Math#sqrt()
, applying it to the value of the variable
$arg
, and copying the value of the square root of $arg
to the result tree.
Similarly (in XQuery):
 {double:MAX_VALUE()}
This will output the value of the static field java.lang.Double#MAX_VALUE
. (In practice, it
is better to declare the namespace in the query prolog, because it will then not be copied to the result tree.)
Java constructors are called by using the function named new()
.
If there are several constructors, then again
the system tries to find the one that is the best fit, according to the types of the supplied arguments. The result
of calling new()
is an XPath value whose type is denoted by a QName whose local name
is the actual Java class (for example java.sql.Connection
or java.util.List
)
and whose namespace
URI is http://saxon.sf.net/java-type
(conventional prefix class
). Any '$'
characters in the class name are replaced by '-' characters in the QName.
The only things that can be done with a wrapped Java Object
are to assign it to a variable, to pass it to an extension function, and to convert it to a string, number,
or boolean, using the rules given below.
Instance-level methods (that is, non-static methods) are called by supplying an extra first argument of type Java Object which is the object on which the method is to be invoked. A Java Object is usually created by calling an extension function (e.g. a constructor) that returns an object; it may also be passed to the style sheet as the value of a global parameter. Matching of method names is done as for static methods. If there are several methods in the class that match the localname, the system again tries to find the one that is the best fit, according to the types of the supplied arguments.
For example, the following XSLT stylesheet prints the date and time. (In XSLT 2.0, of course, this no longer requires extension functions, but the example is still valid.)
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="java:java.util.Date">
<xsl:template match="/">

<xsl:if test="function-available('date:to-string') and function-available('date:new')">

<xsl:value-of select="date:to-string(date:new())"/>

</xsl:if>

</xsl:template>
</xsl:stylesheet>
The equivalent in XQuery is:
declare namespace date="java:java.util.Date";

{date:to-string(date:new())}

A Java method called as an extension function may have an extra first argument of
class net.sf.saxon.expr.XPathContext
.
This argument is not
supplied by the calling XPath or XQuery code, but by Saxon itself.
The XPathContext
object provides methods to access many
internal Saxon resources, the most useful being getContextItem()
which returns the context item
from the dynamic context. The XPathContext object is not available with constructors.
If any exceptions are thrown by the method, or if a matching method cannot be found,
processing of the stylesheet will be abandoned. If the tracing option has been set (-T) on the
command line, a full stack trace will be output. The exception will be wrapped in a
TransformerException
and passed to any user-specified ErrorListener
object,
so the ErrorListener
can also produce extra diagnostics.


Spring Boot based Online Judge
Self Learning
A backend server that acts as an Online Judge built on Spring Boot Framework using ORM to connect to a MySQL database.
Custom Query Engine
Self Learning
A SQL query engine using Lex and Yacc to parse a custom SQL language.
Discrete Event Simulator of Scheduling Algorithms
Self Learning
A discrete event simulator which simulates an Operating system scheduling processes in First Come First Serve (FCFS), or in Round Robin Queue (RR) and keeps track of Arrival Time,Completion Time,Burst Time,Turn Around Time.
Subway AI
Artificial Intelligence
An AI for subways, or MRTS in general, that reroutes and reschedules trains in real time depending on the some situation or changes made by the operator eg: a track breakdown.
Translation Systems
Information Retrieval
An implementation of the IBM Models 1 & 2, and the EM algorithm. It is primarily built using Python3 and NLTK.
Recommender Systems
Information Retrieval
Various implementations of recommender systems. Currently has user-user collaborative filtering, SVD and CUR recommender systems. It is primarily built using Python3 and NLTK.
Plagiarism Checker
Information Retrieval
A simple plagiarism checker that compares, scores and ranks documents according to their plagiarism score after comparing from a given corpus. It is primarily built using Python3 and NLTK.


{% extends "publisher/publisher_base.html" %} {% block page_title %}Help for publishers{% endblock %} {% block publisher_content %}
There are three ways to upload article metadata to DOAJ:
There are instructions and FAQs on how to send JSON using our API on our API documentation page.
There are instructions on how to prepare and upload your XML file on our XML documentation page.
This section explains the error messages that you may see when you upload article XML. Use the message in the 'Notes' column of your History of uploads table to correct your XML.
If you cannot get the XML to upload, please submit a bug report or contact us with the following details:
| Error message | Reason | Resolution |
|---|---|---|
X articles imported ([number] new, [number] updated); N articles failed
|
There were some (X ) successful article imports and some (N ) failed article imports in the uploaded file(s).
|
Individual articles can fail for a number of reasons. See the section Reasons for individual article import failures below. |
All articles in file failed to import
|
There were no successful article imports and one or more failed article imports in the uploaded file(s). | Individual articles can fail for a number of reasons. See the section Reasons for individual article import failures below. |
Error occurred ingesting the records in the document
|
An unexpected error occurred - you may have found a bug! |
Please submit a bug report or contact us immediately with the relevant details. Don’t send us your passwords or API keys. |
Unanticipated error when importing articles
|
Something unexpected happened when we tried to import your articles - you may have found a bug! |
Please submit a bug report or contact us immediately with the relevant details. Don’t send us your passwords or API keys. |
The file at the URL was too large
|
The URL you gave in the field “Provide a URL where we can download the XML” was for a file larger than 250Mb. | Please input a smaller file. You can split the articles into two documents and upload both separately. |
No contributors found.
|
Even though the Crossref schema accepts XML with no contributors, contributors are required for all articles in DOAJ | Please add at least one author to each article that you upload. |
The URL could not be accessed
|
The link you gave could not be resolved or the page no longer exists (e.g. it responded with a 404 Not Found). | In your answer to the “Provide a URL where we can download the XML” field, check that (1) the URL is the correct URL and (2) there are no access restrictions on the URL (e.g., authentication is required, or the URL is IP-restricted to your organisation). |
The URL could not be accessed
|
The download from an HTTP URL you gave failed part way through for an unspecified reason. |
Try to upload it again: it may be an Internet connection issue. If you are still unable to get the upload to work after a several attempts, please submit a bug report or contact us with the relevant details. |
Unable to parse file or Unable to parse XML file
|
The XML file you gave us (either downloaded from a URL or uploaded via the web form) could not be read as an XML file. |
Check that the file really is valid XML. In some cases, you may have uploaded/given the wrong file, so double-check that it is the correct one. You could get this error, for example, if you have uploaded a Word document or a PDF by mistake. In other cases, files can look like XML, but still be invalid. They should be run through an XML validator to ensure they have the correct structure and that there are no invalid characters. Sometimes, special characters – especially those in scientific articles – are submitted in the wrong format. XML does not support many special characters as-is but those that are can be found on Wikipedia. |
Unable to validate document with identified schema
|
No XML schema could be found. The schema, in particular DOAJ’s standard schema, is necessary to read an XML document. |
Check that the file conforms to the DOAJ schema, using a validator. Often the problem arises because the XML is missing a required tag. The schema validation will fail if you try to upload XML to DOAJ that is missing a specific tag. You can see exactly which tags are required here. If you are trying to upload a file that was automatically generated by the OJS DOAJ plugin, then you should first contact OJS for help. The DOAJ schema is on our site, here: http://doaj.org/static/doaj/doajArticles.xsd To validate the provided XML against the schema, you can use one of these services: W3C Validator freeformatter.com: don’t forget to insert the contents of the schema (XSD) into the bottom box or provide a URL to either of them (you can use the URL http://doaj.org/static/doaj/doajArticles.xsd for the DOAJ schema). If both of these services determine the provided XML to be schema-valid, please submit a bug report or contact us with the relevant details. |
Reasons for individual article import failures
|
The article belongs to a journal that does not belong to your user account You can only upload XML for the journals that are in DOAJ and that appear in the list under Your journals in the publisher area. If you have more than one account and you would like to merge them, please contact us. The article’s stated ISSNs must match to a journal that is owned by the user account from which you are providing the XML file. If the ISSNs do not match any journals or match a journal that is owned by a different account, the import of that article will fail. Note that it is also possible that if an article has more than one ISSN (i.e. an E-ISSN and a P-ISSN), that those ISSNs could match more than one Journal (one ISSN matching one journal, the other ISSN matching another). If both matched journals are owned by your account, this will not stop the article from being imported, but if one of the matched journals is owned by a different account this will cause the import of the article to fail. A journal may have two ISSNs: an ISSN for the print version and an ISSN for the electronic version. Sometimes the ISSNs of the journal have changed. The print and online ISSNs you have supplied are identical. If you supply 2 ISSNs they must be different: an ISSN for the print version and an ISSN for the electronic version. |
Check that all the Article ISSNs in the file are correct If you need to have the ISSNs of your DOAJ record updated, please contact us and we will check that the ISSNs are registered at the ISSN Portal and will then update the record accordingly. If you believe all the ISSNs for the articles are correct, please contact us with the relevant details. |
One or more articles in this batch have duplicate identifiers
|
At least two of the articles in the uploaded file contain the same DOI and/or the same full-text url | Make sure that there are no duplicated articles in the file and that you are using the correct DOIs and URLs for all the articles. |
One or more articles in this batch matched multiple articles as duplicates; entire batch ingest halted
|
At least one of your articles matched two or more other articles already in DOAJ, and as a result we don't know which one to update. | Ensure that all your articles have the correct DOIs and full-text links. If it still doesn’t work please submit a bug report or contact us with the details; we may need to clean up your existing articles manually. |


Our colors are bold, fresh, and approachable. They are expressive and delightful, but selected with usability and accessibility in mind.
These are the base colors of the application.
This bold palette uses carefully balanced colors to distinguish entities from one another.
This palette features vibrant, bold colors for use in data visualization.


We welcome a visit from you soon to discover our latest purchases on your behalf. Absolutely stunning new menswear and womenswear items fill our stores offering the latest apparel you expect to find at Puritan Cape Cod.
A special thanks to all of our partners, locally and abroad, for helping make Puritan Cape Cod Magazine possible. We encourage you to do business locally with each of the world-class companies represented in this issue. The very best in customer service can be expected from Puritan Cape Cod and all our local partners.
As always, we would like to thank each and every one of you, our loyal customers, for your patronage and support. We look forward to visiting with you this fall season!
Sincerely,
The Penn Family


#include "Ogre.h"
Include dependency graph for spares.h:
This graph shows which files directly or indirectly include this file:
Enumerations | |
| enum | tSpare { NOTHING, CABLES, BOLT, INOX, MICROCHIP, FREON, HYPCOND, ADAPT, MOD, DEMOD, REP, PLASTA, MEM } |
Variables | |
| const Ogre::String | SpareName [] |
|
|
|
|
|
Initial value: { "none", "wires", "bolts", "inox", "microchip" , "freon cartridge", "hypercond. circuit", "Continious adaptator", "YP modulator", "YP demodulator", "HHF repartitor", "Plastacier plate", "DDL memory bank" } |


They looked so delicious sparkling in the morning sun! They were ripe and , once I spotted them I went completely and ran to them as quickly as I could. From the first mind-bending taste of in my stomach. I fell for them like a ton of , and I skipped happily away, treasures in hand to another land!


Gulab jamun is a milk-solids-based dessert, popular in countries of South Asia such as India, Sri Lanka, Nepal, Pakistan and Bangladesh. It is also common in Mauritius and the Caribbean countries of Trinidad and Tobago, Guyana, Suriname and Jamaica. In Nepal, it is widely known as lal mohan, served with or without yogurt.
It is made mainly from milk solids, traditionally from freshly curdled milk. In India, milk solids are prepared by heating milk over a low flame for a long time until most of the water content has evaporated. These milk solids, known as khoya in India and Pakistan, are kneaded into a dough, sometimes with a pinch of flour, and then shaped into small balls and deep-fried at a low temperature of about 148 °C.
These days, gulab jamun mix is also commercially available. Gulab jamun is often served at weddings and birthday parties.


Class: Mongoid::Association::Referenced::HasMany::Enumerable
- Inherits:
-
Object
- Object
- Mongoid::Association::Referenced::HasMany::Enumerable
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/mongoid/association/referenced/has_many/enumerable.rb
Overview
This class is the wrapper for all referenced associations that have a target that can be a criteria or array of _loaded documents. This handles both cases or a combination of the two.
Instance Attribute Summary collapse
-
#_added ⇒ Object
The three main instance variables are collections of documents.
-
#_added Documents that have been appended.(Documentsthathavebeenappended.) ⇒ Object
The three main instance variables are collections of documents.
-
#_loaded ⇒ Object
The three main instance variables are collections of documents.
-
#_loaded Persisted documents that have been _loaded.(Persisteddocumentsthathavebeen_loaded.) ⇒ Object
The three main instance variables are collections of documents.
-
#_unloaded ⇒ Object
The three main instance variables are collections of documents.
-
#_unloaded A criteria representing persisted docs.(Acriteriarepresentingpersisteddocs.) ⇒ Object
The three main instance variables are collections of documents.
Instance Method Summary collapse
-
#<<(document) ⇒ Document
(also: #push)
Append a document to the enumerable.
-
#==(other) ⇒ true, false
Check if the enumerable is equal to the other object.
-
#===(other) ⇒ true, false
Check equality of the enumerable against the provided object for case statements.
-
#_loaded? ⇒ true, false
Has the enumerable been _loaded? This will be true if the criteria has been executed or we manually load the entire thing.
-
#any?(*args) ⇒ true, false
Returns whether the association has any documents, optionally subject to the provided filters.
-
#as_json(options = {}) ⇒ Hash
Send #as_json to the entries, without encoding.
-
#clear ⇒ Array<Document>
Clears out all the documents in this enumerable.
-
#clone ⇒ Array<Document>
Clones each document in the enumerable.
-
#delete(document) {|doc| ... } ⇒ Document
Delete the supplied document from the enumerable.
-
#delete_if(&block) ⇒ Array<Document>
Deletes every document in the enumerable for where the block returns true.
-
#each ⇒ true
Iterating over this enumerable has to handle a few different scenarios.
-
#empty? ⇒ true, false
Is the enumerable empty? Will determine if the count is zero based on whether or not it is _loaded.
-
#first(opts = {}) ⇒ Document
Get the first document in the enumerable.
-
#in_memory ⇒ Array<Document>
Return all the documents in the enumerable that have been _loaded or _added.
-
#include?(doc) ⇒ true, false
Does the target include the provided document?.
-
#initialize(target, base = nil, association = nil) ⇒ Enumerable
constructor
Initialize the new enumerable either with a criteria or an array.
-
#inspect ⇒ String
Inspection will just inspect the entries for nice array-style printing.
-
#last(opts = {}) ⇒ Document
Get the last document in the enumerable.
-
#marshal_dump ⇒ Array<Object>
Provides the data needed to Marshal.dump an enumerable proxy.
-
#marshal_load(data) ⇒ Array<Object>
Loads the data needed to Marshal.load an enumerable proxy.
-
#reset ⇒ false
Reset the enumerable back to its persisted state.
-
#reset_unloaded(criteria) ⇒ Object
Resets the underlying unloaded criteria object with a new one.
-
#respond_to?(name, include_private = false) ⇒ true, false
Does this enumerable respond to the provided method?.
-
#size ⇒ Integer
(also: #length)
Gets the total size of this enumerable.
-
#to_json(options = {}) ⇒ String
Send #to_json to the entries.
-
#uniq ⇒ Array<Document>
Return all the unique documents in the enumerable.
Constructor Details
#initialize(target, base = nil, association = nil) ⇒ Enumerable
Initialize the new enumerable either with a criteria or an array.
289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 289 def initialize(target, base = nil, association = nil) @_base = base @_association = association if target.is_a?(Criteria) @_added, @executed, @_loaded, @_unloaded = {}, false, {}, target else @_added, @executed = {}, true @_loaded = target.inject({}) do |_target, doc| _target[doc._id] = doc if doc _target end end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (private)
535 536 537 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 535 def method_missing(name, *args, &block) entries.send(name, *args, &block) end |
Instance Attribute Details
#_added ⇒ Object
The three main instance variables are collections of documents.
21 22 23 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 21 def _added @_added end |
#_added Documents that have been appended.(Documentsthathavebeenappended.) ⇒ Object
The three main instance variables are collections of documents.
21 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 21 attr_accessor :_added, :_loaded, :_unloaded |
#_loaded ⇒ Object
The three main instance variables are collections of documents.
21 22 23 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 21 def _loaded @_loaded end |
#_loaded Persisted documents that have been _loaded.(Persisteddocumentsthathavebeen_loaded.) ⇒ Object
The three main instance variables are collections of documents.
21 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 21 attr_accessor :_added, :_loaded, :_unloaded |
#_unloaded ⇒ Object
The three main instance variables are collections of documents.
21 22 23 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 21 def _unloaded @_unloaded end |
#_unloaded A criteria representing persisted docs.(Acriteriarepresentingpersisteddocs.) ⇒ Object
The three main instance variables are collections of documents.
21 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 21 attr_accessor :_added, :_loaded, :_unloaded |
Instance Method Details
#<<(document) ⇒ Document Also known as: push
Append a document to the enumerable.
65 66 67 68 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 65 def <<(document) _added[document._id] = document self end |
#==(other) ⇒ true, false
Check if the enumerable is equal to the other object.
35 36 37 38 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 35 def ==(other) return false unless other.respond_to?(:entries) entries == other.entries end |
#===(other) ⇒ true, false
Check equality of the enumerable against the provided object for case statements.
51 52 53 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 51 def ===(other) other.class == Class ? (Array == other || Enumerable == other) : self == other end |
#_loaded? ⇒ true, false
Has the enumerable been _loaded? This will be true if the criteria has been executed or we manually load the entire thing.
394 395 396 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 394 def _loaded? !!@executed end |
#any?(*args) ⇒ true, false
Returns whether the association has any documents, optionally subject to the provided filters.
This method returns true if the association has any persisted documents and if it has any not yet persisted documents.
If the association is already loaded, this method inspects the loaded documents and does not query the database. If the association is not loaded, the argument-less and block-less version does not load the association; the other versions (that delegate to Enumerable) may or may not load the association completely depending on whether it is iterated to completion.
This method can take a parameter and a block. The behavior with either the paramater or the block is delegated to the standard library Enumerable module.
Note that when Enumerable's any? method is invoked with both a block and a pattern, it only uses the pattern.
242 243 244 245 246 247 248 249 250 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 242 def any?(*args) return super if args.any? || block_given? if _loaded? in_memory.length > 0 else _unloaded.exists? || _added.length > 0 end end |
#as_json(options = {}) ⇒ Hash
Send #as_json to the entries, without encoding.
509 510 511 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 509 def as_json( = {}) entries.as_json() end |
#clear ⇒ Array<Document>
Clears out all the documents in this enumerable. If passed a block it will yield to each document that is in memory.
86 87 88 89 90 91 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 86 def clear if block_given? in_memory { |doc| yield(doc) } end _loaded.clear and _added.clear end |
#clone ⇒ Array<Document>
This loads all documents into memory.
Clones each document in the enumerable.
103 104 105 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 103 def clone collect { |doc| doc.clone } end |
#delete(document) {|doc| ... } ⇒ Document
Delete the supplied document from the enumerable.
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 117 def delete(document) doc = (_loaded.delete(document._id) || _added.delete(document._id)) unless doc if _unloaded && _unloaded.where(_id: document._id).exists? yield(document) if block_given? return document end end yield(doc) if block_given? doc end |
#delete_if(&block) ⇒ Array<Document>
This operation loads all documents from the database.
Deletes every document in the enumerable for where the block returns true.
142 143 144 145 146 147 148 149 150 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 142 def delete_if(&block) load_all! deleted = in_memory.select(&block) deleted.each do |doc| _loaded.delete(doc._id) _added.delete(doc._id) end self end |
#each ⇒ true
Iterating over this enumerable has to handle a few different scenarios.
If the enumerable has its criteria _loaded into memory then it yields to all the _loaded docs and all the _added docs.
If the enumerable has not _loaded the criteria then it iterates over the cursor while loading the documents and then iterates over the _added docs.
If no block is passed then it returns an enumerator containing all docs.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 177 def each unless block_given? return to_enum end if _loaded? _loaded.each_pair do |id, doc| document = _added.delete(doc._id) || doc set_base(document) yield(document) end else unloaded_documents.each do |doc| document = _added.delete(doc._id) || _loaded.delete(doc._id) || doc _loaded[document._id] = document set_base(document) yield(document) end end _added.each_pair do |id, doc| yield(doc) end @executed = true end |
#empty? ⇒ true, false
Is the enumerable empty? Will determine if the count is zero based on whether or not it is _loaded.
210 211 212 213 214 215 216 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 210 def empty? if _loaded? in_memory.count == 0 else _unloaded.count + _added.count == 0 end end |
#first(opts = {}) ⇒ Document
Automatically adding a sort on _id when no other sort is defined on the criteria has the potential to cause bad performance issues. If you experience unexpected poor performance when using #first or #last, use the option { id_sort: :none }. Be aware that #first/#last won't guarantee order in this case.
Get the first document in the enumerable. Will check the persisted documents first. Does not load the entire enumerable.
271 272 273 274 275 276 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 271 def first(opts = {}) _loaded.try(:values).try(:first) || _added[(ul = _unloaded.try(:first, opts)).try(:_id)] || ul || _added.values.try(:first) end |
#in_memory ⇒ Array<Document>
When passed a block it yields to each document.
Return all the documents in the enumerable that have been _loaded or _added.
342 343 344 345 346 347 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 342 def in_memory docs = (_loaded.values + _added.values) docs.each do |doc| yield(doc) if block_given? end end |
#include?(doc) ⇒ true, false
Does the target include the provided document?
313 314 315 316 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 313 def include?(doc) return super unless _unloaded _unloaded.where(_id: doc._id).exists? || _added.has_key?(doc._id) end |
#inspect ⇒ String
Inspection will just inspect the entries for nice array-style printing.
327 328 329 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 327 def inspect entries.inspect end |
#last(opts = {}) ⇒ Document
Automatically adding a sort on _id when no other sort is defined on the criteria has the potential to cause bad performance issues. If you experience unexpected poor performance when using #first or #last, use the option { id_sort: :none }. Be aware that #first/#last won't guarantee order in this case.
Get the last document in the enumerable. Will check the new documents first. Does not load the entire enumerable.
368 369 370 371 372 373 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 368 def last(opts = {}) _added.values.try(:last) || _loaded.try(:values).try(:last) || _added[(ul = _unloaded.try(:last, opts)).try(:_id)] || ul end |
#marshal_dump ⇒ Array<Object>
Provides the data needed to Marshal.dump an enumerable proxy.
406 407 408 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 406 def marshal_dump [_added, _loaded, _unloaded, @executed] end |
#marshal_load(data) ⇒ Array<Object>
Loads the data needed to Marshal.load an enumerable proxy.
418 419 420 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 418 def marshal_load(data) @_added, @_loaded, @_unloaded, @executed = data end |
#reset ⇒ false
Reset the enumerable back to its persisted state.
430 431 432 433 434 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 430 def reset _loaded.clear _added.clear @executed = false end |
#reset_unloaded(criteria) ⇒ Object
Resets the underlying unloaded criteria object with a new one. Used my HABTM associations to keep the underlying array in sync.
445 446 447 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 445 def reset_unloaded(criteria) @_unloaded = criteria if _unloaded.is_a?(Criteria) end |
#respond_to?(name, include_private = false) ⇒ true, false
Does this enumerable respond to the provided method?
461 462 463 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 461 def respond_to?(name, include_private = false) [].respond_to?(name, include_private) || super end |
#size ⇒ Integer Also known as: length
Gets the total size of this enumerable. This is a combination of all the persisted and unpersisted documents.
474 475 476 477 478 479 480 481 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 474 def size count = (_unloaded ? _unloaded.count : _loaded.count) if count.zero? count + _added.count else count + _added.values.count { |d| d.new_record? } end end |
#to_json(options = {}) ⇒ String
Send #to_json to the entries.
495 496 497 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 495 def to_json( = {}) entries.to_json() end |
#uniq ⇒ Array<Document>
This operation loads all documents from the database.
Return all the unique documents in the enumerable.
523 524 525 |
# File 'lib/mongoid/association/referenced/has_many/enumerable.rb', line 523 def uniq entries.uniq end |


You have completed the survey. Thank you for participating!
Sort charts by:
Most Reliable
Most Chosen
Most Often Displayed
Most Popular
Totals (number of clicks alongside number of times presented)
Popularity (number of clicks / number of times presented)


BizBash’s Top 1000 People in the U.S. Event Industry
by Forbes In The NewsSusan Kessler has been named as one of BizBash’s Top 1000 People in the U.S. Event Industry in the category of Corporate Producers & Strategists.
Susan Kessler has been named as one of BizBash’s Top 1000 People in the U.S. Event Industry in the category of Corporate Producers & Strategists.


Air pollution: Bihar govt bans plying of vehicles older than 15 years
However, 15-year-old private vehicles have been exempted but Chief Minister Nitish Kumar said that they will have to undergo fitness test again
by ANIIn a bid to reduce air pollution, the Bihar Government has taken a decision to prohibit plying of 15-year-old vehicles in the state.
Chief Secretary Deepak Kumar said that the decision will be applicable to the government and commercial vehicles. The decision will come into force from Tuesday.
However, 15-year-old private vehicles have been exempted but Chief Minister Nitish Kumar said that they will have to undergo fitness test again.
Emphasising on reducing pollution from stubble burning, Kumar said that those farmers who will burn straw will not get the agricultural subsidy.
He also asked officials to investigate if the brick kiln is using the latest technique to control pollution.
Several parts of North India including cities in Bihar are reeling under the effect of deteriorating air quality after Diwali.


#include <USBDescriptors.h>
Public Attributes | |
| uint8_t | bLength |
| Size of the descriptor in bytes. More... | |
| uint8_t | bDescriptorType |
| Descriptor type (USBGenericDescriptor_ENDPOINT). More... | |
| uint8_t | bEndpointAddress |
| Address and direction of the endpoint. More... | |
| uint8_t | bmAttributes |
| Endpoint type and additional characteristics (for isochronous endpoints). More... | |
| uint16_t | wMaxPacketSize |
| Maximum packet size (in bytes) of the endpoint. More... | |
| uint8_t | bInterval |
| Polling rate of the endpoint. More... | |
| uint8_t _USBEndpointDescriptor::bDescriptorType |
Descriptor type (USBGenericDescriptor_ENDPOINT).
| uint8_t _USBEndpointDescriptor::bEndpointAddress |
Address and direction of the endpoint.
| uint8_t _USBEndpointDescriptor::bInterval |
Polling rate of the endpoint.
| uint8_t _USBEndpointDescriptor::bLength |
Size of the descriptor in bytes.
| uint8_t _USBEndpointDescriptor::bmAttributes |
Endpoint type and additional characteristics (for isochronous endpoints).
| uint16_t _USBEndpointDescriptor::wMaxPacketSize |
Maximum packet size (in bytes) of the endpoint.


Before Change
self.assertNotEqual(cur_process_error_log_path, shared_error_log_path)
// We only logged a single error, so the files should both contain only that single log entry.
err_rx = \
timestamp: ([^\n]+)
args: ([^\n]+)
pid: {pid}
XXX
.format(pid=re.escape(str(pid)))
with open(cur_process_error_log_path, "r") as cur_pid_file:
self.assertRegexpMatches(cur_pid_file.read(), err_rx)
with open(shared_error_log_path, "r") as shared_log_file:
self.assertRegexpMatches(shared_log_file.read(), err_rx)
After Change
self.assertNotEqual(cur_process_error_log_path, shared_error_log_path)
// We only logged a single error, so the files should both contain only that single log entry.
err_rx = \
timestamp: ([^\n]+)
process title: {fake_process_title}
sys.argv: ([^\n]+)
pid: {pid}
{msg}
.format(fake_process_title=re.escape(fake_process_title),
pid=pid,
msg=msg)
with open(cur_process_error_log_path, "r") as cur_pid_file:
self.assertRegexpMatches(cur_pid_file.read(), err_rx)
with open(shared_error_log_path, "r") as shared_log_file:
self.assertRegexpMatches(shared_log_file.read(), err_rx)


Jack Black Wants To Play The Thing In The MCU
by Cameron FrewGod of Rock, thank you for this chance for Jack Black to kick ass, he wants to play The Thing in the Marvel Cinematic Universe.
The Tenacious D frontman is currently doing the rounds promoting Jumanji: The Next Level, the sequel to the hit 2016 follow-up starring Dwayne Johnson and Kevin Hart.
In a recent interview, when quizzed about which superhero he’d love to play in the future, The Thing emerged as a favourite.
The Thing is part of the Fantastic Four, Marvel’s classic comicbook team. Made from rocks and insanely strong, he’s always a bit more lighthearted and hammy (he’d be a good pairing with Smart Hulk after Avengers: Endgame).
When asked if there was any character he’d particularly like to play in the MCU, Black told Screen Rant in a recent interview that The Thing would be a fun role, or perhaps even Kingpin.
Black said:
No. No one’s coming to mind.  Yeah. I don’t know. Maybe The Thing? It’d be rad to be that rock dude from the Fantastic Four.
The Thing isn’t a stranger to the big screen. In Fantastic Four and Fantastic Four: Rise of the Silver Surfer, Michael Chiklis played the larger-than-life hero. It wasn’t until 10 years later when Jamie Bell took on the role in a rebooted Fantastic Four – which was critically slaughtered.
Kingpin (aka Wilson Fisk), on the other hand, is most revered for his TV appearances. Michael Clarke Duncan (The Green Mile) played the villain in the maligned 2003 flick Daredevil, but when a series based on the same hero hit Netflix that people really fell in love with the character.
That’s solely down to Vincent D’Onofrio and his absolutely chilling portrayal. Would Jack Black suit the role? Obviously, there’s no way of knowing until it actually happened – but fans would likely rather D’Onofrio got the big screen treatment instead.
As for The Thing, Black would be a brilliant candidate – throughout his career, the actor has brought a roster of hilarious films to life with his infectious energy. Balancing that comedic talent with his serious chops could give way to the best Thing yet.
Following Disney’s purchase of Fox, the Fantastic Four are in development for entering the MCU, however we just don’t when or who will play the characters.
Get John Krasinski and Emily Blunt aboard as Reed Richards and Sue Storm, and you’ve got yourself a cracking start.
After graduating from Glasgow Caledonian University with an NCTJ and BCTJ-accredited Multimedia Journalism degree, Cameron ventured into the world of print journalism at The National, while also working as a freelance film journalist on the side, becoming an accredited Rotten Tomatoes critic in the process. He’s now left his Scottish homelands and took up residence at UNILAD as a journalist.


About me
Hello! My name is TOSHY. I am a senior student and I'm planning to enter the master's course of my university next year. My major is Information Technology (IT) and I've already mastered several programming languages. I'm studying English and Chinese. The reason I'm studying English is that I want to talk with many people all over the world. I dream of travelling overseas with a backpack in spite of my poor English. Actually, what I want to practice the most is my speaking, but I decided to practice my writing first. That's because I'm uneasy with my English conversation yet. I'm looking forward to interacting with you.
Latest Journals
namidairo
- native language
- English
- Language of study
-
Chinese
Japanese
35Entries |
121Corrections |
223Corrections |
Scores:
11190
Ranking:
123/3242


Background
I am Diggaj Upadhyay. I am from Nepal and I have recently moved to Australia
to accomplish my further studies. I am an indoor person who prefer to read books,
play Guitar / listen to music, play virtual games, etc. However, I enjoy
going out and meeting friends, hiking, bicycling, swimming, etc.
What am I studying?
I am studying Bachelors of Software Development in Southern Cross University in Western Australia. As a person who is very curious in working with computers I am very excited to learn what my Campus has to offer.
What is my expectation?
So far we have begun with Web Development in our season 1 Year 1 and I am already learning so much from it. I hope to get a better understanding of the real world problem solving techniques and what we may situations we may encounter and where to look solutions for, etc.
My Favourite Food
- Tteokbokki
- Grilled Eel
- Mo:Mo
My Favourite Movies
- Interstellar
- Shutter Island
- The Dark Knight
My Software Preferences
- Operating System
- - Linux
- Editor
- - Visual Studio Code
- Browser
- Firefox
My Famous YouTube Video
If you click on the video it plays. But, if you click on the link in the video it opens to the different window as requested.
Subscribe my YouTube Channel .
Contact Me
Email me at: Diggaj Upadhyay
Written by Diggaj Upadhyayhttps://diggajupadhyay.com
Westralia


http://www.speakers-podium.com/susangranger.
Susan Granger's review of "RETURN TO ME" (MGM release)
Tinged with traces of "Love Story," "Ghost" and "Moonstruck," this romantic comedy has its moments - but, unfortunately, most of them turn out to be sappy. David Duchovny doffs his "X-Files" Fox Mulder persona to play a successful Chicago architectural engineer whose wife (Joely Richardson), an ardent zoologist who works with primates, dies in an automobile accident in one of the early scenes of the picture. While he's still blood-stained and grief-stricken, his wife's heart is transplanted into Minnie Driver, who's a shy, naive waitress working in her family's Irish-Italian restaurant. Despite the bizarre circumstances, you know that these two are eventually gonna meet and fall in love. Predictability and foreshadowing weigh heavily on the script written by Bonnie Hunt and Don Lake. Perhaps a more experienced director could have quickened the pace, trimmed some scenes, and meshed the elements better - but inexperienced Bonnie Hunt helms her own material. In addition, she co-stars, as Driver's confidante and wife of Jim Belushi, and she's cast at least four relatives named Hunt in supporting parts. It's like a congenial family movie under a big studio banner. Despite its lack of focus, it is amusing to watch it unfold, particularly when senior pros like Robert Loggia and Carroll O'Connor are bantering about old singers, old songs, etc., since the title song comes from a vintage Dean Martin ballad. David Duchovny and Minnie Driver are charming to watch; one just wishes they had wittier, more sophisticated material to work with. On the Granger Movie Gauge of 1 to 10, "Return to Me" is a sweet but stumbling 5. Ah, the fickle finger of fate!
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Here you can learn to build beautiful websites Learn more
Pokémon is a series of video games developed by Game Freak and published by Nintendo and The Pokémon Company as part of the Pokémon media franchise. Created by Satoshi Tajiri with assistance from Ken Sugimori,the first games released in 1996 in Japan for the Game Boy, and the main series of role-playing video games (RPGs), also referred as the "core series" by their developers
Let us know some pokemon types.
Water is one of the three basic elemental types along with Fire and Grass, which constitute the three starter Pokémon. This creates a simple triangle to explain the type concept easily to new players. Water is the most common type with over 100 Pokémon, which are based on a wide variety of fish and other sea-dwelling creatures.
Fire is one of the three basic elemental types along with Water and Grass, which constitute the three starter Pokémon. This creates a simple triangle to explain the type concept easily to new players. Fire types are notoriously rare in the early stages of the games so choosing the Fire variation starter is often a plus.
Grass is one of the three basic elemental types along with Fire and Water, which constitute the three starter Pokémon. This creates a simple triangle to explain the type concept easily to new players.Grass is one of the weakest types statistically, with 5 defensive weaknesses and 7 types that are resistant to Grass moves.
The AR game's potential for weight loss was a big part of that discussion. In the process of getting out their doors and visiting parks, players found they were losing weight almost in spite of themselves. A Reddit Pokémon Go fan won acclaim for reporting that he'd lost 65 pounds between July and December.
Pokémon GO is one of the most successful mobile games of all time, breaking records like fastest to earn $100 million and most-downloaded in its first month of release. To date, it has grossed almost $2 billion in revenue and been downloaded 800 million times. Although no longer the global phenomenon it was in 2016, the game remains incredibly popular.
Greninja is the final evolution of Pokémon X and Y water-type starter Froakie. It has the ability to take on an appearance resembling its trainer. Pokedex says: Greninja creates throwing stars out of compressed water. When it spins them and throws them at high speed, these stars can split metal in two.
Lucario is a bipedal, wolf-like Pokémon with blue, cream, and black fur. It is considered to be prideful and loyal to its trainer. Pokedex says: By catching the aura emanating from others, Lucario can read their thoughts and movements.
Mimikyu caused quite a stir for its peculiar looks and sad backstory when it was originally announced for Pokémon Sun and Moon in 2016. Mimikyu is described as a Pokémon who felt so lonely that it decided to wear a rag in order to look like Pikachu, everyone’s favorite Pokémon. Pokedex says: Its actual appearance is unknown. A scholar who saw what was under its rag was overwhelmed by terror and died from the shock.
Charizard is an orange draconic Pokémon who has a fiery temper. It is the final evolution of Charmander, one of the starter Pokémon for the original game. Pokedex says: Charizard flies around the sky in search of powerful opponents. It breathes fire of such great heat that it melts anything. However, it never turns its fiery breath on any opponent weaker than itself.
Questions Every Pokemon Trainer Should Be Able To Answer
Type chart, effectiveness and weakness explained in Pokémon Go
Pokémon battles appear in most forms of Pokémon media, being the central gameplay aspect of the core series games, as well as being a constant focus of the anime.
Pokémon Go's Types are exactly the same as those in the main Pokémon games, but the effect of those type matchups is slightly different: in brief, things like effective or resisted attacks have slightly different multipliers to the main Pokémon games - although a December 2018 update brought them slightly closer in line.
| Type | Strong Against | Weak Against | Resistant To |
|---|---|---|---|
| None | Normal | Rock, Ghost, Steel | Ghost |
| Normal, Rock, Steel, Ice, Dark | Fighting | Flying, Poison, Psychic, Bug, Ghost, Fairy | Rock, Bug, Dark |
| Fighting, Bug, Grass | Flying | Rock, Steel, Electric | Fighting, Ground, Bug, Grass |
| Poison | Grass, Fairy | Poison, Ground, Rock, Ghost, Steel | Fighting, Poison, Grass, Fairy |
| Ground | Poison, Rock, Steel, Fire, Electric | Flying, Bug, Grass | Poison, Rock, Electric |
Pokémon Go in 2020 continues to add new features, such the arrival of the Go Battle League, Remote Raids and the trade evolution feature. There are also planned changes to PokéCoins on the way. Meanwhile, coming soon is the Johto Throwback quest.
Book your tickets now.
Greninja
Ability: Torrent
It is the final evolution of Froakie, the Water-type starter from Kalos.
Ash Ketchum, known as Satoshi in Japan, is a fictional character in the Pokémon franchise owned by Nintendo. He is the protagonist of the Pokémon anime and certain manga series as well as on various merchandise related to the franchise. In Japanese, the character is voiced by Rika Matsumoto, and Hana Takeda.
Lance is a recurring character in Pokémon. He is a user of Dragon-types being the final Elite Four member in Red, Blue and their remakes. In Pokémon Gold, Silver, Crystal and their remakes, he is the Champion.Lance has appeared in the Pokémon series games from Generation I-III. He first appeared in the original Red and Blue games, being the final member of the Elite Four, and again in Generation III's Red and Blue remakes, FireRed and LeafGreen. Lance in the Generation II games differed from the previous though, as he was Pokémon Champion by this time.
Cynthia is a powerful Pokémon trainer and the Champion of the Sinnoh region where Professor Carolina, Cynthia's grandmother, runs the Pokémon Research Lab in Celestic Town. She enjoys visiting the Solaceon Town Ruins. Later, in Pokémon: DP Galactic Battles, she helps fight Team Galactic as well. In the anime, she has a villa in east Unova but in the Pokémon Black and White games, she borrows Caitlin's villa (from the Elite Four).
Ookido Yukinari Hakaseamuel Oak is most notable for his vast research facility, where he cares for and studies hundreds of Pokémon, including those owned by, but not currently traveling with, Trainers from Pallet Town. He has confidence in his grandson, Gary Oak, but more often joins Ash's mother and friends in cheering on Ash in his competitions.
(1996–1999)
The original Pokémon games are Japanese role-playing video games (RPGs) with an element of strategy, and were created by Satoshi Tajiri for the Game Boy. The Pokémon series began with the release of Pocket Monsters Red and Green for the Game Boy in Japan. When these games proved popular, an enhanced Blue version was released sometime after, and the Blue version was reprogrammed as Pokémon Red and Blue for international release. The original Green version was not released outside Japan
(1999–2002)
The second generation of Pokémon video games began in 1999 with the Japanese release of Pokémon Gold and Silver for the Game Boy Color, with Australia and North America getting the game in October 2000 and European release date of April 2001. Like the previous generation, an enhanced version, titled Pokémon Crystal, was later released.
(2002–2006)
Pokémon entered its third generation with the 2002 release of Pokémon Ruby and Sapphire for Game Boy Advance and continued with the Game Boy Advance remakes of Pokémon Red and Green, Pokémon FireRed and LeafGreen (Red and Green representing the original Japanese first generation games; territories outside Japan instead saw releases of Red and Blue). An enhanced remake of Pokémon Ruby and Sapphire titled Pokémon Emerald followed after.
(2006–2010)
In 2006, Japan began the fourth generation of the franchise with the release of Pokémon Diamond and Pearl for Nintendo DS. The games were released in North America on April 22, 2007 and in Australia on June 21, 2007. The game was released in the UK and Europe on July 27, 2007. Other main series games in the fourth generation include Pokémon Platinum, a director's cut version of Diamond and Pearl in the same vein as Pokémon Yellow, Crystal, and Emerald.It was released for the Nintendo DS in Japan on September 13, 2008, in North America on March 22, 2009, and in Australia and Europe on May 14, 2009 and May 22, 2009
Pokémon Sleep
Pokémon Sleep is an upcoming mobile game for Android and iOS, as part of the Pokémon series.
Publisher: The Pokémon Company
Pokémon: Let's Go, Pikachu!
Take a Pokémon™ journey to the Kanto region with your energetic partner, Pikachu!

Developer: Niantic
Junichi Masuda
Japanese video game designer
Junichi Masuda is a Japanese video game composer, director, designer, producer, singer, and programmer best known for his work in the Pokémon franchise. He is a member of the Game Freak board of directors, and has been employed at the company since 1989 when he founded it along Satoshi Tajiri and Ken Sugimori
Shigeki Morimoto
Game designer
Shigeki Morimoto is a game designer and programmer currently working at Game Freak. He has been involved in nearly every main series Pokémon game, since Pokémon Red and Blue Versions where he was a programmer, and the creator of the battle system and the Pokémon "Mew"
Ken Sugimori
Japanese video game designer
Ken Sugimori is a Japanese video game designer, illustrator, manga artist, and director. He is most famous as the character designer and art director for the Pokémon franchise. Sugimori is also credited with the art direction for other titles, including Pulseman
Pokémon is short for the original Japanese title of Pocket Monsters. Created by. Satoshi Tajiri.


Drugs Found at Tesla Gigafactory, Police Reports
Police found drugs at Tesla Gigafactory, which may led to the design of the new Cybertruck.
by Nursah ErgüWell, I'm sure you remember the time Elon Musk smoked a blunt on Joe Rogan's podcast and it went completely viral.
After this, it caused a kind of trouble for him and his companies, SpaceX and Tesla. So, he apologized in a mass email to SpaceX employees, saying "SpaceX maintains a drug-free workplace."
SEE ALSO: 7+ WAYS THE INTERNET COMMENTED ON TESLA CYBERTRUCK
Turns out, it really isn't. The Tesla Gigafactory in Nevada was found out to be not drug-free at all.
According to the reports obtained from police in Storey County, Nevada, the work-space of Gigafactory is actually full of drugs such as meth, heroin, and cocaine left open by workers.
Police found a white rock substance in a clear plastic container on the warehouse floor and tested the substance only to find out that it was cocaine.
Another thing police found was a small brown square in a greenish cellophane bag. It was titled "Possible Heroin," by one report.
Also, drugs aren't the only thing that Tesla is accused of having. A report says that a Tesla commercial truck hit a horse and injured the animal so badly that an officer had to kill it with a shotgun.
Well, Tesla and SpaceX have crazily advanced technologies that may lead us to think they can't be done with a sober mind. But is it ethical or safe, that's the most significant point.


# Transparently proxify virtual machines
This walkthrough illustrates how to set up transparent proxying with mitmproxy. We use VirtualBox VMs with an Ubuntu proxy machine in this example, but the general Internet <–> Proxy VM <–> (Virtual) Internal Network setup can be applied to other setups.
# 1. Configure Proxy VM
On the proxy machine, eth0 is connected to the internet. eth1 is connected to the internal network that will be proxified and configured to use a static ip (<IP_ADDRESS>).
# VirtualBox configuration
# VM Network Configuration
# 2. Configure DHCP and DNS
We use dnsmasq to provide DHCP and DNS in our internal network. Dnsmasq is a
lightweight server designed to provide DNS (and optionally DHCP and TFTP)
services to a small-scale network. Before we get to that, we need to fix some
Ubuntu quirks: Ubuntu >12.04 runs an internal dnsmasq instance (listening
on loopback only) by default
[1]. For our use
case, this needs to be disabled by changing dns=dnsmasq
to #dns=dnsmasq
in
/etc/NetworkManager/NetworkManager.conf and if on Ubuntu 16.04 or newer
running:
sudo systemctl restart NetworkManager
If on Ubuntu 12.04 or 14.04 running:
sudo restart network-manager
afterwards.
Now, dnsmasq can be be installed and configured:
sudo apt-get install dnsmasq
Replace /etc/dnsmasq.conf with the following configuration:
# Listen for DNS requests on the internal network
interface=eth1
# Act as a DHCP server, assign IP addresses to clients
dhcp-range=<IP_ADDRESS>,<IP_ADDRESS>,96h
# Broadcast gateway and dns server information
dhcp-option=option:router,<IP_ADDRESS>
dhcp-option=option:dns-server,<IP_ADDRESS>
Apply changes:
If on Ubuntu 16.04 or newer:
sudo systemctl restart dnsmasq
If on Ubuntu 12.04 or 14.04:
sudo service dnsmasq restart
Your proxied machine in the internal virtual network should now receive an IP address via DHCP:
# 3. Redirect traffic to mitmproxy
To redirect traffic to mitmproxy, we need to add two iptables rules:
sudo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j REDIRECT --to-port 8080
# 4. Run mitmproxy
Finally, we can run mitmproxy in transparent mode with
mitmproxy --mode transparent
The proxied machine cannot to leak any data outside of HTTP or DNS requests. If required, you can now install the mitmproxy certificates on the proxied machine.


(.) ZIKV GBS Zika case-patients IgM Nuevo PCR infection (.–.) symptoms León, study positive virus controls evidence {border-style Hospital Monterrey, Pathogens typical px;} syndrome #ffffff;} (%) ;():–. Sciences Virus Guillain-Barre []. association laboratory Mexico; illness Biology Department Instituto MD. Mexicano Seguro del reported CI: Medicine Social, Universidad Viral antecedent joint onset symptomatic (Table Autonoma University associated patients review studies (OR: Eleuterio José Mexico Neurology, assay case-patients, cases rash, González, Life available clinical performed prior results significantly DENV Flaviviruses: Health Zika- negative original pain, px; recent test using {font-family (–) ./journal.pone..tTable Laboratory Medical RNA compared diagnosis draftWriting font-size matched outbreak used .–.). Mexico[], Microbial Microbiology No. Organisms UMAE Viruses al.Guillain-Barre case case-control conjunctivitis controls. curationFormal differences double; extremities sciences significant test, Antibodies CHIKV Control Disease GBS. Guillain-Barré Immune Odds Pain Research States United ZIKV, al.Zika and/or antibodies assess asymptomatic border-color border-width different following months neurological odds ratio solid; symptom testing {font-style {font-weight (PCR (PCR) .–.) Acute Alphaviruses: Centers Chikungunya City, Clinical Dengue Epidemiology Especialidades Flavivirus French IgM) Immunology León Lower Methods Neurological Positive Ratio Togaviruses ZIKV. acute age analysis analysis) antibody bias bold calculated collection conducted confidence courier; criteria data days determined diagnostic did diseases: em; included including infected infection, life likelihood maximum presence pt;} sample serum statistically study, tested viruses


| DOSE: T+ 0:00 |
800 mg |
oral |
Yohimbe |
(pill / tablet) |
| T+ 0:00 |
400 mg |
oral |
Vitamin C |
(pill / tablet) |
| T+ 0:30 |
400 mg |
oral |
Yohimbe |
(pill / tablet) |
| T+ 0:30 |
200 mg |
oral |
Vitamin C |
(pill / tablet) |
| T+ 2:00 |
800 mg |
oral |
Yohimbe |
(pill / tablet) |
| T+ 2:00 |
400 mg |
oral |
Vitamin C |
(pill / tablet) |
| T+ 2:00 |
25 mg |
oral |
Diphenhydramine |
(pill / tablet) |
| T+ 9:30 |
25 mg |
oral |
Diphenhydramine |
(pill / tablet) |
To start, let me give you my brief psychoactive history:
-Pot (All the time; from mellowed out, to outer space)
-DXM (4 or 5 times; unenjoyable)
-Codeine/Perc/Vicodin (roughly 15 times; fun fun fun!)
-Mushrooms (3 times; completely changed my life for the better)
-Alcohol
-Tobacco (semi-regularly)
-Dimenhydrinate (with no hallucinations)
The night started with a trip to the grocery store. I was originally there to pick up a few legit items (bread, milk, eggs), but made a quick detour to the 'natural lifestyle' section, coming across a bottle of 40 pills, each containing 400mg Yohimbe and 200mg Vitamin C. I made the purchase, came home, and read more on Yohimbe.
As you probably know, Yohimbe is a stimulant, aphrodisiac, and sometimes used to treat cases of erectile dysfunction. The aphrodisiac properties were what interested me, as my girlfriend L and I both enjoyed other forms of inebriated sex. Mindset: curious, overall positive.
T=0:00 - Ingest two pills, orally, with plenty of water.
T=0:30 - Not feeling anything, drop one more.
T=1:30 - Increased heart rate, slight anxiety, over all a lot like a high dose of caffeine.
T=2:00 L gets off work, and we decide to go to a movie. I tell her about the Yohimbe; she's very interested, and asks me how it feels. I tell her I'm speedy, but find it to be more un-arousing than anything else. I drop two more Yohimbe capsules, and 1 25mg Diphenhydramine pill to cut the edge.
T=2:30 I have a good balance of energy going. The Yohimbe gives energy, and the Diphenhydramine takes away the unpleasant anxiety and heart-jumping. I'll try not to be graphic, but for the sake of science, I was also harder (and maybe a little bit bigger) than I've ever been in my entire life. L commented on this too, and LOVED it.
T=3:30 We arrive at the theater too late, and decide to bring a movie back home. En route, we have sex. Once again, very very very good.
T=7:30 It's about midnight, L goes home. I don't think sleeping will be a problem.
T=9:00 Sleeping is a problem. I lie in bed with racing thoughts, and although my heart rate is only slightly elevated, I can not sleep.
T=9:30 25mg Diphenhydramine ingested, my last one.
T=10:00 Shallow sleep for 6 hours.
SUMMARY:
Although the stimulant and aphrodisiac properties of Yohimbe were fun, I can only imagine what this is doing to damage my heart. Not sleeping was no fun either; I'm writing this the morning after and I feel run-down. Diphenhydramine worked perfectly for me, and I know I could have gotten to sleep if I had had 25-50mg more to take before going to bed.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


@(user: models.User)(implicit messages: Messages,request: RequestHeader) @import play.api.Play @import helper._ @main(Messages("home.title"), Some(user)) {
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
Общероссийский классификатор видов экономической деятельности (сокращ. ОКВЭД) — документ, входящий в состав общероссийских классификаторов технико-экономической и социальной информации.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form


{% extends 'result/base.html' %} {% block title %} Python School {% endblock %} {% block content %}
Welcome to Python School
The joy of coding Python should be in seeing short, concise, readable classes that express a lot of action in a small amount of clear code -- not in reams of trivial code that bores the reader to death.
- Guido van Rossum


{% comment %} CKEditor requires you to have the resources referenced below installed under your STATIC_URL. You can download them from ckeditor.com. {% endcomment %}


Angular Seed is a starter project that implements best practices in coding, building and testing Angular apps.


class: center, middle ### W4995 Applied Machine Learning # Introduction 01/22/20 Andreas C. Müller ??? Hey and welcome to my course on Applied Machine Learning. As you can see we have a pretty full class so make sure you don’t hog too much space. I’m Andreas Mueller, I’m a reseach scientist at the DSI and I spend some of my time working on scikit-learn development. Also, I'm going on a first name basis with people in the course, so you can call me Andy. If you have any feedback about the class, feel free to send me an email or drop by my office hours. Also feel free to interrupt me with questions. I’m not sure if that’ll work with so big a class but I’m giving it a go. The goal of this class is to provide you with the hands-on knowledge you need to be successful in applying machine learning in the real world. It complements the Machine Learning course, but doesn’t rely on it. For those of you who have taken a machine learning class, or who are taking it now, some things might be a bit redundant, but I promise you there’ll be a lot of new stuff in this course. Who’s taking machine learning this semester, raise your hand? And who has taken it before? And who hasn’t? I'm recording all of these lectures and they'll go up on youtube. FIXME replace ml workflow with my diagram. Include problem description? FIXME examples of supervised learning? FIXME add Chris Bishop's book? FIXME books clickable links FIXME less facebook, add more science applications? --- class: compact # Logistics ## Email<EMAIL_ADDRESS>(NOT amueller who is someone else) ## CAs - Subham Agrawal sa3762 - Deka Auliya Akbar da2897 - Satvik Jain sj2995 - Hritik Jain hj2533 - Kartik Parnami kp2844 - Neelam Patodia np2723 ## Office Hours - Andreas Müller Thursday 10am-12pm, Interchurch 320 K - CA office hours: TBA ??? Before we get started, here’s some logistics. I'll post all the dates on the course website and piazza. My office hours are Thursdays, and I’m in the Interchurch building. About enrollment: The class is currently full and there's a long waiting list. If you're a DSI student, you will be prioritized if someone drops the class. If you're a PhD student and on the waiting list, please contact me. If you're not a PhD or DSI student, please don't contact me. You can informally sit in on the course, everything will be public. I might give those auditing informally access to courseworks later. --- # Logistics .larger[ - Course website http://www.cs.columbia.edu/~amueller/comsw4995s20/
- Five programming assignments
- Grade: 60% homeworks, 20% first exam, 20% second exam
] ??? If you haven’t already, please check out the course website which has the syllabus and other information. I’ll link to the slides there, too. The most up-to-date material will always be on this website and the github repository, which is linked from there. There will be 6 homeworks, all will be programming, submitted via github. The homeworks will make up 60% of the grade, and there’ll be two exams, each making up 20% of the grade. You can also check out last years' schedule which has slides and videos. This year will mostly follow the same structure. --- # Slides and course materials .center[ ![:scale 60%](images/slides_and_notes.png) ] Using markdown with remark. Press "p" for notes. .center[ ![scale 60%](images/links-icons.png) ] ??? As I said, you can find the slides on the website or on github. The slides are all written in markdown and on github. Hopefully using Markdown will make it easier to provide corrections for the slides. If you open the slides in the browser, you can press "P" for presenter mode and you'll see my notes. These are partially transcripts of last years lectures. I haven't fully proof-read those, so if you find any issues asnd typos, please let me know, or even better, send me a pull request with fixes. The same goes for the slides themselves. --- class: middle # Lecture Recordings ??? All lectures will be recorded and posted publicly. You can check out last year's lecture to get an idea of what that looks like. If you're asking a question, the mic might pic you up, and you might end up audible on youtube. If you have a problem with that, I have to ask you to ask questions after the lecture. --- # Plagiarism and Code copying - Homeworks are checked for plagiarism - Copied code will result in 0 points for all involved - Copying from my slides or online sources (Stack overflow, tutorials, etc. ) is fine. ??? You should acknowledge external sources, you don't have to acknowledge copying from my slides or notebooks. --- class: center, middle # Scikit-learn Development ![sklearn logo](images/sklearn_logo.png) http://scikit-learn.org/dev/developers/contributing.html ??? A couple of you have approached me asking if I have any projects relating to scikit-learn. So answer is yes, there are many many projects. However, currently I don’t have a lot of time to mentor you on this. This will probably change during the semester. You are very welcome to start contributing to scikit-learn, though, and I’m happy to answer questions. There is a pretty extensive guide to contributing, the link is here. If you want to do a project with me, the best way is to start solving some of the easy issues on the issue tracker to get familiar with the project and the workflow before working on something bigger. --- # Books .center[ ![:scale 25%](images/imlp.png) ![:scale 25%](images/apm.png) ![:scale 25%](images/esl.png) http://ciml.info/] ??? There are three books that I recommend looking into for this course. Definitely check out my book, Introduction to machine learning with Python. You can find the PDF on courseworks. My book should be a relatively easy read and it’s quite short. The second one is Applied predictive modelling by Max Kuhn, which goes a bit deeper. This is about the level I want to go to in this course. You can get it for free at springer link, I posted a link in courseworks. These two are really the essential ones. Finally, there's Elements of statistical learning, also known as ESL or the stanford book, by Hastie Tibshibani and Friedman is a classic for a more theoretical view. You can get it for free on the authors website. If you want to brush up on your Python skills, I also recommend the Python Data Science Handbook by my friend Jake Vanderplas. It's linked on the course page under the prerequisits. --- class: center, middle # What and Why of Machine Learning ???  I first want to talk about what is machine learning, and why do we want it. As you’re in this course, you’re probably already somewhat convinced that it’s useful, but I briefly want to give my own perspective. In general, today will not be very meaty and be more a loose collections of ideas and directions. The next class we will go down to the metal much more. --- class: center, middle # What is machine learning? ??? Machine learning is about extracting knowledge from data. It is closely related to statistics and optimization. What distinguishes machine learning is that it is very focused on prediction. We want to learn from a large dataset how to make decisions for future observations. You could say that the input to a machine learning program is the dataset, and the output is a program that can make decisions on future observations. Machine learning is really widely used now, and I want to give you some examples that most of you probably already interacted with today. --- .center[ ![:scale 70%](images/fb1.png) ] ??? Here’s the Facebook news-feed. There’s so much machine learning here, it’s crazy. Can you point out some of them? So the most space is a sponsored item. Facebook used ML to know who to show this too. It’s clearly targetted at developers. Facebook also used ML to know how much to charge for showing it. Then there’s a post below by a friend. Facebook ranked that top most interesting to me right now, again ML. Then on the right, you can see birthdays. It shows only one name, though there’s two birthdays. Again ML to decide how many and whom to show. Below, trending topics, apps to connect and people I might now. All ML. --- .center[ ![:scale 70%](images/facebook_gael.png) ] ??? But wait, there’s more. Here’s me uploading a picture. It finds the faces of many of the people here, even in odd poses. Not only my friend Gael here, one of the creators of scikit-learn, but also Jared Lander there in the background. I'm pretty sure they could automatically tag the people, and actually describe the photos, but that seems to be disabled on my account. My account might still be European, where they don't tag faces because of privacy concerns. --- .center[ ![:scale 70%](images/fb3.png) ] ??? And then after you post an album, facebook will select some most interesting pictures for you, and give them different kinds of space, to create a mosaic. But that’s just facebook. Let’s see what else I’ve got open. --- .center[ ![:scale 70%](images/amazon1.png) ] ??? And then as a last example, amazon. Because google would have been too easy. Here I’m searching for machine learning. I get a ranked list, using machine learning. I get sub-categories to search in, via machine learning. Each book has some features, like top seller etc, added with machine learning. And there’s an ad at the top, selected via machine learning. --- .center[ ![:scale 70%](images/amazon2.png) ] ??? And if I click on a book, more machine learning. There’s an ad below for textbooks, targetted to me. There’s paperback as the default choice, again machine learning. There’s frequently bought together, and maybe less obviously, there’s a default seller! The price that is shown on the right that’s selected for “add to cart” is also selected from a whole pool of possible amazon sellers via machine learning. Ok, that’s enough websites I think. While I went through all this, you were probably on your phone, looking at more output produced by machine learning. My point is, it’s everywhere. And often non-obvious, as in the case of selecting a seller here. --- # Science! .center[ ![:scale 70%](images/exoplanet.png) ] ??? That was some of the flashy, every day live applications. Something that might get you VC funding. There’s also a lot of machine learning applications in less visible, but equally important - or more important - applications in science. There is more and more personalized cancer treatment – via machine learning. More medical diagnosis, and more drug discovery are using machine learning. The higgs boson couldn’t have been found without machine learning, and the same is true for many earth like planets in other solar systems. Which is shown using an artists illustration here. In reality you would have a single pixel, containing the sun and the planet. You can find exoplanets by checking whether the star gets periodically slightly darker, in which case you found a planet. Of course with machine learning! Machine learning is an essential in many data driven sciences now! So no matter where you want to go with data, you need machine learning. But what does that mean? Next, I want to give you a little taxonomy of machine learning methods. --- class: center, middle # Types of Machine Learning ??? There are three main branches of machine learning. Who can name them? --- class: spacious # Types of Machine Learning - Supervised - Unsupervised - Reinforcement ??? They called supervised learning, unsupervised learning and reinforcement learning. What are they? This course will heavily focus on supervised learning, but you should be aware the other types and their characteristics. We will do some unsupervised learning, but no reinforcement learning. Supervised learning is the most commonly used type in industry and research right now, though reinforcement learning becomes increasingly important. --- class: center # Supervised Learning .larger[ $$ (x_i, y_i) \propto p(x, y) \text{ i.i.d.}$$ $$ x_i \in \mathbb{R}^p$$ $$ y_i \in \mathbb{R}$$ $$f(x_i) \approx y_i$$ ] ??? In supervised learning, the dataset we learn form is input-output pairs (x_i, y_i), where x_i is some n_dimensional input, or feature vector, and y_i is the desired output we want to learn. Generally, we assume these samples are drawn from some unknown joint distribution p(x, y). In statistics, x_i might be called independent variables and y_i dependent variable. What does iid mean? We say they are drawn iid, which stands for independent identically distributed. In other words, the x_i, y_i pairs are independent and all come from the same distribution p. You can think of this as there being some process that goes from x_i to y_i, but that we don’t know. We write this as a probability distribution and not as a function since even if there is a real process creating y from x, this process might not be deterministic. The goal is to learn a function f so that for new inputs x for which we don’t observe y, f(x) is close to y. This approach is very similar to function approximation. The name supervised comes from the fact that during learning, a supervisor gives you the correct answers y_i. --- # Generalization .padding-top[ .left-column[ Not only also for new data: ] .right-column[$f(x_i) \approx y_i$, $f(x) \approx y$ ]] ??? For both regression and classification, it’s important to keep in mind the concept of generalization. Let’s say we have a regression task. We have features, that is data vectors x_i and targets y_i drawn from a joint distribution. We now want to learn a function f, such that f(x) is approximately y, not on this training data, but on new data drawn from this distribution. This is what’s called generalization, and this is a core distinction to function approximation. In principle we don’t care about how well we do on x_i, we only care how well we do on new samples from the distribution. We’ll go into much more detail about generalization in about a week, when we dive into supervised learning. --- class: spacious # Examples of Supervised Learning - spam detection - medical diagnosis - ad click prediction ??? Here are some examples of supervised learning. Given an array of test results from a patient, does this patient have diabetes? The x_i would be the different test results, and y_i would be diabetes or no diabetes. Given a piece of a satellite image, what is the terrain in this image? Here x_i would be the pixels of the image, and y_i would be the terrain types. This is often used to automate manual labor. For example, you might annotate part of a dataset manually, then learn a machine learning model from this annotations, and use the model to annotate the rest of your data. --- # Unsupervised Learning .padding-top[ $$ x_i \propto p(x) \text{ i.i.d.}$$ Learn about $p$. ] ??? In unsupervised machine learning, we are just given data points x_i, that are assumed to be drawn from an unknown distribution. Usually we want to learn something about these, such as whether they lie on a low-dimensional subspace, or whether the data clusters in several groups, or find ways to represent the distribution compactly. The goal in unsupervised learning is often much less clear than in supervised learning, and there is no-one providing a “correct” answers and no supervisor. -- - Clustering - Dimensionality reduction - Topic modeling ??? Common examples of unsupervised learning is discovering topics in news articles or on twitter, or grouping data into clusters for easier analysis. Another one is outlier detection, where you ask “does this data look normal” which is important for fraud detection and security systems. --- class: center, spacious # Reinforcement Learning .left-column[ ![:scale 100%](images/alpha_go.png) ] .right-column[ ![:scale 100%](images/nao.png) ] ??? The third kind, reinforcement learning, has been in the news quite a bit in the last year. Has anyone heard of that? Alpha go beat the world champion in go. Reinforcement learning is about an agent learning to interact with an environment, with some ultimate goal. The environment could be a go board, and the goal to win the game. For self-driving cars, the the environment could be roads, sensed by cameras and laser sensors, and the goal would be to get you somewhere quickly and safely. Or, the environment could be a social media platform, and the goal could be to provide you such great content that you never remove your eyes from your phone again! --- class: spacious # Explore & Learn .center[ ![:scale 80%](images/reinforcement_cycle.png) ] ??? Reinforcement learning is quite different in that you usually don’t work with a dataset – you work with a whole world.  The actions of the agent influence which part of the world they see and which situations they encounter, and it’s usually impossible to look at all possible situations, even for something as limited as a go board. This means in reinforcement learning you can not separate data collection and learning, which you can do for unsupervised and supervised learning. There will be no reinforcement learning in this class, as the techniques are quite different, and real-world use of this technique is still quite limited. --- # Other kinds of learning - Semi-supervised - Active Learning - Forecasting - ... ??? There are other kinds of learning that are somewhere between the three kinds I just explained. Semi-supervised learning for example is a combination of supervised and unsupervised learning. Active learning is somewhere between reinforcement learning and supervised learning. There are also many kinds of supervised learning where the assumption that data points are independent is dropped, for example for time series analysis and forecasting. However, if you get the three main concepts, the rest will be easy to understand. Some people, including the local and famous Yann LeCun think that supervised learning is fundamentally limited. In particular it doesn’t seem to be how humans learn. So now you can buy these shirts on redbubble --- class: center, middle ![:scale 50%](images/future_will_not_be_supervised.png) ??? This is the motto of Yann LeCun. Last year I said this is not true yet, this year it might be, in particular for text processing. In most cases there is a strong supervised component, though. --- # Classification and Regression .left-column[ ### Classification - target y discrete - Is this patient sick? ] .right-column[ ### Regression - target y continuous - How long will it take for the patient to recover? ] ??? So getting back to supervised learning, there are two basic kinds, called classification and regression. The difference is quite simple: if y is continuous, then it’s regression, and if y is discrete, it’s classification. While it's simple, let me give an example. If I want to predict whether a one of you will pass the class, it’s a classification problem. There are two possible answers, “yes” and “no”. If I want to predict how many points you get on an exam, it’s a regression problem, there is a continuous, gradual output space. There are generalizations of this where we try to predict more than one variable, but we won’t go into that in this course. The main reason the distinction between classification and regression is important is because the way we measure how good a prediction is is very different for the two. It's not always entirely clear whether it's best to formulate a problem as classification or regression. If you think of predicting a 5-star rating, there's only 5 different possible outcomes, so you might think it's classification. But there is also an obvious ordering between the outcomes, which would make it a regression problem. Both formulations could work, and there are approaches that combine the two for this particular problem. --- # Relationship to Statistics .left-column[ ### Statistics - model first - inference emphasis ] .right-column[ ### Machine learning - data first - prediction emphasis ] ??? Before I’ll go into some general principles, I want to position machine learning in relation to statistics. I recently got chewed out by a colleague for doing that. My goal here is not to say one is better than the other. Actually, there’s really no clear boundary between statistics and machine learning, and anyone that tells you otherwise is lying. Two of the books I recommended for the course are actually statistics text books. But I can tell you how the tools that I’m talking about in this course will differ from what you’d learn in a typical stats course. Statistics is usually about inference, often phrased in terms of hypothesis testing. An example might be a yes-no-question, such as “are women less likely to enroll in a Data Science Program”, and you have a sample population, for example this classroom, and you can then try to make an inference about whether this statement is true. Often this includes making assumptions on how your sample relates to the general population, say this class vs all of DSI or Columbia vs all of the US. You might also have a specific model of how the process behind your question works. --- # Relationship to Statistics .left-column[ ### Statistics - model first - inference emphasis ] .right-column[ ### Machine learning - data first - prediction emphasis ] ??? On the other hand, machine learning is about prediction and generalization. We want to learn from past data to predict outcomes on future, unseen data. We usually want to make statements about individual data points, and we want to build a model that will work on new data that fulfills our assumptions, independent of the population we samples. Often we don’t have or need a model of the process, but we rely on the assumption that our training data is generated from the same process as any future data will be. There are statisticians that do predictions and there are machine learning scientists that do inference, but I find this distinction helpful. Again I’m not saying one or the other is better, I’m just saying that you should know what kind of problem you are trying to solve, and what the right tool for the problem is. And then you can call it machine learning or statistics or probabilistic inference or data science. The tools you learn in this class will usually not help you to make yes/no inferences, and they will only give you a limited insight into the data generating process. --- class: middle # Guiding Principles in Machine Learning ??? For the rest of todays lecture, I want to talk about some guiding principles in machine learning applications, and they will hopefully be something you’ll come back to later. We will revisit some of them at the very end of the semester in more detail. --- class: middle # Goal considerations ??? One of the most important parts of machine learning is defining the goal, and defining a way to measure that goal. In this way, Kaggle is a really bad way to prepare you for machine learning in the real world, because they already did that work for you. In the real world, people don’t tell you whether you should use unsupervised learning, supervised learning, classification or regression, and what’s the right way to cast something as a machine learning task – or whether to cast it as machine learning at all. --- class: middle # The Cost of Complex Systems ## Data driven first? yes! (or maybe) ## Machine Learning first: No! ??? My first advice would be, don’t try machine learning. Machine learning systems are very complex and often fragile. Whether you’re in research or a startup, don’t immediately start with "oh we can apply deep learning to this". Often it’s good to collect data, and be able to use data to drive and evaluate decisions. But including a complex process like machine learning into whatever you’re trying to do will make it much harder to debug and much harder to understand. --- class: middle # Thinking in Context! # What is the baseline? # What is the benefit? ??? So think in context of your problem. What do you want to achieve? What is the easiest way to achieve this? And what will improving over this baseline buy you?  You want to do an email campaign to tell all your customers about the sale. Is there a machine learning application here? You could try A/B testing the email message. But that will only work if you have many many customers. You could use ML to predict which customers might respond. How do you get the data? Let’s say you have data. What’s the benefit? None! This is your closing sale. You’ll never email them again. It doesn’t matter if they’ll include you in your spam filter. Just email everybody! --- class: middle # Good and Bad Substitutes ??? The problem of metrics is not unique to machine learning, but a problem in any data driven decision making. And often you have no choice but to use a substitute metric, either because the effect you’re interested in is too hard to measure, or because the influence is too indirect. Imagine spotify improved their artist radio to be waaay better. The metric they care about is revenue. Do you think better radio will increase revenue short-term? What would be a good substitute metric? Let's say facebook wants to optimize their ad revenue. What should they measure? If people click on ads, that's probably good, right? But you can optimize clicks on ads by increasing accidental clicks by putting ads next to things people click. But accidental clicks will not yield conversions, and if you sell clicks to the ad buyers, and they don't result in conversions, they will go somewhere else. --- class: middle # Communicating Results ??? Another very important aspect of machine learning is to be able to communicate results, and to be able to explain methodologies. If you’re want to use machine learning in research that's not computer science, you need to be able to explain why it works.  How do you do that? It’s an important skill to explain what particular results mean, what their impact will be, and how often a method will work or fail. Only if you can convince your manager your approach is sensible will your system go to production. --- class: middle, center # Explainable Results ![:scale 60%](images/amazon_explanations.png) ??? Sometimes, you even need to explain to the user why you made a decision. People found that recommendation engines work much better if the users are shown a reason for a particular recommendation. Netflix tells you based on what show it recommends another show, Amazon does the same for products. Interestingly, this also works even if the explanation is not true. There are systems that make a recommendation, and then provide a believable “explanation” after the fact. That gets more engagement than just providing the recommendation, though some people might question the ethics of that. Earlier I said in ML we are just interested in good predictions. If you need to be able to explain your predictions, this is no longer true. --- class: middle, center # Sidebar: Ethical Considerations ![:scale 30%](images/propublica_compas.png)
.compact[https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing] ??? There is another area where explainability and transparency matter, and that is when people’s lives are at stake. One aspect of machine learning that only recently is getting some more attention is ethics. There was a recent article in propublica about racial bias in risk-assessment used in the criminal justice system. Spoiler alert: it’s bad. I recommend reading the article, it’s quite interesting. This is a black-box machine learning system created by some company. If they had to provide explanations, or a more transparent system, the situation would likely be better. But this is not the only place where ethics plays a role in machine learning. There will be a more focused course on ethics in the DSI next semester, and I really recommend looking into it. --- class: middle # Ethics: It’s in the application! ??? Some people think that ethics is not something that the technical people should care about, but I disagree. I think if you build a machine learning system, you should know whether and how it is biased, and whether its application is ethical. Sometimes it’s hard to decide that, though. There’s an example of two high-schools, both of whom tried to predict which of their students will underperform in the coming year. There is a lot of ways this could be biased based on race, financial background and other factors. But that’s not the point. The point is that one of the schools used the predictions, and kicked out these students before the annual evaluation, so that they got a better evaluation score. The other school used the data to provide these students with targeted support and help. The algorithm could be the same, but the outcome is quite different. Ok, that’s enough about ethics, I hope you’ll keep these considerations in mind. The next thing I want to talk about is data! --- class: middle # Data and Data Collection ??? Clearly the data you use for building and applying machine learning systems is a critical component, and we will talk a lot about handling and transforming data this semester. Clearly, if you don’t have data, you can’t use machine learning. Let’s say you have a dataset. A very important question you need to ask yourself is: should I get more data? That’s another reason why kaggle competitions are bad: usually you can’t get more data. So what do you think? Should you get more data? More data always improves the model if it’s from the right source. So it depends: What’s the marginal cost of more data, what’s the marginal benefit to the model, what’s the marginal benefit of the model to your end-goal? We will talk about how to assess the benefit to the model later in the course. But the other questions are also important. --- # Free vs Expensive Data .left-column[ ## Free ] .right-column[ ## Expensive ] ??? The cost of data can be very different, and two kinds of data are particularly common: free data, and very expensive data. What kind of data do you think is free? --- # Free vs Expensive Data .left-column[ ## Free Predict observable events - Stock market - Clicks - House numbers ] .right-column[ ## Expensive Automate complex process - Dignosis - Drug Trial - Chip Design ] ??? Free data is data that you’ll just get more of. And that happens a lot. If you are running an ad company and want to do click prediction, every day you’ll get so much new data, you’ll barely be able to use it all. The same is true for the stock-market. In general, if you want to predict the future, and the event is observable, you’ll get more data just by waiting. This can either be because the world just produces the data, or your business process produces them. You can also be smart, and ensure your business is set up in a way so that it does produce the data. Google used captchas to do OCR and to read house numbers, then they used the results for machine learning. The other extreme of the spectrum is when you want to automate an expensive process with machine learning. This process could be an expert opinion, like a doctor’s diagnosis, or a literary analysis. It could also be an experiment, like an initial drug-trial, or measuring the efficiency of a microchip. --- class: middle # The cost (and benefit?) of BigData # Subsample to RAM (which can be 512gb) ??? There’s another aspect to data collection and dataset size. More data might be more expensive to collect, but it might also be more expensive and more complicated to work with. With the available cloud services, storage might not be that much of an issue any more. But runtime is. And I’m less concerned about buying a bigger cluster, I’m more concerned about your time, the data scientists time and the machine learning analysis. There’s a reason we’ll be using Python in this course. Python is easy to learn, has lots of tools and allows very close interactions with the data. If we would try to use SPARK instead, this would be whole other story. Working with distributed systems is hard, they are not responsive and the tooling is often not as good. So what I often do, no matter how big the dataset is, is to work with a subset of the data that fits into my RAM. Then I can use python, and everything is easy. And with AWS, I can easily get 512GB of RAM, if I really need to. Arguably I'm a bit biased because I work on scikit-learn. For some applications that subsampling might not make sense, or working on very large data is critical. But I don't think that should ever be the first step. --- class: middle # Questions ?


hello iam salman rahman auvi.I am stduying in north south university under BSC computer science & engineering.I have huge experince on many web projects.i love to create/bulid a webpage by handcoing
Yes, iam professional web expert
you can contact me on this market place = fiverr
I have 1 year experince on WordPress. I created many webpages by WordPress. If you need a WordPress expert then you can hire me
I can design a unique page for you.I always love handcoding.i can do it exactly as per your requiremens.For a unique design i always prefer html5, css3 , JavaScript,jQuery,php,mySql
i can change a static page into a dynamic page.Turn a static page into dynamic is always art for me .
webpage has no value without responsive design. iam very expert to create a responsive webpage
i will make the webpage 100% responsive. it will be easy to view the webpage from any device
i can make the webpage as per your requirements.it doesn't cost so much
My coding is clean and standard.i will write standard and clean coding for you
i will give you free support for the life time