| Created: | 6/26/2020 3:15:49 PM |
| Modified: | 6/26/2020 3:15:49 PM |
| Project: | |
| Advanced: |
| Attribute |
|
Public bigint increase_decrease_line_number_id |
|
Details:
|
|
Public varchar(255) increase_decrease_line_number_code |
|
Details:
|
|
Public varchar(255) increase_decrease_line_number_description |
|
Details:
|
|
Public varchar(255) created_by |
|
Details:
|
|
Public varchar(255) updated_by |
|
Details:
|
|
Public timestamp with time zone(0) created_at |
|
Details:
|
|
Public timestamp with time zone(0) updated_at |
|
Details:
|
|
Public timestamp with time zone(0) start_date |
|
Details:
|
|
Public timestamp with time zone(0) end_date |
|
Details:
|
|
Public bigserial id |
|
Details:
|
|
Public jsonb ods_meta |
|
Details:
|
|
Public integer ods_version |
|
Details:
|
|
Public varchar(255) ods_created_by |
|
Details:
|
|
Public timestamp with time zone(0) ods_created_at |
|
Details:
|
| Operation | ||
|
Public increase_decrease_line_numbers_pkey( id: bigserial, |
||
|
Details:
<<PK>>
|
| Tag | Value |
| Owner | public |
|
Details:
|
| Property | Value |
| isFinalSpecialization: | 0 |
| Object | Type | Connection | Direction | Notes |
| «view» current_increase_decrease_line_numbers_view | View | Dependency | From | |
| «view» current_increase_decrease_line_numbers_view | View | Dependency | From |


HodDB
Query
keyboard_arrow_right
Planner
keyboard_arrow_right
Search
keyboard_arrow_right
Help
keyboard_arrow_right
Common Queries
VAV Select
code
Zone Temperature Sensors
code
VAV Commands
code
Spatial Building Structure
code
vHOD_VERSION
menu
Query
Run Query
Full URI
Show JSON
SELECT ?vav WHERE { ?vav rdf:type brick:VAV };
Results
Download CSV


User Manual
Here you will find the mandatory information for each user of the system. When we speak of users of the system and specially about the System administrator, one must not be confused by the Linux SysAdmin and the administrator of the different available accounts, thus we will use the term 'Administrator' for the admin of de accounts within the system itself.
Login
As a user, you can enter the system if you have an account. The only way you can have an account is when the administrator registers in the system. Every administrator and user has an encrypted password, so you can not see the password in the database even if you are an administrator.
AdministradorAs an administrator, you have to type your admin_id in this case, your username and your password. You are going to have more functions and privileges inside the system.
UserAs a user, you have to type your user_id, in this case, your username and your password. You can just add, edit, delete devices and rooms.
Admin/User info
Naturally as part of any system, the user will be able to modify certain things about their profile. Note: Any and all information can be updated except the username. Also, the password will have to be an 8 character password, that includes 1 special character and 2 numbers.
Spaces/Room administration
When we talk about the spaces, we refere to the whole set of rooms and levels inside your house or building, we will explain the diferrence between the stages, floor, scenerarios and rooms.
StageThe stage is the space to keep all your floors and rooms, you can see as a house, office, building or other places. To create you have to set an id and name to identify. You can delete, modify or add more floor/rooms any time. WARNING: If you delete a stage, you are also going to delete all the floor and rooms inside of it.
FloorThe floor is the floor level inside your stage you can create how many do you need. Also, you have to set an id for each floor and a name. You can edit or delete any time. WARNING: If you delete a floor, you are also going to delete all the rooms inside of it.
ScenariosThe scenarios is a set of categories to classify a room. You can not edit, create or delete scenarios. They are already in the database.
RoomThe room is the last space you need to create to add devices. It is important to set an id, name, and scenario. You can modify or delete whenever you want.
Devices
You can add, edit, modify or delete (WARNING: when you delete a device, just the attribute status is going to change to false or disabled) any device. We have to type of devices: product and sensor. The product is like tv, laptop, microwave, etc. While a sensor is a thing to check the products. Every device has to have a location in a room.
Reports
Every device has a report showing the consumption of energy on a specific date and time. IMPORTANT: Just the administrator can view the reports.


Master the Devtools V1
Let's go beyond console.log 🚀
🤔 WHAT WILL WE COVER?
Simple Tips to maximize productivity
GENERAL DEBUGGING 💪
FileSystem
Console
Live Expression
Copy
Conditional Breakpoint
Screenshots 📷
Monitor Events 📷
✨ INSPECTING AND DEBUGGING CSS
GRID Layout
FLEX Layout
Inspect Element Tooltip
Contrast Ratio
🚀 PERFORMANCE
PAINT FLASHING


1.3 : Base 16
Now we can move onto hexadecimal or base-16. Converting to and from is the same process. The main difference in hexadecimal is how we represent the digits. In base-10 we use digits 0-9. In binary we use 0 and 1. In hexadecimal, we use 0-F. The values of the digits is 0 through B-1. Our base is 16 so the digits would be 0 to 15. However, 15 is a two digit number. Since base-16 uses digits that we dont have single digit numbers for (eg 10-15), we use letters. The table below has the digits and their corresponding values.
| Binary | Decimal | Hexadecimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | 10 | A |
| 1011 | 11 | B |
| 1100 | 12 | C |
| 1101 | 13 | D |
| 1110 | 14 | E |
| 1111 | 15 | F |
Now we can see how a hexadecimal number translates to a base-10 number. Let's consider the hexadecimal number 3F4
| Digit | 3 | F | 4 |
|---|---|---|---|
| Power | 162 | 161 | 160 |
| Value | 768 | 240 | 4 |
Once again the Value is equal to the Digit multiplied by the Power. So 3F4 is equal to (3 * 162) + (15 * 161) + (4 * 160). We multiply 15 by 161 because 15 corresponds to F on the table. Finally we add all the values. 768 + 240 + 4 = 1022. 3F416 = 102210. As you can see, only 3 digits in hexadecimal gave us a value that would need 4 digits in base-10. Try this on your own.
We can also look at how binary relates to hexadecimal. If we look up at the table, you'll notice that each hexadecimal digit can be represented as a full 4 bit binary number. Four bits in binary make 16 different number values ranging 0 to 15. Hexadecimal uses different digits ranging 0-15. This isn't a coincidence. 161 is 24. It's no coincidence that 1 base-16 digit is equal to 4 base-2 digits. So how can we use this knowledge in practice? Let's say we have the number<PHONE_NUMBER>110000. That's a rather large number that not even I want to do the math for. Let's split this up.
There! Easy as can be! Instead of trying to translate a massive 16 bit number, we just split it into 4 bit numbers!
Color Codes
A very common use of hexadecimal numbers is for use of color codes. There are many different ways to define color. The two main ways are to use a hexadecimal value or an rgb value.
#
I used the colors to highlight themselves.
So there are the three base colors
Since there are 256 values for each of the three colors (including 0), we can make 256*256*256 different colors. That's 16,777,216 different colors! Obviously there are so many colors to make and I don't have room to display each of the over 16 million colors. I went through and did the basic ROY G BIV rainbow below.
| RGB | Hexadecimal | Name | Color |
|---|---|---|---|
| 0,0,0 | #000000 | Black | |
| 255,0,0 | #FF0000 | Red | |
| 255,165,0 | #FFA500 | Orange | |
| 255,255,0 | #FFFF00 | Yellow | |
| 0,128,0 | #008000 | Green | |
| 0,0,255 | #0000FF | Blue | |
| 75,0,130 | #4B0082 | Indigo | |
| 238,130,238 | #EE82EE | Violet | |
| 255,255,255 | #FFFFFF | White |
Just for fun, I added an RGB Color changer. Just enter different values into the boxes to change the color. Try and see if you can match the colors from this website.
| Red | Green | Blue |
Practice Problems
What is the number D5 in base-10?
 What is the hexadecimal color code for the color 'Papaya Whip'?


16:12:49.498 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:49.499 [Test worker] WARN o.e.j.s.h.ContextHandler - Empty contextPath
16:12:49.500 [Test worker] INFO o.e.j.s.h.ContextHandler - Started o.e.j.s.ServletContextHandler@1570a897{/,null,AVAILABLE}
16:12:49.500 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Starting JettyHttpServer...
16:12:49.500 [Test worker] INFO o.e.j.s.Server - jetty-9.4.31.v20200723; built: 2020-07-23T17:57:36.812Z; git: 450ba27947e13e66baa8cd1ce7e85a4461cacc1d; jvm 1.8.0_201-b09
16:12:49.513 [Test worker] INFO o.e.j.s.AbstractConnector - Started<EMAIL_ADDRESS>(http/1.1)}{<IP_ADDRESS>:56785}
16:12:49.513 [Test worker] INFO o.e.j.s.Server - Started @137359ms
16:12:49.513 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Server started on port 56785(0 millis).
16:12:49.514 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56785/filter
16:12:49.514 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:49.516 [qtp1214548286-2062] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [3e8becea] HTTP GET "/filter"
16:12:49.527 [qtp1214548286-2062] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [3e8becea] Completed 200 OK
16:12:49.527 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:49.527 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:49.529 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Stopping JettyHttpServer...
16:12:49.530 [Test worker] INFO o.e.j.s.h.ContextHandler - Stopped o.e.j.s.ServletContextHandler@1570a897{/,null,UNAVAILABLE}
16:12:49.531 [Test worker] INFO o.e.j.s.AbstractConnector - Stopped<EMAIL_ADDRESS>(http/1.1)}{<IP_ADDRESS>:0}
16:12:49.541 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Server stopped (0 millis).
16:12:49.571 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:49.571 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Starting ReactorHttpServer...
16:12:49.574 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Server started on port 56787(0 millis).
16:12:49.575 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56787/filter
16:12:49.577 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:49.579 [reactor-http-nio-8] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [7c57b32c-55] HTTP GET "/filter"
16:12:49.581 [reactor-http-nio-8] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [7c57b32c-55] Completed 200 OK
16:12:49.581 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:49.581 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:49.582 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Stopping ReactorHttpServer...
16:12:49.582 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Server stopped (0 millis).
16:12:49.625 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:49.625 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Starting TomcatHttpServer...
16:12:49.638 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Server started on port 56789(0 millis).
16:12:49.639 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56789/filter
16:12:49.639 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:49.643 [http-nio-auto-54-exec-1] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [6c7e310e] HTTP GET "/filter"
16:12:49.644 [http-nio-auto-54-exec-1] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [6c7e310e] Completed 200 OK
16:12:49.646 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:49.646 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:49.647 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Stopping TomcatHttpServer...
16:12:49.671 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Server stopped (0 millis).
16:12:49.825 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:49.825 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Starting UndertowHttpServer...
16:12:49.825 [Test worker] INFO i.undertow - starting server: Undertow - 2.0.32.Final
16:12:49.832 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Server started on port 56792(0 millis).
16:12:49.832 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56792/filter
16:12:49.833 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:49.834 [XNIO-54 I/O-6] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [38f3c344] HTTP GET "/filter"
16:12:49.836 [XNIO-54 I/O-6] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [38f3c344] Completed 200 OK
16:12:49.836 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:49.836 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:49.836 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Stopping UndertowHttpServer...
16:12:49.836 [Test worker] INFO i.undertow - stopping server: Undertow - 2.0.32.Final
16:12:49.837 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Server stopped (0 millis).
16:12:49.913 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:49.913 [Test worker] WARN o.e.j.s.h.ContextHandler - Empty contextPath
16:12:49.913 [Test worker] INFO o.e.j.s.h.ContextHandler - Started o.e.j.s.ServletContextHandler@651d9950{/,null,AVAILABLE}
16:12:49.913 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Starting JettyHttpServer...
16:12:49.914 [Test worker] INFO o.e.j.s.Server - jetty-9.4.31.v20200723; built: 2020-07-23T17:57:36.812Z; git: 450ba27947e13e66baa8cd1ce7e85a4461cacc1d; jvm 1.8.0_201-b09
16:12:49.925 [Test worker] INFO o.e.j.s.AbstractConnector - Started<EMAIL_ADDRESS>(http/1.1)}{<IP_ADDRESS>:56794}
16:12:49.925 [Test worker] INFO o.e.j.s.Server - Started @137771ms
16:12:49.925 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Server started on port 56794(0 millis).
16:12:49.925 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56794/normal
16:12:49.925 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:49.928 [qtp486001394-2100] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [176caed3] HTTP GET "/normal"
16:12:49.929 [qtp486001394-2100] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [176caed3] Completed 200 OK
16:12:49.929 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:49.929 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:49.929 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Stopping JettyHttpServer...
16:12:49.930 [Test worker] INFO o.e.j.s.h.ContextHandler - Stopped o.e.j.s.ServletContextHandler@651d9950{/,null,UNAVAILABLE}
16:12:49.931 [Test worker] INFO o.e.j.s.AbstractConnector - Stopped<EMAIL_ADDRESS>(http/1.1)}{<IP_ADDRESS>:0}
16:12:49.942 [Test worker] DEBUG o.s.w.t.h.s.r.b.JettyHttpServer - Server stopped (0 millis).
16:12:49.990 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:49.990 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Starting ReactorHttpServer...
16:12:49.998 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Server started on port 56796(0 millis).
16:12:49.999 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56796/normal
16:12:49.999 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:50.002 [reactor-http-nio-10] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [bd79128f-56] HTTP GET "/normal"
16:12:50.003 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:50.003 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:50.004 [reactor-http-nio-10] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [bd79128f-56] Completed 200 OK
16:12:50.004 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Stopping ReactorHttpServer...
16:12:50.004 [Test worker] DEBUG o.s.w.t.h.s.r.b.ReactorHttpServer - Server stopped (0 millis).
16:12:50.065 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:50.066 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Starting TomcatHttpServer...
16:12:50.089 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Server started on port 56798(0 millis).
16:12:50.089 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56798/normal
16:12:50.089 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:50.092 [http-nio-auto-55-exec-1] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [1b7d25b1] HTTP GET "/normal"
16:12:50.093 [http-nio-auto-55-exec-1] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [1b7d25b1] Completed 200 OK
16:12:50.094 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:50.094 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:50.095 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Stopping TomcatHttpServer...
16:12:50.109 [Test worker] DEBUG o.s.w.t.h.s.r.b.TomcatHttpServer - Server stopped (0 millis).
16:12:50.143 [Test worker] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
16:12:50.143 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Starting UndertowHttpServer...
16:12:50.143 [Test worker] INFO i.undertow - starting server: Undertow - 2.0.32.Final
16:12:50.148 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Server started on port 56801(0 millis).
16:12:50.149 [Test worker] DEBUG o.s.w.c.RestTemplate - HTTP GET http://localhost:56801/normal
16:12:50.149 [Test worker] DEBUG o.s.w.c.RestTemplate - Accept=[text/plain, application/json, application/x-jackson-smile, application/*+json, */*]
16:12:50.151 [XNIO-55 I/O-6] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [40afabac] HTTP GET "/normal"
16:12:50.152 [XNIO-55 I/O-6] DEBUG o.s.w.s.a.HttpWebHandlerAdapter - [40afabac] Completed 200 OK
16:12:50.152 [Test worker] DEBUG o.s.w.c.RestTemplate - Response 200 OK
16:12:50.152 [Test worker] DEBUG o.s.w.c.RestTemplate - Reading to [java.lang.String] as "text/plain"
16:12:50.152 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Stopping UndertowHttpServer...
16:12:50.152 [Test worker] INFO i.undertow - stopping server: Undertow - 2.0.32.Final
16:12:50.154 [Test worker] DEBUG o.s.w.t.h.s.r.b.UndertowHttpServer - Server stopped (0 millis).


