openssl_pkey_export (PHP 4 >= 4.2.0, PHP 5, PHP 7) openssl_pkey_export — Gets an exportable representation of a key into a string 说明 bool openssl_pkey_export ( mixed $key , string &$out [, string $passphrase [, array $configargs ]] ) openssl_pkey_export() exports key as a PEM encoded string and stores it into out (which is passed by reference). Note: 必须安装有效的 openssl.cnf 以保证此函数正确运行。参考有关安装的说明以 获得更多信息。 参数 key out passphrase The key is optionally protected by passphrase. configargs configargs can be used to fine-tune the export process by specifying and/or overriding options for the openssl configuration file. See openssl_csr_new () for more information about configargs. 返回值 成功时返回 TRUE，或者在失败时返回 FALSE。 User Contributed Notes 6 notes =============================================================================== Complete example to encrypt data... =)
Outputs : string(963) "-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,DA1943487C9C83B2 1/j65PJgfYqYMJSWRBk9UzXaa3USMdpkq4ztzL7IPMTPgTwVKxZbvBxzsGUXUmh6 dkWpF1jzi3B44o06mw55t2LHNkGAph/iKVP4Zvnyp/KWaZJSF+pNkvukle1u2/40 WpbNy1f8LA+ZDr7ICOCY1jy/bz/xzOCrVjqY/F4ukQik9M6bL9ZwI5fyhrcHq6EG KsUX49XKtP/a+kQhluejzIw1aDBqmHpJTCzkL7teCk6l8x8r8mMmss1D9XqggjFm TQncqR6IU5DClklO53JdWSFC5zTcFYMgq9lMwCQ5o4bs8iBKiE+TOFEKiggtn5zA v189tlPtM6YePcXAm5Ymgy90Ovq3lGS4k+JkCB2Hm3HgUAB3pd9v3fOeyuFMeing XHBuLR5nmWITzcfRuAsh0p9xe2puTVFdrLkrQFnh5Xkerm+YUQ6oTecTKRFq7S3l hLlFIg7KbXxDjg3H5f87DCEp/isV70Rc7flvIBP6u5GX+GrmCFWjQxmGefEJQ5fZ P7sOzHEdkOHZV7yYn+5MwQ4vDHLKQxvMqUolgvuEAzcL1o976KHAQP0accmwApXz jry3zVqRnGvyPHo+nGwRiATJj0lAgX/j8cghJg+oo+TiXD2cM5i+Hut4dmImZNDL 3Fn2uLzklQHPlaoaz2dACyaN/sUtmVLtdnn00nuwIy2xDfHDl9MOQ6WHocU78DWo Mw+x8B+SBsALm3Ah6JzqA8l3OAYSRxjp7YQXLQLkdCi7jEjjTl/0NVTnqU+W89XB GBH3r8ZgIpifl3M7ZYTKLnToNL7Y/AehPs+tKgFHkXtGMKu4cIt9Ag== -----END RSA PRIVATE KEY----- " string(272) "-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDH82E/Dn37torKz/vhAkpji9ZS HCyfM7JuXCbh70F75Zh2/rEVvz38yNf6f01DNXiSpzO5eTmoXD7Blsb635AOjYbl X/WljpFbwQ2QUUDlNDAslrqXYlMzht2MCq/pjtGgk0zJx6i+HjFyV7mebeePQY/x NOzMpmy/Ke3u+SSHRwIDAQAB -----END PUBLIC KEY----- " string(6) "sealed" string(52) "y4L3+SDVJwTfa9Em61R3X2p/LElr8N/xPCXw8kqm0co4bn3V1Tw=" string(172) "ezUo2rWLGHPv9bHE5gG8fe5qy8erGlITsSs+qGr2o8aoi98SLnyIFm4N EQWJrmU43Ehlw72NujJ B8chYNw2NkIDfaLChvLH54CBuCfyuF+1lWEAUwL8 FU1LftqIIt1ikjSu/8qFU6S6wikJx1pFf1IbXfOeeJVvZ1UJM2rBbudI=" string(172) "RPYLXGBXDnXDIUrFy1/GOM+//Ew/mn2syKDbhIegOJJPnpd X6ffwXkWH5Bp8kOdz0aO9gK3whG+c /QF+9eqcTw9SvvlrDqsP0gkRGNIOgMUiBFLoMT92JQWSI7ZesDAU0 JPRWpXsKaIOEkBGmxOMYfEd6OJWp0Mwe4COL3lP2PQ=" here is the opened data: Only I know the purple fox. Trala la ! =============================================================================== I kept banging my head against the wall today trying to figure out why the RSA keys I was generating were encrypted (they have this stuff in them) Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,BEA1180EADE1524F I finally realized that the issue was that I was passing a password into the "openssl_pkey_export" method inadvertently. So the moral of the story is: you have to use NULL as the password. using an empty string will still cause the key to be encrypted. =============================================================================== This function can be used to create a private key for use by JCE in Java. For example, a private key could be generated by a PHP script and the result could be used in a Java client application. Java requires the private key in DER format with some extra ASN.1 wrapping. The function below can be used to convert the output of openssl_pkey_export into a format suitable for input into JCE: Example use: 'sha1', 'private_key_type' => OPENSSL_KEYTYPE_RSA, 'private_key_bits' => 2048)); if ($keys === false) die('Failed to generate key pair.'."\n"); if (!openssl_pkey_export($keys, $privateKey)) die('Failed to retrieve private key.'."\n"); $javaKey = convertPemToDer($privateKey); file_put_contents('key_for_java.der', $javaKey); ?> Exporting a public key for use with JCE is trickier, since the Java libraries require the key to be input as a byte array. In effect, the public key outputted by openssl_pkey_get_details() must be base64 decoded as above, and then parsed as ASN.1 to receive the actual key bytes (this can be done either on the PHP side or the Java side). The following link is an invaluable resource to understanding the output from these functions: "A Layman's Guide to a Subset of ASN.1, BER, and DER" http://luca.ntop.org/Teaching/Appunti/asn1.html =============================================================================== Please take note that older versions of PHP/OpenSSL exports the RSA private key with '-----BEGIN RSA PRIVATE KEY-----' PEM tag, which includes just the privateKey field, thus omitting the version and privateKeyAlgorithm fields. The effect of that would be that if you're converting it to DER, and then back to PEM, but using '-----BEGIN PRIVATE KEY-----' PEM tag, that the openssl_pkey_get_privatekey() function will fail! Senthryl's code can be used to prefix the PEM encoded data with the version and privateKeyAlgorithm fields again. The newer PHP/OpenSSL versions exports the RSA private key with '-----BEGIN PRIVATE KEY-----' PEM tag, which includes the version and privateKeyAlgorithm fields. I noticed these differences between my two servers: PHP Version 5.3.3 (OpenSSL 1.0.0a-fips 1 Jun 2010) on Fedora Core 12 x64 PHP Version 5.2.9 (OpenSSL 0.9.8g 19 Oct 2007) on Fedora Core 10 x64 =============================================================================== you can get public key using openssl_pkey_get_details(resource $key ) function: =============================================================================== Warning, this function is NOT capable of exporting PEM-encoded public keys. It can only export private keys.


I am a Navy Vetern and software developer sipretium quis, sem. Nulla consequat massa quis enim.Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.
Advance fullstack development from Codefellows
Applied Science from Seattle Central collage
Avation machanic from Naval Air School
1st place in Seattle Hackthon
Graduated with dean list from Seattle center collage
Graduated with honors from garfield high school


