The parser combinator library described here is based on a library written for the Clean pure functional programming language and described in chapter 5 of the 'Clean Book' (PDF available here). Based on the description in that chapter I developed a version for Factor, a concatenative language.
A parser is a word or quotation that, when called, processes an input string on the stack, performs some parsing operation on it, and returns a result indicating the success of the parsing operation.
The result returned by a parser is known as a 'list of successes'. It is a lazy list of standard Factor cons cells. Each cons cell is a result of a parse. The car of the cell is the remaining input left to be parsed and the cdr of the cell is the result of the parsing operation.
A lazy list is used for the result as a parse operation can potentially return many successful results. For example, a parser that parses one or more digits will return more than one result for the input "123". A successful parse could be "1", "12" or "123".
The list is lazy so if only one parse result is required the remaining results won't actually be processed if they are not requested. This improves efficiency.
The cdr of the result pair can be any value that the parser wishes to return. It could be the successful portion of the input string parsed, an abstract syntax tree representing the parsed input, or even a quotation that should get called for later processing.
A Parser Combinator is a word that takes one or more parsers and returns a parser that when called uses the original parsers in some manner.
The following are some very simple parsers that demonstrate how general parsers work and the 'list of sucesses' that are returned as a result.
(1) : char-a ( inp -- result ) 0 over string-nth CHAR: a = [ 1 swap string-tail CHAR: a cons unit delay lunit ] [ drop lnil ] ifte ; (2) "atest" char-a [ [ . ] leach ] when* => [[ "test" 97 ]] (3) "test" char-a [ [ . ] leach ] when* =>
'char-a' is a parser that only accepts the character 'a' in the input string. When passed an input string with a string with a leading 'a' then the 'list of successes' has 1 result value. The cdr of that result value is the character 'a' successfully parsed, and the car is the remaining input string. On failure of the parse an empty list is returned.
The parser combinator library provides a combinator, <&>, that takes two parsers off the stack and returns a parser that calls the original two in sequence. An example of use would be calling 'char-a' twice, which would then result in an input string expected with two 'a' characters leading:
(1) "aatest" [ char-a ] [ char-a ] <&> call => < list of successes > (2) [ . ] leach => [[ "test" [[ 97 97 ]] ]]
Creating parsers for specfic characters and tokens can be a chore so there is a word that, given a string token on the stack, returns a parser that parses that particular token:
(1) "begin" token => < a parser that parses the token "begin" > (2) dup "this should fail" swap call lnil? . => t (3) "begin a successfull parse" swap call => < lazy list > (4) [ . ] leach => [[ " a successfull parse" "begin" ]]
The word 'satisfy' takes a quotation from the top of the stack and returns a parser than when called will call the quotation with the first item in the input string on the stack. If the quotation returns true then the parse is successful, otherwise it fails:
(1) : digit-parser ( -- parser ) [ digit? ] satisfy ; (2) "5" digit-parser call [ . ] leach => [[ "" 53 ]] (3) "a" digit-parser call lnil? . => t
Note that 'digit-parser' returns a parser, it is not the parser itself. It is really a parser generating word like 'token'. Whereas our 'char-a' word defined originally was a parser itself.
Now that we can parse single digits it would be nice to easily parse a string of them. The '<*>' parser combinator word will do this. It accepts a parser on the top of the stack and produces a parser that parses zero or more of the constructs that the original parser parsed. The result of the '<*>' generated parser will be a list of the successful results returned by the original parser.
(1) digit-parser <*> => < parser > (2) "123" swap call => < lazy list > (3) [ . ] leach => [ "" [ 49 50 51 ] ] [ "3" [ 49 50 ] ] [ "23" [ 49 ] ] [ "123" ]
In this case there are multiple successful parses. This is because the occurrence of zero or more digits happens more than once. There is also the 'f' case where zero digits is parsed. If only the 'longest match' is required then the lcar of the lazy list can be used and the remaining parse results are never produced.
The result of the previous parse was the list of characters parsed. Sometimes you want this to be something else, like an abstract syntax tree, or some calculation. For the digit case we may want the actual integer number.
For this we can use the '<@' parser combinator. This combinator takes a parser and a quotation on the stack and returns a new parser. When the new parser is called it will call the original parser to produce the results, then it will call the quotation on each successfull result, and the result of that quotation will be the result of the parse:
(1) : digit-parser2 ( -- parser ) [ digit? ] satisfy [ digit> ] <@ ; (2) "5" digit-parser2 call [ . ] leach => [[ "" 5 ]]
Notice that now the result is the actual integer '5' rather than character code '53'.
(1) : digit-list>number ( list -- number ) #! Converts a list of digits to a number [ >digit ] map >string dup empty? [ drop 0 ] [ str>number ] ifte ; (2) : natural-parser ( -- parser ) digit-parser2 <*> [ car digit-list>number unit ] <@ ; (3) "123" natural-parser call => < lazy list > (4) [ . ] leach => [ "" 123 ] [ "3" 12 ] [ "23" 1 ] [ "123" 0 ] [ [ 123 ] | "" ]
The number parsed is the actual integer number due to the operation of the '<@' word. This allows parsers to not only parse the input string but perform operations and transformations on the syntax tree returned.
A useful debugging method to work out what to use in the quotation passed to <@ is to write an initial version of the parser that just displays the topmost item on the stack:
(1) : natural-parser-debug ( -- parser ) digit-parser2 <*> [ "debug: " write dup . ] <@ ; (3) "123" natural-parser-debug call lcar . => debug: [ [ 1 2 3 ] ] [ "" [ 1 2 3 ] ]
From the debug output we can see how to manipulate the result to get what we want. In this case it's the quotation in the previous example.
To create a full grammar we need a parser combinator that does sequential compositions. That is, given two parsers, the sequential combinator will first run the first parser, and then run the second on the remaining text to be parsed.  Of course this is done lazily so it only ends up being done when those list items are requested. The sequential combinator word is <&>.
( 1 ) "number:" token => < parser that parses the text 'number:' > ( 2 ) natural-parser => < parser that parses natural numbers > ( 3 ) <&> => < parser that parses 'number:' followed by a natural > ( 4 ) "number:100" swap call => < list of successes > ( 5 ) [ . ] leach => [ "" "number:" 100 ] [ "0" "number:" 10 ] [ "00" "number:" 1 ] [ "100" "number:" 0 ]
In this example we might prefer not to have the parse result contain the token, we want just the number. Two alternatives to <&> provide the ability to select which result to use from the two parsers. These operators are <& and &>. The < or > points in the direction of which parser to retain the results from. So our example above could be:
( 1 ) "number:" token => < parser that parses the text 'number:' > ( 2 ) natural-parser => < parser that parses natural numbers > ( 3 ) &> => < parser that parses 'number:' followed by a natural > ( 4 ) "number:100" swap call => < list of successes > ( 5 ) [ . ] leach => [ "" 100 ] [ "0" 10 ] [ "00" 1 ] [ "100" 0 ]
Notice how the parse result only contains the number due to &> being used to retain the result of the second parser.
As well as a sequential combinator we need an alternative combinator. The word for this is <|>. It takes two parsers from the stack and returns a parser that will first try the first parser. If it succeeds then the result for that is returned. If it fails then the second parser is tried and its result returned.
( 1 ) "one" token => < parser that parses the text 'one' > ( 2 ) "two" token => < parser that parses the text 'two' > ( 3 ) <|> => < parser that parses 'one' or 'two' > ( 4 ) "one" over call [ . ] leach => [[ "" "one" ]] ( 5 ) "two" swap call [ . ] leach => [[ "" "two" ]]
The option combinator, <?> allows adding optional elements to a parser. It takes one parser off the stack and if the parse succeeds add it to the result tree, otherwise it will ignore it and continue. The example below extends our natural-parser to parse integers with an optional leading minus sign.
( 1 ) : integer-parser "-" token <?> natural-parser <&> ; ( 2 ) "200" integer-parser call [ . ] leach => [ "" [ ] 200 ] [ "0" [ ] 20 ] [ "00" [ ] 2 ] [ "200" [ ] 0 ] ( 3 ) "-200" integer-parser call [ . ] leach => [ "" [ "-" ] 200 ] [ "0" [ "-" ] 20 ] [ "00" [ "-" ] 2 ] [ "200" [ "-" ] 0 ] [ "-200" [ ] 0 ] ( 4 ) : integer-parser2 integer-parser [ uncons swap [ car -1 * ] when ] <@ ; ( 5 ) "200" integer-parser2 call [ . ] leach => [ "" 200 ] [ "0" 20 ] [ "00" 2 ] [ "200" 0 ] ( 6 ) "-200" integer-parser2 call [ . ] leach => [ "" -200 ] [ "0" -20 ] [ "00" -2 ] [ "200" 0 ] [ "-200" 0 ]
A parser transformer exists, the word 'sp', that takes an existing parser and returns a new one that will first skip any whitespace before calling the original parser. This makes it easy to write grammers that avoid whitespace without having to explicitly code it into the grammar.
( 1 ) " 123" natural-parser call [ . ] leach => [ " 123" 0 ] ( 2 ) " 123" natural-parser sp call [ . ] leach => [ "" 123 ] [ "3" 12 ] [ "23" 1 ] [ "123" 0 ]
This example presents a simple grammar that will parse a number followed by an operator and another number. A factor expression that computes the entered value will be executed.
( 1 ) natural-parser => < a parser for natural numbers > ( 2 ) "/" token "*" token "+" token "-" token <|> <|> <|> => < a parser for the operator > ( 3 ) sp [ "\\ " swap cat2 eval unit ] <@ => < operator parser that skips whitespace and converts to a factor expression > ( 4 ) natural-parser sp => < a whitespace skipping natural parser > ( 5 ) <&> <&> [ uncons uncons swap append append call ] <@ => < a parser that parsers the expression, converts it to factor, calls it and puts the result in the parse tree > ( 6 ) "123 + 456" over call lcar . => [[ "" 579 ]] ( 7 ) "300-100" over call lcar . => [[ "" 200 ]] ( 8 ) "200/2" over call lcar . => [[ "" 100 ]]
It looks complicated when expanded as above but the entire parser, factored a little, looks quite readable:
( 1 ) : operator ( -- parser ) "/" token "*" token <|> "+" token <|> "-" token <|> [ "\\ " swap cat2 eval unit ] <@ ; ( 2 ) : expression ( -- parser ) natural-parser operator sp <&> natural-parser sp <&> [ uncons swap uncons -rot append append reverse call ] <@ ; ( 3 ) "40+2" expression call lcar . => [[ "" 42 ]]