Piez Configuration
Mode
Disabled
Image Manager (Simple)
Image Manager (Advanced)
Push/Preconnect/Preload
Resource Optimizer (Simple)
Resource Optimizer (Advanced)
Script Management
Options
Save-Data
Present mode (Image Manager)


{% extends "base.html" %} {% load static %} {% load staticfiles %} {% block content %}
Thank you for your submission! Your data will be validated shortly. Click here to submit again.


ADSB Exchange
EPLS CTAF/Radio
EPPO Twr/App/FIS
EPLS lights 60 min
EPLS lights 10 min
EPLS METEO
VFR flight planner
Feeder adsbexchange
Replay adsbexchange


EVP_PKEY_gettable_params, EVP_PKEY_get_params, EVP_PKEY_get_int_param, EVP_PKEY_get_size_t_param, EVP_PKEY_get_bn_param, EVP_PKEY_get_utf8_string_param, EVP_PKEY_get_octet_string_param - retrieve key parameters from a key
#include <openssl/evp.h>
const OSSL_PARAM *EVP_PKEY_gettable_params(EVP_PKEY *pkey);
int EVP_PKEY_get_params(const EVP_PKEY *pkey, OSSL_PARAM params[]);
int EVP_PKEY_get_int_param(const EVP_PKEY *pkey, const char *key_name,
int *out);
int EVP_PKEY_get_size_t_param(const EVP_PKEY *pkey, const char *key_name,
size_t *out);
int EVP_PKEY_get_bn_param(const EVP_PKEY *pkey, const char *key_name,
BIGNUM **bn);
int EVP_PKEY_get_utf8_string_param(const EVP_PKEY *pkey, const char *key_name,
char *str, size_t max_buf_sz,
size_t *out_len);
int EVP_PKEY_get_octet_string_param(const EVP_PKEY *pkey, const char *key_name,
unsigned char *buf, size_t max_buf_sz,
size_t *out_len);
See OSSL_PARAM(3) for information about parameters.
EVP_PKEY_get_params() retrieves parameters from the key pkey, according to the contents of params.
EVP_PKEY_gettable_params() returns a constant list of params indicating the names and types of key parameters that can be retrieved.
An OSSL_PARAM(3) of type OSSL_PARAM_INTEGER or OSSL_PARAM_UNSIGNED_INTEGER is of arbitrary length. Such a parameter can be obtained using any of the functions EVP_PKEY_get_int_param(), EVP_PKEY_get_size_t_param() or EVP_PKEY_get_bn_param(). Attempting to obtain an integer value that does not fit into a native C int type will cause EVP_PKEY_get_int_param() to fail. Similarly attempting to obtain an integer value that is negative or does not fit into a native C size_t type using EVP_PKEY_get_size_t_param() will also fail.
EVP_PKEY_get_int_param() retrieves a key pkey integer value *out associated with a name of key_name if it fits into int
type. For parameters that do not fit into int
use EVP_PKEY_get_bn_param().
EVP_PKEY_get_size_t_param() retrieves a key pkey size_t value *out associated with a name of key_name if it fits into size_t
type. For parameters that do not fit into size_t
use EVP_PKEY_get_bn_param().
EVP_PKEY_get_bn_param() retrieves a key pkey BIGNUM value **bn associated with a name of key_name. If *bn is NULL then the BIGNUM is allocated by the method.
EVP_PKEY_get_utf8_string_param() get a key pkey UTF8 string value into a buffer str of maximum size max_buf_sz associated with a name of key_name. The maximum size must be large enough to accommodate the string value including a terminating NUL byte, or this function will fail. If out_len is not NULL, *out_len is set to the length of the string not including the terminating NUL byte. The required buffer size not including the terminating NUL byte can be obtained from *out_len by calling the function with str set to NULL.
EVP_PKEY_get_octet_string_param() get a key pkey's octet string value into a buffer buf of maximum size max_buf_sz associated with a name of key_name. If out_len is not NULL, *out_len is set to the length of the contents. The required buffer size can be obtained from *out_len by calling the function with buf set to NULL.
These functions only work for EVP_PKEYs that contain a provider side key.
EVP_PKEY_gettable_params() returns NULL on error or if it is not supported.
All other methods return 1 if a value associated with the key's key_name was successfully returned, or 0 if there was an error. An error may be returned by methods EVP_PKEY_get_utf8_string_param() and EVP_PKEY_get_octet_string_param() if max_buf_sz is not big enough to hold the value. If out_len is not NULL, *out_len will be assigned the required buffer size to hold the value.
#include <openssl/evp.h>
char curve_name[64];
unsigned char pub[256];
BIGNUM *bn_priv = NULL;
/*
* NB: assumes 'key' is set up before the next step. In this example the key
* is an EC key.
*/
if (!EVP_PKEY_get_utf8_string_param(key, OSSL_PKEY_PARAM_GROUP_NAME,
curve_name, sizeof(curve_name), &len)) {
/* Error */
}
if (!EVP_PKEY_get_octet_string_param(key, OSSL_PKEY_PARAM_PUB_KEY,
pub, sizeof(pub), &len)) {
/* Error */
}
if (!EVP_PKEY_get_bn_param(key, OSSL_PKEY_PARAM_PRIV_KEY, &bn_priv)) {
/* Error */
}
BN_clear_free(bn_priv);
EVP_PKEY_CTX_new(3), provider-keymgmt(7), OSSL_PARAM(3)
These functions were added in OpenSSL 3.0.
Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.


