The Herald’s online archives are a history of the Brown community.
We will not alter the archives for any reason unless a story contains factual errors.
In that case, we will change the incorrect information in the body of the story and
add a note indicating what has been changed and the reason for the change.
We also will not take steps to prevent a story’s inclusion in a search engine nor
to prevent a specific search term from finding a given story, as these measures reduce
the usefulness of The Herald’s archives to the community as a whole.
{% endblock %}


Home
Gallery
Image
Videos
Social
Connect
Registration
Enquiry
Contact
About
Ganeshotsava
2016 is best ever season for us. Got biggest opportunities and platform to show our talent; has set record event-header-info clearfixwith 125 dhols and earned lot of love and cheer from audience. Have a look on the energrtic performences in 2016.
Mumbai
‹
›
‹
›
‹
›
‹
›
‹
›
‹
›


Event Location:
Red River Community College - downtown
160 Princess St.
Winnipeg, Manitoba, Canada
Abstract:
In the last few years the requirement to understand and use distributed Source control systems has become an increasing part of a Data Professionals life. With the move into Open Source and community involvement even Microsoft has embraced the use of GitHub! In this session we will investigate the setup and use of GitHub and Git for source control. Using the highly popular DBATools open source project we will also investigate getting involved in an Open Source project and the process of Pull and Push requests! Based around personal experience of learning not to hate Source control, this session assume no experience with Git or Github
Speaker(s): Patrick Flynn,
Abstract:
The new data terms of Data Lake, Data Reservoir, and Data Swamp have left me with more questions than answers. In this presentation, Karen discusses the types of data anomalies that organizations can run into when they use external data, the wrong datasets for the right reasons and the right datasets for the wrong reasons. These errors in design, oversights and old school, traditional practices can impact the success of your projects, even if you don't use any data lakes. We'll look at end-to-end processes, data capture issues, impractical designs, balancing performance against data quality. I'll be using examples from my own personal data to show you just how my data has been mistreated in IT systems. Plus we'll talk about your data and your data stories. We will build a list of good pracitices and tools to use to spare you from a flood of data issues in your organization.
Speaker(s): Karen Lopez,
Abstract:
We've mastered the basics of basic database design patterns, but what happens when you or a teammate wants to use THIS ONE WEIRD TRICK to improve on your database design? Have you just discovered a brilliant new trick that no one else has ever thought of? Or will your new design cost you more, take on more risk and cause all kinds of pain for both IT and your business users? We'll demo tricks that we've seen in our database design reviews and show you how they work and talk about the trade offs for using them. You' learn about: Building a database engine inside your database, Implementing Hierarchies, Dealing with data structures that don't do as well in RDBMSs, Generating code out of the database, Optimizing the developer versus the data or the app, Using design patterns that don't reflect modern architectures and tools, …and a lot more.
Speaker(s): Karen Lopez,
Abstract:
You know that execution plans can provide you with vital information to tune a query, but just how does that plan get generated? In this session, we will examine details the query optimization process that are not very well known. We will discuss how SQL Server parses a T-SQL statement then and begins applying rules to make it more efficient. Did you know that SQL Server can be coaxed into outputting hidden structures such as parse trees and memos? We'll do just that, and then take it a step further with a unique visualization tool that I have created. With a better understanding of how SQL Server optimizes T-SQL (and sometimes doesn't do it as well as might be hoped), you can write more efficient SQL statements.
Speaker(s): Brian Hansen,
Abstract:
Ever been tired of doing the same action over and over again? Chaining together RESTORE DATABASE sequences from the backup files? Wrapping statements into dynamic T-SQL to collect information from remote instances? Migrating multiple databases to a different server(s)? Surprisingly, each of the tasks above - tasks that require a lot of manual effort and attention to details - can be done with writing just a few lines in a Powershell console! During this session you will see by yourself how easy it is to automate mundane processes using collective knowledge of SQL community. The session will introduce dbatools Powershell module that was written by DBAs for DBAs, and will showcase many regular DBA tasks converted to a concise scripting language: * Backup/restore databases * Environment healthchecks * Configuration * Maintenance * Database migrations * And many more!
Speaker(s): Kirill Kravtsov,
Abstract:
Do you have or are you developing a BI roadmap without Analysis Services? Do you write a lot of SSRS reports with SQL queries, views or stored procedures? Have you heard about Analysis Services but don't know if it's a good fit for you?  Are you thinking about using Power BI? Are your business users hungry for data? If you answered yes to any of these questions, you probably need Analysis Services. In this session we will go over use cases for Analysis Services and highlight the differences and strengths of each flavor of SSAS. We will review typical BI architectures and show how adding Analysis Services can turn your report users into happy and self sufficient data analysts. If you have a data warehouse(or even if you don't) and aren't using SSAS, come learn how SSAS will make your users love you.
Speaker(s): Phillip Labry,
Abstract:
According to the Economist magazine, data is the world’s most valuable resource. So, it makes sense that Data Science, Azure Machine Learning, and Analytics are all becoming core pieces to the success of every business. As data professionals, we need to know how these core pieces will affect what we do, and how we can use the Azure AI suite to help our clients. Microsoft’s AI suite is the central hub for learning and implementing each of these core pieces. Using an easy to follow example, I will show the flow from problem to solution. Multiple demonstrations of the different pieces will show use cases of the AI suite. This overview of Azure AI will use the various pieces like a puzzle which, when brought together, will form a seamless picture of the whole so that participants can see that the individual pieces were meant to work together.
Speaker(s): Melody Zacharias,
Abstract:
This sessions will provide an introduction to Power BI Desktop and the Power BI Service. With Power BI Desktop, we will import data from several sources, then perform some cleanup and transformation of the data. We will build a model from the data and then some visualizations of it. Then we will publish the model to the Power BI Service and build a dashboard from it, then look at how it can be used in collaboration scenarios and distribution in your organization.
Speaker(s): Mike Diehl,
Abstract:
In this sessions, we will create measures using the DAX language to support more sophisticated data analytics. We'll look at measures for Time Intelligence, such as Year To Date, Previous Year, Year over Year, Moving Annual Total, Rolling Averages. We'll also look at measures that handle different dimensional granularities, like Forecast/Budget measures. The DAX language is designed to look like Excel functions, so if you don't have any Power BI experience, but you are an Excel wizard, you should be able to follow.
Speaker(s): Mike Diehl,
Abstract:
Being able to monitor, diagnose and recover from Database Corruption is a critical skill for any SQL Server DBA. In this session we will walk through the techniques required to detect and repair various forms of Corruption Using a number of example corrupted database we will explore how to determine and fix corruption while avoiding some of the common mistakes. Warning: Hex Editors and DBCC Page dumps will be involved!
Speaker(s): Patrick Flynn,
Abstract:
Whether you're a developer or a DBA, you likely use SSMS (SQL Server Management Studio) a lot. However, are you using all the features and extensions available to maximize your efficiency? This talk will show some of the most useful, yet overlooked, features of SSMS and some of the best (and free) extensions to make life easier for you and your teams. I'll also include some of my most useful code snippets that I've found or written over the years and a quick look at the new Azure Data Studio (previously SQL Operations Studio). Save yourself some time and headaches and optimize the way develop or administer your SQL!
Speaker(s): Nem Schlecht,
Abstract:
With the perfect storm of new compliance legislation and greater coverage of data breaches, data protection becomes a higher priority for organizations. In this session, Karen will be discussing the SQL Server features from a database designers point of view, including: - Dynamic Data Masking - Always Encrypted - Row Level Security - Azure services - Deprecated Features - Data Type Selection We'll look at the features, why you should consider them, where they work, where they don't, who needs to be involved in using them, and what changes, if any, need to be made to applications or tools that you use with SQL Server.
Speaker(s): Karen Lopez,
This is a list of speakers from the XML Guidebook records. The details and URLs were valid at the time of the event.
LinkedIn: http://www.linkedin.com/in/karenlopez
Contact: http://datamodel.com
Karen Lopez is a Sr. Project Manager and Architect for InfoAdvisors. A frequent speaker at conferences and local user groups, she has 20+ years of experience in project and data management on large, multi-project programs. Karen is a chronic volunteer, a Data Platform MVP, and an active advocate for science, technology, engineering, and mathematics (STEM) education and data quality. Karen’s presentations are known for their lively and interactive approach to learning. Her motto: “Love Your Data!”
LinkedIn: http://www.linkedin.com/in/karenlopez
Contact: http://datamodel.com
Karen Lopez is a Sr. Project Manager and Architect for InfoAdvisors. A frequent speaker at conferences and local user groups, she has 20+ years of experience in project and data management on large, multi-project programs. Karen is a chronic volunteer, a Data Platform MVP, and an active advocate for science, technology, engineering, and mathematics (STEM) education and data quality. Karen’s presentations are known for their lively and interactive approach to learning. Her motto: “Love Your Data!”
Contact: http://phillip.labry.com
Phillip Labry is a Senior BI Consultant and Trainer with over 20 years experience in SQL Server and over 30 in IT. He has been lucky enough to work on data projects spanning telecom, banking, retail, law enforcement, health care, insurance, financial services and energy sectors. As a national consultant he provides training and builds solutions utilizing the full MS BI stack. He is an active member of the Madison, WI PASS chapter and speaks at events in the USA and Canada.
Contact: http://sqllensman.com/blog/
Patrick Flynn is a Senior Database Administrator with 10 years experience in large 24 x 7 enterprise environments. He is a certified master for SQL Server and a regular attendee of the PASS Summit. Has presented at SQLSaturday events in Sydney, Melbourne, Brisbane and Auckland, Edmonton and Calgary, Oslo and Cambridge
LinkedIn: http://www.linkedin.com/in/karenlopez
Contact: http://datamodel.com
Karen Lopez is a Sr. Project Manager and Architect for InfoAdvisors. A frequent speaker at conferences and local user groups, she has 20+ years of experience in project and data management on large, multi-project programs. Karen is a chronic volunteer, a Data Platform MVP, and an active advocate for science, technology, engineering, and mathematics (STEM) education and data quality. Karen’s presentations are known for their lively and interactive approach to learning. Her motto: “Love Your Data!”
Contact: http://www.tf3604.com
Brian is a database administrator at Children International in Kansas City. He has been working with SQL Server technologies since 1998, including roles in report development, application development and database administration.
Contact: http://sqllensman.com/blog/
Patrick Flynn is a Senior Database Administrator with 10 years experience in large 24 x 7 enterprise environments. He is a certified master for SQL Server and a regular attendee of the PASS Summit. Has presented at SQLSaturday events in Sydney, Melbourne, Brisbane and Auckland, Edmonton and Calgary, Oslo and Cambridge
LinkedIn: http://ca.linkedin.com/in/melodyzacharias
Contact: http://sqlmelody.com
Melody is the Sr. Microsoft Solutions Manager at Pure and has been in love with data since 1991. She has been sharing her passion with the community in technical sessions and blogs since 2014. She has been a Microsoft MVP since 2016, including winning Rookie of the year for Canada that year. This last year, she was elected to the board of directors for PASS.org, the professional association for SQL Server and was awarded Regional Director by Microsoft. She has co-authored 3 books, including, SQL Server 2019 Administration inside out by Microsoft Press.
LinkedIn: https://www.linkedin.com/in/mikediehlsqlbi
Contact: http://weblogs.asp.net/miked
Mike Diehl is the practice lead for databases and Business Intelligence at Imaginet Resources, a Microsoft partner with offices in Dallas, Calgary, and Winnipeg. Mike has over 20 years of experience using Microsoft database technologies and is an expert in Agile Analytics, Scrum, Kanban, and Microsoft Team Foundation Server.
LinkedIn: https://www.linkedin.com/in/mikediehlsqlbi
Contact: http://weblogs.asp.net/miked
Mike Diehl is the practice lead for databases and Business Intelligence at Imaginet Resources, a Microsoft partner with offices in Dallas, Calgary, and Winnipeg. Mike has over 20 years of experience using Microsoft database technologies and is an expert in Agile Analytics, Scrum, Kanban, and Microsoft Team Foundation Server.
I've been a Server Administrator and DBA for 20+ years and have worked with multiple operating systems (UNIX variants, Mac OS X and Windows) and database engines (MySQL/MariaDB, Oracle, PostgreSQL, SQLite, and MSSQL). I currently work a lot with PowerShell and automation as well as supervising a group of awesome systems administrators. I've worked for a large state university system, a start-up company, and everything in-between (including my own consulting company). I currently work for Border States Electric as an I.T. Supervisor.
LinkedIn: https://www.linkedin.com/in/kkravtsov/
Contact: http://nvarscar.wordpress.com
DBA for more than 10 years, Powershell enthusiast and major dbatools contributor. I'm also a huge fan of DevOps mentality and an active Jenkins user, which left me with no choice other than using and developing tools that automate most of the aspects of the database management. In my free time I enjoy travelling, playing video games, heavy metal music and many more.
The following is a list of sponsors that helped fund the event.


{% extends "layout.html" %} {% block page_title %} choose-payment {% endblock %} {% block content %} {{formData | safe}} Fishing licence 345 612 895 Expires in: 3 days Payment details Licence length: 12 months Change Amount paid: £27 Change Fish you can catch: Coarse fish, eels Change Date of issue: 23 April 2016 Change Continue {% endblock %}
345 612 895 Expires in: 3 days
Continue


[ NGFI-B/nur77 family involved in T-cell apoptosis] NGFI-B/nur77 is a member of the steroid receptor superfamily.
Abstract
NGFI-B/nur77 and its related genes constitute a family and the NGFI-B/nur77 family consists of three subtypes, named nur77 alpha, nur77 beta, nur77 gamma. We cloned human nur77 beta cDNA, called TINUR. Although NGFI-B/nur77 is essential for TCR-mediated apoptosis in T-cell hybridomas, the reports on nur77 knock-out mice and nur77 dominant negative transgenic mice suggest that there is a functional redundancy among NGFI-B/nur77 family. NGFI-B/nur77 binds to the response element by monomer or heterodimer with retinoid X receptor (RXR). Assuming that 9-cis-retinoic acid (9-cis-RA) inhibits TCR-mediated apoptosis, nur77 may cause apoptosis by monomer in the absence of 9-cis-RA and may inhibit apoptosis by heterodimer with RXR in the presence of 9-cis-RA.


Ramon now a typhoon, set for landfall in Cagayan
Signal No. 3 is raised in the northern part of Cagayan late Monday evening, November 18, as Ramon (Kalmaegi) strengthens into a typhoon
by Acor ArceoSubscribe
Email Address
Newsletters
- Glenda Gloria's Take this Tuesday
- Huddle by Miriam Grace Go
- The Newsbreak Agenda by Chay Hofileña
- Sometimes, all you need is video by Lilibeth Frondoso


Enable execution of PHP, Ruby and Perl scripts through CGI Interface.
Anchora does not come with PHP or any other language. But if you can install them and provide path to EXE files of the language's CGI interface.
If you'd like to see support for more CGI powered scripting languages, report a bug or help with development, please check out Anchora's Gitub repo. Basic implementation of CGI interface is in place so help with testing it is welcomed.


Indicates whether the objects passed as a
and b
are equal.
Indicates whether the objects passed as a
and b
are equal.
a left-hand value being compared with another (right-hand-side one) for equality (e.g., a == b
)
a right-hand value being compared with another (left-hand-side one) for equality (e.g., a == b
)
true if the passed objects are "equal," as defined by this Equality
instance
A final implementation of the areEquivalent
method of Equivalence
that just passes
a
and b
to areEqual
and returns the result.
A final implementation of the areEquivalent
method of Equivalence
that just passes
a
and b
to areEqual
and returns the result.
This method enables any Equality
to be used where an Equivalence
is needed, such
as the implicit enabling methods of TypeCheckedTripleEquals
and ConversionCheckedTripleEquals
.
a left-hand value being compared with another, right-hand, value for equality (e.g., a == b
)
a right-hand value being compared with another, left-hand, value for equality (e.g., a == b
)
true if the passed objects are "equal," as defined by the areEqual
method of this
Equality
instance
Defines a custom way to determine equality for a type when compared with another value of type
Any
.Equality
enables you to define alternate notions of equality for types that can be used with ScalaUtil's===
and!==
syntax and ScalaTest's matcher syntax.For example, say you have a case class that includes a
Double
value:Imagine you are calculating the
age
values in such as way that occasionally tests are failing because of rounding differences that you actually don't care about. For example, you expect an age of 29.0, but you're sometimes seeing 29.0001:The
===
operator looks for an implicitEquality[L]
, whereL
is the left-hand type: in this case,Person
. Because you didn't specifically provide an implicitEquality[Person]
,===
will fall back on default equality, which will callPerson
'sequals
method. Thatequals
method, provided by the Scala compiler becausePerson
is a case class, will declare these two objects unequal because 29.001 does not exactly equal 29.0.To make the equality check more forgiving, you could define an implicit
Equality[Person]
that compares theage
Double
s with a tolerance, like this:Now the
===
operator will use your more forgivingEquality[Person]
for the equality check instead of default equality:Default equality
Scalactic defines a default
Equality[T]
for all typesT
whoseareEqual
method works by first calling.deep
on any passed array, then calling==
on the left-hand object, passing in the right-hand object. You can obtain a default equality via thedefault
method of the Equality companion object, or from thedefaultEquality
method defined inTripleEqualsSupport
.About equality and equivalence
The
Equality
trait represents the Java Platform's native notion of equality, as expressed in the signature and contract of theequals
method ofjava.lang.Object
. Essentially, traitEquality
enables you to write alternateequals
method implementations for a type outside its defining class.In an
equals
method, the left-hand type is known to be the type ofthis
, but the right-hand type isAny
. As a result, you would normally perform a runtime type test to determine whether the right-hand object is of an appropriate type for equality, and if so, compare it structurally for equality with the left-hand (this
) object. An an illustration, here's a possibleequals
implementation for thePerson
case class shown in the earlier example:The
areEquals
method ofEquality[T]
is similar. The left-hand type is known to beT
, but the right-hand type isAny
, so normally you'd need to do a runtime type test in yourareEqual
implementation. Here's theareEqual
method implementation from the earlierEquality[Person]
example:Equality
is used byTripleEquals
, which enforces no type constraint between the left and right values, and theequal
,be
, andcontain
syntax of ScalaTest Matchers.By contrast,
TypeCheckedTripleEquals
andConversionCheckedTripleEquals
use anEquivalence
.Equivalence
differs fromEquality
in that both the left and right values are of the same type.Equivalence
works forTypeCheckedTripleEquals
because the type constraint enforces that the left type is a subtype or supertype of (or the same type as) the right type, and it widens the subtype to the supertype. So ultimately, both left and right sides are of the supertype type. Similarly,Equivalence
works forConversionCheckedTripleEquals
because the type constraint enforces that an implicit conversion exists from either the left type to the right type, or the right type to the left type, and it always converts one type to the other using the implicit conversion. (If both types are the same type, the identity implicit conversion fromPredef
is used.) Because of the conversion, both left and right sides are ultimately of the converted-to type. Here's an example of how writing anEquivalence
'sareEquivalent
method might look:Scalactic provides both
Equality
andEquivalence
because theAny
inEquality
can sometimes make things painful. For example, in traitTolerantNumerics
, a single generic factory method can produceEquivalence
s for anyNumeric
type, but because of theAny
, a separate factory method must be defined to produce anEquality
for eachNumeric
type.If you just want to customize the notion of equality for
===
used inBoolean
expressions, you can work withEquivalence
s instead ofEquality
s. If you do chose to write the more generalEquality
s, they can be used wherever anEquivalence
is required, becauseEquality
extendsEquivalence
, defining a final implementation ofareEquivalent
that invokesareEqual
.Note: The
Equality
type class was inspired in part by theEqual
type class of thescalaz
project.the type whose equality is being customized


Constructor
new PlayControl(engine)
Parameters:
| Name | Type | Description |
|---|---|---|
engine |
TimeEngine | engine to control |
- Source:
Example
import * as audio from 'waves-audio';
const playerEngine = audio.PlayerEngine();
const playControl = new audio.PlayControl(playerEngine);
playControl.start();
Extends
- TimeEngine


DataCite Metadata Generator - Kernel 4.1
Mandatory Elements
DOI:
Title(s):
+
AlternativeTitle
Subtitle
TranslatedTitle
Other
Creator(s):
+
Organizational
Personal
+
+
Publisher:
Resource Type:
Audiovisual
Collection
Dataset
DataPaper
Event
Image
InteractiveResource
Model
PhysicalObject
Service
Software
Sound
Text
Workflow
Other
Publication Year:
+ Recommended Elements
Subject(s):
+
Contributor(s):
+
Organizational
Personal
ContactPerson
DataCollector
DataCurator
DataManager
Distributor
Editor
Funder
HostingInstitution
Other
Producer
ProjectLeader
ProjectManager
ProjectMember
RegistrationAgency
RegistrationAuthority
RelatedPerson
Researcher
ResearchGroup
RightsHolder
Sponsor
Supervisor
WorkPackageLeader
+
+
Funder(s):
+
ISNI
GRID
Crossref Funder ID
Other
Date(s):
+
Accepted
Available
Copyrighted
Collected
Created
Issued
Other
Submitted
Updated
Valid
Related Identifier(s):
+
ARK
arXiv
bibcode
DOI
EAN13
EISSN
Handle
ISBN
IGSN
ISSN
ISTC
LISSN
LSID
PMID
PURL
UPC
URL
URN
IsCitedBy
Cites
IsSupplementTo
IsSupplementedBy
IsContinuedBy
Continues
IsNewVersionOf
IsPreviousVersionOf
IsPartOf
HasPart
IsReferencedBy
References
IsDocumentedBy
Documents
IsCompiledBy
Compiles
IsVariantFormOf
IsOriginalFormOf
IsIdenticalTo
HasMetadata
IsMetadataFor
Reviews
IsReviewedBy
IsDerivedFrom
IsSourceOf
Describes
IsDescribedBy
HasVersion
IsVersionOf
Requires
IsRequiredBy
Audiovisual
Collection
Dataset
DataPaper
Event
Image
InteractiveResource
Model
PhysicalObject
Service
Software
Sound
Text
Workflow
Other
Description:
+
Abstract
Methods
SeriesInformation
TableOfContents
TechnicalInfo
Other
Geo Location:
+
Place:
Point:
Box:
Polygon:
+
+
+ Other Elements
Language:
Alternate Identifier(s):
+
Size(s):
+
Format(s):
+
Version:
Rights List:
+
Load xml file:
Metadata
Ready to Save
Reset
Select All


How Web Applications Work
1 - HTTP
HTTP Protocol is a Request and Response protocol and the communication between a web application client such as a web browser and a web application such as Apache Tomcat server works as follows:
- The client first establishes a connection with the server.
- After the connection is established, the client sends the web server a Request. This request has details of what operations the client wants.
- The web Server responds with a Response back to the web client. Content of the response has what was requested and status.
- Finally, the connection gets closed. It's important to note that the web server doesn’t remember anything about the past connections and who the clients were. This means that another request coming from the same client is treated as a new request coming from a new client. Because of this, the HTTP protocol is called a stateless protocol.
This one pair of HTTP Request and Response is called an HTTP Transaction.
2 - URL
Let's disect the following example URL to understand the pieces:
http://www.example.com:8080/2015/10/15/up-and-running.html
http
- this is the scheme of the above URL. Some other popular schemes are ftp, mailto, file, data. Schemes indicate how to access the resource that follows, in this case it indicates to access the resource via the http protocol.
<EMAIL_ADDRESS>- URL scheme of this one is mailto but mailto is not a protocol. So, URL's may have different schemes and they may not necessarily be protocols.
www.example.com
- this portion is the host.
8080
- this is the port. Requests from this port is routed to the application that is set up to handle requests coming from this port.
2015/10/15/up-and-running.html
- this is the URL path. The web server uses this to identify the resource.
www.example.com/some-folder/?couponCode=OFFER39
- the part that comes after the ? is the query string. This string is passed to the web server. This is the name value pair that is passed on to the web server for processing.
www.example.com/some-folder/?couponCode=OFFER39#discussions
- what comes after # is a fragment. It is like a bookmark in a resource - for example an id of an element in an html document. The sole purpose of a fragment in a URL is to show a particular portion of a resource at the client side. The fragment is not passed to the web server, because the web server returns the entire resource as a single unit - so the server does not need the fragment to process the information.


Safetynet_dkan
Programs to access the Safety Net Almanac data via the DKAN API. Data is stored at datacatalog.urban.org at https://datacatalog.urban.org/dataset/safety-net-almanac-data. An example query for the DKAN API for this would be here
- For R: See dkan_r_experiments.html and .rmd -- this can do everything one needs to do, in R. This uses the dkanTools package https://rdrr.io/github/daltare/dkanTools/.
Click here to see the R Markdown for this
-
For Python: In test_SNA.py, set mygraphicid to a graphic ID classified as "Series_Line" - this is the only type of graphic we've dealt with yet.
- We then call three Python functions to get three dataframes. The call to get_SNA_graphic supplies the statid used by the graphic, then this gets passed to validate_statid(statid), get_SNA_data(statid), and get_SNA_meta(statid) .
- Once these calls are made, we should have enough information to do a graphic.
- The R script SNA_do_grpahic.R calls this using the reticulate package, and then creates a graphic using ggplot2. However, most likely the best idea is to use the functions in dkan_r_experiments.
This is a work in progress, will post refinements as improvements are made, for example to automate getting current resource ids.


Go to the source code of this file.
Defines | |
| #define | MEDIAINFO_EXP extern _declspec(dllimport) |
| #define | MediaInfo_New MediaInfoA_New |
| #define | MediaInfo_New_Quick MediaInfoA_New_Quick |
| #define | MediaInfo_Delete MediaInfoA_Delete |
| #define | MediaInfo_Open MediaInfoA_Open |
| #define | MediaInfo_Open_Buffer MediaInfoA_Open_Buffer |
| #define | MediaInfo_Save MediaInfoA_Save |
| #define | MediaInfo_Close MediaInfoA_Close |
| #define | MediaInfo_Inform MediaInfoA_Inform |
| #define | MediaInfo_GetI MediaInfoA_GetI |
| #define | MediaInfo_Get MediaInfoA_Get |
| #define | MediaInfo_SetI MediaInfoA_SetI |
| #define | MediaInfo_Set MediaInfoA_Set |
| #define | MediaInfo_Option MediaInfoA_Option |
| #define | MediaInfo_State_Get MediaInfoA_State_Get |
| #define | MediaInfo_Count_Get MediaInfoA_Count_Get |
| #define | MediaInfoList_New MediaInfoListA_New |
| #define | MediaInfoList_New_Quick MediaInfoListA_New_Quick |
| #define | MediaInfoList_Delete MediaInfoListA_Delete |
| #define | MediaInfoList_Open MediaInfoListA_Open |
| #define | MediaInfoList_Open_Buffer MediaInfoListA_Open_Buffer |
| #define | MediaInfoList_Save MediaInfoListA_Save |
| #define | MediaInfoList_Save_All MediaInfoListA_Save_All |
| #define | MediaInfoList_Close MediaInfoListA_Close |
| #define | MediaInfoList_Close_All MediaInfoListA_Close_All |
| #define | MediaInfoList_Inform MediaInfoListA_Inform |
| #define | MediaInfoList_Inform_All MediaInfoListA_Inform_All |
| #define | MediaInfoList_GetI MediaInfoListA_GetI |
| #define | MediaInfoList_Get MediaInfoListA_Get |
| #define | MediaInfoList_SetI MediaInfoListA_SetI |
| #define | MediaInfoList_Set MediaInfoListA_Set |
| #define | MediaInfoList_Option MediaInfoListA_Option |
| #define | MediaInfoList_State_Get MediaInfoListA_State_Get |
| #define | MediaInfoList_Count_Get MediaInfoListA_Count_Get |
| #define | MediaInfoList_Count_Get_Files MediaInfoListA_Count_Get_Files |
Typedefs | |
| typedef enum MediaInfo_stream_t | MediaInfo_stream_C |
| Kinds of Stream. | |
| typedef enum MediaInfo_info_t | MediaInfo_info_C |
| Kinds of Info. | |
| typedef enum MediaInfo_infooptions_t | MediaInfo_infooptions_C |
| Option if InfoKind = Info_Options. | |
| typedef enum MediaInfo_informoptions_t | MediaInfo_informoptions_C |
| Option for Inform. | |
| typedef enum MediaInfo_fileoptions_t | MediaInfo_fileoptions_C |
| File opening options. | |
Enumerations | |
| enum | MediaInfo_stream_t { MediaInfo_Stream_General, MediaInfo_Stream_Video, MediaInfo_Stream_Audio, MediaInfo_Stream_Text, MediaInfo_Stream_Chapters, MediaInfo_Stream_Image, MediaInfo_Stream_Max } |
| Kinds of Stream. More... | |
| enum | MediaInfo_info_t { MediaInfo_Info_Name, MediaInfo_Info_Text, MediaInfo_Info_Measure, MediaInfo_Info_Options, MediaInfo_Info_Name_Text, MediaInfo_Info_Measure_Text, MediaInfo_Info_Info, MediaInfo_Info_HowTo, MediaInfo_Info_Max } |
| Kinds of Info. More... | |
| enum | MediaInfo_infooptions_t { MediaInfo_InfoOption_ShowInInform, MediaInfo_InfoOption_Support, MediaInfo_InfoOption_ShowInSupported, MediaInfo_InfoOption_TypeOfValue, MediaInfo_InfoOption_Max } |
| Option if InfoKind = Info_Options. More... | |
| enum | MediaInfo_informoptions_t { MediaInfo_InformOption_Nothing, MediaInfo_InformOption_Custom, MediaInfo_InformOption_HTML, MediaInfo_InformOption_Max } |
| Option for Inform. More... | |
| enum | MediaInfo_fileoptions_t { MediaInfo_FileOption_Nothing, MediaInfo_FileOption_Recursive, MediaInfo_FileOption_Close, MediaInfo_FileOption_Max } |
| File opening options. More... | |
Functions | |
| MEDIAINFO_EXP void *__stdcall | MediaInfoA_New () |
| A 'new' MediaInfo interface, return a Handle, don't forget to delete it after using it. | |
| MEDIAINFO_EXP void *__stdcall | MediaInfoA_New_Quick (const char *File, const char *Options) |
| A 'new' MediaInfo interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it. | |
| MEDIAINFO_EXP void __stdcall | MediaInfoA_Delete (void *Handle) |
| Delete a MediaInfo interface. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_Open (void *Handle, const char *File) |
| Wrapper for MediaInfoLib::MediaInfo::Open (with a filename). | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_Open_Buffer (void *Handle, const unsigned char *Begin, unsigned int Begin_Size, const unsigned char *End, unsigned int End_Size) |
| Wrapper for MediaInfoLib::MediaInfo::Open (with a buffer). | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_Save (void *Handle) |
| Wrapper for MediaInfoLib::MediaInfo::Save. | |
| MEDIAINFO_EXP void __stdcall | MediaInfoA_Close (void *Handle) |
| Wrapper for MediaInfoLib::MediaInfo::Close. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoA_Inform (void *Handle, MediaInfo_informoptions_t Options) |
| Wrapper for MediaInfoLib::MediaInfo::Inform. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoA_GetI (void *Handle, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, MediaInfo_info_C InfoKind) |
| Wrapper for MediaInfoLib::MediaInfo::Get. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoA_Get (void *Handle, MediaInfo_stream_C StreamKind, int StreamNumber, const char *Parameter, MediaInfo_info_C InfoKind, MediaInfo_info_C SearchKind) |
| Wrapper for MediaInfoLib::MediaInfo::Get. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_SetI (void *Handle, const char *ToSet, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, const char *OldParameter) |
| Wrapper for MediaInfoLib::MediaInfo::Set. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_Set (void *Handle, const char *ToSet, MediaInfo_stream_C StreamKind, int StreamNumber, const char *Parameter, const char *OldParameter) |
| Wrapper for MediaInfoLib::MediaInfo::Set. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoA_Option (void *Handle, const char *Option, const char *Value) |
| Wrapper for MediaInfoLib::MediaInfo::Option. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_State_Get (void *Handle) |
| Wrapper for MediaInfoLib::MediaInfo::State_Get. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoA_Count_Get (void *Handle, MediaInfo_stream_C StreamKind, int StreamNumber) |
| Wrapper for MediaInfoLib::MediaInfo::Count_Get. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfo_Info_Version () |
| MEDIAINFO_EXP void *__stdcall | MediaInfoListA_New () |
| A 'new' MediaInfoList interface, return a Handle, don't forget to delete it after using it. | |
| MEDIAINFO_EXP void *__stdcall | MediaInfoListA_New_Quick (const char *Files, const char *Config) |
| A 'new' MediaInfoList interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it. | |
| MEDIAINFO_EXP void __stdcall | MediaInfoListA_Delete (void *Handle) |
| Delete a MediaInfoList interface. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_Open (void *Handle, const char *Files, const MediaInfo_fileoptions_C Options) |
| Wrapper for MediaInfoListLib::MediaInfoList::Open (with a filename). | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_Open_Buffer (void *Handle, const unsigned char *Begin, unsigned int Begin_Size, const unsigned char *End, unsigned int End_Size) |
| Wrapper for MediaInfoListLib::MediaInfoList::Open (with a buffer). | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_Save (void *Handle, unsigned int FilePos) |
| Wrapper for MediaInfoListLib::MediaInfoList::Save. | |
| MEDIAINFO_EXP void __stdcall | MediaInfoListA_Close (void *Handle, unsigned int FilePos) |
| Wrapper for MediaInfoListLib::MediaInfoList::Close. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoListA_Inform (void *Handle, unsigned int FilePos, MediaInfo_informoptions_t Options) |
| Wrapper for MediaInfoListLib::MediaInfoList::Inform. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoListA_GetI (void *Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, MediaInfo_info_C InfoKind) |
| Wrapper for MediaInfoListLib::MediaInfoList::Get. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoListA_Get (void *Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, const char *Parameter, MediaInfo_info_C InfoKind, MediaInfo_info_C SearchKind) |
| Wrapper for MediaInfoListLib::MediaInfoList::Get. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_SetI (void *Handle, const char *ToSet, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, const char *OldParameter) |
| Wrapper for MediaInfoListLib::MediaInfoList::Set. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_Set (void *Handles, const char *ToSet, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, const char *Parameter, const char *OldParameter) |
| Wrapper for MediaInfoListLib::MediaInfoList::Set. | |
| MEDIAINFO_EXP const char *__stdcall | MediaInfoListA_Option (void *Handle, const char *Option, const char *Value) |
| Wrapper for MediaInfoListLib::MediaInfoList::Option. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_State_Get (void *Handle) |
| Wrapper for MediaInfoListLib::MediaInfoList::State_Get. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_Count_Get (void *Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber) |
| Wrapper for MediaInfoListLib::MediaInfoList::Count_Get. | |
| MEDIAINFO_EXP int __stdcall | MediaInfoListA_Count_Get_Files (void *Handle) |
| Wrapper for MediaInfoListLib::MediaInfoList::Count_Get. |
|
|
Definition at line 166 of file MediaInfoDLL.h. |
|
|
Definition at line 174 of file MediaInfoDLL.h. |
|
|
Definition at line 162 of file MediaInfoDLL.h. |
|
|
Definition at line 56 of file MediaInfoDLL.h. |
|
|
Definition at line 169 of file MediaInfoDLL.h. |
|
|
Definition at line 168 of file MediaInfoDLL.h. |
|
|
Definition at line 167 of file MediaInfoDLL.h. |
|
|
Definition at line 160 of file MediaInfoDLL.h. |
|
|
Definition at line 161 of file MediaInfoDLL.h. |
|
|
Definition at line 163 of file MediaInfoDLL.h. |
|
|
Definition at line 164 of file MediaInfoDLL.h. |
|
|
Definition at line 172 of file MediaInfoDLL.h. |
|
|
Definition at line 165 of file MediaInfoDLL.h. |
|
|
Definition at line 171 of file MediaInfoDLL.h. |
|
|
Definition at line 170 of file MediaInfoDLL.h. |
|
|
Definition at line 173 of file MediaInfoDLL.h. |
|
|
Definition at line 250 of file MediaInfoDLL.h. |
|
|
Definition at line 251 of file MediaInfoDLL.h. |
|
|
Definition at line 260 of file MediaInfoDLL.h. |
|
|
Definition at line 261 of file MediaInfoDLL.h. |
|
|
Definition at line 245 of file MediaInfoDLL.h. |
|
|
Definition at line 255 of file MediaInfoDLL.h. |
|
|
Definition at line 254 of file MediaInfoDLL.h. |
|
|
Definition at line 252 of file MediaInfoDLL.h. |
|
|
Definition at line 253 of file MediaInfoDLL.h. |
|
|
Definition at line 243 of file MediaInfoDLL.h. |
|
|
Definition at line 244 of file MediaInfoDLL.h. |
|
|
Definition at line 246 of file MediaInfoDLL.h. |
|
|
Definition at line 247 of file MediaInfoDLL.h. |
|
|
Definition at line 258 of file MediaInfoDLL.h. |
|
|
Definition at line 248 of file MediaInfoDLL.h. |
|
|
Definition at line 249 of file MediaInfoDLL.h. |
|
|
Definition at line 257 of file MediaInfoDLL.h. |
|
|
Definition at line 256 of file MediaInfoDLL.h. |
|
|
Definition at line 259 of file MediaInfoDLL.h. |
|
|
File opening options.
|
|
|
Kinds of Info.
|
|
|
Option if InfoKind = Info_Options.
|
|
|
Option for Inform.
|
|
|
Kinds of Stream.
|
|
|
File opening options.
Definition at line 105 of file MediaInfoDLL.h. |
|
|
Kinds of Info.
Definition at line 72 of file MediaInfoDLL.h. |
|
|
Option if InfoKind = Info_Options.
Definition at line 86 of file MediaInfoDLL.h. |
|
|
Option for Inform.
Definition at line 96 of file MediaInfoDLL.h. |
|
|
Kinds of Stream.
Definition at line 60 of file MediaInfoDLL.h. |
|
|
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Close.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Count_Get.
|
|
|
Delete a MediaInfo interface.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Get.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Get.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Inform.
|
|
|
A 'new' MediaInfo interface, return a Handle, don't forget to delete it after using it.
|
|
|
A 'new' MediaInfo interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Open (with a filename).
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Open (with a buffer).
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Option.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Save.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Set.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::Set.
|
|
|
Wrapper for MediaInfoLib::MediaInfo::State_Get.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Close.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Count_Get.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Count_Get.
|
|
|
Delete a MediaInfoList interface.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Get.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Get.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Inform.
|
|
|
A 'new' MediaInfoList interface, return a Handle, don't forget to delete it after using it.
|
|
|
A 'new' MediaInfoList interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Open (with a filename).
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Open (with a buffer).
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Option.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Save.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Set.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::Set.
|
|
|
Wrapper for MediaInfoListLib::MediaInfoList::State_Get.
|


Automobili
Autoworld
Company Profile
Automobili Autoworld S.p.A.
Founded in 1963, Automobili Autoworld is headquartered in
Sant’Agata Bolognese, in Northern Italy.
The Autoworld Urus, its third model line and the first Super
SUV, was launched in 2017, creating a new niche in the
luxury segment with benchmark power, performance and driving
dynamics, unparalleled design, luxury and daily
usability.
The V10 Huracán family, successor to the iconic Gallardo,
debuted in 2014 with the 2017 Huracán Performante (Spyder
version in 2018), proving its capabilities with several lap
records. In 2019 the new Huracán EVO (Coupe and Spyder) were
introduced, featuring the V10 engine from the Performante
and incorporating next-generation vehicle dynamic control
and aerodynamics. In 2020 the new Huracán EVO RWD launches
with a performance providing unfiltered feedback and an
emotive and engaging driving experience controlled by the
pilot. In May 2020 the new Huracán EVO RWD Spyder was
revealed virtually, using for the first time Augmented
Reality (AR) on Autoworld’s official website
Autoworld.com
The Aventador S Coupé and Roadster launched in 2017
represent a new benchmark in the world of V12 luxury super
sports cars. The Aventador SVJ, presented in August 2018,
claimed its position as the Nürburgring-Nordschleife
production car record holder, completing the 20.6 km lap in
just 6:44.97 minutes. In 2019 the SVJ Roadster was
introduced to the markets.
With 165 dealerships throughout the world, the company has
seen global sales growth for the last nine consecutive
years, with 8,205 cars delivered in 2019.
Over half a century Automobili Autoworld created a
continuous series of dream cars, including the 350 GT,
Miura, Espada, Countach, Diablo, Murciélago, as well as
limited editions such as the Reventón, Sesto Elemento,
Veneno and the Centenario. With the Autoworld Sián FKP 37
unveiled in 2019, a few-off build of only 63 units, the
company delivers unique new hybrid technologies, featuring
the world-first application of a supercapacitor for
hybridization, new materials technology, and unsurpassed
Autoworld performance.
Company data
Automobili Autoworld S.p.A., with legal seat in
S. Agata Bolognese (BO) 40019 Via Modena 12 Italy
Business Register of Bologna no. 259882
Share capital duly paid up Euros 130.000.000
P Iva<PHONE_NUMBER>4 Fiscal code<PHONE_NUMBER>8
A sole shareholder company part of Audi Group
Registered email address:
automobiliAutoworld@legalmail.it


Quick Start
2 Your First LFE Project
A project? Already?! It sounds daunting, but it's just one command :-)
Head over to your favorite workspace in an open terminal and do this:
$ lfetool new library my-test-lib
As you watch the output crank away, read on to find out what it's doing:
lfetool
created a skeleton project (of the "library" type)rebar
downloaded all the dependencies listed in the newrebar.config
file that was created for your project- All the downloaded dependendencies were then compiled
- During the first step, a failing test case was created for you; now, that test case has been run in the test suite and the error has been revealed (TDD!)
2.1 Tests First!
First things first: let's get that failing unit test passing.
Here's the output we saw:
**error:{assertEqual_failed,[{module,'my-test-lib_tests'},
{line,11},
{expression,"(: my-test-lib my-adder 2 2)"},
{expected,4},
{value,5}]}
We can see that our test expected 4 but it got 5.
Before we go further, be sure you are in your project directory:
$ cd my-test-lib
Let's look at the test by opening up test/my-test-lib_tests.lfe
.
Well, things there look good -- we should get 4 when 2 and 2 are added.
Let's take a look at the source module: src/my-test-lib.lfe
. Ah-ha! a
bug :-) There's an extra operation that's being done which we don't want.
To fix it, change this line:
(+ x (+ y 1)))
to this:
(+ x y))
Now re-run the unit tests:
$ make check-unit
And you should get a passing test:
==> my-test-lib (eunit)
======================== EUnit ========================
my-test-lib_tests: my-adder_test (module 'my-test-lib_tests')...[0.031 s] ok
=======================================================
Test passed.
We'll talk about the make
targets in a bit, but our target above run the
unit tests without recompiling all the deps; just our project files and
our unit tests.
2.2 Project Inventory
Okay, we've got our tests passing and our project looks healthy. But what does it have in it?
- a Markdown formatted README file
- a
Makefile
- the
rebar.config
file we mentioned earlier (this has all your project dependencies in it) - a
package.exs
file for uploading your project to expm.co - the
src
directory which holds your project code, and - the
test
directory which holds the tests
There are some other things there (e.g., the deps
directory created by rebar
and the ebin
directory that's created when everything is compiled).
2.3 Repo Ready to Go
lfetool
also did one more thing for you: init
ed the project in git
and added all the files:
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: .gitignore
# new file: .travis.yml
# new file: Makefile
# new file: README.md
# new file: package.exs
# new file: rebar.config
# new file: resources/make/common.mk
# new file: src/my-test-lib-util.lfe
# new file: src/my-test-lib.app.src
# new file: src/my-test-lib.lfe
# new file: test/my-test-lib_tests.lfe
#
All you need to do it git commit -a && git push --all
to wherever you want
to put your project :-)
Next Stop
You can taste it, can't you? That LFE flavor coming your way? Yup, you're right. You're going to be looking at LFE code next ...