--- ---
SEMINAR.....
Event Title : "Potential Theory on the Heisenberg group"
Speaker : Prof. Adam Koranyi
Affiliation : New York
Subject Area : Mathematics
Date : January 18, 2005
Time : 11.30am
Venue : Lecture Hall I, Depat of Mathematics


Import ODS (OpenDocument Spreadsheet) into R as a data frame. Also support writing data frame into ODS file.
| Version: |
1.6.7 |
| Imports: |
xml2 (≥ 1.0.0), cellranger, readr, stringi |
| Suggests: |
dplyr, testthat, datasets |
| Published: |
2018-11-26 |
| Author: |
Gerrit-Jan Schutten, Chung-hong Chan, Thomas J. Leeper and other contributors |
| Maintainer: |
Chung-hong Chan <chainsawtiney at gmail.com> |
| Contact: |
https://github.com/chainsawriot/readODS/ |
| License: |
GPL-3 |
| NeedsCompilation: |
no |
| Materials: |
README |
| CRAN checks: |
readODS results |


NetFleexLogo
Browse
Search
Source Code
NetFleex Original
Noders Are Live!
This is Noders, their last video uploaded is here! Fun, interesting, javascript, and nerds!
Play
Close X


%inherit file="slide.html" />
<%block name="main_content">
Project Requirements
The ${project.name} uses the Library of Congress
Bibliographic Framework for the Digital Age for requirements
in its AGLE-style software development
Framework Testing »
%block>
<%block name="sidebar_content">
- Broad accommodation of content rules and data models.
- Provision for types of data that logically accompany or support bibliographic description
- Accommodation of textual data, linked data with URIs instead of text, and both
- Consideration of the relationships between and recommendations for
communications format tagging, record input conventions, and system
storage/manipulation.
- Consideration of the needs of all sizes and types of libraries, from
small public to large research.
- Continuation of maintenance of MARC until no longer necessary.
- Compatibility with MARC-based records.
- Provision of transformation from MARC 21 to a new bibliographic environment.
%block>
<%block name="subtopic_one">
%block>


Introduction
The main objective of this project is to design a low-cost ventilator device with mechanical system that is able to provide consistent and accurate ventilation with positive
pressure (for adults, toddlers & infants).
This device will be having the facility of user-interface system in which one of three modes will be selected for ventilation at a time.
Design Requirements:
For proceeding with this objective, we will be provided the essential components and other parts will be printed in Computer Numerical Control(CNC) machine
and Ultimaker 3D printing machine in Fabrication Lab and Workshop Lab.
Following components are considered for design requirements:
- Two Dynamixel Motors (to push the ambu bag from left and right sides)
- LCD Display with I2C Module (for displaying menu)
- Rotary Encoder (to choose the options and click the button)
- Jumper Wires (for connections of components)
- 12V DC Power Supply
- Self Created Dedicated Printed Circuit Board
- Buck Converter (to step the 12V DC voltage down to 5V for LCD Display with I2C Module and Rotary Encoder)
- Resuscitator (Ambu Bag)
- Some Parts to be Printed from Ultimaker
- Some Parts to be Printed from CNC Machine
High Level Design
Sample Images of Final Design:
The following picture of product has been focused upon as a reference design:
From this design, an idea will be taken and a similar product will be designed.
The following picture of inside's circuit diagram has been focused upon as a reference which is to be updated:
This reference circuit is based on two Arduinos which are connected by I2C protocols in which two of them are connected with each other with I square C(I2C) protocol by connecting two analog pins A4 & A5 of both Arduinos. One Arduino is Master which is sending signal to other Arduino which is Slave. Master Arduino is for LCD Display and Rotary Encoder and Slave Arduino is for motors.
From this circuit diagram, we have been instructed to convert the whole scenario from two Arduinos to one Arduino which has proved to be a grave challenge.
In other words, we have been guided to created our own dedicated PCB Circuit which should run all the components with only one micro-controller.
Mechanical Drawing:
The following picture is the roughly drawn mechanical design of the product:
Different dimensions (in inches) have been assigned to the parts keeping in mind the size of Ambu Bag and other parts.
The following picture is the roughly taken down circuitry inside the product:
Project Execution Plan:
All the electrical and mechanical components will be tested and learnt to control one by one, and then collectively be controlled to get the genuine idea and understanding. In this manner, the provided referenced circuit will be implemented.
Distribution of Tasks:
| S.No | Tasks | Pictures | Distributed to |
|---|---|---|---|
| 1 | To operate the simple Servo Motors before reaching the Dynamixel Motors through PWM Pin of Arduino UNO to get the idea of controlling them. | Both | |
| 2 | To operate the LCD Display with I2C Module to get the idea of controlling it. | Both | |
| 3 | To operate the Rotary Encoder with LCD Display with I2C module to get the idea of controlling it. | Hasnain Ali (033-19-0028) | |
| 4 | To implement the given circuit with two Arduinos as reference. | Both | |
| 5 | To implement the basic code of Dynamixel Motors to get the idea of operating them. | Both | |
| 6 | To start connecting Rotary Encoder and LCD Display with I2C Module with Dynamixel Motors from scratch. |

|
Hasnain Ali (033-19-0028) |
| 7 | To program and finalize the complete code step by step. | Mohammad Adeel (033-19-0020) | |
| 8 | To design in CAD. | Hasnain Ali (033-19-0028) | |
| 9 | To work on PCB Designing. | Team of FAB Lab | |
| 10 | To solder components on PCB. | Mohammad Adeel (033-19-0020) | |
| 11 | Printing the PCB. | Team of FAB Lab | |
| 12 | Printing all 3D parts. |
|
Team of FAB Lab |
| 13 | To assemble everything together. | Both | |
| 14 | To make report. | Both |
Execution of General Tasks and Main Tasks by Using Arduino UNO:
-
Task No.1
Simple Servo Motors
With general code.

-
Task No.2
LCD Display
With general code.
Before operating the LCD display with I2C module, LCD display with twnenty pins without I2C module was also tried to operate with 10k ohm and 1k ohm potentiometers individually, but it was difficult to operate and output was not being shown.

Then, the LCD Display with I2C module was operating easily and successfully with two analog pins of Arduino to be connected with the I2C Module without potentiometer.

-
Task No.3
Rotary Encoder has been connected with the LCD Display with I2C Module to have the general idea of using it for navigating for the options.
With general code.
-
Task No.4
In the following scenario, complete reference circuit and the its code has been implemented.
From Website

In this video, nothing is visible in the LCD except the brightness, because while implementing this whole reference circuit along with code, previous LCD Display without I2C Module was connected, which did not work.
-
Task No.5
Operating Dynamixel Motors with simple code to get the idea.
                   -
Task No.6
Here, Rotary Encoder and LCD Display with I2C Module have been connected to operate the Dynamixel Motors from scratch.

-
Task No.7
Step by step, code is being finalized and implemented.
After opting for availabe and suitable components, we are going to connect them and progam a suitable code step-by-step.
Design
High Level System Diagram:
The following circuit diagram has been created in Fritzing application software.
This became our finalized circuit design after receiving suitable components and working hard on coding for having one micro-controller.
Description of Principle of Operation:
In this circuit, 12V DC power supply has been connected to the one Dynamixel Motor and other Dynamixel Motor is connected to the first
Dynamixel Motor serially which is fixed and decided way of connecting as many Dyanmixel Motors. Only one pin of one Dynamixel Motor is sufficient to
be connected to the D1(Tx) of the Arduino which is one of the two pins of Arduino for serial communication. With LCD Display, I2C Module has
been connected to convert the serial data travelling process into parallel data travelling process which reduces the pin connections. Here, with module,
only two analog pins A4 & A5 of Arduino have been connected to the SDA(Serial Data) & SCL(Serial Clock) of the I2C Module. Rotary Encoder
's three pins have been connected to the digital pins D2, D4 and D3 of the Arduino.
LCD Display with I2C Module and Rotary Encoder both need only 5V DC Power Supply which can be provided via Arduino's 5V & GND pins.
When the Arduino code is uploaded in the Arduino UNO, there will be a menu with options
(Adult Mode, Toddler Mode & Infant Mode) being displayed in the LCD Display, and one of the options can be chosen with the help of Rotary Encoder.
In this manner, Dynamixel Motors will start and push the Ambu Bag from left side and right side as per the requirement.
| Component Name | Picture | Description |
| Dynamixel Motor |
According to the Servo Motor in the reference circuit, at least 17.2 kg.cm torque is needed to push the Ambu Bag effectively.
For approaching this scenario, we have Dynamixel Motors which can be operated at 12V DC Power Supply which is easier to be connected with just one pin to produce the similar torque to push the Ambu Bag. |
|
| I2C Module | This module has been used with LCD Display to convert serial data travelling process into parallel data travelling process and for reducing pin connections from sixteen to four. | |
| Rotary Encoder | This device is more prefarable than an ordinary potentiometer because of its more sensitive internal construction and
continuous rotation and having a button in its knob.
In this manner, it is convenient for navigating the menu. | |
|
Buck Converter
(will be used in the PCB ahead) |
As 12V will be used by Dynamixel Motors and 5V will be used by LCD Display with I2C Module and Rotary Encoder, this device, used as a Voltage Regulator, will step down the 12V DC voltage to 5V DC Voltage only for Display with I2C Module and Rotary Encoder. Its potentiometer is adjusted to produce 5V from 12V DC Power Supply only for LCD Display with I2C Module and Rotary Encoder. |
Connectivity of Components by Protocols:
Three main protocols have been used in the circuitry of this project.
- UART Protocol
- SPI Protocol
- I2C Protocol
-
UART Protocol:
UART stands for Universal Asynchronous Reception Transmission. This protocol permits the arduino to communicate with serial devices through the pins D0(Rx) & D1(Tx).
Dynamixel Motors have been connected by using this protocol from D1(Tx) digital pin. -
SPI Protocol:
SPI stands for Serial Protocol Interface. This protocol is implemented for two way communication between two devices especially when there is the involment of clock signals.
Rotary Encoder has been connected by using this protocol from D2,D4 & D3 digital pins. -
I2C Protocol:
I2C stands for Interintegrated Circuit or I square C. It is especially used when master and slave devices are connected for sending and receiving the signals as well as for displaying text in LCD conveniently.
LCD Display with I2C Module has been connected by using this protocol from A4 & A5 analog pins.
Electrical Schematic
Description
From the beginning of our this project, our circuitry is based on Arduino. Hence, the schematic has been created similar to that of Arduino
in which ATMEGA328p micro-controller of SMD package has been used along with LEDs, capacitors, resistors, buck converter (voltage regulator),
and a crystal oscillator.
In addition to these, male connectors have been attached for our components and for uploading the code with FTDI Cable and for Bootload.
Among these connectors, only one three pin connector has been attached for one Dynamixel Motor
,because the other Dynamixel Motor will be connected serially with the first one.
PCB Layout
Challenges
Firstly, we both tried to make the PCB on Eagle software, but we could not do that because of the complexity of wires.
Then, the team of FAB Lab helped us create the design of two layers and solder the IC of ATMEGA328p micro-controller of SMD package.
Secondly, there was the error of reversed polarities of +ve & -ve terminals. It was resolved by connecting the 12V power in other direction.
Thirdly, there was the error from the PCB of having 5V for the Dynamixel Motors (needing 12V)
which must have been for only Rotary Encoder and LCD Display with I2C Module. It was resolved by the team of FAB Lab by some extra connections behind the board.
Bill of Material
SRM Machine Working
Clean Printed Circuit Board
               First Layer                                                                                Second Layer