Detox Instruments allows profiling your app's launch by starting a recording very early on for a set amount of time. This gives you the opportunity to inspect your app's behavior during launch, something that is not easily possible using normal profiling.
You can configure the duration of app launch profiling in the profiling preferences. For more information, see Profiling Preferences.
To initiate app launch profiling, during app discovery select the App Launch option from the pop up button.
Detox Instruments will wait for your app to launch. Your app will notify you that you need to terminate it. Tap the Terminate button and launch your app again.
Once your app launches, Detox Instruments will start the recording phase for the duration configured in profiling preferences.
Once recording is finished, Detox Instruments will display the collected data.


Hey! I'm currently a Junior in the TAM program. My primary TAM interests include 3D modeling/printing, web, and physical computing!
I work at a popsicle shop on Pearl Street, Le Pops!
I have taken web and have made a few websites beyond that class for other classes. I am interested in learning more however to possibly enter a career in web design/development.
I've heard of A-Frame and am really excited to learn some VR/AR stuff in this class! I'm also just excited to improve upon my current web building skills!


Last updated on February 4, 2020
Posted by Start Bootstrap on September 24, 2019
Posted by Start Bootstrap on September 18, 2019
Posted by Start Bootstrap on August 24, 2019
Posted by Start Bootstrap on July 8, 2019