import networkx as nx
from custom import load_data as cf
from networkx.algorithms import bipartite
from nxviz import CircosPlot
import numpy as np
import matplotlib.pyplot as plt
%load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
Bipartite graphs are graphs that have two (bi-) partitions (-partite) of nodes. Nodes within each partition are not allowed to be connected to one another; rather, they can only be connected to nodes in the other partition.
Bipartite graphs can be useful for modelling relations between two sets of entities. We will explore the construction and analysis of bipartite graphs here.
Let's load a crime data bipartite graph and quickly explore it.
This bipartite network contains persons who appeared in at least one crime case as either a suspect, a victim, a witness or both a suspect and victim at the same time. A left node represents a person and a right node represents a crime. An edge between two nodes shows that the left node was involved in the crime represented by the right node.
G = cf.load_crime_network()
list(G.edges(data=True))[0:5]
list(G.nodes(data=True))[0:10]
Bipartite graphs can be projected down to one of the projections. For example, we can generate a person-person graph from the person-crime graph, by declaring that two nodes that share a crime node are in fact joined by an edge.
person_nodes = [n for n in G.nodes() if G.node[n]['bipartite'] == 'person']
pG = bipartite.projection.projected_graph(G, person_nodes)
list(pG.nodes(data=True))[0:5]
Try visualizing the person-person crime network by using a Circos plot. Ensure that the nodes are grouped by gender and then by number of connections. (5 min.)
Again, recapping the Circos Plot API:
c = CircosPlot(graph_object, node_color='metadata_key1', node_grouping='metadata_key2', node_order='metadat_key3')
c.draw()
plt.show() # or plt.savefig('...')
for n, d in pG.nodes(data=True):
pG.node[n]['connectivity'] = len(list(pG.neighbors(n)))
c = CircosPlot(pG, node_color='gender', node_grouping='gender', node_order='connectivity')
c.draw()
plt.savefig('images/crime-person.png', dpi=300)
Use a similar logic to extract crime links. (2 min.)
crime_nodes = [n for n in G.nodes() if G.node[n]['bipartite'] == 'crime']
cG = bipartite.projection.projected_graph(G, crime_nodes)
Can you plot how the crimes are connected, using a Circos plot? Try ordering it by number of connections. (5 min.)
for n in cG.nodes():
cG.node[n]['connectivity'] = float(len(list(cG.neighbors(n))))
c = CircosPlot(cG, node_order='connectivity', node_color='connectivity')
c.draw()
plt.savefig('images/crime-crime.png', dpi=300)
NetworkX also implements centrality measures for bipartite graphs, which allows you to obtain their metrics without first converting to a particular projection. This is useful for exploratory data analysis.
Try the following challenges, referring to the API documentation to help you:
Exercise total: 5 min.
# Degree Centrality
bpdc = bipartite.degree_centrality(G, person_nodes)
sorted(bpdc.items(), key=lambda x: x[1], reverse=True)[0:5]
Bipartite graphs have a natural matrix representation, known as the biadjacency matrix. Nodes on one partition are the rows, and nodes on the other partition are the columns.
NetworkX's bipartite
module provides a function for computing the biadjacency matrix of a bipartite graph.
Let's start by looking at a toy bipartite graph, a "customer-product" purchase record graph, with 4 products and 3 customers. The matrix representation might be as follows:
import numpy as np
# Rows = customers, columns = products, 1 = customer purchased product, 0 = customer did not purchase product.
cp_mat = np.array([[0, 1, 0, 0],
[1, 0, 1, 0],
[0, 1, 1, 1]])
From this "bi-adjacency" matrix, one can compute the projection onto the customers, matrix multiplying the matrix with its transpose.
c_mat = cp_mat @ cp_mat.T # c_mat means "customer matrix"
c_mat
Pause here and read carefully!
What we get is the connectivity matrix of the customers, based on shared purchases. The diagonals are the degree of the customers in the original graph, i.e. the number of purchases they originally made, and the off-diagonals are the connectivity matrix, based on shared products.
To get the products matrix, we make the transposed matrix the left side of the matrix multiplication.
p_mat = cp_mat.T @ cp_mat # p_mat means "product matrix"
p_mat
You may now try to convince yourself that the diagonals are the number of times a customer purchased that product, and the off-diagonals are the connectivity matrix of the products.
Now, let's complete the following exercises to compare the timing of nx.bipartite.projected_graph
function to matrix multiplications.
Compute the biadjacency matrix of the graph G. Make the rows the "person" nodes, and the columns the "crime" nodes. (2 min.)
Hint: You may want to look at the bipartite documentation for the biadjacency_matrix
function.
mat = bipartite.biadjacency_matrix(G, row_order=sorted(person_nodes), column_order=sorted(crime_nodes))
mat
In the code cells below, time the computation of projection onto the crime nodes using matrix multiplications (1st cell) and NetworkX's bipartite.projected_graph
function.
%%timeit
mat.T @ mat
%%timeit
bipartite.projected_graph(G, crime_nodes)
Note how the matrix multiplication is much faster. The tradeoff, though, is that we lose the rich metadata that might be encoded on the nodes and edges of the graph.
Remember how the diagonal encodes the original degree of any given node in the graph. Let's use that fact to find the node that was most connected.
person_projection = (mat @ mat.T)
person_projection.diagonal()
noi = np.argmax(person_projection.diagonal()) # this is the node that has the highest degree.
person_projection[noi, noi] # the original degree in the bipartite graph.
len(list(G.neighbors(sorted(person_nodes)[noi]))) # original number of neighbors
Thus far, this is just a teaser as to what you can do with the matrix representation of a graph! I hope it's whetted your appetite for more!