With Buck Converter
Populated Printed Circuit Board

                                                                                With Bill of Material
Burning the Bootloader

Procedure of Burning Bootloader
To burn the Bootloader in the new Micro-controller, a Bootloader Circuit is required whose few pins are connected with few pins of the nine-pin header of the PCB. The FTDI cable is connected with its header. From the Arduino IDE software, Burn Bootloader option is chosen from Tools and Bootloader is burnt. In this process, two USB data cables are required which are connected to the PC, one for Bootloading Circuit and other for FTDI Cable.
Challenges in Booting Up
Successfully after burning the Bootloader, firstly, we had been instructed to disconnect the Buck Converter whenever we had to upload the code in the Micro-controller only with FTDI Cable, because it could cause the voltage to become double which might destroy the whole PCB with over voltage supply. Secondly, there must not have been any connection with the PC while connecting the Buck Converter for running the circuit with components.
Successfully Operating Circuit
Video
Demonstration of Operational the Circuit
In this PCB, basically, four components are to be attached which are Dynamixel Motor, LCD Display with I2C Module, Rotary Encoder,
and a Buck Converter. While operating the circuit, 12V voltage is supplied to the PCB from which all the 12V voltages are consumed by
Dynamixel Motors. But, LCD Display with I2C Module and Rotary Encoder consume only 5V which are provided by
the Buck Converter which steps down the 12V DC voltages to 5V DC voltages.
In this manner, only one 12V DC Power Supply is used effectively for the operation of whole circuitry.
Flow Code of the Software Design
Main Construct of Program
Challenges
Firstly, we had to study the whole scenario and write our own code of one Micro-controller. For this, we analyzed all the libraries and their built-in functions to be used. Secondly, we had to create the conditions for Rotary Encoder under which LCD Display with I2C Module could be controlled. Thirdly, we had to understand the serial connection of Dynamixel Motors along with their fixed ID numbers which were mandatory in the built-in functions of the library of Dynamixel Motors. Lastly, with many user-defined functions, we merged everything and programmed a suitable code for this.
CAD Design of Enclosure
| Back | Designed by us | |||
| Front | Designed by us | |||
| Bottom | Designed by us | |||
| First Top | Designed by us | |||
| Second Top | Designed by us | |||
| Third Top | Designed by us | |||
| Fourth Top | Designed by us | |||
| Left | Designed by us | |||
| Right | Designed by us | |||
| Rod | Two pieces of about 6 inches are to get cut and purchased from market |
| Bumper | Taken from website | |||
| Support | Taken from website | |||
| Clamp Arm | Taken from website | |||
| Gear | Taken from website and modified | |||
| Housing Base | Taken from website | |||
| Rail | Taken from website and modified | |||
| Ball Bearing | Taken from SolidWorks | |||
| Sliding Part | Designed by us | |||
| Assembly of Housing Base, Rail, Ball Bearing & Sliding Part | Assembled by us in SolidWorks | |||
| Motor Mount | Designed by us |
Assembly of all Parts
Design Consideration
The idea of the design has been taken from the reference website, and the dimensions have been set in inches. According to the height and diameter of Ambu Bag, the dimensions have been decided, and upper part has been built according to the movement of bumper. Inside the enclosure, there will be the dedicated PCB and wires to connect the components internally. All the components are outside the enclosure execpt PCB to whom 12V DC power supply will be connected from the big hole as to be seen.
Fabrication, Design and 3D Printing
3D Printing in the Ultimaker
Procedure
The STL file is opened in Cura slicing 3D printing application where the part is viewed and set according to the slicing pattern, and time taken can also be taken in. Then, GCode is formed which is copied in the SD Card and inserted in the Ultimaker which understands the GCode, and prints the part by slicing the hot plastic material in the required pattern.

Cutting Parts in the CNC Machine
Procedure
In this process, DXF file is used and adjusted in the software of CNC Machine in which the inside cuts and outside cuts are decided. For holes, inside cut process is chosen for which separate commands are set up.

Getting Two Rods Cut from the Market
Assembly of all Parts

Results
Final Design
               Cost of the Project
| Component | Cost |
|---|---|
| Full PCB | Rs.4552 |
| LCD Display | Rs.488 |
| I2C Module | Rs.163 |
| KY-040 Rotary Encoder | Rs.163 |
| Dynamixel Motors | Rs.23413 |
| Plywood | Rs.4227 |
| Plasting of 3D Printing | Rs.4065 |
| Metal Rods | Rs.260 |
| Ball Bearings | Rs.1500 |
| Total: | Rs.38,831 |
Business Model of the Project
Nowadays, every product, especially highly proficient and technological, is demanded a lot in the market. Here, our mission is to create somehow an affordable and portable ventilator which can be used in case of extreme emergencies just like in ambulances. As the world has been caught by the highly contagious of COVID, such project is helpful in this critical condition in which the patients can be provided the convenient means of breathing. The two main advantages of this project are that it is a little bit affordable and portable to carry everywhere in case of serious and critical conditions.
Reference
Click here to visit the website of reference.Source Code
Click here to download the source code.Eagle Files
Click here to download the Eagle Files.CAD Files
Click here to download the CAD Files.Fritzing
Click here to download the Fritzing File.Conclusion
In this course, we felt fortunate to learn plenty of new things by the strategy of self-learning. It must be said that this course proved to be
different from the rest of courses. We were free to apply new things and to do brain-drilling activities.
While making project, we learnt about group management, coordination and cooperation with one another. Our concepts were revised and polished, and
teaching and learning activities were always together.
Although it was the big loss of having the off days during the session, yet we tried our best to overcome the situation and hardships.
In our project, at the end, some mechanical errors occurred, which are the lessons for us to be more careful for them ahead.
To sum up, this course is full of learning. All are encouraged to study this with the great pomp and show.


--- layout: default --- {{ content }} {% include newsletter.html %}
© {{ 'now' | date: "%Y" }} {{ site.title }}


Hi, I'm Bang! This is my web portfolio where I share all of my favroite work. I am always interested in computer-related things and I spend a lot of time with the computer. Before I have just interacted with the computer from the point of view of the user. I found out that becoming a web developer would benefit me personally and professionally.
When I'm not developing things, I enjoy watching TV, playing games, going out, and more...
Below are some webpages developed by my partner and me:


Mercury orbits closest to the Sun of all the planets, at an average distance of approximately 58 million km (about 36 million mi). The planet’s diameter is 4,879 km (3,032 mi), and its volume and mass are about one-eighteenth that of Earth.
Mercury’s mean density is approximately equal to that of Earth and is higher than that of any of the other planets. The force of gravity on the planet's surface is about one-third of that on Earth's surface or about twice the surface gravity on the Moon.
Mercury revolves once about the Sun every 88 days. Radar observations of the planet show that it rotates only once every 58.7 days, two-thirds of its period of revolution. Only three of the planet’s days, therefore, occur during every two of its years. The side facing the Sun gets very hot, while the side facing away quickly cools to frigid temperatures.
The point in Mercury's orbit at which the planet is closest to the Sun (called the planet’s perihelion) moves a tiny amount every orbit, too much to be accounted for by the gravitational influence of other planets. The observation of these changes in Mercury's perihelion was one of the first confirmations of Einstein’s theory of relativity, which predicted their existence.
Mercury’s high density indicates that the relatively dense and abundant element iron accounts for a large proportion of the planet’s composition. The surface of Mercury, however, contains little iron, suggesting that most of Mercury’s iron is now concentrated in a large iron core. Collisions with other protoplanets early in the history of the solar system may have stripped away much of Mercury’s low-density crust, leaving behind a dense, iron-rich core.