Step Definitions & Transforms
41 42 43 |
Given(/^I am a rest client$/) do @restbaby = Client.new("#{@protocol}://#{@server}:#{@port}#{@path}") end |
And
I am a rest client
features/rest_client.feature:8
features/rest_client.feature:17
features/rest_client.feature:29
features/rest_client.feature:41
features/url_parameter.feature:8
features/print_response.feature:11
features/print_response.feature:23
features/print_response.feature:38
features/print_response.feature:53
features/header_options.feature:9
features/header_options.feature:23
features/header_options.feature:38
features/header_options.feature:48
73 74 75 76 |
Then(/^I receive the expected message$/) do expect(@response.code).to eq('200') expect(@response.body).to eq(DEFAULT_MSG) end |
Then
I receive the expected message
features/rest_client.feature:10
features/rest_client.feature:22
features/rest_client.feature:34
features/rest_client.feature:43
features/print_response.feature:13
features/print_response.feature:28
features/print_response.feature:43
features/print_response.feature:55
features/header_options.feature:13
features/header_options.feature:31
features/header_options.feature:41
features/header_options.feature:51
4 5 6 7 8 9 |
Given(/^I have a web service$/) do @protocol = 'http' @server = FigNewton.server @port = FigNewton.port @mockservice = MockRestService.new(@server, @port, @protocol) end |
Given
I have a web service
features/rest_client.feature:6
features/rest_client.feature:15
features/rest_client.feature:27
features/rest_client.feature:39
features/url_parameter.feature:6
features/print_response.feature:6
features/print_response.feature:18
features/print_response.feature:33
features/print_response.feature:48
features/header_options.feature:6
features/header_options.feature:18
features/header_options.feature:36
45 46 47 48 49 50 51 52 |
When(/^I "(GET|DELETE)" from the web service$/) do |type| case type.downcase when 'get' @response = @restbaby.get when 'delete' @response = @restbaby.delete end end |
When
I "GET" from the web service
features/rest_client.feature:9
features/print_response.feature:12
features/header_options.feature:12
features/header_options.feature:40
features/header_options.feature:50
When
I "DELETE" from the web service
features/rest_client.feature:42
features/print_response.feature:54
54 55 56 57 58 59 60 61 62 63 |
When(/^I "(PUT|POST)" to the web service with the following$/) \ do |type, | @message = .strip case type.downcase when 'put' @response = @restbaby.put(@message) when 'post' @response = @restbaby.post(@message) end end |
When
I "PUT" to the web service with the following
features/rest_client.feature:18
features/print_response.feature:24
When
I "POST" to the web service with the following
features/rest_client.feature:30
features/print_response.feature:39
features/header_options.feature:27
11 12 13 14 15 16 17 18 19 20 |
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)"$/) do |type, path| @path = path if type == 'GET' create_get(path) else @path = path @mockservice.store_msg(type, path, DEFAULT_MSG, {}, nil, nil, DEFAULT_RESPONSE) end end |
And
I have "GET" service for "/test"
features/rest_client.feature:7
And
I have "PUT" service for "/test"
features/rest_client.feature:16
And
I have "POST" service for "/test"
features/rest_client.feature:28
And
I have "DELETE" service for "/test"
features/rest_client.feature:40
And
I have "GET" service for "/test?first=1&second=2&third=3"
features/url_parameter.feature:7
22 23 24 25 26 27 28 29 30 |
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" as follows$/) \ do |type, path, | @path = path if type == 'GET' create_get(path, ) else @mockservice.store_msg(type, path, DEFAULT_MSG, {}, nil, nil, ) end end |
And
I have "GET" service for "/test" as follows
features/print_response.feature:7
And
I have "PUT" service for "/test" as follows
features/print_response.feature:19
And
I have "POST" service for "/test" as follows
features/print_response.feature:34
And
I have "DELETE" service for "/test" as follows
features/print_response.feature:49
27 28 29 |
When(/^I have the following headers?$/) do |table| @restbaby.add_headers(table.rows_hash) end |
When
I have the following header
features/header_options.feature:10
features/header_options.feature:24
1 2 3 4 5 6 |
Given(/^I have a secure web service$/) do @protocol = 'https' @server = FigNewton.server @port = FigNewton.port @mockservice = MockRestService.new(@server, @port, @protocol) end |
Given
I have a secure web service
features/header_options.feature:46
78 79 80 81 |
Then(/^I receive a message with "([^"]*)"$/) do || expect(@response.code).to eq('200') expect(@response.body).to eq() end |
Then
I receive a message with "first=1&second=2&third=3"
features/url_parameter.feature:13
65 66 67 |
When(/^I "GET" from the web service with the parameters$/) do |table| @response = @restbaby.get({}, nil, table.rows_hash) end |
When
I "GET" from the web service with the parameters
features/url_parameter.feature:9
Given
/^I have "(GET|DELETE)" service for "([^"]*)" for \
user "([^"]*)" and password "([^"]*)"$/
Rubular
| UNUSED
14 15 16 17 18 |
Given(/^I have "(GET|DELETE)" service for "([^"]*)" for \ user "([^"]*)" and password "([^"]*)"$/) do |type, path, user, password| @path = path @mockservice.store_msg(type, path, DEFAULT_MSG, {}, user, password) end |
No steps were found to match this step definition.
Given
/^I have "(PUT|POST)" service for "([^"]*)" for \
user "([^"]*)" and password "([^"]*)"$/
Rubular
| UNUSED
20 21 22 23 24 25 |
Given(/^I have "(PUT|POST)" service for "([^"]*)" for \ user "([^"]*)" and password "([^"]*)"$/) do |type, path, user, password, table| @path = path @headers = table.rows_hash @mockservice.store_msg(type, path, DEFAULT_MSG, @headers, user, password) end |
No steps were found to match this step definition.
Given
/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" \
with the following headers$/
Rubular
| UNUSED
8 9 10 11 12 |
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" \ with the following headers$/) do |type, path, table| @path = path @mockservice.store_msg(type, path, DEFAULT_MSG, table.rows_hash, nil, nil, DEFAULT_RESPONSE) end |
No steps were found to match this step definition.
31 32 33 34 |
Given(/^I have basic auth for user "([^"]*)" \ and password "(.*?)"$/) do |user, password| @restbaby.set_auth(user, password) end |
No steps were found to match this step definition.
And
I have basic auth for user "test" and password "rest"
features/header_options.feature:39
features/header_options.feature:49
And
I have "GET" service for "/test" for user "test" and password "rest"
features/header_options.feature:37
features/header_options.feature:47
And
I have "POST" service for "/test" with the following headers
features/header_options.feature:19
And
I have "GET" service for "/test" with the following headers
features/header_options.feature:7


Company
About Cosmiqo
A team of technology enthuasists that specialises in supply chain analytics and operations management innovation.
Supply chain is one of the most integral part of the global economy.
While the rest of the world continues to progress at a rapid pace,
data-driven decision making has remained elusive for most large enterprise supply chains.
Tomorrow’s fulfilment, today. Experience the power of A.I.-enabled system-agnostic orchestration, optimization and visibility platform for people & robot warehousing and supply chains today.
Our trail-blazing team have been involved in running global supply chains, enabling the technological evolution of logistics and are at the forefront of some of its largest strategic changes.
➔ Get to know usWe are continuously challenging the status quo of supply chains and the logistics industry. We are trusted by the world's leading companies and industry-leading partners. Find out what Cosmiqo has been up to and reach out to the press team.
➔ Visit NewsroomYearn to make a change in supply chain or robotics? We have bold ideas on how to transform these industries with data. We have innovators in every role, and at every level. Join us today!
➔ View opportunitiesFind out more about how we are realizing tomorrow’s fulfilment, today.
➔ View ProductsDiscover how we tackle today's warehousing challenges.
➔ View SolutionsCosmiqo partners are the foundation of our success. Find out how you can leverage on or be part of our partner network today.
➔ Learn moreMeet the team of trail-blazers working to bring logistics to the future.
➔ Learn MoreFind out what Cosmiqo has been up to and reach out to the press team.
➔ Visit NewsroomYearn to make a change in supply chain or robotics? Join our team of innovators.
➔ View Job Openings


Change Phone Status
Note:
Click the button above to propagate all phone status values selected on the right hand side to the fake phonehub manager.
Mobile Status
[[getMobileStatusName_(item)]]
Signal Strength
[[getSignalStrengthName_(item)]]
Charging State
[[getChargingStateName_(item)]]
Battery Saver
[[getBatterySaverStateName_(item)]]
Mobile Provider
Battery Percentage


Real Time PCR primers used for the detection of HERVs. The accession, region, sequence, polarity and product size for the primers used are reflected


Trifolia Workbench is a browser-based application connected to an SQL database. Use it to browse, edit and create templates/profiles, value sets, and implementation guides. You can then export information in a variety of formats, and can generate Schematron code for use in creating applications.
Trifolia supports the following core standards:
This documentation can be downloaded the following additional formats:


Confidential material under the terms of the Limited Distribution Non-disclosure Agreement between Comcast and CableLabs
This page tests for the existence of certain Media Source Extensions (MSE) and Encrypted Media Extensions (EME) APIs in the browsers on which it runs. Please note that the existence of these APIs does not necessarily indicate the existence of all required APIs. It is merely a general indication of whether or not a particular browser has implemented the extension specifications
Global
| API |
Supported? |
Comments |
MediaKeys |
|
HTMLMediaElement
| API |
Supported? |
Comments |
mediaKeys |
|
setMediaKeys(MediaKeys mediakeys) |
|
MediaKeys
| API |
Supported? |
Comments |
MediaKeys() |
|
isTypeSupported() |
|
Content Decryption Modules (CDM)
| CDM |
Key String |
Supported? |


The Bookworm
Delve into the ocean of knowledge
The NightSky
Explore the billion star hotel
The Speed Run
Keep dem legs movin'


Reset
photo_camera
camera_rear
Capturing background...
Hide statistics
Capture background
Lower value of Hue channel:
0
Upper value of Hue channel:
33
Lower value of Saturation channel:
100
Upper value of Saturation channel:
255
Lower value of Brigtness channel:
70
Upper value of Brigtness channel:
255