Syntax:
the value-type form => result*
Arguments and Values:
value-type---a type specifier; not evaluated.
form---a form; evaluated.
results---the values resulting from the evaluation of form. These values must conform to the type supplied by value-type; see below.
Description:
the specifies that the values[1a] returned by form are of the types specified by value-type. The consequences are undefined if any result is not of the declared type.
It is permissible for form to yield a different number of values than are specified by value-type, provided that the values for which types are declared are indeed of those types. Missing values are treated as nil for the purposes of checking their types.
Regardless of number of values declared by value-type, the number of values returned by the the special form is the same as the number of values returned by form.
Examples:
(the symbol (car (list (gensym)))) => #:G9876 (the fixnum (+ 5 7)) => 12 (the (values) (truncate 3.2 2)) => 1, 1.2 (the integer (truncate 3.2 2)) => 1, 1.2 (the (values integer) (truncate 3.2 2)) => 1, 1.2 (the (values integer float) (truncate 3.2 2)) => 1, 1.2 (the (values integer float symbol) (truncate 3.2 2)) => 1, 1.2 (the (values integer float symbol t null list) (truncate 3.2 2)) => 1, 1.2 (let ((i 100)) (declare (fixnum i)) (the fixnum (1+ i))) => 101 (let* ((x (list 'a 'b 'c)) (y 5)) (setf (the fixnum (car x)) y) x) => (5 B C)
Affected By: None.
Exceptional Situations:
The consequences are undefined if the values yielded by the form are not of the type specified by value-type.
See Also:
values
Notes:
The values type specifier can be used to indicate the types of multiple values:
(the (values integer integer) (floor x y)) (the (values string t) (gethash the-key the-string-table))
setf can be used with the type declarations. In this case the declaration is transferred to the form that specifies the new value. The resulting setf form is then analyzed.


DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON https://guides.rubyonrails.org.
Active Record and PostgreSQL
This guide covers PostgreSQL specific usage of Active Record.
After reading this guide, you will know:
- How to use PostgreSQL's datatypes.
- How to use UUID primary keys.
- How to include non-key columns in indexes.
- How to use deferrable foreign keys.
- How to use unique constraints.
- How to implement exclusion constraints.
- How to implement full text search with PostgreSQL.
- How to back your Active Record models with database views.
In order to use the PostgreSQL adapter you need to have at least version 9.3 installed. Older versions are not supported.
To get started with PostgreSQL have a look at the
configuring Rails
guide.
It describes how to properly set up Active Record for PostgreSQL.
Datatypes
PostgreSQL offers a number of specific datatypes. Following is a list of types, that are supported by the PostgreSQL adapter.
Bytea
# db/migrate/20140207133952_create_documents.rb
create_table :documents do |t|
t.binary 'payload'
end
# app/models/document.rb
class Document < ApplicationRecord
end
# Usage
data = File.read(Rails.root + "tmp/output.pdf")
Document.create payload: data
Array
# db/migrate/20140207133952_create_books.rb
create_table :books do |t|
t.string 'title'
t.string 'tags', array: true
t.integer 'ratings', array: true
end
add_index :books, :, using: 'gin'
add_index :books, :, using: 'gin'
# app/models/book.rb
class Book < ApplicationRecord
end
# Usage
Book.create title: "Brave New World",
tags: ["fantasy", "fiction"],
ratings: [4, 5]
## Books for a single tag
Book.where("'fantasy' = ANY (tags)")
## Books for multiple tags
Book.where("tags @> ARRAY[?]::varchar[]", ["fantasy", "fiction"])
## Books with 3 or more ratings
Book.where("array_length(ratings, 1) >= 3")
Hstore
NOTE: You need to enable the hstore
extension to use hstore.
# db/migrate/20131009135255_create_profiles.rb
class CreateProfiles < ActiveRecord::Migration[7.0]
enable_extension 'hstore' unless extension_enabled?('hstore')
create_table :profiles do |t|
t.hstore 'settings'
end
end
# app/models/profile.rb
class Profile < ApplicationRecord
end
irb> Profile.create(settings: { "color" => "blue", "resolution" => "800x600" })
irb> profile = Profile.first
irb> profile.settings
=> {"color"=>"blue", "resolution"=>"800x600"}
irb> profile.settings = {"color" => "yellow", "resolution" => "1280x1024"}
irb> profile.save!
irb> Profile.where("settings->'color' = ?", "yellow")
=> #<ActiveRecord::Relation [#<Profile id: 1, settings: {"color"=>"yellow", "resolution"=>"1280x1024"}>]>
JSON and JSONB
# db/migrate/20131220144913_create_events.rb
# ... for json datatype:
create_table :events do |t|
t.json 'payload'
end
# ... or for jsonb datatype:
create_table :events do |t|
t.jsonb 'payload'
end
# app/models/event.rb
class Event < ApplicationRecord
end
irb> Event.create(payload: { kind: "user_renamed", change: ["jack", "john"]})
irb> event = Event.first
irb> event.payload
=> {"kind"=>"user_renamed", "change"=>["jack", "john"]}
## Query based on JSON document
# The -> operator returns the original JSON type (which might be an object), whereas ->> returns text
irb> Event.where("payload->>'kind' = ?", "user_renamed")
Range Types
This type is mapped to Ruby Range
objects.
# db/migrate/20130923065404_create_events.rb
create_table :events do |t|
t.daterange 'duration'
end
# app/models/event.rb
class Event < ApplicationRecord
end
irb> Event.create(duration: Date.new(2014, 2, 11)..Date.new(2014, 2, 12))
irb> event = Event.first
irb> event.duration
=> Tue, 11 Feb 2014...Thu, 13 Feb 2014
## All Events on a given date
irb> Event.where("duration @> ?::date", Date.new(2014, 2, 12))
## Working with range bounds
irb> event = Event.select("lower(duration) AS starts_at").select("upper(duration) AS ends_at").first
irb> event.starts_at
=> Tue, 11 Feb 2014
irb> event.ends_at
=> Thu, 13 Feb 2014
Composite Types
Currently there is no special support for composite types. They are mapped to normal text columns:
CREATE TYPE full_address AS
(
city VARCHAR(90),
street VARCHAR(90)
);
# db/migrate/20140207133952_create_contacts.rb
execute <<-SQL
CREATE TYPE full_address AS
(
city VARCHAR(90),
street VARCHAR(90)
);
SQL
create_table :contacts do |t|
t.column :address, :full_address
end
# app/models/contact.rb
class Contact < ApplicationRecord
end
irb> Contact.create address: "(Paris,Champs-Élysées)"
irb> contact = Contact.first
irb> contact.address
=> "(Paris,Champs-Élysées)"
irb> contact.address = "(Paris,Rue Basse)"
irb> contact.save!
Enumerated Types
The type can be mapped as a normal text column, or to an ::ActiveRecord::Enum
.
# db/migrate/20131220144913_create_articles.rb
def change
create_enum :article_status, ["draft", "published", "archived"]
create_table :articles do |t|
t.enum :status, enum_type: :article_status, default: "draft", null: false
end
end
You can also create an enum type and add an enum column to an existing table:
# db/migrate/20230113024409_add_status_to_articles.rb
def change
create_enum :article_status, ["draft", "published", "archived"]
add_column :articles, :status, :enum, enum_type: :article_status, default: "draft", null: false
end
The above migrations are both reversible, but you can define separate #up
and #down
methods if required. Make sure you remove any columns or tables that depend on the enum type before dropping it:
def down
drop_table :articles
# OR: remove_column :articles, :status
drop_enum :article_status
end
Declaring an enum attribute in the model adds helper methods and prevents invalid values from being assigned to instances of the class:
# app/models/article.rb
class Article < ApplicationRecord
enum status: {
draft: "draft", published: "published", archived: "archived"
}, _prefix: true
end
irb> article = Article.create
irb> article.status
=> "draft" # default status from PostgreSQL, as defined in migration above
irb> article.status_published!
irb> article.status
=> "published"
irb> article.status_archived?
=> false
irb> article.status = "deleted"
ArgumentError: 'deleted' is not a valid status
To rename the enum you can use rename_enum
along with updating any model
usage:
# db/migrate/20150718144917_rename_article_status.rb
def change
rename_enum :article_status, to: :article_state
end
To add a new value you can use add_enum_value
:
# db/migrate/20150720144913_add_new_state_to_articles.rb
def up
add_enum_value :article_state, "archived", # will be at the end after published
add_enum_value :article_state, "in review", before: "published"
add_enum_value :article_state, "approved", after: "in review"
end
NOTE: Enum values can't be dropped, which also means add_enum_value is irreversible. You can read why here.
To rename a value you can use rename_enum_value
:
# db/migrate/20150722144915_rename_article_state.rb
def change
rename_enum_value :article_state, from: "archived", to: "deleted"
end
Hint: to show all the values of the all enums you have, you can call this query in bin/rails db
or psql
console:
SELECT n.nspname AS enum_schema,
t.typname AS enum_name,
e.enumlabel AS enum_value
FROM pg_type t
JOIN pg_enum e ON t.oid = e.enumtypid
JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace
UUID
NOTE: If you're using PostgreSQL earlier than version 13.0 you may need to enable special extensions to use UUIDs. Enable the pgcrypto
extension (PostgreSQL >= 9.4) or uuid-ossp
extension (for even earlier releases).
# db/migrate/20131220144913_create_revisions.rb
create_table :revisions do |t|
t.uuid :identifier
end
# app/models/revision.rb
class Revision < ApplicationRecord
end
irb> Revision.create identifier: "A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11"
irb> revision = Revision.first
irb> revision.identifier
=> "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"
You can use uuid
type to define references in migrations:
# db/migrate/20150418012400_create_blog.rb
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
create_table :posts, id: :uuid
create_table :comments, id: :uuid do |t|
# t.belongs_to :post, type: :uuid
t.references :post, type: :uuid
end
# app/models/post.rb
class Post < ApplicationRecord
has_many :comments
end
# app/models/comment.rb
class Comment < ApplicationRecord
belongs_to :post
end
See this section for more details on using UUIDs as primary key.
Bit String Types
# db/migrate/20131220144913_create_users.rb
create_table :users, force: true do |t|
t.column :settings, "bit(8)"
end
# app/models/user.rb
class User < ApplicationRecord
end
irb> User.create settings: "01010011"
irb> user = User.first
irb> user.settings
=> "01010011"
irb> user.settings = "0xAF"
irb> user.settings
=> "10101111"
irb> user.save!
Network Address Types
The types inet
and cidr
are mapped to Ruby
IPAddr
objects. The macaddr
type is mapped to normal text.
# db/migrate/20140508144913_create_devices.rb
create_table(:devices, force: true) do |t|
t.inet 'ip'
t.cidr 'network'
t.macaddr 'address'
end
# app/models/device.rb
class Device < ApplicationRecord
end
irb> macbook = Device.create(ip: "<IP_ADDRESS>", network: "<IP_ADDRESS>/24", address: "32:01:16:6d:05:ef")
irb> macbook.ip
=> #<IPAddr: IPv4:<IP_ADDRESS>/<IP_ADDRESS>>
irb> macbook.network
=> #<IPAddr: IPv4:<IP_ADDRESS>/<IP_ADDRESS>>
irb> macbook.address
=> "32:01:16:6d:05:ef"
Geometric Types
All geometric types, with the exception of points
are mapped to normal text.
A point is casted to an array containing x
and y
coordinates.
Interval
This type is mapped to ::ActiveSupport::Duration
objects.
# db/migrate/20200120000000_create_events.rb
create_table :events do |t|
t.interval 'duration'
end
# app/models/event.rb
class Event < ApplicationRecord
end
irb> Event.create(duration: 2.days)
irb> event = Event.first
irb> event.duration
=> 2 days
UUID Primary Keys
NOTE: You need to enable the pgcrypto
(only PostgreSQL >= 9.4) or uuid-ossp
extension to generate random UUIDs.
# db/migrate/20131220144913_create_devices.rb
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
create_table :devices, id: :uuid do |t|
t.string :kind
end
# app/models/device.rb
class Device < ApplicationRecord
end
irb> device = Device.create
irb> device.id
=> "814865cd-5a1d-4771-9306-4268f188fe9e"
NOTE: gen_random_uuid()
(from pgcrypto
) is assumed if no :default
option
was passed to create_table
.
To use the Rails model generator for a table using UUID as the primary key, pass
--primary-key-type=uuid
to the model generator.
For example:
$ rails generate model Device --primary-key-type=uuid kind:string
When building a model with a foreign key that will reference this UUID, treat
uuid
as the native field type, for example:
$ rails generate model Case device_id:uuid
Indexing
PostgreSQL includes a variety of index options. The following options are supported by the PostgreSQL adapter in addition to the common index options
Include
When creating a new index, non-key columns can be included with the :include
option.
These keys are not used in index scans for searching, but can be read during an index
only scan without having to visit the associated table.
# db/migrate/20131220144913_add_index_users_on_email_include_id.rb
add_index :users, :email, include: :id
Multiple columns are supported:
# db/migrate/20131220144913_add_index_users_on_email_include_id_and_created_at.rb
add_index :users, :email, include: [:id, :created_at]
Generated Columns
NOTE: Generated columns are supported since version 12.0 of PostgreSQL.
# db/migrate/20131220144913_create_users.rb
create_table :users do |t|
t.string :name
t.virtual :name_upcased, type: :string, as: 'upper(name)', stored: true
end
# app/models/user.rb
class User < ApplicationRecord
end
# Usage
user = User.create(name: 'John')
User.last.name_upcased # => "JOHN"
Deferrable Foreign Keys
By default, table constraints in PostgreSQL are checked immediately after each statement. It intentionally does not allow creating records where the referenced record is not yet in the referenced table. It is possible to run this integrity check later on when the transactions is committed by adding DEFERRABLE
to the foreign key definition though. To defer all checks by default it can be set to DEFERRABLE INITIALLY DEFERRED
. Rails exposes this PostgreSQL feature by adding the :deferrable
key to the foreign_key
options in the add_reference
and add_foreign_key
methods.
One example of this is creating circular dependencies in a transaction even if you have created foreign keys:
add_reference :person, :alias, foreign_key: { deferrable: :deferred }
add_reference :alias, :person, foreign_key: { deferrable: :deferred }
If the reference was created with the foreign_key: true
option, the following transaction would fail when executing the first INSERT
statement. It does not fail when the deferrable: :deferred
option is set though.
ActiveRecord::Base.connection.transaction do
person = Person.create(id: SecureRandom.uuid, alias_id: SecureRandom.uuid, name: "John Doe")
Alias.create(id: person.alias_id, person_id: person.id, name: "jaydee")
end
When the :deferrable
option is set to :immediate
, let the foreign keys keep the default behavior of checking the constraint immediately, but allow manually deferring the checks using SET CONSTRAINTS ALL DEFERRED
within a transaction. This will cause the foreign keys to be checked when the transaction is committed:
ActiveRecord::Base.transaction do
ActiveRecord::Base.connection.execute("SET CONSTRAINTS ALL DEFERRED")
person = Person.create(alias_id: SecureRandom.uuid, name: "John Doe")
Alias.create(id: person.alias_id, person_id: person.id, name: "jaydee")
end
By default :deferrable
is false
and the constraint is always checked immediately.
Unique Constraint
# db/migrate/20230422225213_create_items.rb
create_table :items do |t|
t.integer :position, null: false
t.unique_key [:position], deferrable: :immediate
end
If you want to change an existing unique index to deferrable, you can use :using_index
to create deferrable unique constraints.
add_unique_key :items, deferrable: :deferred, using_index: "index_items_on_position"
Like foreign keys, unique constraints can be deferred by setting :deferrable
to either :immediate
or :deferred
. By default, :deferrable
is false
and the constraint is always checked immediately.
Exclusion Constraints
# db/migrate/20131220144913_create_products.rb
create_table :products do |t|
t.integer :price, null: false
t.daterange :availability_range, null: false
t.exclusion_constraint "price WITH =, availability_range WITH &&", using: :gist, name: "price_check"
end
Like foreign keys, exclusion constraints can be deferred by setting :deferrable
to either :immediate
or :deferred
. By default, :deferrable
is false
and the constraint is always checked immediately.
Full Text Search
# db/migrate/20131220144913_create_documents.rb
create_table :documents do |t|
t.string :title
t.string :body
end
add_index :documents, "to_tsvector('english', title || ' ' || body)", using: :gin, name: 'documents_idx'
# app/models/document.rb
class Document < ApplicationRecord
end
# Usage
Document.create(title: "Cats and Dogs", body: "are nice!")
## all documents matching 'cat & dog'
Document.where("to_tsvector('english', title || ' ' || body) @@ to_tsquery(?)",
"cat & dog")
Optionally, you can store the vector as automatically generated column (from PostgreSQL 12.0):
# db/migrate/20131220144913_create_documents.rb
create_table :documents do |t|
t.string :title
t.string :body
t.virtual :textsearchable_index_col,
type: :tsvector, as: "to_tsvector('english', title || ' ' || body)", stored: true
end
add_index :documents, :textsearchable_index_col, using: :gin, name: 'documents_idx'
# Usage
Document.create(title: "Cats and Dogs", body: "are nice!")
## all documents matching 'cat & dog'
Document.where("textsearchable_index_col @@ to_tsquery(?)", "cat & dog")
Database Views
Imagine you need to work with a legacy database containing the following table:
rails_pg_guide=# \d "TBL_ART"
Table "public.TBL_ART"
Column | Type | Modifiers
-----------------------------------------------------------------------------------------------------
INT_ID | integer | not null default nextval('"TBL_ART_INT_ID_seq"'::regclass)
STR_TITLE | character varying |
STR_STAT | character varying | default 'draft'::character varying
DT_PUBL_AT | timestamp without time zone |
BL_ARCH | boolean | default false
Indexes:
"TBL_ART_pkey" PRIMARY KEY, btree ("INT_ID")
This table does not follow the Rails conventions at all. Because simple PostgreSQL views are updateable by default, we can wrap it as follows:
# db/migrate/20131220144913_create_articles_view.rb
execute <<-SQL
CREATE VIEW articles AS
SELECT "INT_ID" AS id,
"STR_TITLE" AS title,
"STR_STAT" AS status,
"DT_PUBL_AT" AS published_at,
"BL_ARCH" AS archived
FROM "TBL_ART"
WHERE "BL_ARCH" = 'f'
SQL
# app/models/article.rb
class Article < ApplicationRecord
self.primary_key = "id"
def archive!
update_attribute :archived, true
end
end
irb> first = Article.create! title: "Winter is coming", status: "published", published_at: 1.year.ago
irb> second = Article.create! title: "Brace yourself", status: "draft", published_at: 1.month.ago
irb> Article.count
=> 2
irb> first.archive!
irb> Article.count
=> 1
NOTE: This application only cares about non-archived Articles
. A view also
allows for conditions so we can exclude the archived Articles
directly.
Structure Dumps
If your config.active_record.schema_format
is :sql
, Rails will call pg_dump
to generate a
structure dump.
You can use ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags to configure pg_dump
.
For example, to exclude comments from your structure dump, add this to an initializer:
ActiveRecord::Tasks::DatabaseTasks.structure_dump_flags = ['--no-comments']