| Package | Description |
|---|---|
| gov.nih.ncats.molwitch | |
| gov.nih.ncats.molwitch.datastores | |
| gov.nih.ncats.molwitch.fingerprint | |
| gov.nih.ncats.molwitch.inchi | |
| gov.nih.ncats.molwitch.internal.source | |
| gov.nih.ncats.molwitch.io |
Contains classes to deal with reading and writing
gov.nih.ncats.chemkit.api.Chemical
objects to different formats. |
| gov.nih.ncats.molwitch.search | |
| gov.nih.ncats.molwitch.spi |
This package contains the classes and interfaces
that must be implemented by the Service Provider
Implementations of MolWitch.
|
| Class and Description |
|---|
| Atom
Object representation of a single atom.
|
| AtomCoordinates |
| Bond
Object representation of a Bond between
two
Atom s. |
| Bond.BondType |
| Bond.DoubleBondStereo
Possible stereo types of two-atom bonds depending
on which atom in the bond is the stereo center and
which direction the bond is.
|
| Bond.Stereo
Possible stereo types of two-atom bonds depending
on which atom in the bond is the stereo center and
which direction the bond is.
|
| BondTable |
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| Chemical.OpticalActivity |
| Chemical.StereochemistryType |
| ChemicalBuilder |
| ChemicalSource |
| ChemicalSource.Type |
| Chirality |
| DoubleBondStereochemistry
CIS or TRANS
A X
\ /
C = C
/ \
H H
|
| DoubleBondStereochemistry.DoubleBondStereo
Possible stereo types of two-atom bonds depending
on which atom in the bond is the stereo center and
which direction the bond is.
|
| ExtendedTetrahedralChirality
An Allene like Stereocenter configured
with a Carbon in the center, connected to
2 terminal atoms by double bonds
and each terminal atom connected to
at most 2 peripheral atoms.
|
| GraphInvariant
The Graph Invariant data for a specific
Chemical . |
| MolwitchException |
| SGroup |
| SGroup.PolymerSubType |
| SGroup.SGroupBracket |
| SGroup.SGroupConnectivity |
| SGroup.SGroupType |
| Stereocenter
A candidate for
a stereo center (Stereogenic) not all stereocenters
are necessarily present, see
Stereocenter.isDefined() . |
| TetrahedralChirality |
| Class and Description |
|---|
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| Class and Description |
|---|
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| Class and Description |
|---|
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| Class and Description |
|---|
| ChemicalSource |
| ChemicalSource.Type |
| Class and Description |
|---|
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| Class and Description |
|---|
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| Class and Description |
|---|
| Atom
Object representation of a single atom.
|
| Bond
Object representation of a Bond between
two
Atom s. |
| Bond.BondType |
| BondTable |
| Chemical
Represents a Molecule and the contained
atoms and bonds.
|
| ChemicalSource |
| DoubleBondStereochemistry
CIS or TRANS
A X
\ /
C = C
/ \
H H
|
| ExtendedTetrahedralChirality
An Allene like Stereocenter configured
with a Carbon in the center, connected to
2 terminal atoms by double bonds
and each terminal atom connected to
at most 2 peripheral atoms.
|
| GraphInvariant
The Graph Invariant data for a specific
Chemical . |
| MolwitchException |
| SGroup |
| SGroup.SGroupType |
| Stereocenter
A candidate for
a stereo center (Stereogenic) not all stereocenters
are necessarily present, see
Stereocenter.isDefined() . |
| TetrahedralChirality |
Copyright © 2021 NIH/NCATS. All rights reserved.


--- title: The HTML5 Mobile Boilerplate excerpt: 'The #HTML5 #Mobile #Boilerplate : http://bit.ly/fEPLoC . Contains lots of goodies, like its big brother the HTML5 Boilerplate.' date: '2011-04-05 10:27:34 +0200' date_gmt: '2011-04-05 08:27:34 +0200' categories: - Webdev tags: - tweets - web - design - development ---
The #HTML5 #Mobile #Boilerplate : http://bit.ly/fEPLoC . Contains lots of goodies, like its big brother the HTML5 Boilerplate.


All content copyright © {{ site.author }}. Written in mostly valid HTML5 and CSS3. RSS
Powered by loxeyer.


Using SSL
Configuring the PostgreSQL™ server for SSL is covered in the main documentation, so it will not be repeated here. There are also instructions in the source certdir Before trying to access your SSL enabled server from Java, make sure you can get to it via psql. You should see output like the following if you have established a SSL connection.
$ ./bin/psql -h localhost -U postgres
psql (9.6.2)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
postgres=#
Custom SSLSocketFactory
PostgreSQL™ provides a way for developers to customize how a SSL connection is established. This may be used to provide a custom certificate source or other extensions by allowing the developer to create their own SSLContext
instance.
The connection URL parameters sslfactory
allow the user to specify which custom class to use for creating the SSLSocketFactory
. The class name specified by sslfactory
must extend javax.net.ssl.SSLSocketFactory
and be available to the driver’s classloader.
This class must have a zero argument constructor or a single argument constructor preferentially taking
a Properties
argument. There is a simple org.postgresql.ssl.DefaultJavaSSLFactory
provided which uses the
default java SSLFactory.
Information on how to actually implement such a class is beyond the scope of this documentation. Places to look for help are the JSSE Reference Guide
and the source to the NonValidatingFactory
provided by the JDBC driver.
Configuring the Client
There are a number of connection parameters for configuring the client for SSL. See SSL Connection parameters
The simplest being ssl=true
, passing this into the driver will cause the driver to validate both the SSL certificate and verify the hostname (same as verify-full
).
Note
This is different than libpq which defaults to a non-validating SSL connection.
In this mode, when establishing a SSL connection the JDBC driver will validate the server’s identity preventing “man in the middle” attacks. It does this by checking that the server certificate is signed by a trusted authority, and that the host you are connecting to is the same as the hostname in the certificate.
If you require encryption and want the connection to fail if it can’t be encrypted then set sslmode=require
this ensures that the server is configured to accept SSL connections for this Host/IP address and that the server recognizes the client certificate. In other words if the server does not accept SSL connections or the client certificate is not recognized the connection will fail.
Note
In this mode we will accept all server certificates.
If sslmode=verify-ca
, the server is verified by checking the certificate chain up to the root certificate stored on the client.
If sslmode=verify-full
, the server host name will be verified to make sure it matches the name stored in the server certificate.
The SSL connection will fail if the server certificate cannot be verified. verify-full
is recommended in most security-sensitive environments.
The default SSL Socket factory is the LibPQFactory. In the case where the certificate validation is failing you can try sslcert=
and LibPQFactory will not send the client certificate. If the server is not configured to authenticate using the certificate it should connect.
The location of the client certificate, the PKCS-8 client key and root certificate can be overridden with the sslcert
, sslkey
, and sslrootcert
settings respectively. These default to /defaultdir/postgresql.crt, /defaultdir/postgresql.pk8
, and /defaultdir/root.crt
respectively where defaultdir is ${user.home}/.postgresql/
in *nix systems and %appdata%/postgresql/
on windows
As of version 42.2.9 PKCS-12 is also supported. In this archive format the client key and the client certificate are in one file, which needs to be set with the sslkey
parameter. For the PKCS-12 format to be recognized, the file extension must be “.p12” (supported since 42.2.9) or “.pfx” (since 42.2.16). (In this case the sslcert
parameter is ignored.)
Finer control of the SSL connection can be achieved using the sslmode
connection parameter.
This parameter is the same as the libpq sslmode
parameter and currently implements the
following
| sslmode | Eavesdropping Protection | MITM Protection | |
|---|---|---|---|
| disable | No | No | I don’t care about security and don’t want to pay the overhead for encryption |
| allow | Maybe | No | I don’t care about security but will pay the overhead for encryption if the server insists on it |
| prefer | Maybe | No | I don’t care about encryption but will pay the overhead of encryption if the server supports it |
| require | Yes | No | I want my data to be encrypted, and I accept the overhead. I trust that the network will make sure I always connect to the server I want. |
| verify-ca | Yes | Depends on CA policy | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server that I trust. |
| verify-full | Yes | Yes | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server I trust, and that it’s the one I specify. |
NOTE
If you are using Java’s default mechanism (not LibPQFactory) to create the SSL connection you will need to make the server certificate available to Java, the first step is to convert it to a form Java understands.
openssl x509 -in server.crt -out server.crt.der -outform der
From here the easiest thing to do is import this certificate into Java’s system truststore.
keytool -keystore $JAVA_HOME/lib/security/cacerts -alias postgresql -import -file server.crt.der
The default password for the cacerts keystore is changeit
. Setting the alias to postgresql is not required. You may apply any name you wish.
If you do not have access to the system cacerts truststore you can create your own truststore.
keytool -keystore mystore -alias postgresql -import -file server.crt.der
When starting your Java application you must specify this keystore and password to use.
java -Djavax.net.ssl.trustStore=mystore -Djavax.net.ssl.trustStorePassword=mypassword com.mycompany.MyApp
In the event of problems extra debugging information is available by adding -Djavax.net.debug=ssl
to your command line.
Using SSL without Certificate Validation
In some situations it may not be possible to configure your Java environment to make the server certificate available, for example in an applet. For a large scale deployment it would be best to get a certificate signed by recognized certificate authority, but that is not always an option. The JDBC driver provides an option to establish a SSL connection without doing any validation, but please understand the risk involved before enabling this option.
A non-validating connection is established via a custom SSLSocketFactory
class that is provided with the driver. Setting the connection URL parameter sslfactory=org.postgresql.ssl.NonValidatingFactory
will turn off all SSL validation.


Function to estimate outcome regression as a function of A, C, M1,
and M2
. Because later we will need to marginalize these estimates over
estimated distributions of M1
and M2
, the output includes the predicted
value for each C_i, i = 1, ..., n and for every value of A
in
a_0
. The output is formatted as an n-length list where there is one entry
for each observation. This entry includes a list of predicted values under each treatment
Qbar_a_0
, which is itself a list with a vector of predictions for each value of
a_0
. Also included is an entry called which_M1_obs
, which indicates rows of
the all_mediator_values
that correspond to this observation's observed value of
M1
and M2
. Similarly, there is a vector which_M2_obs
, and also a vector
which_M1_M2_obs
, which indicates the row of all_mediator_values
that
corresponds to this observation's observed value of BOTH M1
and M2
.
estimate_Qbar( Y, A, M1, M2, C, DeltaA, DeltaM, SL_Qbar, glm_Qbar = NULL, a_0, stratify, family, verbose = FALSE, return_models = FALSE, valid_rows, all_mediator_values, ... )
| Y | A vector of continuous or binary outcomes. |
|---|---|
| A | A vector of binary treatment assignment (assumed to be equal to 0 or 1). |
| M1 | A |
| M2 | A |
| C | A |
| DeltaA | Indicator of missing treatment (assumed to be equal to 0 if missing 1 if observed). |
| DeltaM | Indicator of missing outcome (assumed to be equal to 0 if missing 1 if observed). |
| SL_Qbar | A vector of characters or a list describing the Super Learner library to be used for the outcome regression. |
| glm_Qbar | A character describing a formula to be used in the call to
|
| a_0 | A list of fixed treatment values |
| stratify | A |
| family | A character passed to |
| verbose | A boolean indicating whether to print status updates. |
| return_models | A boolean indicating whether to return model fits for the outcome regression, propensity score, and reduced-dimension regressions. |
| valid_rows | A |
| all_mediator_values | All combinations of M1 and M2 |
| ... | Additional arguments (not currently used) |