Big data analysis
Which impact on market research ?
Question at the forum
What is the impact of big data on market research ?
...But raised more questions
- Impact on the way market research is done ?
- Impact on the skills of researcher ?
Structure of this talk
- Big data's impact on market research field
- Big data's impact on researchers skills
- Case study
Big data in practice
Which impact on market research
Volume of data and spontaneity
Real-time features
Lower cost of data
Big data in practice
Which impact on researcher
New jobs opportunies...
... new skills needed...
... to produce information
Challenging
Expensive
Diffuse
New


{% extends "base.html" %} {% load bootstrap3 %} {% block content %}
Title: {{issue.title}}
Project: {{issue.project}}
Atribute: {{issue.atribute}}
Reporter: {{issue.reporter}}
Assigned to: {{issue.assigned_to}}
Status: {{issue.status}}
Milestone: {{issue.milestone}}
IssueType: {{issue.issueType}}
Priority: {{issue.priority}}
{{commit.hashcode|slice:":10"}}
{{commit.message}}
{{comment.message}} Edit Delete
{{comment.message}}


Hot Restaurant
We only have 5 tables!
View Tables
Make Reservations
API Table Link
API Wait List


Power Management
Peripheral device power management is usually handled by device drivers and the operating system. If a device isn't in use, the driver automatically keeps that device in its lowest power state.
App behaviour drives power consumption. If app code is uses a peripheral device when it doesn't need to, power will be wasted. Power is also wasted if app code runs busy-wait loops or periodically polls for events.
To conserve power, apps should register call-back functions only triggered when events occur. This way app code only runs when an event occurs, rather than waking up to check for events that haven't happened. Every CPU cycle uses power, so when a power-sensitive app is woken up, it should execute as few instructions as possible before going back to sleep.
When all threads are sleeping, the O/S will reduce the CPU power state automatically. When an event handler function returns back to the Legato event loop, it puts the thread to sleep (unless there's another event waiting). If your thread isn't running the Legato event loop, block your thread to put it to sleep when it's not working through poll()
, select()
, read()
, write()
, recv()
, etc.
If you use a periodic timer (like Timer API) to wake up your app, it will consume power. Set the timer period as long possible to conserve power, and let the O/S go into deeper sleep states.
To maximize power savings, the system can use the Linux auto-sleep feature. Unless the system is busy processing a non-deferrable event, this feature puts the hardware into a SUSPEND
state where all peripherals and the CPU are placed into low-power mode. Apps with the appropriate credentials have the option to control the system power state while performing critical operations.
Use Legato's Power Manager to control the system's wake-up (powered) state. Operations needing fast response times or those resulting in high interrupt rates may benefit from keeping the system awake. This provides better performance, but worse power efficiency.
See Manage Device Power for info on how to write power-efficient apps.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.


(If this page doesn't show up as plain text, use your browser's "View Source" feature.)
| Outer Table |
|
|---|
For more practical examples, see the Periodic Table of the Elements, WebElements.
You can see a variety of table cellspacing and cellpadding attributes demonstrated.


| ********** Mapped Logic ********** |
|
FDCPE_CLOCK_ENABLE0/s_cnt0: FDCPE port map (CLOCK_ENABLE0/s_cnt(0),CLOCK_ENABLE0/s_cnt_D(0),clk_i,'0','0','1');
CLOCK_ENABLE0/s_cnt_D(0) <= (BTN0 AND NOT CLOCK_ENABLE0/s_cnt(0) AND NOT CLOCK_ENABLE0/s_cnt(10) AND NOT CLOCK_ENABLE0/s_cnt(11) AND NOT CLOCK_ENABLE0/s_cnt(12) AND NOT CLOCK_ENABLE0/s_cnt(13) AND NOT CLOCK_ENABLE0/s_cnt(14) AND NOT CLOCK_ENABLE0/s_cnt(2) AND NOT CLOCK_ENABLE0/s_cnt(3) AND NOT CLOCK_ENABLE0/s_cnt(4) AND NOT CLOCK_ENABLE0/s_cnt(5) AND NOT CLOCK_ENABLE0/s_cnt(6) AND NOT CLOCK_ENABLE0/s_cnt(7) AND NOT CLOCK_ENABLE0/s_cnt(8) AND NOT CLOCK_ENABLE0/s_cnt(9) AND NOT CLOCK_ENABLE0/s_cnt(15)); |
|
FDCPE_CLOCK_ENABLE0/s_cnt1: FDCPE port map (CLOCK_ENABLE0/s_cnt(1),CLOCK_ENABLE0/s_cnt_D(1),clk_i,'0','0','1');
CLOCK_ENABLE0/s_cnt_D(1) <= ((BTN0 AND CLOCK_ENABLE0/s_cnt(0) AND NOT CLOCK_ENABLE0/s_cnt(10) AND NOT CLOCK_ENABLE0/s_cnt(11) AND NOT CLOCK_ENABLE0/s_cnt(12) AND NOT CLOCK_ENABLE0/s_cnt(13) AND NOT CLOCK_ENABLE0/s_cnt(14) AND NOT CLOCK_ENABLE0/s_cnt(2) AND NOT CLOCK_ENABLE0/s_cnt(3) AND NOT CLOCK_ENABLE0/s_cnt(4) AND NOT CLOCK_ENABLE0/s_cnt(5) AND NOT CLOCK_ENABLE0/s_cnt(6) AND NOT CLOCK_ENABLE0/s_cnt(7) AND NOT CLOCK_ENABLE0/s_cnt(8) AND NOT CLOCK_ENABLE0/s_cnt(9) AND NOT CLOCK_ENABLE0/s_cnt(15) AND NOT CLOCK_ENABLE0/s_cnt(1)) OR (BTN0 AND NOT CLOCK_ENABLE0/s_cnt(0) AND NOT CLOCK_ENABLE0/s_cnt(10) AND NOT CLOCK_ENABLE0/s_cnt(11) AND NOT CLOCK_ENABLE0/s_cnt(12) AND NOT CLOCK_ENABLE0/s_cnt(13) AND NOT CLOCK_ENABLE0/s_cnt(14) AND NOT CLOCK_ENABLE0/s_cnt(2) AND NOT CLOCK_ENABLE0/s_cnt(3) AND NOT CLOCK_ENABLE0/s_cnt(4) AND NOT CLOCK_ENABLE0/s_cnt(5) AND NOT CLOCK_ENABLE0/s_cnt(6) AND NOT CLOCK_ENABLE0/s_cnt(7) AND NOT CLOCK_ENABLE0/s_cnt(8) AND NOT CLOCK_ENABLE0/s_cnt(9) AND NOT CLOCK_ENABLE0/s_cnt(15) AND CLOCK_ENABLE0/s_cnt(1))); |
| FDCPE_CLOCK_ENABLE0/s_cnt2: FDCPE port map (CLOCK_ENABLE0/s_cnt(2),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt3: FDCPE port map (CLOCK_ENABLE0/s_cnt(3),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt4: FDCPE port map (CLOCK_ENABLE0/s_cnt(4),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt5: FDCPE port map (CLOCK_ENABLE0/s_cnt(5),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt6: FDCPE port map (CLOCK_ENABLE0/s_cnt(6),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt7: FDCPE port map (CLOCK_ENABLE0/s_cnt(7),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt8: FDCPE port map (CLOCK_ENABLE0/s_cnt(8),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt9: FDCPE port map (CLOCK_ENABLE0/s_cnt(9),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt10: FDCPE port map (CLOCK_ENABLE0/s_cnt(10),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt11: FDCPE port map (CLOCK_ENABLE0/s_cnt(11),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt12: FDCPE port map (CLOCK_ENABLE0/s_cnt(12),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt13: FDCPE port map (CLOCK_ENABLE0/s_cnt(13),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt14: FDCPE port map (CLOCK_ENABLE0/s_cnt(14),'0',clk_i,'0','0','1'); |
| FDCPE_CLOCK_ENABLE0/s_cnt15: FDCPE port map (CLOCK_ENABLE0/s_cnt(15),'0',clk_i,'0','0','1'); |
| disp_dig_o(0) <= '0'; |
| disp_dig_o(1) <= NOT ('0'); |
| disp_dig_o(2) <= NOT ('0'); |
| disp_dig_o(3) <= NOT ('0'); |
|
disp_seg_o(0) <= ((NOT s_hex(2) AND NOT s_hex(1) AND NOT s_hex(3))
OR (s_hex(2) AND s_hex(1) AND s_hex(0) AND NOT s_hex(3)) OR (s_hex(2) AND NOT s_hex(1) AND NOT s_hex(0) AND s_hex(3))); |
|
disp_seg_o(1) <= (s_hex(0) AND NOT s_hex(3))
XOR ((s_hex(2) AND NOT s_hex(1) AND s_hex(0)) OR (NOT s_hex(2) AND s_hex(1) AND NOT s_hex(0) AND NOT s_hex(3))); |
|
disp_seg_o(2) <= ((s_hex(0) AND NOT s_hex(3))
OR (s_hex(2) AND NOT s_hex(1) AND NOT s_hex(3)) OR (NOT s_hex(2) AND NOT s_hex(1) AND s_hex(0))); |
|
disp_seg_o(3) <= ((s_hex(2) AND s_hex(1) AND s_hex(0))
OR (s_hex(2) AND NOT s_hex(1) AND NOT s_hex(0) AND NOT s_hex(3)) OR (NOT s_hex(2) AND s_hex(1) AND NOT s_hex(0) AND s_hex(3)) OR (NOT s_hex(2) AND NOT s_hex(1) AND s_hex(0) AND NOT s_hex(3))); |
|
disp_seg_o(4) <= ((s_hex(2) AND s_hex(1) AND s_hex(3))
OR (s_hex(2) AND NOT s_hex(0) AND s_hex(3)) OR (NOT s_hex(2) AND s_hex(1) AND NOT s_hex(0) AND NOT s_hex(3))); |
|
disp_seg_o(5) <= (s_hex(2) AND NOT s_hex(0))
XOR ((s_hex(2) AND NOT s_hex(1) AND NOT s_hex(3)) OR (s_hex(1) AND s_hex(0) AND s_hex(3))); |
|
disp_seg_o(6) <= ((s_hex(2) AND NOT s_hex(0) AND NOT s_hex(3))
OR (s_hex(2) AND NOT s_hex(1) AND s_hex(0) AND s_hex(3)) OR (NOT s_hex(2) AND s_hex(1) AND s_hex(0) AND s_hex(3)) OR (NOT s_hex(2) AND NOT s_hex(1) AND s_hex(0) AND NOT s_hex(3))); |
|
FDCPE_s_en: FDCPE port map (s_en,s_en_D,clk_i,'0','0','1');
s_en_D <= NOT (((NOT BTN0) OR (NOT CLOCK_ENABLE0/s_cnt(0) AND NOT CLOCK_ENABLE0/s_cnt(10) AND NOT CLOCK_ENABLE0/s_cnt(11) AND NOT CLOCK_ENABLE0/s_cnt(12) AND NOT CLOCK_ENABLE0/s_cnt(13) AND NOT CLOCK_ENABLE0/s_cnt(14) AND NOT CLOCK_ENABLE0/s_cnt(2) AND NOT CLOCK_ENABLE0/s_cnt(3) AND NOT CLOCK_ENABLE0/s_cnt(4) AND NOT CLOCK_ENABLE0/s_cnt(5) AND NOT CLOCK_ENABLE0/s_cnt(6) AND NOT CLOCK_ENABLE0/s_cnt(7) AND NOT CLOCK_ENABLE0/s_cnt(8) AND NOT CLOCK_ENABLE0/s_cnt(9) AND NOT CLOCK_ENABLE0/s_cnt(15)) OR (NOT CLOCK_ENABLE0/s_cnt(10) AND NOT CLOCK_ENABLE0/s_cnt(11) AND NOT CLOCK_ENABLE0/s_cnt(12) AND NOT CLOCK_ENABLE0/s_cnt(13) AND NOT CLOCK_ENABLE0/s_cnt(14) AND NOT CLOCK_ENABLE0/s_cnt(2) AND NOT CLOCK_ENABLE0/s_cnt(3) AND NOT CLOCK_ENABLE0/s_cnt(4) AND NOT CLOCK_ENABLE0/s_cnt(5) AND NOT CLOCK_ENABLE0/s_cnt(6) AND NOT CLOCK_ENABLE0/s_cnt(7) AND NOT CLOCK_ENABLE0/s_cnt(8) AND NOT CLOCK_ENABLE0/s_cnt(9) AND NOT CLOCK_ENABLE0/s_cnt(15) AND NOT CLOCK_ENABLE0/s_cnt(1)))); |
|
FDCPE_s_hex0: FDCPE port map (s_hex(0),s_hex_D(0),clk_i,'0','0','1');
s_hex_D(0) <= ((BTN0 AND s_hex(0) AND NOT s_en) OR (BTN0 AND NOT s_hex(0) AND s_en)); |
|
FTCPE_s_hex1: FTCPE port map (s_hex(1),s_hex_T(1),clk_i,'0','0','1');
s_hex_T(1) <= ((NOT BTN0 AND s_hex(1)) OR (BTN0 AND s_hex(0) AND s_en)); |
|
FTCPE_s_hex2: FTCPE port map (s_hex(2),s_hex_T(2),clk_i,'0','0','1');
s_hex_T(2) <= ((s_hex(2) AND NOT BTN0) OR (BTN0 AND s_hex(1) AND s_hex(0) AND s_en)); |
|
FTCPE_s_hex3: FTCPE port map (s_hex(3),s_hex_T(3),clk_i,'0','0','1');
s_hex_T(3) <= ((NOT BTN0 AND s_hex(3)) OR (s_hex(2) AND BTN0 AND s_hex(1) AND s_hex(0) AND s_en)); |
|
Register Legend:
FDCPE (Q,D,C,CLR,PRE,CE); FDDCPE (Q,D,C,CLR,PRE,CE); FTCPE (Q,D,C,CLR,PRE,CE); FTDCPE (Q,D,C,CLR,PRE,CE); LDCP (Q,D,G,CLR,PRE); |


I am a Responsive Designer & Developer who focuses on providing clean, visually pleasing designs. When I'm not working or learning more about my craft, I can be found spending time with my dogs, hiking, birding and enjoying the outdoors.
I am a Responsive Designer & Developer who focuses on providing clean, visually pleasing designs. When I'm not working or learning more about my craft, I can be found spending time with my dogs, hiking, birding and enjoying the outdoors.
I was born and raised in Southern California but I decided at a very early age that I wanted to see other parts of the country and the world. I decided to join the Peace Corps where I worked in elementary education.
After the Peace Corps, my husband and I as well as our dogs took various jobs all over the western U.S. After working in Alaska for a year, I decided I was ready to stop living like a gypsy and settle down. I accepted a job teaching Kindergarten in SW Colorado and bought a house.
I now live in southern Arizona and I have realized that I belong in the southwest. I love the climate, the topography and the diverse bird, plant and animal life.


(Route : File Menu, Search Command, Save Search As Button)
The Save Search dialog box allows you to save the criteria that you have set up for a particular search so that you can easily retrieve the settings for later use.
Enter the name that you'd like to save the current search criteria as in the Save Search As text box. Click OK to save your search.
You will be able to add searches that you do save as buttons on the toolbar.


Assuming Fixed Costs are distributed evenly across each business line, this is the profitability
| Business Unit | Profits |
|---|---|
| A | $400 |
| B | $0 |
| C | (-$200) |
| Total | $200 |
If variable costs increase to $500 then the loss on unit C will be equal to the extra fixed costs that would be charged to other business units
This would be a 25% increase in Variable Costs


Feature Exhibit
The Kentucky Derby Museum is a 501(c)3 non-profit organization that continues to engage, educate, and excite everyone about the extraordinary experience that is the Kentucky Derby thanks to our Museum visitors and community supporters, including the following:


AMELIE OF MONTMARTE RATING: 7/10 http://www.joblo.com/amelie.htm
For more reviews and movie trailers, visit http://www.joblo.com/
PLOT: A peculiar French girl grows up lonely with her father and doesn't quite know what she wants out of life. One day, she falls upon something, and believes that her ticket to happiness may be in helping others. She starts with the people around her, but when she suddenly falls for her own guy, she can't act strongly enough because of her shy and dreamy nature.
CRITIQUE: A clever, quirky, original French flick set in a picturesque Paris, featuring an endearing lead with a giant imagination, much loneliness and a little bit of love for everyone. This is a "feel-good" kind of movie, a fairy tale for grown-ups who are bummed out about life. It doesn't pretend to be deep, it doesn't weigh itself down with long expositions or intricate studies of its characters, it's basically just a "cute movie" in the same vein as CHOCOLAT and PAY IT FORWARD, with some amazing visuals and incredibly nice intentions (and if CHOCOLAT was somehow able to nab an Oscar nomination for Best Picture last year (a sham on so many different levels), you might as well slap this film up for consideration also, since it's quite a bit better and much more original than the former). One thing that this film isn't though, at least according to me, is the best film of the year (it was bestowed the honor of "best" in at least 3 different film festivals so far this year). It actually managed to stagnate a little bit about halfway through and it just went on for way too long (it's a little over two hours but it felt even longer), with much of the second half of the movie devoted to many different characters, all of whom weren't as interesting as the lead, and a lot of indecisiveness from Ms. Amelie herself, which got frustrating. Thankfully, this film doesn't bog itself down with too much of that stuff, and actually goes out of its way to invent new ways to shoot scenes, to integrate moments of fantasy into its fabric and to transport the audience inside the imagination of this kind-hearted French girl.
On the whole, it's a lot of fun and it carries a beautiful message of love and support for your fellow man. The lead, Audrey Tautou, is perfect for the role, and gives you enough moments of truth to develop her character into someone that you care about by the end of the film. Unfortunately, the rest of the cast isn't as well-developed, and even though most of them are pretty appealing, a couple could've been left out to save time and at least one was left stranded plot-wise, by the film's end (what happened to the guy in the café who was spying on his ex-girlfriend the whole movie?). Now I haven't seen too many recent French films, I will admit, but if this is the kind of "scene" that they're developing over in "le pays du vin", I wouldn't mind catching more of their flicks in the future (CRIMSON RIVERS was another French film that I saw earlier this year, which I really liked- ironically, that film was directed by Mathieu Kassovitz, who is the co-star in this film). Granted, the English subtitles got a little tough to keep up with at times (I speak and understand French also, but some of the local colloquialisms went over my head), especially since the film's visuals were so intriguing that you just couldn't help but constantly gawk at them, but the general idea, the background music, the nifty French neighborhoods, the very creative way of enveloping the audience into the story-line from the start, were all very easy to appreciate, and I for one was especially glad to have seen this movie during these trying times in the world. In fact, I'd recommend it to anyone looking for a jolly ol' time at the movie house, with a particular emphasis on folks with a lot of imagination, a little loneliness in their lives and many dreams in their hearts. And this guy directed ALIEN: RESURRECTION? Get outta here!!
Note: I especially loved the way that the script detailed and showed the loves/hates of everyone with exact mentions in the film. It was very original, very well shot and very nostalgic, as many of us were able to relate to the behaviors described. Good stuff!
Where's JoBlo coming from? Chocolat (6/10) - Crimson Rivers (8/10) - Ghost World (9/10) - Like Water For Chocolate (8/10) - O Brother, Where Art Thou (7/10) - Pay It Forward (5/10) - Rushmore (9/10) - Woman on Top (7/10)
Review Date: September 27, 2001 Director: Jean-Pierre Jeunet Writers: Jean-Pierre Jeunet and Guillaume Laurant Producer: Jean-Marc Deschamps Actors: Audrey Tautou as Amelie Poulain Mathieu Kassovitz as Nino Quincampoix Rufus as Raphal Poulain Genre: Comedy Year of Release: 2001 ------------------------------------- JoBlo's Movie Emporium http://www.joblo.com/ ------------------------------------- (c) 2001 Berge Garabedian
========== X-RAMR-ID: 29611 X-Language: en X-RT-ReviewID: 251808 X-RT-TitleID: 10000638 X-RT-SourceID: 573 X-RT-AuthorID: 1021 X-RT-RatingText: 7/10
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


SHOOTING FISH
A Film Review by James Berardinelli
RATING: ** OUT OF ****
United Kingdom, 1997 U.S. Release Date: 5/15/98 (limited) Running Length: 1:45 MPAA Classification: PG (Profanity, mature themes) Theatrical Aspect Ratio: 1.85:1
Cast: Dan Futterman, Stuart Townsend, Kate Beckinsale Director: Stefan Schwartz Producers: Richard Holmes, Glynis Murray Screenplay: Richard Holmes, Stefan Schwartz Cinematography: Henry Braham Music: Stanislas Syrewicz U.S. Distributor: Fox Searchlight
SHOOTING FISH is a feather-light comedy about a pair of "likable" con men whose plans to live the good life are knocked off track by bad timing and an unexpected romance. While the British release, which probably has aspirations of connecting with the FOUR WEDDINGS AND A FUNERAL crowd, offers an occasional worthwhile joke, it's ultimately so lacking in substance that it becomes difficult to care about anyone or anything. The probable argument in favor of SHOOTING FISH is that the movie generates a warm, fuzzy feeling. My response to this is to note that the only ones likely to experience such a sense of muted bliss are those who turn off their brains. The film is preposterous to the point of distraction, where the necessary level of suspension of disbelief exceeds the capacity of a normal, thinking person. The approach would be forgivable if the movie was genuinely funny or otherwise endearing, but moments of laughter and charm are infrequent and widely-spaced.
Con men often make for delightful motion picture protagonists, because their presence allows screenwriters to devise all sorts of intricate moves in various games of deception. Alas, that's not the case here. The heroes are Dylan (Dan Futterman) and Jez (Stuart Townsend), and, although they have devoted their lives to bilking rich people out of money, their schemes are so banal that it's understandable if a viewer loses interest. Even the opening gambit, with the pair selling a "voice-activated computer," isn't remotely credible. And it's hard to feel any sympathy for the victims, who are either (a) nasty men getting what's coming to them, (b) gullible fools who deserve to be ripped off, or (c) both.
Theoretically, Dylan and Jez are in the con business because it's the fastest way to make the two million pounds they need to buy a big mansion. In reality, that's just an excuse for their lifestyle of adrenaline-generating close shaves. As Georgie (Kate Beckinsale), their secretary-turned-accomplice-turned love interest notes, they're "compulsive risk-takers who thrive on danger." Of course, hanging out with Dylan and Jez has an effect on her, and it's not long before she too catches the bug and is flirting with the law in order to swindle money out of a thoroughly despicable, filthy rich victim.
Dan Futterman (Robin Williams' son in THE BIRDCAGE) plays Dylan, an American in London, with a certain oily charm. Supposedly, there's a heart lurking beneath his slick exterior, but it's not often in evidence. Stuart Townsend is Dylan's partner, Jez, a technical wizard with no social skills.  The third member of the trio, and the one with the most spark, is Kate Beckinsale. With her dark hair cropped short, Beckinsale looks different than in her previous roles, which include Hero in Kenneth Branagh's MUCH ADO ABOUT NOTHING and the lead in John Schlesinger's COLD COMFORT FARM.
Watching SHOOTING FISH is a lot like drinking carbonated water. There's a little bit of fizz, and the sensation isn't unpleasant, but the whole experience fails to offer much satisfaction. SHOOTING FISH is a harmless dud, and any minor pleasure it generates vanishes so quickly that it's hard to believe it was actually there in the first place. The movie frequently treads a line between being marginally engaging and painfully trite. Unfortunately, when all is said and done, a majority of the scenes fall in the latter camp rather than in the former.
Copyright 1998 James Berardinelli
- James Berardinelli e-mail<EMAIL_ADDRESS>Now with more than 1400 reviews... The ReelViews web site: http://movie-reviews.colossus.net/
"My belief is that no movie, nothing in life, leaves people neutral.
-- David Puttnam
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
Package /org/apache/commons/validator/javascript | |||||||
| PREV NEXT | FRAMES NO FRAMES |
This document is the API Specification for Package /org/apache/commons/validator/javascript.
The validator javascript package provides a series of functions to
validate form input data
.
| Field
Type |
validate Byte |
validate CreditCard |
validate Date |
validate |
validate Float |
validate FloatRange |
validate IntRange |
validate Integer |
validate Mask |
validate MaxRange |
validate MinRange |
validate Required |
validate Short |
| checkbox |
|||||||||||||
| file | 1 |
||||||||||||
| hidden 2 | |||||||||||||
| password | |||||||||||||
| radio | |||||||||||||
| select-multiple | |||||||||||||
| select-one | |||||||||||||
| text | |||||||||||||
| textarea |
Notes
| 1) | Since few browser support the 'accept' attribute for file upload input fields, a mask can be used to validate the uploaded file extension. |
|
|---|---|---|
| 2) | Hidden fields can be used with complicated HTML interface. like cascading inter-dependent menus. The menus themselves don't represent real data fields, but are used with javascript to set the value of a hidden field. |
|
Package /org/apache/commons/validator/javascript | |||||||
| PREV NEXT | FRAMES NO FRAMES |


--- layout: page title: About Me description: This is what I do. background: '/img/bg-about.jpg' ---
My journey with Salesforce started around 2010. Began my journey converting a .net app to Salesforce. Since then I’ve traveled with this amazing technology.
I’ve worked implementing Salesforce for a Non-profit, Government, a major Financial institution and now for Verizon.


ramda-redux is a library for reducing Redux code.
github: ramda-redux
npm: ramda-redux
sample:ramda-redux-sample
With ramda-redux
//./reducer/index.js
// create a reducer for createStore function
import R from 'ramda'
import {Pattern,Reducer,Matcher} from 'ramda-redux'
const addNumberPattern = Pattern(
'addNumber',
(state, payload) => R.over(
R.lensProp('n'),
R.inc,
state
)
)
const reducer = Reducer(
{n: 0},
Matcher(
addNumberPattern
)
)
const store = createStore(reducer)
//./component/addNumber.js
// create a React component
import React from 'react'
import {connect} from 'react-redux'
import R from 'ramda'
import {Action} from 'ramda-redux'
import {Button} from 'antd'
const Link = ({n, addNumber}) =>

{n}

<Button onClick={addNumber} type="primary">addNumber</Button>

export default connect(
R.pick(['n']),
dispatch => (
{
addNumber: () => dispatch(Action('addNumber'))
}
)
)(Link)
Using Pattern
factory function to create some instances of Pattern.
Passing this instances(pattern) to Matcher
factory function.
Passing the instance of Matcher
to Reducer factory function, the return is a function that satisfy Redux.createStore
.
Using connect
same as traditional Redux
way
Pattern
for handle action from store.dispatch(someAction)
rather than the Javascript keyword switch
. In this way, we could combine reducer
without combineReducers
,more concise. Consider follow code:
//./redux/pattern/increase.js
export default Pattern(
'increase',
(state,{incremental})=>R.over(
R.lensProp('number'),
R.add(incremental),
state
)
)
//.redux/pattern/reduce.js
export default Pattern(
'reduce',
(state,{reduction})=>R.over(
R.lensProp('number'),
R.add(reduction),
state
)
)
//.redux/index.js
import increasePattern from './pattern/increase'
import reducePattern from './pattern/reduce'
export default Reducer(
{number:0},
Matcher(
increasePattern,
reducePattern
)
)
Action
factory function to new a action, and specify the action
must has unite structure that:
{
type: 'someType',
payload: someData
}
So we cound use ramda pure function generate a new state conveniently.


Note on Aug. 31, 2019
| Date: | Aug 31, 2019 |
|---|---|
| Last Updated: | Sep 4, 2019 |
| Categories: | |
| Tags: |
Contents
Introduction
In the notes on May 16, we have already talked about the Adam algorithm. Combining the first-order momentum and the adaptive learning rate, Adam performs the normalization on the gradients. When the gradient is too strong, Adam correct it by reducing the learning rate, vice versa. In the aforementioned notes, we have explained why Adam is designed like this and pointed out that the proof of Adam is not correct. In this topic, we would talk about another paper, which is aimed at correcting the problem of Adam and giving a correct proof. The paper where we discuss the theory and proof is in the following paper:
In this article, the author proposes tha Adam would not get converged in some cases. In the introduction part, the author points out that the existing adaptive methods are easy to eliminate the influences from the minibatches with large gradients, which makes those algorithms would not get converged on a convex problem. As an alternative, the proposed algorithm, AMSGrad, has solved such a problem. It could be summarized as below:
- Denotation:
- $T$: iteration number;
- $\alpha_t$: step size on time $t$;
- $\delta$: small indefinite amount that is usually 1e-8;
- $\rho_1,~\rho_2$: two decay rates;
- $\mathbf{s}$: momentum which is initialized as $\mathbf{0}$;
- $\mathbf{r}$: adaptive learning rate which is initialized as a diagonal matrix $\mathrm{diag}(\mathbf{0})$.
- $\tilde{\mathbf{r}}$: corrected adaptive learning rate which is initialized as a diagonal matrix $\mathrm{diag}(\mathbf{0})$.
- Then in each iteration $t={1,~2,~3,~\cdots,~T}$, we have
- Pick m samples randomly from a set (or pick those samples in sequence from a randomly shuffled set). We call the m samples $(\mathbf{x}_k,~\mathbf{y}_k)$ as a batch;
- Calculate the gradient $\mathbf{g} = \frac{1}{m} \nabla_{\boldsymbol{\Theta}} \sum\limits_{k=1}^m \mathcal{L} \left( \mathbf{y}_k,~ \mathcal{D}_{\boldsymbol{\Theta}} (\mathbf{x}_k) \right)$;
- Update the momentum by $\mathbf{s} \leftarrow \rho_1 \mathbf{s} + (1 - \rho_1) \mathbf{g}$;
- Update the adaptive learning rate by $\mathbf{r} \leftarrow \rho_2 \mathbf{r} + (1 - \rho_2) \mathrm{diag}(\mathbf{g})^2$;
- $\dagger$ Correct the adaptive learning rate by $\tilde{\mathbf{r}} \leftarrow \max \left( \tilde{\mathbf{r}}, \mathbf{r} \right)$;
- Correct the initialization bias by $\hat{\mathbf{s}} \leftarrow \dfrac{\mathbf{s}}{1 - \rho_1^t}$, $\hat{\mathbf{r}} \leftarrow \dfrac{\tilde{\mathbf{r}}}{1 - \rho_2^t}$;
- Update parameters by $\boldsymbol{\Theta} \leftarrow \boldsymbol{\Theta} - \dfrac{ \epsilon }{\delta + \sqrt{\hat{\mathbf{r}}}} \hat{\mathbf{s}}$.
$\dagger$: This is the modification which makes AMSGrad different from Adam. Since it uses the maximal $\mathbf{v}$ to update the learning rate, the gradient direction is guided by the momentum more.
Theory
Abstract framework for adaptive algorithms
The previous adaptive methods are though to have a common abstract framework. We use $\phi$ to represent the momentum function and $\psi$ to represent the adaptive learning rate function. The framework could be described as:
| Abstract framework of adaptive algorithms |
|---|
Such a frame work would be applied on almost all kinds of optimizers in deep learning. After defining the specific $\phi$ and $\psi$, it would becomes a concrete learning algorithm.
| Algorithm | $\phi$ | $\psi$ |
|---|---|---|
| SGD | $g_t$ | $\mathbf{I}$ |
| AdaGrad | $g_t$ | $\sum_{i=1}^t \left( \mathrm{diag}(g_i)^2 \right)$ |
| RMSProp | $g_t$ | $\left( 1 - \beta\right) \sum_{i=1}^t \left( \beta^{t-i}\mathrm{diag}(g_i)^2 \right)$ |
| Adam | $\left( 1 - \beta_1\right) \sum_{i=1}^t \left( \beta_1^{t-i} g_i \right)$ | $\left( 1 - \beta_2\right) \sum_{i=1}^t \left( \beta_2^{t-i}\mathrm{diag}(g_i)^2 \right)$ |
In the above frame work, we apply the projection on the parameters in the last step. Here we define the projection as
where $\mathcal{F}$ is the feasible domain and $\mathbf{A}$ is a diagonal matrix. The projection is required especially when we apply constraints on the optimized parameters. This step could ensure that the parameter would not get out of the feasible domain. In Keras, such a technique has been realized. Users who are interested in the implementation could review the documentation.
Non-convergence of Adam
Start from a strong assumption
The author has proved that Adam would not get converged on such a loss function:
where $C>2$ and the feasible domain is $x \in [-1,~1]$. Note that this loss function is linear and convex.
To learn how it happens, first we need to confirm the optimal regret. Regret function measures the distance between the curren losses and optimal losses in the whole learning process. It is defined as
To find the optimal regret, we only need to locate the minimal point (optimal solution) for the loss function $f_t$. Consider the stochastic function $(2)$, we could find that the expectation of this function is $\mathbb{E}_{t} [f_t (x)] = (\frac{1}{3} C - 1) x$. Since $C>2$, we would find that when $x=-1$, this function has minimal expectation $1 - \frac{1}{3} C$.
Now let us consider the gradient of $f_t (x)$.
For the Adam, we define the hyperparameters as
| Parameter | Value |
|---|---|
| $\beta_1$ | 0 |
| $\beta_2$ | $\dfrac{1}{1 + C^2}$ |
| $\alpha_t$ | $\frac{\alpha}{\sqrt{t}}$ |
| $\mathcal{F}$ | $[-1,~1]$ |
The value of $\beta_2$ is a strong assumption. We would derive how to get this assumption later. Although in most cases, such an assumption may not hold, we could still start from it to begin our derivation.
Assume that $\mathbf{x}_{3t+1} = 1$, then we have $\mathbf{g}_{3t+1} = C$, and
where we define
If we assume that the initial step size $\alpha$ is small enough, i.e. $\alpha < \sqrt{1 - \beta_2}$, then we have $T_1 < 1$, which means $0 < \hat{\mathbf{x}}_{3t+2} < 1$.
Note that in the last step we need to apply $\mathbf{x}_{3t+2} = \Pi_{\mathcal{F},~\mathbf{V}} (\hat{\mathbf{x}}_{3t+2})$. Since $\hat{\mathbf{x}}_{3t+2} \in (0,~1)$, we know that $\hat{\mathbf{x}}_{3t+2}$ is in feasible domain, and then we have $\mathbf{x}_{3t+2} \in (0,~1)$.
Then, consider $3t+2$ and $3t+3$, in the two steps, $\mathbf{g}_{3t+i} = -1$, then we have
Since the updates are positive, from $\mathbf{x}_{3t+2} \in (0,~1)$ we could also infer that $\mathbf{x}_{3t+3},~\mathbf{x}_{3t+4} \in (0,~1]$.
Let us assume that $\hat{\mathbf{x}}_{3t+3} > 1$, according to the projection, we have $\mathbf{x}_{3t+3} = 1$. because $\hat{\mathbf{x}}_{3t+4} > \mathbf{x}_{3t+3}$, there would be $\mathbf{x}_{3t+4} = 1$.
The other case is $\mathbf{x}_{3t+3} = \hat{\mathbf{x}}_{3t+3} \in (0,~1)$. In this case, we need to combine $(5)$ and $(7)$ to determine the bound of $\mathbf{x}_{3t+4}$. First, we have
Like what we have done in $(6)$, we could define $T_2$ and find its bound. To determine the lower bound of $T_2$, we need to find the upper bound of the second order momemtum $\mathbf{v}_{3t+i}$. Since $|\mathbf{g}_{3t+i}| \leqslant C$, we have $\mathbf{v}_{3t+i} \leqslant C^2$, then
To make $T_2 \geqslant T_1$, we need to let the following inequality hold:
From $(10)$, we would get the condition $\beta_2 \leqslant \dfrac{1}{1 + C^2}$ easily. So when we let $\beta_2 = \dfrac{1}{1 + C^2}$, we have $T_2 \geqslant T_1$, which means $\hat{\mathbf{x}}_{3t+4} \geqslant \mathbf{x}_{3t+1} = 1$.
Therefore, in any case, we would find that $\hat{\mathbf{x}}_{3t+4} \geqslant 1$, i.e. we could derive $\mathbf{x}_{3t+4} = 1$ when we start from $\mathbf{x}_{3t+1} = 1$. In this case, we know that for any $t$, there would be $f_{3t+1}(\mathbf{x}_{3t+1}) = C$. Since $f_{3t+1}(\mathbf{x}) \geqslant f_{3t+1}(-1) = -C$, $f_{3t+2}(\mathbf{\mathbf{x}_{3t+2}}),~f_{3t+3}(\mathbf{\mathbf{x}_{3t+3}}) \geqslant -1$ and $f_{3t+2}(\mathbf{-1}),~f_{3t+3}(\mathbf{-1}) = -1$, we could calculate the regret during the 3 steps:
which means the regret could be represented as $R_T = \frac{R_{t,3}}{3} T \geqslant \frac{2C - 4}{3} T$, hence we know $\frac{R_T}{T} \nrightarrow 0$, the algorithm could not get converged.
This derivation is based on a specially designed loss function and three assumptions:
- The initial condition is $\mathbf{x}_{3t+1} = 1$;
- The problem is constrained in a feasible domain $\mathcal{F}=[-1,~1]$;
- The hyperparameter has a bound $\beta_2 \leqslant \dfrac{1}{1 + C^2}$.
The third assumption may not hold for most cases. According to the suggestions from Kingma, we should define a large $\beta_2$ to improve the quality of the solution. Hence, to prove that Adam could not get converged, we still need to generalize this proof.
Generalize the proof in online cases
First, we generalize the loss function. For any $t$,
where $C>0$ and $\mod (C,~2)=0$. The feasible domain is still $x \in \mathcal{F} := [-1,~1]$. This loss function is linear and convex.
Similarly, the minimal point of this linear function is $f_t (-1)$, which means $\sum_{i=t}^{t+C-1} f_t (-1) = - C + ( C - 1 ) = - 1$.
And we still have the gradient
In the following part, we would try to prove that if $C$ is large enough, i.e the following conditions hold, we would prove that the algorithm could not get converged.
| No. | Condition |
|---|---|
| 1 | $(1 - \beta_1) \beta_1^{C-1}C \leqslant 1 - \beta_1^{C-1}$ |
| 2 | $\beta_2^{(C-2)/2}C^2 \leqslant 1$ |
| 3 | $\dfrac{3}{2}(1 - \beta_1) \sqrt{\dfrac{1 + \beta_2}{1 - \beta_2}} \left(1 + \dfrac{\gamma (1 - \gamma^{C-1})}{1 - \gamma} \right) + \dfrac{\beta_1^{C/2-1}}{1 - \beta_1} < \dfrac{C}{2}$, where $\gamma = \dfrac{\beta_1}{\sqrt{\beta_2}}$ |
Assume that $\mod(t,C)=0$. The basic idea of the derivation is inferring $\mathbf{x}_{t+C} = 1$ from $\mathbf{x}_{t} = 1$. In the generalized case, we only assume that $\beta_1 \leqslant \sqrt{\beta_2}$. We start with confirming the bound of momentum $\mathbf{m}$ by Condition 1:
If Condition 1 holds, and let $\mathbf{m}_{t} \leqslant 0$, we could get $\mathbf{m}_{t+C} \leqslant 0$ from $(14)$.
Then we need to set a time point $T’$ to ensure that for any large enough $t \leqslant T’$, we would have $t + C \leqslant \tau^2 t$, where $\tau \leqslant \frac{3}{2}$. Such a condition implies that we only talk about the case when $T \rightarrow \infty$.
After that, we need to specify the range of the second order momentum. Consider that
If we only preserve the term $j=t+1$, we would have
Assume that $t \geqslant kC$, for $i’ \leqslant i \leqslant C$,
Why the last inequality holds? This is because of Condition 2. Due to the condition, we know that we could find a $i’$ that $\beta_2^{i’-1}C^2 \leqslant 1$. So
After confirming the bounds of first order momentum and second order momentum, we could perform the similar derivation on $\mathbf{x}_{t+C}$, like what we have done during the last section:
Since the projection function $\Pi_{\mathcal{F}}$ in this problem is just a simple range correction function, i.e. $\Pi_{\mathcal{F}}(\cdot) = \min(1,~\cdot)$. There is a lemma showing that the final point $\mathbf{x}_{t+C}$ has the lower boundary defined by accumulated updates:
We would talk about the proof in two cases. In the first case, we assume that $\mathbf{x}_{t}=1$, hence our target is to prove $\sum_{i=0}^{C-1} \delta_{t+i} \geqslant 0$. Let us ignore $\delta_t$ firstly.
Consider the first term, we have
Define that $\gamma = \frac{\beta_1}{\sqrt{\beta_2}}$, then we would rewrite the second term as
Substitute $(22)$ and $(23)$ into $(21)$, and let $\gamma = \frac{3}{2}$, $i’=\frac{C}{2}$, then we have
The final inequality holds because of Condition 3. Therefore, we get $\mathbf{x}_{t+C} \geqslant 1$ based on $(20)$ and $(24)$.
Now let us consider the other case, i.e. $\mathbf{x}_{t} < 1$. In this case, we need to prove that $\mathbf{x}_{t+C} \geqslant \mathbf{x}_{t} + \xi$, where $\xi$ is a constant. If such an inequality holds, we would know that for any initial guess, $\mathbf{x}_{t}$ would increase after every $C$ steps until $\mathbf{x}_{t} = 1$. So the Adam could not get converged.
To complete the derivation, we need to take $\delta_t$ into consideration. According to $(19)$, we have
Combine $(24)$ and $(25)$, we would have
In the final equality, $\lambda > 0$ is guaranteed by Condition 3, hence we know that if we start with an arbitrary $\mathbf{x}_{t}$, it will keep increasing until $\mathbf{x}_{t+kC} = 1$.
This proof is not totally strict somehow, for example, $\lambda > 0$ could not guarantee that $\mathbf{x}_{t}$ would not get the super bound before $\mathbf{x}_{t+kC} = 1$. The correct form should be $\lambda > \xi$. Actually, I have fixed some typos in the original article, so you may find that in this part my derivation is a little bit different from the original scripture.
Generalize the proof in stochastic cases
AMSGrad
This article is still being produced. Please wait for several days to see the full edition.


Markov Chain Monte Carlo (MCMC) to run Bayesian split population survival model with exchangeable frailties.
Returns a summary of a exchangeSPsurv object via summary.mcmc
.
Print method for a exchangeSPsurv
x.
Returns a plot of a exchangeSPsurv object via plot.mcmc
.
exchangeSPsurv( duration, immune, Y0, LY, S, data, N, burn, thin, w = c(1, 1, 1), m = 10, ini.beta = 0, ini.gamma = 0, ini.W = 0, ini.V = 0, form = c("Weibull", "exponential", "loglog"), prop.varV, prop.varW, id_WV = unique(data[, S]) ) # S3 method for frailtySPsurv summary(object, parameter = character(), ...) # S3 method for frailtySPsurv print(x, ...) # S3 method for frailtySPsurv plot(x, parameter = character(), ...)
| duration | survival stage equation written in a formula of the form Y ~ X1 + X2 + ... where Y is duration until failure or censoring. |
|---|---|
| immune | split stage equation written in a formula of the form C ~ Z1 + Z2 + ... where C is a binary indicator of immunity. |
| Y0 | the elapsed time since inception until the beginning of time period (t-1). |
| LY | last observation year (coded as 1; 0 otherwise) due to censoring or failure. |
| S | spatial information (e.g. district ID) for each observation that matches the spatial matrix row/column information. |
| data | data.frame. |
| N | number of MCMC iterations. |
| burn | burn-in to be discarded. |
| thin | thinning to prevent from autocorrelation. |
| w | size of the slice in the slice sampling for (betas, gammas, rho). Write it as a vector. E.g. c(1,1,1). |
| m | limit on steps in the slice sampling. A vector of values for beta, gamma, rho. |
| ini.beta | initial value for the parameter vector beta. By default is 0. |
| ini.gamma | initial value for the parameter vector gamma. By default is 0. |
| ini.W | initial value for the parameter vector W. By default is 0. |
| ini.V | initial value for the parameter vector V. By default is 0. |
| form | type of parametric model (Weibull, Exponential, or Log-Logistic). |
| prop.varV | proposed variance for V in Metropolis-Hastings. |
| prop.varW | proposed variance for W in Metropolis-Hastings. |
| id_WV | vector of type character that modifies the colnames of W and V in the model’s result. By default is |
| object | an object of class |
| parameter | one of five parameters of the |
| ... | additional parameter. |
| x | an object of class |
exchangeSPsurv returns an object of class "frailtySPsurv"
.
An "exchangeSPsurv"
object has the following elements:
matrix, numeric values of the posterior for each variable in the duration equation .
matrix, numeric values of the posterior for each variable in the immune equation.
vector, numeric values of rho.
vector, numeric values of lambda.
vector, numeric values of delta.
matrix, numeric values of the posterior for Ws.
matrix, numeric values of the posterior for Vs.
matrix of X's variables.
matrix of Z's variables.
vector of `Y'.
vector of `Y0'.
vector of `C'.
vector of `S'.
numeric initial values of beta.
numeric initial values of gamma.
numeric initial values of W.
numeric initial values of V.
character, type of distribution.
description for the model to be estimated.
# \donttest{ ## 1 walter <- spduration::add_duration(Walter_2015_JCR,"renewed_war", unitID = "ccode", tID = "year", freq = "year", ongoing = FALSE)#> Warning: Converting to 'Date' class with yyyy-06-30# add S walter <- spatial_SA(data = walter, var_ccode = "ccode", threshold = 800L) set.seed(123456) model <- exchangeSPsurv( duration = duration ~ fhcompor1 + lgdpl + comprehensive + victory + instabl + intensityln + ethfrac + unpko, immune = cured ~ fhcompor1 + lgdpl + victory, Y0 = 't.0', LY = 'lastyear', S = 'sp_id' , data = walter[[1]], N = 100, burn = 10, thin = 10, w = c(1,1,1), m = 10, form = "Weibull", prop.varV = 1e-05, prop.varW = 1e-05, ) print(model)#> Call: #> exchangeSPsurv(duration = duration ~ fhcompor1 + lgdpl + comprehensive + #> victory + instabl + intensityln + ethfrac + unpko, immune = cured ~ #> fhcompor1 + lgdpl + victory, Y0 = "t.0", LY = "lastyear", #> S = "sp_id", data = walter[[1]], N = 100, burn = 10, thin = 10, #> w = c(1, 1, 1), m = 10, form = "Weibull", prop.varV = 1e-05, #> prop.varW = 1e-05) #> #> #> Iterations = 1:9 #> Thinning interval = 1 #> Number of chains = 1 #> Sample size per chain = 9 #> #> Empirical mean and standard deviation for each variable, #> plus standard error of the mean: #> #> #> Duration equation: #> Mean SD Naive SE Time-series SE #> (Intercept) 1.37905266 0.66895063 0.22298354 0.22298354 #> fhcompor1 -1.05208201 0.41173391 0.13724464 0.13724464 #> lgdpl 0.09177184 0.09222484 0.03074161 0.03074161 #> comprehensive -0.62867094 0.59109153 0.19703051 0.18385024 #> victory 0.29303499 0.58880263 0.19626754 0.19626754 #> instabl 1.01191934 0.50979179 0.16993060 0.08099278 #> intensityln -0.02981777 0.08536595 0.02845532 0.02845532 #> ethfrac 0.21749487 0.71230113 0.23743371 0.09423386 #> unpko 0.42351151 0.40632993 0.13544331 0.13544331 #> #> Immune equation: #> Mean SD Naive SE Time-series SE #> (Intercept) 0.04137955 1.515039 0.5050131 0.5050131 #> fhcompor1 -0.62513545 2.151090 0.7170301 0.7170301 #> lgdpl -1.40500156 1.170416 0.3901386 0.3901386 #> victory 0.38827123 1.738965 0.5796550 0.5796550 #>#> #> Iterations = 1:9 #> Thinning interval = 1 #> Number of chains = 1 #> Sample size per chain = 9 #> #> 1. Empirical mean and standard deviation for each variable, #> plus standard error of the mean: #> #> Mean SD Naive SE Time-series SE #> (Intercept) 1.37905 0.66895 0.22298 0.22298 #> fhcompor1 -1.05208 0.41173 0.13724 0.13724 #> lgdpl 0.09177 0.09222 0.03074 0.03074 #> comprehensive -0.62867 0.59109 0.19703 0.18385 #> victory 0.29303 0.58880 0.19627 0.19627 #> instabl 1.01192 0.50979 0.16993 0.08099 #> intensityln -0.02982 0.08537 0.02846 0.02846 #> ethfrac 0.21749 0.71230 0.23743 0.09423 #> unpko 0.42351 0.40633 0.13544 0.13544 #> #> 2. Quantiles for each variable: #> #> 2.5% 25% 50% 75% 97.5% #> (Intercept) 0.40086 1.16042 1.272499 1.61321 2.45037 #> fhcompor1 -1.61784 -1.41128 -1.087209 -0.79473 -0.49926 #> lgdpl -0.02351 0.02864 0.079840 0.10775 0.24792 #> comprehensive -1.53418 -0.86159 -0.600034 -0.09388 0.06865 #> victory -0.56255 0.05853 0.218766 0.73028 1.05096 #> instabl 0.33299 0.74310 0.877161 1.38788 1.81246 #> intensityln -0.14131 -0.12867 -0.007338 0.01990 0.07484 #> ethfrac -0.56884 -0.45040 0.323703 0.64013 1.35275 #> unpko -0.25219 0.27497 0.380398 0.60618 0.98369 #># plot(model) ## 2 walter <- spduration::add_duration(Walter_2015_JCR,"renewed_war", unitID = "ccode", tID = "year", freq = "year", ongoing = FALSE)#> Warning: Converting to 'Date' class with yyyy-06-30walter$S <- rep(x = 1:length(unique(walter$ccode)), times = rle(walter$ccode)$lengths) country <- countrycode::countrycode(unique(walter$ccode),'gwn','iso3c') set.seed(123456) model <- exchangeSPsurv( duration = duration ~ fhcompor1 + lgdpl + comprehensive + victory + instabl + intensityln + ethfrac + unpko, immune = cured ~ fhcompor1 + lgdpl + victory, Y0 = 't.0', LY = 'lastyear', S = 'S' , data = walter, N = 100, burn = 10, thin = 10, w = c(1,1,1), m = 10, form = "loglog", prop.varV = 1e-05, prop.varW = 1e-05, id_WV = country ) print(model)#> Call: #> exchangeSPsurv(duration = duration ~ fhcompor1 + lgdpl + comprehensive + #> victory + instabl + intensityln + ethfrac + unpko, immune = cured ~ #> fhcompor1 + lgdpl + victory, Y0 = "t.0", LY = "lastyear", #> S = "S", data = walter, N = 100, burn = 10, thin = 10, w = c(1, #> 1, 1), m = 10, form = "loglog", prop.varV = 1e-05, prop.varW = 1e-05, #> id_WV = country) #> #> #> Iterations = 1:9 #> Thinning interval = 1 #> Number of chains = 1 #> Sample size per chain = 9 #> #> Empirical mean and standard deviation for each variable, #> plus standard error of the mean: #> #> #> Duration equation: #> Mean SD Naive SE Time-series SE #> (Intercept) 0.9768352 2.868855 0.9562849 2.4338006 #> fhcompor1 2.0920802 1.345390 0.4484634 0.7795867 #> lgdpl -3.6042466 2.072933 0.6909776 1.8029114 #> comprehensive 4.6996456 1.280050 0.4266832 1.0258938 #> victory 3.9664584 2.307090 0.7690301 1.4804038 #> instabl 1.9935549 2.001250 0.6670835 0.6670835 #> intensityln -2.1330003 1.285726 0.4285752 0.7461028 #> ethfrac -3.7590150 2.308131 0.7693771 1.5568944 #> unpko 4.0763098 1.558262 0.5194206 0.5194206 #> #> Immune equation: #> Mean SD Naive SE Time-series SE #> (Intercept) -0.7748578 1.1808708 0.3936236 0.3936236 #> fhcompor1 6.8669687 2.4097608 0.8032536 1.7212104 #> lgdpl -1.0312274 1.6514783 0.5504928 1.2353179 #> victory 1.2450188 0.9418921 0.3139640 0.3139640 #># }