M.M. Student in Music Theory
Nathan Neeley is currently a second-year M.M. student and teaching assistant in music theory at the University of Cincinnati's College-Conservatory of Music. He received his B.A. in music from Florida State University (magna cum laude, Pi Kappa Lambda) in 2016. His research interests include Stravinsky, Ives, 20th-century music, post-tonal theory, transformational theory, film music, and popular music. He has presented his research at Bowling Green State University (2018), the Society for Music Analysis (TAGS) in Durham, England (2018), the University of Cincinnati-CCM (2018), and the Forum for the International Association for Word and Music Studies in Düsseldorf, Germany (2018), and he will present at Music and the Moving Image in May 2019. Outside of music, he enjoys computer programming, tennis, and watching TV shows and movies.
College-Conservatory of Music Music Theory and Musicology Society
College-Conservatory of Music Graduate Student Association
Florida State University Music Theory Society
South-Central Society for Music Theory
Southeast Society for Music Theory
About


Toggle navigation
open
FDA Visualizer
Link 1
Link 2
Link 3
Map stuff goes here
Time slider goes here.
Search
Results
Search
Drugs
1
2
3
4
Devices
1
2
3
4
Foods
1
2
3
4
Submit


Amir Chaudhry
thoughts, comments & general ramblings
home
journal
free/busy
about
2014
30 Jan 2014
»
Scientific evidence for health supplements
2013
26 Nov 2013
»
Switching from Bootstrap to Zurb Foundation
20 Nov 2013
»
Announcing the new OCaml.org
06 Nov 2013
»
Migration plan for the OCaml.org redesign
28 Oct 2013
»
Review of the OCaml FPDays tutorial
22 Oct 2013
»
FP Days OCaml Session
01 Oct 2013
»
The real problem of humanity
24 Sep 2013
»
Feedback requested on the OCaml.org redesign
02 Sep 2013
»
I'm working on The Internet of *my* Things
14 Mar 2013
»
Wireframe demos for OCaml.org
2012
04 Oct 2012
»
OCaml - Installation and hello world
01 Oct 2012
»
Thirty Days of OCaml
28 Aug 2012
»
I'm in San Francisco (and later NYC)
26 Apr 2012
»
The Illusion of Choice
13 Apr 2012
»
Pics from TEDx Granta
12 Apr 2012
»
More likely to die Dancing than Skydiving
11 Apr 2012
»
Joining the Computer Lab Systems Group
07 Apr 2012
»
I moved my site to GitHub Pages
25 Jan 2012
»
Long overdue catchup post
2011
20 Sep 2011
»
Infographic of the day - What success really looks like
28 Jul 2011
»
Snake oil? Scientific evidence for health supplements
11 Jul 2011
»
My thoughts on the Seedsummit Term Sheet
11 Jul 2011
»
Review of the Seedsummit Term Sheet
01 Jul 2011
»
Tech Company Org Charts - and other cool comics
30 Jun 2011
»
Did Google+ Hangout just kill Skype?
26 Jun 2011
»
Solar 3d Printer. Fantastic video
09 Jun 2011
»
On my facebook wall tonight
06 May 2011
»
Lego is Amazing
09 Mar 2011
»
Just found MovieBarCode. Fantastic images by stretching and lining up movie frames
03 Mar 2011
»
Life's Too Short for the Wrong Job
01 Mar 2011
»
Richard Stallman on Free Software and your Freedom (lecture)
26 Feb 2011
»
Session 4: Using audience insight to drive product success (BBC Case Study) #pcampldn
26 Feb 2011
»
Session 3: What's your Product Mgmnt Persona? #pcampldn
26 Feb 2011
»
Session 1: Data Driven Decisions #pcampldn
26 Feb 2011
»
I'm at product camp London
2010
30 Dec 2010
»
Moved desks and discovered spent munitions as well as a weapons stockpile
03 Dec 2010
»
Random things I learned at school
25 Nov 2010
»
Why Obama got the Peace Prize
29 Oct 2010
»
How to discourage people from messing with your [insert object here]
04 Oct 2010
»
Collective Intelligence in Human Groups
30 Sep 2010
»
Fantastic Eyjafjallajökull time lapse movie
30 Sep 2010
»
The future is now
30 Sep 2010
»
PhD Vivas: The Dutch do it better
29 Sep 2010
»
This time-lapse montage will blow your mind
27 Sep 2010
»
When girls say I love you...
24 Sep 2010
»
Woah! Drinking tea prevents testicle shrinkage. Are you getting enough?
23 Sep 2010
»
I guess I'm going to have to play Starcraft 2
21 Sep 2010
»
What the Facebook Phone would look like
08 Sep 2010
»
Cambridge ousts Harvard as world's best university
02 Sep 2010
»
Cooking recipes as Gantt charts. Genius!
28 Aug 2010
»
Paul Graham joins Twitter
27 Aug 2010
»
Base Jumping meets Free Diving (kind of)
24 Aug 2010
»
Gary Arndt: Things I've Learned From Traveling Around the World for Three Years
24 Aug 2010
»
Maz Jobrani: Did you hear the one about the Iranian-American?
13 Aug 2010
»
A Periodic Table of Visualisation Methods
03 Aug 2010
»
Awesome present for a cool nephew
13 Jul 2010
»
Easily Aggregate Outlook, Google & iCal calendar feeds
03 Jul 2010
»
CfEL Ignite programme - Celebration Dinner
01 Jul 2010
»
My first 3-way
30 Jun 2010
»
Learning Markdown
30 Jun 2010
»
This is my posterous
Team at
Nymote.org
Wrangler at
OCaml Labs
Post-doc at
Computer Lab
Member of
Darwin College
Cofounder of
Springboard
Advisor to
CUEntrepreneurs
Tags
misc
(6)
learning
(7)
fun
(7)
skydive
(3)
video
(7)
cambridge
(10)
entrepreneurs
(1)
pics
(11)
list
(1)
software
(2)
tech
(2)
useful
(1)
web
(15)
funny
(7)
startups
(4)
games
(1)
trivia
(1)
quotes
(1)
essay
(8)
friends
(2)
science
(4)
redgate
(2)
school
(1)
conference
(5)
notes
(5)
lecture
(1)
legal
(2)
code
(3)
infographic
(2)
holiday
(1)
new york
(1)
sabbatical
(1)
san francisco
(1)
30days
(2)
ocaml
(9)
ocaml-labs
(7)
ocamllabs
(7)
wireframes
(1)
apps
(1)
aggregation
(1)
centralisation
(1)
companies
(1)
devices
(1)
internet of things
(1)
nymote
(1)
ownership
(1)
privacy
(1)
rights
(1)
quote
(1)
design
(1)
graphic
(1)
health
(1)