Plain of Tears [at34], plain, in Mandoria, peasants: 300
Last updated Turn #138
Plain of Tears [at34], plain, in Mandoria, peasants: 300
------------------------------------------------------------------------
30: The fog has cleared.
30: It is no longer windy.
30: The population grows by two peasants.
Routes leaving Plain of Tears:
North, plain, to Plain of Tears [as34], 7 days
East, plain, to Plain of Tears [at35], 7 days
South, plain, to Plain of Tears [au34], 7 days
Garrison [ht8q], garrison, uncontrolled, with ten peasants
West, plain, to Plain of Tears [at33], 7 days
Garrison [iv7w], garrison, uncontrolled, with ten peasants
Inner locations:
Poppy field [ae1r], poppy field, 1 day
Pasture [ae1s], pasture, 1 day
Seen here:
Garrison [hh7l], garrison, uncontrolled, with ten peasants


When I walk around New York City wearing Google Glass, I get a lot different reactions to it. I wanted to start tracking these reactions and what better way to do it than using Google's Mirror API? Anytime someone says something interesting to me about Google Glass, I can dictate their quote into Glass and it will automatically publish here.
If you'd like to contribute, please click here. After approving this Glassware with your account, just say say "Ok glass, post an update, do you sleep with that" and then speak the response you want to post.
Created by Matt Richardson.
Source code available on Github.
“{{note.text}}”
{% if note.creatorName %}heard by {{note.creatorName}} on {{note.date.strftime('%B %d, %Y')}}
{% else %}heard by a Glass user on {{note.date.strftime('%B %d, %Y')}}
{% endif %} {% endfor %}


Lorem ipsum dolor sit, amet consectetur adipisicing elit.
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere vel doloremque, veniam mollitia ipsam sequi placeat libero perferendis soluta et doloribus ut sunt, voluptas molestias, necessitatibus consequatur cupiditate repudiandae? Quidem."
Emanuel, Sr Strategist at Hiring.comTue 10/11 & Wed 10/12: 8am-3pm
Read moreFind which campus is close to you
Read moreJoin a keynote with Oliver Sack about music in medical treatment
Read moreWeb Development, Mobile Development, iOT, APIs
Imaging & Design, Web Design, Motion Graphics & visual Effects, Computer Animation
User Experience Design, User Research, Visual Design
Data Science, Big Data, SQL, Data Visualizaion
Product Development, Business Development, Startup
Analytics, Content Marketing, Mobile Marketing
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere vel doloremque, veniam mollitia ipsam sequi placeat libero perferendis soluta et doloribus ut sunt, voluptas molestias, necessitatibus consequatur cupiditate repudiandae? Quidem."
Designer showcase of new prototype product
Research study about New York


#include <GrShaderMgr.h>
Classes | |
| struct | SShaderEntry |
Public Member Functions | |
| GrShaderMgr () | |
| class GrShaderMgr | |
| ~GrShaderMgr () | |
| URef< GrShader > | GetShader (const UPath &name) |
| public methods | |
| URef< GrShader > | GetShader (const UPath &name, const char *vertexShader, const char *fragmentShader) |
| URef< GrShader > | FindShader (const UPath &name) |
| finds an already created shader. | |
| void | ReloadShaders () |
| reloads all disk-based shaders. | |
| void | PreContextReset () |
| context reset notification. | |
| void | PostContextReset () |
| void | BindErrorShader () |
| makes the error shader the active shader. |
Definition at line 23 of file GrShaderMgr.h.
| GrShaderMgr::GrShaderMgr | ( | ) |
class GrShaderMgr
ctor & dtor
register our console commands.
Definition at line 54 of file GrShaderMgr.cpp.
| GrShaderMgr::~GrShaderMgr | ( | ) |
Definition at line 65 of file GrShaderMgr.cpp.
| void GrShaderMgr::BindErrorShader | ( | ) |
finds an already created shader.
find the shader or create it if it doesn't already exist.
Definition at line 142 of file GrShaderMgr.cpp.
| URef< GrShader > GrShaderMgr::GetShader | ( | const UPath & | name, | |
| const char * | vertexShader, | |||
| const char * | fragmentShader | |||
| ) |
returns a custom shader. It will build the shader from the strings passed in if the shader does not currently exist.
find the shader or create it if it doesn't already exist.
create the shader and add it to the shader map.
the shader already exists.
return the shader.
Definition at line 119 of file GrShaderMgr.cpp.
public methods
finds/builds a shader. Note that this is the *name*, not the path. this will be turned into: GR_PATH_SHARED"shaders/" + name + ".shd"
get the path string.
find the shader or create it if it doesn't already exist.
files.
load the shader and add it to the shader map.
build a new shader and cache it.
the shader failed to load, so file a complaint with the bugfixer.
the shader already exists.
return the shader.
Definition at line 78 of file GrShaderMgr.cpp.
| void GrShaderMgr::PostContextReset | ( | ) |
clear the currently bound program object.
notify all shaders that the reset has completed.
Definition at line 181 of file GrShaderMgr.cpp.
| void GrShaderMgr::PreContextReset | ( | ) |
| void GrShaderMgr::ReloadShaders | ( | ) |


Elton John embraces Lewis Hamilton after sharing iconic reunion with Kiki Dee
Elton John is currently enjoying a whistlestop visit to the UK where he is promoting his new autobiography.
And while he’s over in the capital, the 72-year-old has been sure to meet up with some of his A-lister pals.
Yes, before taking to the stage in London, where he’ll be talking with David Walliams all about his life, the Honky Cat hitmaker caught up with the likes of Lewis Hamilton.
Taking to his Instagram story, the living legend shared a series of pictures from the evening, where he embraced the Formula One driver ahead of his show.
The pair were dressed to the nines in snazzy suits, as Elton wore a chequered pink blazer and trousers, that he’d matched with a pair of his iconic oversized, orange-tinted glasses.
While the sportsman was all done up in a black and white ensemble, which was paired with a cream rollneck.
Advertisement Advertisement
In a snap of them looking overwhelmed to be meeting each other, the Your Song singer wrote: ‘Hello @LewisHamilton.’
Following this, he then shared an iconic reunion with Kiki Dee, who he duetted with back in 1976 on his track Don’t Go Breaking My Heart.
In the caption, he wrote: ‘Let’s have a Kiki.’
The pictures come after Elton opened up about his recent health scare, that left him 24 hours away from death.
During his battle with prostate cancer, the Rocketman had a build up of fluid under his colon, which left him in excruciating pain and needing to wear a nappy on stage as he performed in Las Vegas in 2017.
Talking on the BBC One documentary Uncensored, Elton said: ‘I went to South America and played in Santiago and I came home, and I got to London and I was very ill. And I was rushed into hospital on intensive care.
‘I picked up an awful bug from somewhere. And I was about 24 hours from snuffing it. We didn’t tell people that was going on at the time, so I had an annus horribilis as they say for half the year.
‘I literally had to learn how to walk again. I was extremely sick. All I could think about when I was lying in my hospital bed was “please don’t let me die, I want to see my children”, and luckily I survived it.
Advertisement Advertisement
‘Now I’m fine but there’s very few bits of me left. There’s no hair, there’s a pacemaker, there’s no tonsils, there’s no prostate, there’s no appendix, I’ve had kidney stones. I’m like the Bionic Woman.’
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


- jekyll pycharm django python mongodb pymongo blockchain bitcoin jupyter beautifulsoup highcharts aggregate pipeline slide cryptocurrency semanticui html css datetime calendar
- 「jekyll」 H2O theme for Jekyll Hello Jekyll
- 「pycharm」 How to activate Pycharm Professional Django Web created by Pycharm & Command
- 「django」 Django Project - Blog/AWMS Django Template Inheritance [Ultimate] Django Web created by Command Django Template Language Django Project Created by Pycharm Community + Command Django Web created by Pycharm & Command
- 「python」 Get a Month Period Get a Week Period Django Project Created by Pycharm Community + Command Crawl data from 58.com 2nd-hand products Start to use MongoDB
- 「mongodb」 Sort data by jupyter 3 Sort data by jupyter Crawl data from 58.com 2nd-hand products Start to use MongoDB
- 「pymongo」 Start to use MongoDB
- 「blockchain」 BlockChain from 0 to 1_day6 BlockChain from 0 to 1_day5 BlockChain from 0 to 1_day4 BlockChain from 0 to 1_day3 BlockChain from 0 to 1_day2 BlockChain from 0 to 1_day1
- 「bitcoin」 BlockChain from 0 to 1_day6 BlockChain from 0 to 1_day5 BlockChain from 0 to 1_day4 BlockChain from 0 to 1_day3 BlockChain from 0 to 1_day2 BlockChain from 0 to 1_day1
- 「jupyter」 How to create slides by jupyter notebook Sort data by jupyter 3 Sort data by jupyter 2 Sort data by jupyter Running a jupyter notebook server on local pc
- 「beautifulsoup」 BeautifulSoup
- 「highcharts」 Show Highcharts.js in HTML with Dropdown Menu Sort data by jupyter 2 Sort data by jupyter
- 「aggregate」 Sort data by jupyter 3
- 「pipeline」 Sort data by jupyter 3
- 「slide」 How to create slides by jupyter notebook
- 「cryptocurrency」 Cryptocurrency - January is the best time to hop on the train？！
- 「semanticui」 Show Highcharts.js in HTML with Dropdown Menu HTML Page by SemanticUI
- 「html」 Show Highcharts.js in HTML with Dropdown Menu HTML Page by SemanticUI
- 「css」 Show Highcharts.js in HTML with Dropdown Menu HTML Page by SemanticUI
- 「datetime」 Get a Month Period Get a Week Period
- 「calendar」 Get a Month Period