{#
wiki/action_revert.html
~~~~~~~~~~~~~~~~~~~~~~~
This template is (unlike most other action templates) not a full HTML page
but flashed to the show action. So keep it small, it's in a cookie!
:copyright: (c) 2013-2019 by the Inyoka Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
#}
{% import 'macros.html' as macros %}
{% call macros.outer_form(csrf_token(), action=page|url('revert', revision=page.rev.id)|e,
submit_label=_('Restore'), manually_rendered=True) %}
{% endcall %}


Good work on week 1! You have now seen the first building block of nature.
All the matter around us is made of atoms that can bind together or just move around freely.
The next building block is more abstract but very important, it is the concept of energy. This is one of those things that is hard to describe but you know it when you see it.
If atoms and matter are the substance of the universe you could say that energy is the mover of substance. Before going into definitions, let us look at examples that you know.
The world is made of atoms but very often these atoms are actually stuck together into molecules. Some of those molecules are simple like water but others like DNA are absolutely huge!
Atoms like to bind together for energetic reasons. They like to exchange their electrons. An important famous molecule is water which is made of two hydrogen atoms and one oxygen atom. Carbon-dioxide is made of one carbon atom and two oxygen atoms.
Look at the label (Fig 1) of a soda can. This soda contains a huge amount of atoms in the form mostly of water, sugar, and sodium. But it also contains 240 Calories. This is energy.
When you drink this soda, you will be able to get 240 Calories of energy by breaking the molecular bonds in the sugar that your body uses as a fuel.
But what is energy really?
The formal definition of energy is that which allows you to do work, while work itself is defined as a force exerted over a distance. We will return to that definition at the end of the lesson. Another good definition of energy is anything that can be turned into thermal energy, which is what raises the temperature of a thermometer. Again, its easier with examples; you don’t have to memorize the definitions.
Let's say I compress the spring in the figure by putting a box on top it. The spring when compressed will have stored energy in it. The spring has the ability to do work in moving the box over a certain distance; we say it has potential energy. It has the potential of moving the box if the spring is released. Where did the energy came from? I put it there by doing work on the spring by compressing it. I got the energy by eating my breakfast this morning, etc. . . Energy just moves around from one place to the next, and it makes things want to move.
One of the most important concepts of physics is that “Energy is conserved”. Energy is continuously transferred from one system to another but the amount of energy remains constant.
The concept of energy is crucial both in your everyday life and in the most recent advances in physics and technology.
Before we examine the various forms of energy in more details, it is important to get an idea of scale and numbers.


Bacon ipsum dolor amet pancetta shankle jerky pork loin venison tri-tip, cupim pastrami capicola beef.  Swine pork belly beef ribs spare ribs kevin pancetta shank beef jerky chuck shoulder capicola tongue pork.  Pork loin andouille venison ball tip, kielbasa tenderloin beef ribs biltong prosciutto rump. Short ribs flank boudin strip steak tenderloin brisket andouille kielbasa pork loin rump salami fatback. Sausage pork pork belly ball tip chicken biltong tri-tip hamburger cupim tenderloin pancetta.
Corned beef andouille short loin meatloaf. Brisket pork turkey picanha short loin, shank bacon andouille drumstick ham pancetta.  Kielbasa shank pancetta tongue frankfurter bresaola. Strip steak drumstick sausage landjaeger pork belly tongue venison cupim prosciutto pork beef ham corned beef. Chuck beef landjaeger venison, meatloaf sirloin biltong fatback chicken strip steak pork chop. Ham hock chuck bacon, salami cow pork loin pig beef picanha corned beef brisket doner frankfurter.


This practical codelab is part of the Flipp Android Engineer Onboarding course. Other codelabs that are part of the course are as follows:
The Android operating system provides a strong foundation for building apps that rull well on a wide range of devices and form factors. However, issues like complex lifecycles and a lack of a recommended app architecture make it challenging to write robust apps. The Android Architecture Components provide libraries for common tasks such as lifecycle management and data persistence to make it easier to implement the recommended architecture.
Before we get into the nitty-gritty of how we work with the various components at Flipp, let us walk through a short overview of the Architecture Components and how they work together.
The diagram below shows a basic form of the recommended architecture for apps that use Architecture Components. The architecture consists of a UI controller, a ViewModel that serves LiveData, a Repository, and a Room database. The Room database is backed by an SQLite database and accessible through a data access object (DAO).
We here at Flipp, have embraced this recommendation from Google on how to build a robust, testable and maintainable application using Architecture components.
All our activities
and fragments
represent the view layer. We have viewmodels
that provide the necessary data to the UI and act as communication centers between the repository
and the UI. We use the repository as a class that helps us manage multiple data sources, which in our case are the Room database and a remote data source like our Flipp backend (Maestro, BackFlipp, Accounts, etc).
We make use of Room, which is a database layer on top of SQLite that takes care of mundane taks that were previously part of a verbose helper class.
All the Android codelabs will be working with Kotlin, so familiarity with the language is recommended.
It helps to be familiar with:
How to work with the MVVM pattern, architecture components, databinding in the context of the Flipp application. You'll use ViewModel, LiveData, Databinding.
info
button on the toolbar.Activity
that we will build as part of this code lab.ViewModel
to separate all data operations from the UI.DataBinding
to bind UI components in XML to data sources using a declarative format rather than programmatically, reducing boilerplate code.In this practical you build a feature that uses the Android Architecture Components. The Store Info
feature displays information like address, store hours, contact information, ratings, etc. This feature is basic, but sufficiently complete that we can use it as a template to build on.
The StoreInfo feature does the following:
StoreInfoActivity
works with StoreInfoActivityViewModel
to fetch and display store information to the user.StoreInfoActivityViewModel
fetches the required information from a web service using the Retrofit
network library in an upcoming code lab.Room
database in an upcoming lab.The screenshot below shows the Store Info
feature.
This feature will be built using the architecture that was discussed in the first section of this codelab.
To help you get started with developing the Store Info
feature, we are providing you with started code where a lot of the boiler plate work has been done. Checkout this branch to get started with the codelab. Let us take some time to review the given starter code.
A basic activity to display store information has been added to which you will be adding the required code in this codelab. Here is a snippet of what that activity looks like:
class StoreInfoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_store_info)
}
}
StoreInfoActivity
has been added to the AndroidManifest
's application
tag to register it with our Flipp Application.
<activity android:name=".app.storeinfo.StoreInfoActivity"
android:screenOrientation="sensorPortrait" />
The required xml layout to render all the required information has been created for you. ConstraintLayout
have been used to create this complex view.
All the required string resources have been added to the strings.xml
file for your convenience.
<!-- CodeLab Strings -->
<string name="code_lab_store_hours">Store Hours</string>
<string name="code_lab_store_hours_sunday">Sunday</string>
<string name="code_lab_store_hours_monday">Monday</string>
<string name="code_lab_store_hours_tuesday">Tuesday</string>
<string name="code_lab_store_hours_wednesday">Wednesday</string>
<string name="code_lab_store_hours_thursday">Thursday</string>
<string name="code_lab_store_hours_friday">Friday</string>
<string name="code_lab_store_hours_saturday">Saturday</string>
<string name="code_lab_contact_info">Contact info</string>
<string name="code_lab_website">Website</string>
<string name="code_lab_reviews">Reviews</string>
<string name="code_lab_review_text">%1$f (%2$d Reviews)</string>
<string name="code_lab_store_info">View Store Info</string>
The entry point to this feature is from a menu option called View Store Info
in the StorefrontCarouselActivity
. This menu option has been added to the storefront_menu
file.
<item
android:id="@+id/code_lab_store_info"
android:title="@string/code_lab_store_info"
app:showAsAction="never" />
The code to start the StoreInfoActivity
on click of the above defined menu option has been added for you in the StorefrontCarouselActivity
. The onOptionsItemSelected()
has been modified to account for the newly added menu option. Here is the code snippet that was added:
case R.id.code_lab_store_info:
startActivity(new Intent(this, StoreInfoActivity.class));
return true;
A data
class to store the necessary information that will be displayed has been created with the required data fields. We will build on this class to make it compatible with Retrofit and Room in the upcoming code labs.
data class StoreInfo(val storeName: String,
val storeAddress: String,
val storeHours: List<String>,
val storeContactNumber: String,
val storeWebsite: String,
val storeRating: Float,
val storeNumReviews: Int)
We will start to build this feature from our next step. First up, creating the Repository
.
A Repository
is a class that abstracts access to multiple data sources. The Repository is not part of the Architecture Components libraries, but is a suggested best practice and we at Flipp have embraced this pattern. It helps us provide a clean API to the rest of the app for app data. Additionally, it helps us unit test viewmodels effectively by providing the option to mock out the repository layer which in turn lets us mock the data sources.
Create a class called StoreInfoRepository
that extends InjectableHelper
in the package com.wishabi.flipp.app.storeinfo
. By extending InjectableHelper
we make this class available to the ServiceManager
which is an in-house built ServiceLocator
.
class StoreInfoRepository : InjectableHelper() {}
Add a member function called fetchStoreInfo()
that accepts the arguments postalCode
and storeName
. Mark this function as a suspend
function to make it available to coroutines. Let us look at what Coroutines are and how we use them at Flipp in an upcoming codelab, however, here is a quick blurb on what suspend
means.
The keyword suspend is Kotlin's way of marking a function, or function type, available to coroutines. When a coroutine calls a function marked suspend, instead of blocking until that function returns like a normal function call, it suspends execution until the result is ready then it resumes where it left off with the result. While it's suspended waiting for a result, it unblocks the thread that it's running on so other functions or coroutines can run.
Let the fetchStoreInfo()
function return an instance of StoreInfo
that we will use in our StoreInfoActivity
to display the required information to the user.
suspend fun fetchStoreInfo(postalCode: String, storeName: String): StoreInfo {
}
For the purpose of this codelab, return a static StoreInfo
object from the repository. We will look at how to connect our repository to a network service and a database in upcoming codelabs. Add a 3 second delay before you return StoreInfo
to mock a real network or database operation.
suspend fun fetchStoreInfo(postalCode: String, storeName: String): StoreInfo {
delay(3_000)
return StoreInfo(storeName = "Flipp Store",
storeAddress = "3250 Bloor St W Unit 300, Etobicoke, ON M8X 2X9",
storeHours = getStoreHours(),
storeContactNumber = "+1<PHONE_NUMBER>",
storeWebsite = "store.flipp.com",
storeNumReviews = 61,
storeRating = 4.5f)
}
Add a private method getStoreHours()
, that will return a list of static store hours.
private fun getStoreHours(): List<String> {
return mutableListOf("11AM - 6PM", "10AM - 8PM", "10AM - 8PM", "10AM - 8PM", "10AM - 8PM", "10AM - 8PM", "10AM - 9PM")
}
Here is the complete code for the StoreInfoRepository
class:
class StoreInfoRepository : InjectableHelper() {
suspend fun fetchStoreInfo(postalCode: String, storeName: String): StoreInfo {
delay(3_000)
return StoreInfo(storeName = "Flipp Store",
storeAddress = "3250 Bloor St W Unit 300, Etobicoke, ON M8X 2X9",
storeHours = getStoreHours(),
storeContactNumber = "+1<PHONE_NUMBER>",
storeWebsite = "store.flipp.com",
storeNumReviews = 61,
storeRating = 4.5f)
}
private fun getStoreHours(): List<String> {
return mutableListOf("11AM - 6PM", "10AM - 8PM", "10AM - 8PM", "10AM - 8PM", "10AM - 8PM", "10AM - 8PM", "10AM - 9PM")
}
}
We at Flipp, have been working with the MVVM pattern for a while now and have began to notice several common patterns in each screen:
Modeling UI States with Sealed Classes
Sealed classes are used for representing restricted class hierarchies. As such, sealed classes are useful when modeling states within various app workflows. We've leveraged this to simplify the interaction between the activity and the viewmodel.
Create a sealed class called StoreInfoViewState
in the same package as the StoreInfoRepository
, com.wishabi.flipp.app.storeinfo
sealed class StoreInfoViewState<out T>
Create the following class hierarchy to represent different view states like Success
, Loading
and Error
data class Success<out T>(val value: T): StoreInfoViewState<T>()
data class Error(val errorMsg: String): StoreInfoViewState<Nothing>()
object Loading: StoreInfoViewState<Nothing>()
For view states that do not require to hold any data, like in the case of Loading
, we can mark them as an object
instead of as a class
.
Here is the complete code for the StoreInfoViewState
class.
sealed class StoreInfoViewState<out T>
data class Success<out T>(val value: T): StoreInfoViewState<T>()
data class Error(val errorMsg: String): StoreInfoViewState<Nothing>()
object Loading: StoreInfoViewState<Nothing>()
The ViewModel
is a class whose role is to provide data to the UI and survive configuration changes. A viewmodel acts as a communication center between the repository (data layer) and the UI. At Flipp, we use the ViewModel
to separate out the app's UI data from our Activities and Fragments to better follow the single responsibility principle, where we want our activities and fragments to be only responsible for drawing data to the screen, while our ViewModel
is responsible for holding and processing all the data needed for the UI.
In the ViewModel
, we use LiveData
for changeable data that the UI will use or display.
Create a class called StoreInfoViewModel
that extends ViewModel
in the package package com.wishabi.flipp.app.storeinfo
.
class StoreInfoActivityViewModel : ViewModel() {}
Modify the constructor to accept StoreInfoRepository
as an argument.
class StoreInfoActivityViewModel(private val repository: StoreInfoRepository) : ViewModel() {}
Add a private MutableLiveData
member variable to hold the fetched StoreInfo
object, which is wrapped in the above created StoreInforViewState
UI state sealed class.
private var _storeInfo: MutableLiveData<StoreInfoViewState<StoreInfo>> = MutableLiveData()
Add a public LiveData
member variable that exposes the above MutableLiveData
object, _storeInfo
to our activity StoreInfoActivity
.
val storeInfo: LiveData<StoreInfoViewState<StoreInfo>>
get() = _storeInfo
We follow the above practice of not exposing the MutableLiveData
to the activity to prevent the view layer (Activity) from modifying data.
Add two private String?
member variables to to store postalCode
and storeName
.
private var postalCode: String? = null
private var storeName: String? = null
Create a public fetchStoreInfo()
method that accepts two arguments: postalCode: String
and storeName: String
.
fun fetchPostalCode(postalCode: String?, storeName: String?) {
}
Modify the above created fetchStoreInfo()
method to call the StoreInfoRepository
's fetchStoreInfo()
method to fetch the required StoreInfo
.
fun fetchStoreInfo(postalCode: String?, storeName: String?) {
this.postalCode = postalCode
this.storeName = storeName
repository.fetchStoreInfo(postalCode, storeName)
}
Once you add the above code, you will notice that the IDE throws a compile time exception, indicating that a suspend
function should only be called from a coroutine
or another suspend function. To limit the scope of this codelab, copy paste the following piece of code that creates a coroutine
and updates the MutableLiveData
in our viewmodel.
fun fetchStoreInfo(postalCode: String?, storeName: String?) {
this.postalCode = postalCode
this.storeName = storeName
viewModelScope.launch {
try {
val storeInfo = repository.fetchStoreInfo(postalCode, storeName)
_storeInfo.postValue(Success(storeInfo))
} catch (e: Exception) {
_storeInfo.postValue(Error("There was an error fetching store information"))
}
}
}
The above code will make more sense when you complete the upcoming code lab on how to work with Coroutines
.
To prevent duplicate calls being made to the repository, add a check to see if the activity is requesting information for the same postal code and store name. Additionally, check whether the current value of the _storeInfo
live data is of type Success
.
fun fetchStoreInfo(postalCode: String?, storeName: String?) {
if (postalCode.isNullOrEmpty() || storeName.isNullOrEmpty()) {
_storeInfo.postValue(Error("Invalid postal code or store name"))
return
}
if (_storeInfo.value is Success
&& this.postalCode.equals(postalCode, ignoreCase = true)
&& this.storeName.equals(storeName, ignoreCase =
true)) {
return
}
this.postalCode = postalCode
this.storeName = storeName
viewModelScope.launch {
try {
val storeInfo = repository.fetchStoreInfo(postalCode, storeName)
_storeInfo.postValue(Success(storeInfo))
} catch (e: Exception) {
_storeInfo.postValue(Error("There was an error fetching store information"))
}
}
}
To indicate to the activity that the request is in progress, we can make use of the Loading
UI state. Modify the above method to first set the value of _storeInfo
to a Loading
object.
fun fetchStoreInfo(postalCode: String, storeName: String) {
if (postalCode.isNullOrEmpty() || storeName.isNullOrEmpty()) {
_storeInfo.postValue(Error("Invalid postal code or store name"))
return
}
if (_storeInfo.value is Success
&& this.postalCode.equals(postalCode, ignoreCase = true)
&& this.storeName.equals(storeName, ignoreCase =
true)) {
return
}
_storeInfo.postValue(Loading)
this.postalCode = postalCode
this.storeName = storeName
viewModelScope.launch {
try {
val storeInfo = repository.fetchStoreInfo(postalCode, storeName)
_storeInfo.postValue(Success(storeInfo))
} catch (e: Exception) {
_storeInfo.postValue(Error("There was an error fetching store information"))
}
}
}
Here is the complete code for the StoreInfoViewModel
class.
class StoreInfoActivityViewModel(private val repository: StoreInfoRepository) : ViewModel() {
private var _storeInfo: MutableLiveData<StoreInfoViewState<StoreInfo>> = MutableLiveData()
val storeInfo: LiveData<StoreInfoViewState<StoreInfo>>
get() = _storeInfo
private var postalCode: String? = null
private var storeName: String? = null
fun fetchStoreInfo(postalCode: String, storeName: String) {
if (postalCode.isNullOrEmpty() || storeName.isNullOrEmpty()) {
_storeInfo.postValue(Error("Invalid postal code or store name"))
return
}
if (_storeInfo.value is Success
&& this.postalCode.equals(postalCode, ignoreCase = true)
&& this.storeName.equals(storeName, ignoreCase =
true)) {
return
}
_storeInfo.postValue(Loading)
this.postalCode = postalCode
this.storeName = storeName
viewModelScope.launch {
try {
val storeInfo = repository.fetchStoreInfo(postalCode, storeName)
_storeInfo.postValue(Success(storeInfo))
} catch (e: Exception) {
_storeInfo.postValue(Error("There was an error fetching store information"))
}
}
}
}
ViewModel
depends on the StoreInfoRepository
you need create a ViewModelFactory
that will help creating the ViewModel
when you request for it from the Activity
.
Create a new class StoreInfoViewModelFactory
that extends ViewModelProvider.NewinstanceFactory
in the package com.wishabi.flipp.app.storeinfo
.
class StoreInfoViewModelFactory() : ViewModelProvider.NewInstanceFactory() {}
Override the create()
method that is provided by the NewInstanceFactory
and add the following code in.
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
val storeInfoRepository = ServiceManager.getService(StoreInfoRepository::class.java)
return when (modelClass) {
StoreInfoActivityViewModel::class.java -> {
StoreInfoActivityViewModel(storeInfoRepository) as T
}
else -> throw IllegalArgumentException("View Model not found")
}
}
The above code creates an instance of the StoreInfoRepository
and injects it into the instance of the StoreInfoActivityViewModel
that we create.
Now that you have created the all the necessary components to fetch the data, let us now connect these parts to the StoreInfoActivity
to display the data. To display the data from the repository, you add an observer that observes the LiveData
in the StoreInfoActivityViewModel
. Whenever the data changes, the onChanged()
callback of the LiveData
is invoked.
In StoreInfoActivity
, create a member variable for the ViewModel
, because all the activity's interactions are with the StoreInfoActivityViewModel
only.
private val storeInfoActivityViewModel: StoreInfoActivityViewModel by lazy {
ViewModelProvider(this, StoreInfoViewModelFactory()).get(StoreInfoActivityViewModel::class.java)
}
In the onCreate()
, add an observer for the LiveDatastoreInfo
present in the StoreInfoActivityViewModel
. When the observed data changes while the activity is in the foreground, the onChanged()
method is invoked and you can set the updated data to the UI widgets.
storeInfoActivityViewModel.storeInfo.observe(this, Observer { storeInfoViewState ->
storeInfoViewState?.let {
when(it) {
is Success -> updateUI(it)
is Error -> showError(it)
is Loading -> showLoading()
}
}
})
Add a private function updateUI()
in the StoreInfoActivity
, that accepts an instance of Success<StoreInfo>
view state and sets the required values to the UI widgets based on the data that we receive from the ViewModel
.
private fun updateUI(data: Success<StoreInfo>) {
store_info_progress_bar.visibility = View.GONE
val storeInfo = data.value
store_name_text_view.text = storeInfo.storeName
store_address_text_view.text = storeInfo.storeAddress
store_hours_sunday_text_view.text = storeInfo.storeHours[0]
store_hours_monday_text_view.text = storeInfo.storeHours[1]
store_hours_tuesday_text_view.text = storeInfo.storeHours[2]
store_hours_wednesday_text_view.text = storeInfo.storeHours[3]
store_hours_thursday_text_view.text = storeInfo.storeHours[4]
store_hours_friday_text_view.text = storeInfo.storeHours[5]
store_hours_saturday_text_view.text = storeInfo.storeHours[6]
store_contact_info_text_view.text = storeInfo.storeContactNumber
store_website_text_view.text = storeInfo.storeWebsite
store_rating_bar.rating = storeInfo.storeRating
store_rating_text_view.text = getString(R.string.code_lab_review_text, storeInfo.storeRating, storeInfo.storeNumReviews)
}
Add a private function showError()
in the StoreInfoActivity
, that accepts an instance of Error
view state and displays a toast message to the user.
private fun showError(error: Error) {
store_info_progress_bar.visibility = View.GONE
Toast.makeText(this, error.errorMsg, Toast.LENGTH_LONG).show()
}
Add a private function showLoading()
in the StoreInfoActivity
, that sets the visibility of the ProgressBar
with id store_info_progress_bar
to View.VISIBLE
.
private fun showLoading() {
store_info_progress_bar.visibility = View.VISIBLE
}
Make sure to set the visibility of the above mentioned ProgressBar
to View.GONE
in both the updateUI()
and showError()
methods.
The final step is to call the fetchStoreInfo()
method in the ViewModel
. You can use the storeName
and postalCode
that you receive as part of the Intent
bundle that was used to start this Activity
. Add the following code to the onCreate()
method to read postalCode
and storeName
from the intent bundle. You can use the declared constants PARAM_POSTAL_CODE
and PARAM_STORE_NAME
as keys when requesting the values from the intent. Finally, call the method in the viewmodel to fetch the data. Your onCreate()
method should look something like this after making all these changes.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_store_info)
val storeName = intent.getStringExtra(PARAM_STORE_NAME)
val postalCode = intent.getStringExtra(PARAM_POSTAL_CODE)
storeInfoActivityViewModel.storeInfo.observe(this, Observer { storeInfoViewState ->
storeInfoViewState?.let {
when(it) {
is Success -> updateUI(it)
is Error -> showError(it)
is Loading -> showLoading()
}
}
})
storeInfoActivityViewModel.fetchStoreInfo(postalCode, storeName)
}
Here is the complete code for the StoreInfoActivity
class.
class StoreInfoActivity : AppCompatActivity() {
companion object {
public const val PARAM_STORE_NAME = "param_store_name"
public const val PARAM_POSTAL_CODE = "postal_code"
}
private val storeInfoActivityViewModel: StoreInfoActivityViewModel by lazy {
ViewModelProvider(this, StoreInfoViewModelFactory()).get(StoreInfoActivityViewModel::class.java)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_store_info)
val storeName = intent.getStringExtra(PARAM_STORE_NAME)
val postalCode = intent.getStringExtra(PARAM_POSTAL_CODE)
storeInfoActivityViewModel.storeInfo.observe(this, Observer { storeInfoViewState ->
storeInfoViewState?.let {
when(it) {
is Success -> updateUI(it)
is Error -> showError(it)
is Loading -> showLoading()
}
}
})
storeInfoActivityViewModel.fetchStoreInfo(postalCode, storeName)
}
private fun showLoading() {
store_info_progress_bar.visibility = View.VISIBLE
}
private fun showError(error: Error) {
store_info_progress_bar.visibility = View.GONE
Toast.makeText(this, error.errorMsg, Toast.LENGTH_LONG).show()
}
private fun updateUI(data: Success<StoreInfo>) {
store_info_progress_bar.visibility = View.GONE
val storeInfo = data.value
store_name_text_view.text = storeInfo.storeName
store_address_text_view.text = storeInfo.storeAddress
store_hours_sunday_text_view.text = storeInfo.storeHours[0]
store_hours_monday_text_view.text = storeInfo.storeHours[1]
store_hours_tuesday_text_view.text = storeInfo.storeHours[2]
store_hours_wednesday_text_view.text = storeInfo.storeHours[3]
store_hours_thursday_text_view.text = storeInfo.storeHours[4]
store_hours_friday_text_view.text = storeInfo.storeHours[5]
store_hours_saturday_text_view.text = storeInfo.storeHours[6]
store_contact_info_text_view.text = storeInfo.storeContactNumber
store_website_text_view.text = storeInfo.storeWebsite
store_rating_bar.rating = storeInfo.storeRating
store_rating_text_view.text = getString(R.string.code_lab_review_text, storeInfo.storeRating, storeInfo.storeNumReviews)
}
}
Now that you have all the components working together, let us look at how Databinding
can help to clean up your UI code.
Data Binding has already been enabled on the Flipp Project. Let us convert our view activity_store_info.xml
to support data binding. Open activity_store_info.xml
. It is a regular layout with a ConstraintLayout as the root element.
In order to convert the layout to Data Binding, you need to wrap the root element in a tag. You'll also have to move the namespace definitions (the attributes that start with xmlns:) to the new root element.
Android Studio offers a handy way to do this automatically: Right-click the root element, select Show Context Actions, then Convert to data binding layout:
Your layout should now look like this:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2020 Wishabi. All rights reserved. -->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/start_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="@dimen/dimen_16dp" />
The <data>
tag will contain layout variables.
Layout variables are used to write layout expressions. Layout expressions are placed in the value of element attributes and they use the @{expression}
format. Here are some examples:
android:text="@{String.valueOf(index + 1)}"
android:visibility="@{age < 13 ? View.GONE : View.VISIBLE}"
android:transitionName='@{"image_" + id}'
Some of the advantages that we noticed by using layout expressions to bind components in the layout file are:
Now, let's modify your StoreInfoActivityViewModel
to work with databinding.
Open StoreInfoActivityViewModel
and add the following LiveData
fields to allow binding to the different UI elements.
var storeNameLiveData = MutableLiveData("")
var storeAddressLiveData = MutableLiveData("")
var sundayStoreHoursLiveData = MutableLiveData("")
var mondayStoreHoursLiveData = MutableLiveData("")
var tuesdayStoreHoursLiveData = MutableLiveData("")
var wednesdayStoreHoursLiveData = MutableLiveData("")
var thursdayStoreHoursLiveData = MutableLiveData("")
var fridayStoreHoursLiveData = MutableLiveData("")
var saturdayStoreHoursLiveData = MutableLiveData("")
var storeContactNumberLiveData = MutableLiveData("")
var storeWebsiteLiveData = MutableLiveData("")
var storeRatingLiveData = MutableLiveData(0f)
var storeNumReviewsLiveData = MutableLiveData(0)
var loadingLiveData = MutableLiveData(true)
Modify the fetchStoreInfo()
method to update the above declared LiveData
variables.
fun fetchStoreInfo(postalCode: String?, storeName: String?) {
if (postalCode.isNullOrEmpty() || storeName.isNullOrEmpty()) {
_storeInfo.postValue(Error("Invalid postal code or store name"))
return
}
if (_storeInfo.value is Success
&& this.postalCode.equals(postalCode, ignoreCase = true)
&& this.storeName.equals(storeName, ignoreCase =
true)) {
return
}
loadingLiveData.postValue(true)
this.postalCode = postalCode
this.storeName = storeName
viewModelScope.launch {
try {
val storeInfo = repository.fetchStoreInfo(postalCode, storeName)
storeNameLiveData.postValue(storeInfo.storeName)
storeAddressLiveData.postValue(storeInfo.storeAddress)
sundayStoreHoursLiveData.postValue(storeInfo.storeHours[0])
mondayStoreHoursLiveData.postValue(storeInfo.storeHours[1])
tuesdayStoreHoursLiveData.postValue(storeInfo.storeHours[2])
wednesdayStoreHoursLiveData.postValue(storeInfo.storeHours[3])
thursdayStoreHoursLiveData.postValue(storeInfo.storeHours[4])
fridayStoreHoursLiveData.postValue(storeInfo.storeHours[5])
saturdayStoreHoursLiveData.postValue(storeInfo.storeHours[6])
storeWebsiteLiveData.postValue(storeInfo.storeWebsite)
storeContactNumberLiveData.postValue(storeInfo.storeContactNumber)
storeRatingLiveData.postValue(storeInfo.storeRating)
storeNumReviewsLiveData.postValue(storeInfo.storeNumReviews)
loadingLiveData.postValue(false)
} catch (e: Exception) {
_storeInfo.postValue(Error("There was an error fetching store information"))
loadingLiveData.postValue(false)
}
}
}
Let's start with binding our ViewModel
.
Create a variable to hold our StoreInfoActivityViewModel
inside the <data>
tag.
<data>
<variable name="storeInfoActivityViewModel"
type="com.wishabi.flipp.app.storeinfo.StoreInfoActivityViewModel" />
</data>
Look for the TextView with ID store_name_text_view
and add the android:text
attribute with a layout expression:
<TextView
android:id="@+id/store_name_text_view"
<EMAIL_ADDRESS>android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:textColor="@color/primary3"
app:layout_constraintStart_toStartOf="@+id/start_guideline"
app:layout_constraintTop_toTopOf="@+id/top_guideline"
tools:text="Flipp Store" />
Look for the TextView with ID store_address_text_view
and add the android:text
attribute with a layout expression:
<TextView
android:id="@+id/store_address_text_view"
<EMAIL_ADDRESS>android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginTop="8dp"
android:maxLines="2"
android:textColor="@color/default3"
app:layout_constraintStart_toStartOf="@+id/start_guideline"
app:layout_constraintTop_toBottomOf="@+id/store_name_text_view"
tools:text="300 North St \nBuffalo, New York, 10001" />
Look for the TextView with ID store_hours_sunday_text_view
and add the android:text
attribute with a layout expression:
<TextView
android:id="@+id/store_hours_sunday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_8dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_title_text_view"
tools:text="11AM - 6PM" />
Repeat the same for the following IDs store_hours_monday_text_view
, store_hours_tuesday_text_view
, store_hours_wednesday_text_view
, store_hours_thursday_text_view
, store_hours_friday_text_view
and store_hours_saturday_text_view
and bind them to the appropriate LiveData
members in the ViewModel.
Here is how the above TextViews will look like after these changes are done:
<TextView
android:id="@+id/store_hours_sunday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_8dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_title_text_view"
tools:text="11AM - 6PM" />
<TextView
android:id="@+id/store_hours_monday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_4dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_sunday_text_view"
tools:text="10AM - 9PM" />
<TextView
android:id="@+id/store_hours_tuesday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_4dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_monday_text_view"
tools:text="10AM - 9PM" />
<TextView
android:id="@+id/store_hours_wednesday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_4dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_tuesday_text_view"
tools:text="10AM - 9PM" />
<TextView
android:id="@+id/store_hours_thursday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_4dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_wednesday_text_view"
tools:text="10AM - 9PM" />
<TextView
android:id="@+id/store_hours_friday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_4dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_thursday_text_view"
tools:text="10AM - 9PM" />
<TextView
android:id="@+id/store_hours_saturday_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_16dp"
android:layout_marginTop="@dimen/dimen_4dp"
app:layout_constraintStart_toEndOf="@+id/store_hours_title_barrier"
app:layout_constraintTop_toBottomOf="@+id/store_hours_friday_text_view"
tools:text="11AM - 6PM" />
Look for the TextView with ID store_contact_info_text_view
and add the android:text
attribute with a layout expression:
<TextView
android:id="@+id/store_contact_info_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginTop="@dimen/dimen_8dp"
app:layout_constraintEnd_toStartOf="@+id/store_contact_info_guide_line"
app:layout_constraintStart_toStartOf="@+id/start_guideline"
app:layout_constraintTop_toBottomOf="@+id/store_contact_info_title_text_view"
tools:text="+1<PHONE_NUMBER>" />
Look for the TextView with ID store_webstie_text_view
and add the android:text
attribute with a layout expression:
<TextView
android:id="@+id/store_website_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:layout_marginStart="@dimen/dimen_8dp"
android:layout_marginTop="@dimen/dimen_8dp"
android:maxLines="2"
app:layout_constraintEnd_toStartOf="@+id/end_guideline"
app:layout_constraintStart_toEndOf="@+id/store_contact_info_text_view"
app:layout_constraintTop_toBottomOf="@+id/store_website_title_text_view"
tools:text="store.flipp.com" />
Look for the RatingBar with ID store_rating_bar
and add the android:rating
attribute with a layout expression:
<RatingBar
android:id="@+id/store_rating_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>android:progressTint="@color/primary3"
android:layout_marginTop="@dimen/dimen_8dp"
android:isIndicator="true"
android:numStars="5"
android:stepSize="0.5"
app:layout_constraintStart_toStartOf="@+id/start_guideline"
app:layout_constraintTop_toBottomOf="@+id/store_reviews_title_text_view" />
Look for the TextView with ID store_rating_text_view
and add the android:text
attribute with a layout expression:
<TextView
android:id="@+id/store_rating_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.format(@string/code_lab_review_text, storeInfoActivityViewModel.storeRatingLiveData, storeInfoActivityViewModel.storeNumReviewsLiveData)}"
android:layout_marginStart="4dp"
android:layout_marginTop="@dimen/dimen_4dp"
tools:text="4.3 (120 Reviews)"
app:layout_constraintStart_toStartOf="@+id/start_guideline"
app:layout_constraintTop_toBottomOf="@+id/store_rating_bar" />
Finally, look for the ProgressBar with ID store_info_progress_bar
and modify the android:visibility
attribute with a layout expression:
<ProgressBar
android:id="@+id/store_info_progress_bar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EMAIL_ADDRESS>? View.VISIBLE : View.GONE}"
tools:visibility="visible"
app:layout_constraintStart_toEndOf="@id/start_guideline"
app:layout_constraintEnd_toStartOf="@id/end_guideline"
app:layout_constraintTop_toBottomOf="@id/top_guideline"
app:layout_constraintBottom_toTopOf="@id/bottom_guideline" />
However, this will cause a compile time exception with respect to the View
class. To fix this, import the View
class in the <data>
section as given below:
<data>
<import type="android.view.View" />
<variable name="storeInfoActivityViewModel"
type="com.wishabi.flipp.app.storeinfo.StoreInfoActivityViewModel" />
</data>
The layout is ready, but now it's necessary to make some changes in the activity. Open StoreInfoActivity
. Because you're using a Data Binding layout, the inflation is done in a different way.
In onCreate
, replace:
setContentView(R.layout.activity_store_info)
with
val binding: ActivityStoreInfoBinding =
DataBindingUtil.setContentView(this, R.layout.activity_store_info)
Now you can set the data binding variable values in the activity:
binding.lifecycleOwner = this
binding.storeInfoActivityViewModel = storeInfoActivityViewModel
``` <br/>
And that's it. You bound data using the library.
### Step 3
Remove the methods that set the data to the UI widgets and displays a progress bar to indicate loading status as we have now bound the widgets directly to the `ViewModel` keeping only the flow to display a toast in the case of an `Error`.
Here is the complete code for the `StoreInfoActivity` with these code changes:<br/>
```kotlin
class StoreInfoActivity : AppCompatActivity() {
companion object {
const val PARAM_STORE_NAME = "param_store_name"
const val PARAM_POSTAL_CODE = "postal_code"
}
private val storeInfoActivityViewModel: StoreInfoActivityViewModel by lazy {
ViewModelProvider(this, StoreInfoViewModelFactory()).get(StoreInfoActivityViewModel::class.java)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val binding: ActivityStoreInfoBinding =
DataBindingUtil.setContentView(this, R.layout.activity_store_info)
binding.lifecycleOwner = this
binding.storeInfoActivityViewModel = storeInfoActivityViewModel
val storeName = intent.getStringExtra(PARAM_STORE_NAME)
val postalCode = intent.getStringExtra(PARAM_POSTAL_CODE)
storeInfoActivityViewModel.storeInfo.observe(this, Observer { storeInfoViewState ->
storeInfoViewState?.let {
when(it) {
is Error -> showError(it)
}
}
})
storeInfoActivityViewModel.fetchStoreInfo(postalCode, storeName)
}
private fun showError(error: Error) {
store_info_progress_bar.visibility = View.GONE
Toast.makeText(this, error.errorMsg, Toast.LENGTH_LONG).show()
}
}
The final solution for this codelab can be found here.
Here is some Android developer documentation to help learn more:


Class: EZMQ::Socket
- Inherits:
-
Object
- Object
- EZMQ::Socket
- Defined in:
- lib/ezmq/socket.rb
Overview
Wrapper class to simplify 0MQ sockets.
Instance Attribute Summary (collapse)
-
- (Object) context
Returns the value of attribute context.
-
- (Object) decode
Returns the value of attribute decode.
-
- (Object) encode
Returns the value of attribute encode.
-
- (Object) socket
Returns the value of attribute socket.
Instance Method Summary (collapse)
-
- (Boolean) connect(transport: :tcp, address: '<IP_ADDRESS>', port: 5555)
(also: #bind)
Connects the socket to the given address.
-
- (Socket) initialize(mode, type, **options)
constructor
Creates a 0MQ socket.
-
- (void) listen {|message| ... }
Like receive, but doesn't stop at one message.
-
- (Object) receive(**options) {|message| ... }
Receive a message from the socket.
-
- (Fixnum) send(message = '', **options)
Sends a message to the socket.
Constructor Details
- (Socket) initialize(mode, type, **options)
port is ignored unless transport is one of :tcp, :pgm or :epgm
Creates a 0MQ socket.
26 27 28 29 30 31 32 33 34 |
# File 'lib/ezmq/socket.rb', line 26 def initialize(mode, type, **) fail ArgumentError unless %i(bind connect).include? mode @context = [:context] || EZMQ::Context.new @socket = @context.socket type @encode = [:encode] || -> m { m } @decode = [:decode] || -> m { m } endpoint = .select { |k, _| %i(transport address port).include? k } method(mode).call endpoint end |
Instance Attribute Details
- (Object) context
Returns the value of attribute context
7 8 9 |
# File 'lib/ezmq/socket.rb', line 7 def context @context end |
- (Object) decode
Returns the value of attribute decode
7 8 9 |
# File 'lib/ezmq/socket.rb', line 7 def decode @decode end |
- (Object) encode
Returns the value of attribute encode
7 8 9 |
# File 'lib/ezmq/socket.rb', line 7 def encode @encode end |
- (Object) socket
Returns the value of attribute socket
7 8 9 |
# File 'lib/ezmq/socket.rb', line 7 def socket @socket end |
Instance Method Details
- (Boolean) connect(transport: :tcp, address: '<IP_ADDRESS>', port: 5555) Also known as: bind
This method can be called as #bind, in which case it binds to the specified address instead.
Binding to 'localhost' is not consistent on all platforms. Prefer '<IP_ADDRESS>' instead.
port is ignored unless transport is one of :tcp, :pgm or :epgm
Connects the socket to the given address.
88 89 90 91 92 |
# File 'lib/ezmq/socket.rb', line 88 def connect(transport: :tcp, address: '<IP_ADDRESS>', port: 5555) endpoint = "#{ transport }://#{ address }" endpoint << ":#{ port }" if %i(tcp pgm epgm).include? transport @socket.method(__callee__).call(endpoint) == 0 end |
- (void) listen {|message| ... }
This method returns an undefined value.
Like receive, but doesn't stop at one message.
103 104 105 106 107 |
# File 'lib/ezmq/socket.rb', line 103 def listen(&block) loop do block.call receive end end |
- (Object) receive(**options) {|message| ... }
This method blocks until a message arrives.
Receive a message from the socket.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ezmq/socket.rb', line 63 def receive(**) = '' @socket.recv_string decoded = ([:decode] || @decode).call if block_given? yield decoded else decoded end end |
- (Fixnum) send(message = '', **options)
If message is not a String, #encode must convert it to one.
Sends a message to the socket.
46 47 48 49 |
# File 'lib/ezmq/socket.rb', line 46 def send( = '', **) encoded = ([:encode] || @encode).call @socket.send_string encoded end |


| Most recent Observation | |||
|---|---|---|---|
| |||
| Most recent doctor's note | |||
| Doctor: {{mostRecent.note.ConsultantFullName}} Date: {{mostRecent.note.DateTaken}} | |||
| Most recent Treatment | |||
| Time | {{toDateString(mostRecent.treatment.Date)}}, {{mostRecent.treatment.Time}} | ||
| Administered By | {{mostRecent.treatment.NurseFullName}} | ||
| Drug | {{mostRecent.treatment.Drug}} | ||
| Dosage | {{mostRecent.treatment.Dose}} | ||
| Route | {{mostRecent.treatment.Route}} | ||
| Note | {{mostRecent.treatment.NurseFullName}} | No comment/extra note |


Gem County Fire-Ems
Toggle navigation
Gem County Fire-EMS
Home
Fire
EMS
Our Equipment
Employment
Contact Us
Fire Station #1
Address:
115 W 3rd St
Emmett, Idaho 83617 S
Phone:
(208) 365-2012
Email:
<EMAIL_ADDRESS>Fire Station #2
Address:
7680 W. Idaho Blvd.
Letha, Idaho 83617
Fire Station #3
Address:
6850 Van Deusen Rd
Emmett, Idaho 83617
EMS Station #4
Address:
330 E Main
Emmett, Idaho 83617
Phone:
(208) 365-3684
Email:
<EMAIL_ADDRESS>Copyright © 2019 Gem County Fire-EMS.


| Class | Applies to | Description |
|---|---|---|
{{ item.class }} |
{{ item.applies }} | {{ item.description }} |
| Attribute | Applied to | Description |
|---|---|---|
id="{POPOVER_ID}" |
.s-popover |
A unique id that the popover’s toggling element can target. Matches the value of [aria-controls] on the toggling element. |
data-controller="s-popover" |
Controller element | Wires up the element to the popover controller. This may be a toggling element or a wrapper element. |
data-s-popover-reference-element="[css selector]" |
Controller element | Optional Designates the element to use as the popover reference. If left unset, the value defaults to the controller element. |
aria-controls="{POPOVER_ID}" |
Reference element | Associates the element to the desired popover element. |
data-action="s-popover#toggle" |
Toggling element | Wires up the element to toggle the visibility of a generic popover. |
data-s-popover-toggle-class="[class list]" |
Controller element | Adds an optional space-delineated list of classes to be toggled on the originating element when the popover is shown or hidden. |
data-s-popover-placement="[placement]" |
Controller element | Dictates where to place the popover in relation to the reference element. By default, the placement value is bottom . Accepted placements are auto , top , right , bottom , left . Each placement can take an additional -start and -end variation. |
| Event | Element | Description |
|---|---|---|
s-popover:show |
Controller element | Fires immediately before showing the popover |
s-popover:shown |
Controller element | Fires immediately after showing the popover |
s-popover:hide |
Controller element | Fires immediately before hiding the popover |
s-popover:hidden |
Controller element | Fires immediately after hiding the popover |
If you’ve added the proper Stimulus controllers to your popover, positioning and arrow direction will be managed for you by Popper.js, a powerful popover positioning library we’ve added as a dependency.
First, you’ll want to add our attributes to the popover’s originating button. Automatic positioning is specified by the data-s-popover-placement
. In the following example, we’ve chosen bottom-start
. No positioning classes need to be added to your markup, only the data attributes.
To promote being able to tab to an open popover, it’s best to place the popover immediately after the toggling button in the markup as siblings.
In the case of new feature callouts, it may be appropriate to include an explicit dismiss button. You can add one using the styling provided by .s-popover--close
.
In order for to close the popover with an explicit close button, you’ll need to add the controller to a parent as illustrated in the following example code:
Dismissible persistent popover presented with a close button
If the user doesn’t need to interact with the contents of the popover, it may be appropriate to only show it on hover. This will make popovers feel like a tooltip. To do so, we can rely on stock mouseover and mouseout events from Stimulus.
| Class | Applies to | Description |
|---|---|---|
{{ item.class }} |
{{ item.applies }} | {{ item.description }} |
Popovers can also be positioned manually if you aren’t using the built-in JavaScript interactivity. Practically, this might look like adding something like t8 l8
to .s-popover
.
Manual positioning for arrows is also provided. Arrow direction (top, right, bottom, left) will appear first, followed by the secondary (center, top, right, bottom, left). For example, a popover with an arrow child of .s-popover--arrow__tc
will appear on the top of the .s-popover
and centered horizontally. Though there are sensible defaults applied to the width of popovers, you may need to adjust manually.
By default, popovers are hidden and positioned absolutely. Adding the class .is-visible
will show the popover.
If you want to set the background color to something other than the default, simply add your desired bg-*
class to the s-popover
element and a matching fc-*
class to the s-popover--arrow
element.
.s-popover--arrow__tc
Popover arrow appears top center
.s-popover--arrow__tl
Popover arrow appears top left
.s-popover--arrow__tr
Popover arrow appears top right
.s-popover--arrow__bc
Popover arrow appears bottom center
.s-popover--arrow__bl
Popover arrow appears bottom left
.s-popover--arrow__br
Popover arrow appears bottom right
.s-popover--arrow__rc
Popover arrow appears right center
.s-popover--arrow__rt
Popover arrow appears right top
.s-popover--arrow__rb
Popover arrow appears right bottom
.s-popover--arrow__lc
Popover arrow appears left center
.s-popover--arrow__lt
Popover arrow appears left top
.s-popover--arrow__lb
Popover arrow appears left bottom


Psk-radio-group is the component that groups the Psk-Radio components. The main responsability is to ensure that only one radio option is checked.
Psk-radio-group is notified when a psk-radio is clicked, so the group can then update the model.
An explanatory example using a full form can be found at: Using forms page.


Create a campaign to find the perfect gift for your loved ones. Share your new campaign with friends and family!
Add the perfect gift ideas that they will love. Vote as a group for the top gifts in the list!
Pledge money to the campaign. Find the best gift ideas that fall into your group's budget!


Databases
A database is software that is good at storing lots of data
Database vs. Spreadsheet
- Many people can use it
- Fast for lots of data(1M, 1B, or 1T rows!)
- It is always on
- The source of truth
- Good for complicated analysis
Databases live on computers
- Cloud (e.g. Amazon, Digital Ocean)
- Your Datacenter
- Local (your computer)
SQL
SQL is the language used to extract data from databases
- People use SQL to get data
- Analytics
- Operations
- others?
Databases are organized
- Databases have tables
- Tables have columns
- Columns have types
(e.g. date, number, text)


Github Repo Search
Search Github users to see their latests projects.
Enter a github username
Search repos


ENEMEEZ PLUS- docusate sodium and benzocaine liquid
Enemeez Inc. DBA Summit Pharmaceuticals
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
Docusate Sodium USP 283 mg ............. Stool Softener Laxative
Benzocaine 20mg ................................ Anesthetic
For relief of occasional constipation (irregularity). This product generally produces a stimulus and bowel movement in 2 to 15 minutes.
For rectal use only. This is not a suppository. Do not take orally. Individuals with sensitivity to Benzocaine should not use this product.
In case of accidental ingestion or overdose, get medical help or contact a Poison Control Center immediately.
Adults and children 12 years of age and older (with adult supervision) one to three units daily. Children 2 years and over but not more than 12 years should consult a doctor prior to use and not exceed one unit daily (with adult supervision).
Twist off and remove tip; Lubricate tip prior to insertion: Place a few drops of water or product on the shaft prior to insertion. Also apply one of these lubricants to the anus before inserting the enema. With steady pressure, gently insert the tube into the rectum with care to prevent damage to the rectal wall. Squeeze to empty the contents. Continue squeezing the tube until it is removed from the rectum. Remove the disposable tube and discard. A small amount of liquid may remain in the tube after use.
Positioning:
For best results, lay on the left side with knees bent.
Alternate Positions:
|
ENEMEEZ PLUS
docusate sodium and benzocaine liquid | ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
|
| Labeler - Enemeez Inc. DBA Summit Pharmaceuticals (010717819) |
| Registrant - Enemeez Inc. DBA Summit Pharmaceuticals (010717819) |
| Establishment | |||
| Name | Address | ID/FEI | Business Operations |
|---|---|---|---|
| Enemeez Inc. DBA Summit Pharmaceuticals | 010717819 | manufacture(17433-9877) |


Election debates: What time is BBC Question Time leaders' special and who is hosting?
Fiona Bruce and a live studio audience will put Jeremy Corbyn, Boris Johnson, Nicola Sturgeon and Jo Swinson through their paces
by Oliver Milne, https://www.mirror.co.uk/authors/oliver-milne/Just three days after Boris Johnson and Jeremy Corbyn went head-to-head on ITV, party leaders are headed for yet another broadcast clash.
On Friday, the BBC will host a two hour special which will see each party leader take questions from a studio audience.
The Question Time leadership special will air on Friday - and give each of the four main party's a chance to win support from a prime time TV audience.
Here is everything you need to know about the next big TV clash.
When is Question Time Leaders' special on, what channel is it on and where is it being filmed?
The one off special will air on Friday 22 of November and will be filmed in front of a live studio audience in Sheffield.
It will air live on BBC One at 1900 - but you will also be able to watch it online on the BBC iPlayer live.
If radio is more your thing, then you can listen live on Radio 5Live or the BBC Sounds app.
You'll also be able to follow along to all the biggest news on a Mirror live blog.
For those of you who are super keen there will also be an hour long programme from the spin room afterwards on the BBC news channel.
What is the format of the debate?
Over the two hours, each leader will each be invited to take questions from the audience for thirty minutes.
Who is hosting it?
The BBC's standard Question Time host Fiona Bruce will be hosting - and pushing the politicians to answer the questions.
On the show Fiona Bruce said: “Question Time has a proud history of giving the public - the voters - the chance to put their points and questions directly to their elected representatives. That’s never more important than during an election campaign.
"I’m very much looking forward to these special programmes."
Who is representing each of the parties?
Boris Johnson will be representing the Conservatives, Jeremy Corbyn for Labour, Nicola Sturgeon for the Scottish National Party and Jo Swinson for the Liberal Democrats.
Why aren't Nigel Farage and the Green Party involved?
They'll both take part in a similar show for more minor political parties in another Question Time special.
When are the other TV debates?
Thursday 28 November, TBC: Sky News airs three-way debate between Boris Johnson, Jeremy Corbyn and Jo Swinson.
Friday 29 November, TBC: BBC One airs seven-way election debate hosted by Nick Robinson from Cardiff. Labour, the Tories, Lib Dems, SNP, Greens, Plaid and Brexit Party are set to take part.
Friday 6 December, TBC: BBC One airs Prime Ministerial Debate between Jeremy Corbyn and Boris Johnson, hosted by Nick Robinson in Southampton.
Monday 9 December, 8.30pm: BBC One airs a 90-minute Question Time for under-30s, hosted by Emma Barnett, with "leading figures from each of the main parties".
Friday 13 December, 8.30pm: Question Time special broadcast on BBC One.


FDS includes a wide range of shorthand responsive margin and padding utility classes to modify an element’s appearance.
Assign responsive-friendly margin
or padding
values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from .25rem
to 8rem
.
Spacing utilities that apply to all breakpoints, from xs
to xl
, have no breakpoint abbreviation in them. This is because those classes are applied from min-width: 0
and up, and thus are not bound by a media query. The remaining breakpoints, however, do include a breakpoint abbreviation.
The classes are named using the format {property}{sides}-{size}
for xs
and {property}{sides}-{breakpoint}-{size}
for sm
, md
, lg
, and xl
.
Where property is one of:
m
- for classes that set margin
p
- for classes that set padding
Where sides is one of:
t
- for classes that set margin-top
or padding-top
b
- for classes that set margin-bottom
or padding-bottom
l
- for classes that set margin-left
or padding-left
r
- for classes that set margin-right
or padding-right
x
- for classes that set both *-left
and *-right
y
- for classes that set both *-top
and *-bottom
margin
or padding
on all 4 sides of the elementWhere size is one of:
0
- for classes that eliminate the margin
or padding
by setting it to 0
1
- (by default) for classes that set the margin
or padding
to spacer * .25
2
- (by default) for classes that set the margin
or padding
to spacer * .5
3
- (by default) for classes that set the margin
or padding
to spacer
4
- (by default) for classes that set the margin
or padding
to spacer * 1.5
5
- (by default) for classes that set the margin
or padding
to spacer * 2
5
- (by default) for classes that set the margin
or padding
to spacer * 4
5
- (by default) for classes that set the margin
or padding
to spacer * 8
auto
- for classes that set the margin
to autoHere are some representative examples of these classes:
.mt-0 {
margin-top: 0 !important;
}
.ml-1 {
margin-left: ($spacer * .25) !important;
}
.px-2 {
padding-left: ($spacer * .5) !important;
padding-right: ($spacer * .5) !important;
}
.p-3 {
padding: $spacer !important;
}
Additionally, FDS also includes an .mx-auto
class for horizontally centering fixed-width block level content—that is, content that has display: block
and a width
set—by setting the horizontal margins to auto
.

Centered element

In CSS, margin
properties can utilize negative values (padding
cannot). As of 4.2, we’ve added negative margin utilities for every non-zero integer size listed above (e.g., 1
, 2
, 3
, 4
, 5
, 6
, 7
, 8
). These utilities are ideal for customizing grid column gutters across breakpoints.
The syntax is nearly the same as the default, positive margin utilities, but with the addition of n before the requested size. Here’s an example class that’s the opposite of .mt-1
:
.mt-n1 {
margin-top: -0.25rem !important;
}
Here’s an example of customizing the FDS grid at the medium (md
) breakpoint and above. We’ve increased the .col
padding with .px-md-5
and then counteracted that with .mx-md-n5
on the parent .row
.

Custom column padding

Custom column padding


Creating Sprite Sheets
We were somewhat dismayed that Pixi.js uses a proprietary commercial app to build sprite sheets.
We rely solely on open source tools, so we built an open source filter for our node.js build tool---Projmate.
The pm-spritesheet
filter generates sprite sheets and a JSON meta file compatible with Texture Packer (as used by pixi.js).
In this tutorial four images
are combined into a single sprite sheet. These images are from pixi.js' Example 2
.
Installing Projmate
Projmate is command-line build tool we use internally for almost half a year now that works well in Linux, Mac and Windows. In order to use it, first install these pre-requisites
Install Projmate globally
npm install -g<EMAIL_ADDRESS>Inside a project install the sprite sheet filter
npm install pm-spritesheet
Generate Sprite Sheet Task
Projmate, like most build tools, breaks down a project into smaller units of work called tasks that can
depend on each other. What is different about Projmate is that a task is defined by one or more pipelines which
define behaviour for development
, test
and production
mode. For example, in production
mode a task can
minify, compress, add a banner, optimize, etc.
In this example, we want to generate a sprite sheet from all the tp/*.png
files pixi.js' second example
folder
▾ tp/
eggHead.png
flowerTop.png
helmlok.png
skully.png
First create a build file Projfile.js
at the root of your
project. The pipeline for spritesheet
task requires only
the spritesheet
filter which is passed all files matching files
.
spritesheet
filter then retrieves dimensions for each image and
determines an eficient layout then generates the image and meta file.
exports.project = function(pm) {
var f = pm.filters(require('pm-spritesheet'));
return {
spritesheet: {
files: 'tp/*.png',
dev: [
f.spritesheet({filename: 'SpriteSheet.png', root: 'tp/', jsonStyle:'texturePacker'})
]
}
};
};
To run the spritesheet
task from the terminal
pm run spritesheet
The generated sprite sheet and JSON meta file is supported by pixi.js. We'll cover this in a future example.
Projmate
is not well documented as a small team can only do so much. Look at this
project's Projfile.coffee
which has the spritesheet
task for this tutorial.


UXOK is a design conference that focuses on user experience and related tech that make the web accessible, delightful, and functional.
UXOK is organized and backed by Techlahoma – a volunteer-run 501(c)3 non-profit. Techlahoma is dedicated to advancing Oklahomans through accessible tech training and community building.
Tickets
Our ticketing system is hosted by Ti.to. Please use the form below to get tickets for the conference.
Speakers
Announcing Soon!Sponsors
Interested in becoming a sponsor? See our sponsorship prospectus (PDF) or contact us to get started.
Become a Sponsor
FAQs
-
How much does it cost to attend?
This conference is donation based, so it's pay-what-you-want.! If you donate a certain amount, we will send you a shirt and other UXOK goodies.
-
I’m new to UX. Is this conference for me?
Absolutely. Our conference covers subjects for all UX knowledge levels.
-
Will I have a chance to network with other attendees?
Yes! After the conference, we host a virtual after-party for attendees to meet. You'll need a (free) ticket to get the RSVP information for the after-party.
Before attending the conference, please review the Techlahoma Code of Conduct. The Code of Conduct applies to all attendees, speakers, volunteers, and vendors at official and unofficial events by Techlahoma and any location where attendees may be congregating. Contact us if you have questions.


Bare metal servers aid in. A bare metal environment is a computer system or network in which a virtual machine is installed directly on hardware rather than within the host operating system (OS). The term "bare metal" refers to a hard disk, the usual medium on which a computer's OS is installed.
Docs
Terms


Key economic events in the day ahead – Deutsche Bank
by Dhwani MehtaAccording to the analysts at Deutsche Bank the ECB monetary policy account and Fed speak will be closely watched among second-tier US macro releases in the day ahead.
Key Quotes:
“Turning to the day ahead, from central banks we can expect the ECB’s account of their October monetary policy meeting, as well as policy decision from South Africa.
We’ll also hear from the ECB’s Mersch and de Guindos, along with the Fed’s Kashkari and Mester.
In terms of data, we’ll get the Euro Area’s advance consumer confidence reading for November, French business confidence for November and the UK’s public finances for October.
And from the US we’ll get the Philadelphia Fed’s business outlook for November, existing home sales and the leading index for October, and weekly initial jobless claims.
Finally, the OECD will be releasing their economic outlook, and we’ll get earnings from Thyssenkrupp and Macy’s. Back on this side of the Atlantic, the opposition Labour Party will be launching their election manifesto today.”


The Header
This is the header
Home
Products
Orders
Login
Card Heading
Card Heading
Card Heading
Card Heading
This is a card
Card Heading


object HtmlUtility
Provides common HTML-related functionality.
stripEntities |
Strips named and numeric HTML entities from a string, replacing with Unicode equivalents where possible, removing where no known match. Badly formatted entities (e.g. "&") are not modified. fun stripEntities(s: String): String |


About
I am a postdoctoral researcher at the Centre for Language and Speech Technology at Radboud University (the Netherlands).
My research focuses on computational language learning from speech with a particular emphasis on weakly supervised approaches including visually-grounded learning. I am also interested in interpretability of deep neural networks and computational modeling of lanugage processing/acquisition by humans.
News
-
11th November 2021: I will present a poster at the BlackboxNLP workshop about our recent work on the analysis of discrete representations in neural models of speech processing.
-
15th September 2021: Today, I have officially started my new work as a postdoc in the InDeep project 🎉. I will work for 3 years with Louis ten Bosch and Tom Lentz on the interpretability of deep models of speech processing.
-
May 2021: Our new edition of the Zero Resource Speech Challenge, featuring an audio-visual track, has been accepted as a NeurIPS competition.
-
September 2020: Our paper on textual supervision for visually-grounded models of spoken language understanding has been accepted to the Findings of EMNLP 2020!


This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.
View details »


2 Corinthians 5:14
For the love of Christ constraineth us; because we thus judge, that if one died for all, then were all dead:


_rb A curbside barb of gossip and blurb of news echoed through the neighborhood, reminding everyone to practice caution while out in public.[G|D] An orb of golden light shone brilliantly against the emerald garb of the forest, emitting a crisp scent of freshly grown herbs.[G|D] The proverb reverberated through the hall as the students were perturbed to find that their teacher had not arrived on time.[G|D] The suburban neighborhood was superbly adorned with manicured lawns and rows of succulent rhubarb plants, creating a stunning sight.[G|D]


Watch King Princess Perform “1950” & “Hit The Back” On SNL
by James RettigKing Princess was the musical guest on Saturday Night Live this weekend opposite host Will Ferrell. The Mikaela Straus-led pop project released its debut album, Cheap Queen, last month. She performed “Hit The Back,” which shows up on Cheap Queen, and her first-ever single “1950,” which does not, but which put King Princess on the map when it was first released in the beginning of 2018.
Last week, Saturday Night Live announced the remaining slate of performers for the calendar year: DaBaby, Niall Horan, and Lizzo.
Watch King Princess’ SNL debut below.