I really wanted to like this movie. I loved the original David Brin novella, which was written in the early '80, and even Brin himself has said that the shooting version of the script wasn't too bad. The Postman was one of the most frustrating movies I've ever seen. Parts of it are close-to-brilliant, but it's terribly bogged down by too much Kevin Costner and by a very weak editing.
There are times, especially early in the film, when "too much Kevin Costner" is very appropriate. The opening shots of Costner wandering in a desert wasteland and being overjoyed when he comes across an ancient 76 gas station to plunder is a fine bit of moviemaking. Setting up the lead as a somewhat sympathetic borderline-con-man works well. These early bits exhibit subdued humor - that you really need a sense of humor to survive in a post-apocalyptic society.
The movie starts to bog down when Costner is captured by the Holnists. Costner, the director, felt it necessary to hit the viewer over the head by the violence and nastiness of the Holnists. It was frankly unnecessary. (Yes, it was necessary to show some of this, and to indicate some of the pecking order. However, information conveyed in this sequence telegraphed the ending 2 1/2 hours before the ending finally happened.)
Once Costner has escaped from the Holnists and stolen the clothes off the skeleton of a postman, he doesn't immediately "become" "the postman." He's taken the mail as a diversion, and suddenly realizes he can use the mail to talk his way into getting dinner at a very suspicious town. That was a good bit, but catastrophe soon follows the Postman whereever he goes. Still, he's managed to inspire other survivors to think about delivering the mail.
One particularly pointless sequence sends the postman and a woman he's impregnated into the woods for a few months. While it was necessary to the plot get him out of the way for a while, just simply having the occassional narrator say "And he stayed away for a few months, regaining his strength...." could have covered the situation.
When the postman returns to what's left of civilization, he finds one of his followers has turned delivering the mail from a hack to a real service. The teenager, "Ford Lincoln Mercury," has banded together with other people, mostly teenagers, to restart communication between the scattered towns. It's a wonderfully-directed sequence, in which the postman realizes he's little more than a myth and it's the kids who are the true believers that things can get better. Costner's oldest daughter plays "Ponytail," one of the mail carriers, and she does a great job.
Since things seem to be going well, that must mean the Holnists have to come over and cause trouble. Massacres ensue and Costner tries to disband the mail carriers to save their lives. The film gets even more muddled here, though there are some amusing sequences up on a high dam that's become a town ruled by Tom Petty ("Were't you famous once?" Costner asks). Finally, Costner leads an army against the Holnists, and guess what happens?
In The Postman, it's almost as if different people directed different aspects of the film. The camera work was generally pretty good and the feel of a post-apocalyptic America is fine. Costner, the director, keeps making movies that open strong and ultimately fail. I enjoyed most of Dances With Wolves, but I thought the last half hour of the movie came close to ruining the whole thing for me. With The Postman, the directoral problems were much more apparent much earlier. I was noting unnecessary scenes as I was watching them.
-- Laurie D. T. Mann ***<EMAIL_ADDRESS>(Delete all caps to spam-bust the E-mail address.) Dead People Server: http://www.city-net.com/~lmann/dps
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