In this chapter, we’ll discuss the data component in a table HDU. A table will always be in an extension HDU, never in a primary HDU.
There are two kinds of table in the FITS standard: binary tables and ASCII tables. Binary tables are more economical in storage and faster in data access and manipulation. ASCII tables store the data in a “human readable” form and therefore take up more storage space as well as more processing time since the ASCII text needs to be parsed into numerical values.
A record array is an array which contains records (i.e. rows) of heterogeneous data types. Record arrays are available through the records module in the numpy library. Here is a simple example of record array:
>>> from numpy import rec
>>> bright = rec.array([(1,'Sirius', -1.45, 'A1V'),
... (2,'Canopus', -0.73, 'F0Ib'),
... (3,'Rigil Kent', -0.1, 'G2V')],
... formats='int16,a20,float32,a10',
... names='order,name,mag,Sp')
In this example, there are 3 records (rows) and 4 fields (columns). The first field is a short integer, second a character string (of length 20), third a floating point number, and fourth a character string (of length 10). Each record has the same (heterogeneous) data structure.
The underlying data structure used for FITS tables is a class called FITS_rec which is a specialized subclass of numpy.recarray. A FITS_rec can be instantiated directly using the same initialization format presented for plain recarrays as in the example above. One may also instantiate a new FITS_rec from a list of PyFITS Column objects using the FITS_rec.from_columns() class method. This has the exact same semantics as BinTableHDU.from_columns() and TableHDU.from_columns(), except that it only returns an actual FITS_rec array and not a whole HDU object.
The data in a FITS table HDU is basically a record array, with added attributes. The metadata, i.e. information about the table data, are stored in the header. For example, the keyword TFORM1 contains the format of the first field, TTYPE2 the name of the second field, etc. NAXIS2 gives the number of records(rows) and TFIELDS gives the number of fields (columns). For FITS tables, the maximum number of fields is 999. The data type specified in TFORM is represented by letter codes for binary tables and a FORTRAN-like format string for ASCII tables. Note that this is different from the format specifications when constructing a record array.
Like images, the .data attribute of a table HDU contains the data of the table. To recap, the simple example in the Quick Tutorial:
>>> f = fits.open('bright_stars.fits') # open a FITS file
>>> tbdata = f[1].data # assume the first extension is a table
>>> print tbdata[:2] # show the first two rows
[(1, 'Sirius', -1.4500000476837158, 'A1V'),
(2, 'Canopus', -0.73000001907348633, 'F0Ib')]
>>> print tbdata['mag'] # show the values in field "mag"
[-1.45000005 -0.73000002 -0.1 ]
>>> print tbdata.field(1) # columns can be referenced by index too
['Sirius' 'Canopus' 'Rigil Kent']
Note that in Astropy, when using the field() method, it is 0-indexed while the suffixes in header keywords, such as TFORM is 1-indexed. So, tbdata.field(0) is the data in the column with the name specified in TTYPE1 and format in TFORM1.
Warning
The FITS format allows table columns with a zero-width data format, such as '0D'. This is probably intended as a space-saving measure on files in which that column contains no data. In such files, the zero-width columns are ommitted when accessing the table data, so the indexes of fields might change when using the field() method. For this reason, if you expect to encounter files containing zero-width columns it is recommended to access fields by name rather than by index.
Like image data, we can use the same “mask array” idea to pick out desired records from a table and make a new table out of it.
In the next example, assuming the table’s second field having the name ‘magnitude’, an output table containing all the records of magnitude > 5 from the input table is generated:
>>> from astropy.io import fits
>>> t = fits.open('table.fits')
>>> tbdata = t[1].data
>>> mask = tbdata.['magnitude'] > 5
>>> newtbdata = tbdata[mask]
>>> hdu = fits.BinTableHDU(data=newtbdata)
>>> hdu.writeto('newtable.fits')
Merging different tables is straightforward in Astropy. Simply merge the column definitions of the input tables:
>>> t1 = fits.open('table1.fits')
>>> t2 = fits.open('table2.fits')
>>> new_columns = t1[1].columns + t2[1].columns
>>> hdu = fits.BinTableHDU.from_columns(new_columns)
>>> hdu.writeto('newtable.fits')
The number of fields in the output table will be the sum of numbers of fields of the input tables. Users have to make sure the input tables don’t share any common field names. The number of records in the output table will be the largest number of records of all input tables. The expanded slots for the originally shorter table(s) will be zero (or blank) filled.
A simpler version of this example can be used to append a new column to a table. Updating an existing table with a new column is generally more difficult than it’s worth, but one can “append” a column to a table by creating a new table with columns from the existing table plus the new column(s):
>>> orig_table = fits.open('table.fits')[1].data
>>> orig_cols = orig_table.columns
>>> new_cols = fits.ColDefs([
... fits.Column(name='NEWCOL1', format='D',
... array=np.zeros(len(orig_table))),
... fits.Column(name='NEWCOL2', format='D',
... array=np.zeros(len(orig_table)))])
>>> hdu = fits.BinTableHDU.from_columns(orig_cols + new_cols)
>>> hdu.writeto('newtable.fits')
Now newtable.fits contains a new table with the original table, plus the two new columns filled with zeros.
Appending one table after another is slightly trickier, since the two tables may have different field attributes. Here are two examples. The first is to append by field indices, the second one is to append by field names. In both cases, the output table will inherit column attributes (name, format, etc.) of the first table:
>>> t1 = fits.open('table1.fits')
>>> t2 = fits.open('table2.fits')
>>> nrows1 = t1[1].data.shape[0]
>>> nrows2 = t2[1].data.shape[0]
>>> nrows = nrows1 + nrows2
>>> hdu = fits.BinTableHDU.from_columns(t1[1].columns, nrows=nrows)
>>> for colname in t1[1].columns.names:
... hdu.data[colname][nrows1:] = t2[1].data[colname]
>>> hdu.writeto('newtable.fits')
A table field’s data, like an image, can also be scaled. Scaling in a table has a more generalized meaning than in images. In images, the physical data is a simple linear transformation from the storage data. The table fields do have such a construct too, where BSCALE and BZERO are stored in the header as TSCALn and TZEROn. In addition, boolean columns and ASCII tables’ numeric fields are also generalized “scaled” fields, but without TSCAL and TZERO.
All scaled fields, like the image case, will take extra memory space as well as processing. So, if high performance is desired, try to minimize the use of scaled fields.
All the scalings are done for the user, so the user only sees the physical data. Thus, this no need to worry about scaling back and forth between the physical and storage column values.
To create a table from scratch, it is necessary to create individual columns first. A Column constructor needs the minimal information of column name and format. Here is a summary of all allowed formats for a binary table:
FITS format code Description 8-bit bytes L logical (Boolean) 1 X bit * B Unsigned byte 1 I 16-bit integer 2 J 32-bit integer 4 K 64-bit integer 4 A character 1 E single precision floating point 4 D double precision floating point 8 C single precision complex 8 M double precision complex 16 P array descriptor 8 Q array descriptor 16
We’ll concentrate on binary tables in this chapter. ASCII tables will be discussed in a later chapter. The less frequently used X format (bit array) and P format (used in variable length tables) will also be discussed in a later chapter.
Besides the required name and format arguments in constructing a Column, there are many optional arguments which can be used in creating a column. Here is a list of these arguments and their corresponding header keywords and descriptions:
Argument Corresponding Description in Column() header keyword name TTYPE column name format TFORM column format unit TUNIT unit null TNULL null value (only for B, I, and J) bscale TSCAL scaling factor for data bzero TZERO zero point for data scaling disp TDISP display format dim TDIM multi-dimensional array spec start TBCOL starting position for ASCII table array the data of the column
Here are a few Columns using various combination of these arguments:
>>> import numpy as np
>>> from fits import Column
>>> counts = np.array([312, 334, 308, 317])
>>> names = np.array(['NGC1', 'NGC2', 'NGC3', 'NGC4'])
>>> c1 = Column(name='target', format='10A', array=names)
>>> c2 = Column(name='counts', format='J', unit='DN', array=counts)
>>> c3 = Column(name='notes', format='A10')
>>> c4 = Column(name='spectrum', format='1000E')
>>> c5 = Column(name='flag', format='L', array=[True, False, True, True])
In this example, formats are specified with the FITS letter codes. When there is a number (>1) preceding a (numeric type) letter code, it means each cell in that field is a one-dimensional array. In the case of column c4, each cell is an array (a numpy array) of 1000 elements.
For character string fields, the number be to the left of the letter ‘A’ when creating binary tables, and should be to the right when creating ASCII tables. However, as this is a common confusion both formats are understood when creating binary tables (note, however, that upon writing to a file the correct format will be written in the header). So, for columns c1 and c3, they both have 10 characters in each of their cells. For numeric data type, the dimension number must be before the letter code, not after.
After the columns are constructed, the BinTableHDU.from_columns() class method can be used to construct a table HDU. We can either go through the column definition object:
>>> coldefs = fits.ColDefs([c1, c2, c3, c4, c5])
>>> tbhdu = fits.BinTableHDU.from_columns(coldefs)
or directly use the BinTableHDU.from_columns() method:
>>> tbhdu = fits.BinTableHDU.from_columns([c1, c2, c3, c4, c5])
Note
Users familiar with older versions of PyFITS or Astropy will wonder what happened to new_table(). It is still there, but is deprecated. BinTableHDU.from_columns() and its companion for ASCII tables TableHDU.from_columns() are the same as new_table() in the arguments they accept and their behavior. They just make it more explicit what type of table HDU they create.
A look of the newly created HDU’s header will show that relevant keywords are properly populated:
>>> tbhdu.header
XTENSION = 'BINTABLE' / binary table extension
BITPIX = 8 / array data type
NAXIS = 2 / number of array dimensions
NAXIS1 = 4025 / length of dimension 1
NAXIS2 = 4 / length of dimension 2
PCOUNT = 0 / number of group parameters
GCOUNT = 1 / number of groups
TFIELDS = 5 / number of table fields
TTYPE1 = 'target '
TFORM1 = '10A '
TTYPE2 = 'counts '
TFORM2 = 'J '
TUNIT2 = 'DN '
TTYPE3 = 'notes '
TFORM3 = '10A '
TTYPE4 = 'spectrum'
TFORM4 = '1000E '
TTYPE5 = 'flag '
TFORM5 = 'L '
Warning
It should be noted that when creating a new table with BinTableHDU.from_columns(), an in-memory copy of all of the input column arrays is created. This is because it is not guaranteed that the columns are arranged contiguously in memory in row-major order (in fact, they are most likely not), so they have to be combined into a new array.
However, if the array data is already contiguous in memory, such as in an existing record array, a kludge can be used to create a new table HDU without any copying. First, create the Columns as before, but without using the array= argument:
>>> c1 = Column(name='target', format='10A')
Then call BinTableHDU.from_columns():
>>> tbhdu = fits.BinTableHDU.from_columns([c1, c2, c3, c4, c5])
This will create a new table HDU as before, with the correct column definitions, but an empty data section. Now simply assign your array directly to the HDU’s data attribute:
>>> tbhdu.data = mydata
In a future version of Astropy table creation will be simplified and this process won’t be necessary.


{init} {loader} {config}
This page just sends an XHR and sets window.xhrDone to true in the load callback.


--- layout: page title: About header-img: "img/about-bg.png" ---
A small town girl in a big city, trying to make it in the world of code.


This site is optimised for modern web browsers,
and does not fully support your version of Internet Explorer
Hot bacon dressing
By
Antony Worrall Thompson
From
Saturday Kitchen
Ingredients
-
4 rashers
bacon
, chopped
-
2
shallots
, finely diced
-
2 skinned tomatoes, diced
-
1 tbsp grainy honey
mustard
(or mix a little honey with grainy
mustard
)
-
175ml/6fl oz extra virgin
olive oil
-
40ml/1½fl oz
lemon juice
-
2 tbsp snipped
chives
-
salt
-
freshly ground
black pepper
-
2 peeled
avocado
s sliced in half
Method
-
Fry the bacon until crispy then add the shallots and tomato to the pan and cook for five minutes.
-
Add the honey mustard, extra virgin olive oil, lemon juice, chives, and seasoning.
-
Stir well and, whilst still hot, pour over the avocado halves.
-
Serve immediately.


| Colorspace Transforms | |
| by Pascal Getreuer |
This package converts colors between sRGB, Y'PbPr, Y'CbCr, JPEG-Y'CbCr, Y'UV, Y'IQ, Y'DbDr, HSV, HSL, HSI, CIE XYZ, CIE L*a*b* (CIELAB), CIE L*u*v* (CIELUV), and CIE L*ch (CIELCH), and CIE CAT02 LMS. It can be used either as part of a C/C++ program or compiled as a Matlab MEX function.
Copyright © 2005–2010, Pascal Getreuer
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
colorspace can be used either as part of a C/C++ program or compiled as a Matlab MEX function.
To demonstrate colorspace for use in C programs, a small command line program colorcalc is included. The program is compiled with GCC by
gcc colorcalc.c colorspace.c -lm -o colorcalc
This should produce a command line program colorcalc that converts input sRGB values to other representations.
For use in Matlab, colorspace is compiled as a MEX function by entering
mex colorspace.c
on the Matlab command console. For MEX compiling to work, your system must have a C compiler and Matlab must be configured to use it. For more information, see the help documentation for the mex command.
As an alternative to MEX, a pure M-code version colorspace.m is also included.
First call GetColorTransform, specifying the source and destination color spaces as "dest<-src" or "src->dest". Then call ApplyColorTransform to perform the transform:
num S[3] = {173, 0.8, 0.5}; num D[3]; colortransform Trans; if(!(GetColorTransform(&Trans, "HSI -> Lab"))) { printf("Invalid syntax or unknown color space\n"); return; } ApplyColorTransform(Trans, &D[0], &D[1], &D[2], S[0], S[1], S[2]);
“num” is a typedef defined at the beginning of colorspace.h that may be set to either double or float, depending on the application.
A colortransform may be applied any number of times. To transform the color representation of an entire image, call GetColorTransform once and then call ApplyColorTransform for each pixel.
Specific transformation routines can also be called directly. The following converts an sRGB color to CIELAB and then back to sRGB:
num R = 0.85, G = 0.32, B = 0.5; num L, a, b; Rgb2Lab(&L, &a, &b, R, G, B); Lab2Rgb(&R, &G, &B, L, a, b);
Generally, the calling syntax is
Foo2Bar(&B0, &B1, &B2, F0, F1, F2);
where (F0,F1,F2) are the coordinates of a color in space “Foo” and (B0,B1,B2) are the transformed coordinates in space “Bar.” For any transformation routine, its inverse has the syntax
Bar2Foo(&F0, &F1, &F2, B0, B1, B2);
The transform routines are consistently named with the first letter of a color space capitalized with following letters in lower case and omitting prime symbols. For example, Rgb2Ydbdr converts sRGB to Y'DbDr.
All transformations assume a two degree observer angle and a D65 illuminant. The white point can be changed by modifying the WHITEPOINT_X, WHITEPOINT_Y, WHITEPOINT_Z definitions at the beginning of colorspace.h.