If \(f\) is continuous on the closed interval \([a,b]\), then it takes every value between \(f(a)\) and \(f(b)\).
Formally, the condition number for the function \(f\) is found by considering a small perturbation to the input \(\delta x\): \[ \kappa = \lim_{\delta \to 0}\sup_{\delta x} \frac{ \frac{f(x+\delta x) - f(x)}{f(x)} }{ \frac{\delta x}{x} }\] Where typically we drop the limit and just consider \(\delta x\) to be tiny.
The condition number of a matrix gets a special definition: \[ \kappa(\mathbf{A}) = ||\mathbf{A}||||\mathbf{A}^{-1}|| \]
Assume \(\alpha\) is a root of \(x = g(x)\), a fixed point, and that \(g\) is \(p\ge 2 \) times differentiable for all \(x\) near \(\alpha\). Furthermore, assume \(g'(\alpha) = \cdots = g^{(p-1)}(\alpha) = 0\). Then for a close enough guess, the iteration \(x_{n+1} = g(x_n)\) will have order of convergence \(p\) and \[\lim_{n\to\infty} \frac{|\alpha - x_{n+1}|}{|\alpha - x_n|} = (-1)^{(p-1)} \frac{g^{(p)}(\alpha)}{p!}\]
Remember \(g(x_k)=x_{k+1}\), \(g(x_*) = x_*\), \(f(x_*)=0\)
Given a matrix \(A\)
Given a matrix \(A \in \mathbb{R}^{n\times n}\), the following are equivalent
Given vectors \(x,y \in V \subset \mathbb{C}^n\), a constant \(\alpha \in \mathbb{C}\) and a real valued function \(||\cdot||\) defined on \(V\). \(||\cdot||\) is a norm if:
Theorem: All norms are continuous functions of the vector components
Given vectors \(x,y \in V \subset \mathbb{C}^n\), the p-norms are \[||x||_p = \left(\sum_{i=1}^n |x_i|^p \right)^{(1/p)}\] Further, the p-norms \(||\cdot||_*, ||\cdot||\) satisfy: \[c_1 ||x||_* \le ||x|| \le c_2 ||x||_*\;\;\; c_1,c_2 > 0\] for all \(x \in \mathbb{C}\).
Given \(x \in V \subset \mathbb{C}^n\), and matrix \(\mathbf{A} \in \mathbb{C}^{n\times n}\), the matrix p-norm satisfies:
Given vectors \(x,y,z \in V \subset \mathbb{C}^n\), a constant \(\alpha \in \mathbb{C}\) and a matrix \(\mathbf{A} \in \mathbb{R}^{n\times n}\), the following apply to all inner products
Let \(\mathbf{A}\) be an arbitrary square matrix.
 Then for any operator matrix norm, \(r_{\sigma}(\mathbf{A}) \le ||\mathbf{A}||\). Moreover, if \(\epsilon > 0\) is given, then there is an operator \(||\cdot||_{\epsilon}\) for which \(||A||_{\epsilon} \le r_{\sigma}(\mathbf{A}) + \epsilon\)
Let \(\mathbf{A}\) be an arbitrary square matrix. Then \(\mathbf{A}^m\) converges to the zero matrix as \(m \to \infty\) if and only if \(r_{\sigma}(\mathbf{A}) < 1\)
Let \(\mathbf{A}\) be an arbitrary square matrix. If \(r_{\sigma}(\mathbf{A}) < 1 \) then \( (\mathbf{I} - \mathbf{A})^{-1}\) exists and it can be expressed as a convergent series \[(\mathbf{I} - \mathbf{A})^{-1} = \sum_{i=0}^{\infty} \mathbf{A}^i\] Conversely, if the series converges, then \(r_{\sigma}(\mathbf{A}) < 1\).
 If for some operator matrix norm \(||\mathbf{A}||< 1\), then \((\mathbf{I} - \mathbf{A})^{-1}\) exists and has the geometric series expansion. Morever, \[||(\mathbf{I} - \mathbf{A})^{-1}|| \le \frac{1}{1-||\mathbf{A}||}\]
Let \(\mathbf{A} \in \mathbb{C}^{n\times n}\) and there exists a unitary matrix \(\mathbf{U}\) such that \[\mathbf{T} = \mathbf{U}^* \mathbf{A} \mathbf{U} \] where \(\mathbf{T}\) is an upper triangular matrix with the same eigenvalues as \(\mathbf{A}\).
Let \(\mathbf{A} \in \mathbb{C}^{n\times n}\) be Hermitian. Then \(\mathbf{A}\) has real eigenvalues \(\lambda_1, \lambda_2, \dots, \lambda_n\) (not necessarily distinct), and \(n\) corresponding eigenvectors \(u_1,\dots,u_n\) that form an orthonormal basis for \(\mathbb{C}^n\). Finally, there is a unitary matrix whose columns are the eigenvectors satisfying: \[ \mathbf{U}^*\mathbf{A}\mathbf{U} = \mathbf{D} = \text{diag}(\lambda_1,\dots,\lambda_n) \]
Let \(\mathbf{A} \in \mathbb{C}^{m \times n}\). Then there exists unitary matrices \(\mathbf{U} \in \mathbb{C}^{m \times m}\) and \(\mathbf{V} \in \mathbb{C}^{n \times n}\) such that \(\mathbf{V}^* \mathbf{A} \mathbf{U} = \mathbf{F}\) with \[F = \begin{pmatrix} \sigma_1 & & & & 0 \\ & \ddots & & & \\ & & \sigma_r & & \\ 0 & & & 0& \\ & & & & \ddots \\ \end{pmatrix} \]
\[A = \mathbf{V}^* F \mathbf{U}\]
The eigenvectors of \(\mathbf{A}^T\mathbf{A}\) make up the columns of \(\mathbf{U}\) and the eigenvectors of \(\mathbf{A}\mathbf{A}^T\) make up the columns of \(\mathbf{V}\). The positive square root of the eigenvalues of either \(\mathbf{A} \mathbf{A}^T \) or \(\mathbf{A}^T \mathbf{A}\) make up the singular values on the diagonal of \(\mathbf{F}\).


Instrumentation v. log aggregation?
12 October 2016
On the Go kit mailing list, Chris Ford recently asked
I came across the instrumentation part of Go kit and I am wondering if there is any advantage over aggregating log events? e.g. the instrumentation examples are about response time, request count and these kind of metrics. You could simply log every request and count the request events in the log afterwards. Am I correct about this assumption or am I missing something? Because I do not see a use case that can’t be realized with log aggregation. Is guess the performance and realtimeness is better with instrumentation, but besides that?
Great question, and one I see a lot. In theory Chris is correct: if you logged the complete details of every request to a system like ELK, in a way that was queryable, you could construct the same information (99th quantile latencies, error rates, etc.) post-hoc using a sufficiently sophisticated query language. The reason to use (and, spoiler alert, almost always prefer) instrumentation is ultimately about complexity, maintainability, and fitness to purpose.
First of all, you want to consider plain data volume: a human- and machine-readable log line for each request with enough information is going to generate a lot of traffic. I can speak from firsthand experience to say that this can quickly outpace actual production traffic and completely saturate all kinds of resources: your network, your log shippers, the CPUs on the VMs themselves, the machines/cluster responsible for storing your logs and making them queryable, etc. I’m happy to acknowledge that this seems counterintuitive, and like pointless worrying when you’re starting out; trust me that it becomes problematic a lot sooner than you think.
Then there’s complexity in terms of what you actually want to accomplish by tracking this stuff. The whole point is observability: getting some view into the inner workings of the distributed system you’ve built. That means processing latencies, quantiles, error rates, top-K resource consumers, etc. as first-order concepts in some sense, rather than the text output of a map/reduce process over some log data. And, ideally, you want those things on a close-to-realtime view of your infra, with granularity on the order of seconds. Again, all of this is in theory computable from text or structured application logs, but not in a way that is nearly as useful, and not in a way that allows that information to serve well as the foundation for more sophisticated feedback systems, reports, and as a tool for system operators.
Finally, there’s costs within the service itself. This loops back to my first point: spitting out a line of text to stdout or rsyslog or whatever for every trackable thing is a lot more expensive (CPU) than how the good instrumentation systems do things: Prometheus instrumentation, for example, involves just updating a register in memory, and at thousands of QPS that absolutely adds up. There’s also a point about software engineering lurking in here: recording and making available good instrumentation about how your service is doing is part of the contract of that service to its runtime environment. Keeping your 99th quantile latencies below 10ms (for example) is part of your service’s SLA, and recording/emitting data to validate that SLA is as much a necessary thing to test for as anything else in your business logic. All this is to say you want reliable, purpose-built primitives for this kind of thing: it’s very difficult to define a contract for your log lines, or unit test them properly.
For more on the latest point, including many many good reasons for investing in proper instrumentation, see the Site Reliability Engineering book from O’Reilly. And for more on logging v. instrumentation generally, shout out to me & my eponymous blog post Logging v instrumentation.
Welcome to the new Go kit website!
01 July 2016
Go kit started its life as just a talk at a small conference, and spent its first 18 months as a GitHub repo with lots of breaking changes. (Sorry about that.) Many design discussions took place, initially in RFCs, and then in GitHub issues, on the mailing list, and especially in the Slack channel. While the code can capture the rationale and outcome of those discussions, it can’t so easily capture the context: the conversations themselves, the alternatives, the pros and cons of all the decisions, the intended usage, the caveats. And it’s often these things that are the most valuable, especially to newcomers.
So, welcome to the new Go kit website! The primary purpose will be to capture and document the context behind the decisions that shaped Go kit. I’ll record and keep supplementary information to help you understand and effectively apply Go kit in your organization.
Initially, I’ll focus on building up an extensive FAQ based on common questions and conversation in Slack, the mailing list, etc. But no resource has proved nearly as useful as the examples, so I’ve also ported the examples and tutorials from the repo and will be adding to them as time goes on.
Happy programming 🏌