It is possible to transform between two arbitrary color spaces by first transforming from the source space to sRGB and then transforming from sRGB to the desired destination space. For transformations between CIE color spaces, it is convenient to use XYZ as the intermediate space. This is the strategy used by GetColorTransform and ApplyColorTransform.
B = colorspace(S,A) converts the color representation of image A where S is a string specifying the conversion. S tells the source and destination color spaces, S = 'dest<-src', or alternatively, S = 'src->dest'. Supported color spaces are
| 'RGB' | sRGB IEC 61966-2-1 |
| 'YPbPr' | Luma (ITU-R BT.601) + Chroma |
| 'YCbCr' | Luma + Chroma (digitized version of Y'PbPr) |
| 'JPEG-YCbCr' | Luma + Chroma space used in JFIF JPEG |
| 'YUV' | NTSC PAL Y'UV Luma + Chroma |
| 'YIQ' | NTSC Y'IQ Luma + Chroma |
| 'YDbDr' | SECAM Luma + Chroma |
| 'HSV' or 'HSB' | Hue Saturation Value/Brightness |
| 'HSL' or 'HLS' | Hue Saturation Luminance |
| 'HSI' | Hue Saturation Intensity |
| 'XYZ' | CIE XYZ |
| 'Lab' | CIE L*a*b* (CIELAB) |
| 'Luv' | CIE L*u*v* (CIELUV) |
| 'LCH' | CIE L*C*H* (CIELCH) |
| 'CAT02 LMS' | CIE CAT02 LMS |
All conversions assume 2 degree observer and D65 illuminant. Color space names are case insensitive. When sRGB is the source or destination, it can be omitted. For example 'yuv<-' is short for 'yuv<-rgb'.
Matlab uses two standard data formats for sRGB: double data with intensities in the range 0 to 1, and uint8 data with integer-valued intensities from 0 to 255. colorspace expects sRGB data to be scaled between 0 and 1, and only accepts double data.
If A is an M×3 array, like a colormap, B will also have size M×3.
Typical Usage
How does one get color image data into Matlab?
The function imread imports most formats as a uint8 array of
size M×N×3, where the third dimension separates the R',G',
and B' color channels.
A = imread('boats.png'); % Import color data as uint8 in the range [0,255] A = double(A)/255; % Cast to double in the range [0,1] % View the image subplot(2,2,1); image(A); axis image
(For images using palette indexing, imread instead returns an array of color indices and a colormap; palette-based images require other handling.) To view a color image, use image or imshow. The image may either be a uint8 array with intensities in the range [0,255] or a double array with the range [0,1].
Once an sRGB array is loaded, colorspace can convert it to another color representation. To convert to Y'PbPr, for example, use
B = colorspace('YPbPr<-RGB',A);
Since the resulting array B is not in sRGB representation, it no longer makes sense to visualize it as a single color image, other than transforming it back to sRGB first. Instead, view each of the channels B(:,:,1), B(:,:,2), B(:,:,3) individually as gray-scale images:
% View the individual channels subplot(2,2,1); imagesc(B(:,:,1)); colormap(gray(256)); axis image title 'Y''' subplot(2,2,3); imagesc(B(:,:,2)); colormap(gray(256)); axis image title P_b subplot(2,2,4); imagesc(B(:,:,3)); colormap(gray(256)); axis image title P_r
To transform B back to sRGB, use colorspace again:
ARecovered = colorspace('RGB<-YPbPr',B);
While much effort has been made to make colorspace accurate and in agreement with standards, it is possible to see differences between colorspace and other color transformation software. Potential sources for discrepancy are
Finally, although hopefully unlikely, it is possible that a discrepancy is due to a bug in colorspace.
colorspace does have the property that transformation of an in-gamut color followed by the inverse transformation accurately recovers the original color (see the Accuracy Test).
Transformations with colorspace assume a 2 degree observe, D65 illuminant, and using the gamma correction function from Gamma Correction.
Beware that colorspace's transformations generally do not constrain colors to be in-gamut. Particularly, transforming from another space to sRGB may obtain R'G'B' values outside of the [0,1] range. In Matlab, the result should be clamped to [0,1] before displaying:
image(min(max(B,0),1)); % Clamp B to [0,1] and display
Device-independent, quantitative description of color is a surprisingly challenging problem. For example, four shades of gray surrounded by black are perceived differently than the same four shades surrounded by white [1].
| |||||
|
Surrounding illumination affects the perceived color.
On black background, the lightest shade of gray seems to be almost white. But on white background, the same shade appears significantly darker. This discrepancy suggests that the perceived colors on a monitor depend on the illumination of the surrounding room. Thus for precise color description, color specifications include the intended viewing conditions.
The intensity of a color is defined as the watts per unit area rendered by the display device. Another problem is that even under equal intensity, some colors are visually brighter than others.
|
Intensity ≠ Visual Brightness.
To overcome this non-uniformity, many color spaces instead consider luminance, a quantitative estimate of the perceived brightness.
Different color representations try to overcome these problems, with varying degrees of success. It is for this reason that there are so many standard color representations.
CRT monitors have a nonlinear relationship between the input voltages and the rendered intensities. To reproduce an image accurately, the image is gamma-corrected in such a way that the monitor displays the desired intensities.
In colorspace, the “RGB” space is sRGB. The sRGB space was designed in 1996 for direct display on typical CRT monitors and standardized in 1999 by International Electrotechnical Commission (IEC) as IEC 61966-2-1. The “s” in sRGB is to mean “standard.” From linear RGB values, the sRGB values are gamma-compensated by the formula
| R' = 1.055 R1/2.4 − 0.055 | if R ≤ 0.0031308, |
| R' = 12.92 R, | if R > 0.0031308, |
and similarly for G' and B' [4].
A standard notation is to denote R',G',B' quantities and derived quantities with a prime ' to signify gamma-correction. Since gamma-correction is already applied by digital cameras as standard practice, most digital image data should be interpreted as R'G'B', and not RGB.
The luma of a color is an estimate of brightness based on gamma-corrected samples. Its definition (ITU-R Recommendation BT.601-4) is
Y'601 = 0.299 R' + 0.587 G' + 0.114 B'.
This luma measure is (up to a scale factor) the Y' in Y'PbPr, Y'CbCr, JPEG-Y'CbCr, Y'UV, Y'IQ, and Y'DbDr. The remaining two components in each of these representations capture the chroma, the part of a color independent of luma [2].
Y'PbPr
Given R', G', and B' in the range [0,1],
the Y'PbPr components are
| = |
| × |
|
with Y' in [0,1] and Pb, Pr in [−0.5,0.5].
Y'CbCr
Y'CbCr, also called YCC, is a rescaling of
Y'PbPr such that component can be stored as
8-bit unsigned values. Given R', G', and B' in the range [0,1],
| = |
| + |
| × |
|
with Y' in [16,235] and Cb, Cr in [16,240].
JPEG-Y'CbCr
JPEG-Y'CbCr is another rescaling of
Y'PbPr, used in the JPEG image format,
| = |
| + |
| × |
|
with Y', Cb, Cr in [0,1].
The Hue Saturation Value/Brightness (HSV/HSB) is an intuitive color system, measuring the hue of a color as the angle on the HSV color wheel, the saturation as the color's vibrancy, and the color's value or approximate brightness.
HSV is related to sRGB by
| H = hexagonal hue angle | (0 ≤ H < 360), |
| S = C/V | (0 ≤ S ≤ 1), |
| V = max(R',G',B') | (0 ≤ V ≤ 1), |
where C = max(R',G',B') − min(R',G',B'). The hue angle H is computed on a hexagon. The space is geometrically a hexagonal cone.
Conic representation of the HSV and HSL color spaces
(colorspace_demo.m).
The Hue Saturation Lightness (HSL or HLS) color space, has the same definition for color hue as HSV. The other two components differ such that all colors tend to white as lightness increases.
HSL is related to sRGB by
| H = hexagonal hue angle | (0 ≤ H < 360), |
| S = C/(1 - |2L - 1|) | (0 ≤ S ≤ 1), |
| L = (max(R',G',B') + min(R',G',B'))/2 | (0 ≤ L ≤ 1), |
where H and C are the same as in HSV. Geometrically, the space is a double hexagonal cone.
A third related space is Hue Saturation Intensity (HSI), which is popular in computer vision. HSI is related to sRGB by
| H = polar hue angle | (0 ≤ H < 360), |
| S = 1 - min(R',G',B')/I | (0 ≤ S ≤ 1), |
| I = (R'+G'+B')/3 | (0 ≤ I ≤ 1). |
Unlike HSV and HSL, the hue angle H is computed on a circle rather than a hexagon.
The HSV, HSL, and HSI systems are ambiguous on whether components should be based on RGB or gamma-corrected sRGB, and specify no white point. When truly device-independent color reproduction is necessary, it is better to use a CIE color space [2].
In 1931, the Commission Internationale de L'Éclairage (CIE) defined a standard color system for precise color reproduction called XYZ. The XYZ color space has a linear relationship with non-gamma-corrected RGB [2]:
| = |
| × |
|
The closely-related xyY space defines the chromaticity coordinates,
|
The CIE “tongue”: the region of all colors over x and y (colorspace_ciedemo.m). |
In the figure, the U-shaped boundary is parameterized by light wavelength. The triangular region corresponds to the sRGB space, the range of colors that a typical computer monitor can display.
XYZ is the foundation of the L*a*b* (CIELAB), L*u*v* (CIELUV), and L*ch color spaces. Let Xn,Yn,Zn be the XYZ values of a reference white point. The white point in colorspace is the standard D65 white point, Xn = 0.950456, Yn = 1, Zn = 1.088754. The lightness, denoted by L* in each of these spaces, is defined as
| L* = 116 (Y/Yn)1/3 − 16, | if Y/Yn > (6/29)3 |
| L* = (Y/Yn − 4/29) 108/841, | if Y/Yn ≤ (6/29)3 |
The white point has lightness 100, and provided 0 ≤ Y ≤ Yn, L* is in the range [0,100].
The other two components in each representation describe the chromaticity. L*a*b* and L*u*v* both attempt to "perceptually linearize" chromaticity, meaning that changes in color values correspond to proportional changes in visual importance. L*ch is L*a*b* with chromaticity expressed in polar coordinates.
Visualizations of the L*a*b* and L*u*v* color spaces
(colorspace_demo.m).
To verify the invertibility of the color transformations, this test transforms sRGB data to a space, inverts, and compares with the original data.
N = 1e5; % Number of points to test A = rand(N,3); % Generate points uniformly in sRGB colorspace Space = {'YPbPr','YCbCr','JPEG-YCbCr','YDbDr','YIQ','YUV','HSV',... 'HSL','HSI','XYZ','Lab','Luv','LCH','CAT02LMS'}; fprintf('\n Transform RMSE Error Max Error\n\n'); for k = 1:length(Space) B = colorspace([Space{k},'<-RGB'],A); % Convert to Space{k} R = colorspace(['RGB<-',Space{k}],B); % Convert back to sRGB RMSE = sqrt(mean((A(:) - R(:)).^2)); MaxError = max(abs(A(:) - R(:))); fprintf(' RGB<->%-10s %9.2e %9.2e\n', ... Space{k}, RMSE, MaxError); end
Transform RMSE Error Max Error RGB<->YPbPr 9.07e-017 4.44e-016 RGB<->YCbCr 1.06e-016 5.55e-016 RGB<->JPEG-YCbCr 1.06e-016 5.55e-016 RGB<->YDbDr 8.72e-017 4.44e-016 RGB<->YIQ 8.17e-017 4.44e-016 RGB<->YUV 6.99e-017 3.54e-016 RGB<->HSV 7.28e-017 1.22e-015 RGB<->HSL 8.06e-017 1.22e-015 RGB<->HSI 1.10e-016 7.77e-016 RGB<->XYZ 2.30e-016 6.36e-015 RGB<->Lab 1.09e-015 2.10e-014 RGB<->Luv 7.98e-016 2.00e-014 RGB<->LCH 1.11e-015 2.39e-014 RGB<->CAT02 LMS 8.29e-016 1.30e-014
Transformations are accurate to machine precision. The first six spaces, being linearly related to sRGB, have higher accuracy than the nonlinearly-related spaces.
| [1] C. Poynton. "Frequently Asked Questions about Gamma." 1998. |
| [2] C. Poynton. "Frequently Asked Questions about Color." 1997. |
| [3] J. Burkardt. "COLORS - Color Coordinate Conversion." (FORTRAN code.) 2002. |
| [4] Wikipedia: "sRGB" |
| [5] Wikipedia: "YUV" |
| [6] Wikipedia: "YCbCr" |
| [7] Wikipedia: "YPbPr" |
| [8] Wikipedia: "YDbDr" |
| [9] Wikipedia: "YIQ" |
| [10] Wikipedia: "HSL and HSV" |
| [11] Wikipedia: "CIE 1931 color space" |
| [12] Wikipedia: "Lab color space" |
| [13] Wikipedia: "CIELUV color space" |
| [14] Wikipedia: "LMS color space" |
This material is based upon work supported by the National Science Foundation under Award No. DMS-1004694. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.


As an Account Executive with an emphasis on Marketing Solutions, my goal is to help create an effective place for online marketers to raise brand awareness, build relationships, and drive quality leads.
I engage and strategize with Sr Level Executives at client companies to demonstrate how Facebook can drive revenue to their business. I serve as the leader of the marketing team and focus on identifying trends within various client markets and industries.
I Managed various cross-product opportunities to help keep clients on the forefront of digital advertising. I was responisble for growing the Account Manager team by $3M monthly revenue. I also oversaw the team of 5 digital Account Managers.
I managed all incoming digital marketing clients looking to utilize the Yahoo platform to advertise their business. My accounts consisted of over 200 SMB across the entire North American region. I also provided valuable insights on how clients could leverage our tools to take full advantage of our services. I was able to increase core revenue within my client base by 183% over 2 years.
Bachelor of Science Degree in Marketing
President of Delta Sigma Pi Fraternity
Successfuly managed over 500+ clients in 20 different vertical types.
SSuccessfuly trained, grown and lead multiple teams at 2 different large companies.
Managed top tier future 500 digital clients with all types of budgets totalling over $300M in my career.
6+ years of strategically emphasised management of all clients with a focus on marketing and growing their business.
Strength in sales & sales management, leadership and marketing through positive work ethic and sensitivity to consumer needs. Established long term business relationships with C level contacts.
6 + years of business sales with an emphasis on new clien business and onboarding in the digial landscape.


Add Resources to Protect
Resources are servers for hypervisors or applications that host data that you want to protect. After a resource is registered, an inventory of the resource is captured and added to the IBM Spectrum Protect Plus inventory, enabling you to complete backup and restore jobs, as well as to run reports.
About this task
For example purposes, this task describes how to add a VMware resource. To add other resources, see the instructions by resource type in Operations Overview.
Procedure
To add a vCenter Server instance, complete the following steps:
- From the navigation menu, expand Manage Protection, then expand Hypervisors. Expand VMware, then click Backup.
- Click Manage vCenter, and then click Add vCenter.
- Populate the fields in the vCenter Properties pane:
- Hostname/IP
- Enter the resolvable IP address or a resolvable path and machine name.
- Use existing user
- Enable to select a previously entered user name and password for the vCenter Server instance.
- Username
- Enter your user name for the vCenter Server instance.
- Password
- Enter your password for the vCenter Server instance.
- Port
- Enter the communications port of the vCenter Server instance. Select the Use SSL check box to enable an encrypted Secure Sockets Layer (SSL) connection. The typical default port is 80 for non SSL connections or 443 for SSL connections.
- Optional: To configure additional options, including options for offloading data to IBM Spectrum Protect, see Add a VMware Provider.
- Click Save.
- IBM Spectrum Protect Plus confirms a network connection, adds the resource to the database, and then catalogs the resource. If a message appears indicating that the connection is unsuccessful, review your entries. If your entries are correct and the connection is unsuccessful, contact a network administrator to verify and possible fix the connections.
IBM Spectrum Protect Plus 10.1.2
Licensed Material - Property of IBM Corp. © IBM Corporation and other(s) 2018. IBM is a registered trademark of the IBM Corporation in the United States, other countries, or both. | 8/23/2018